From e8f5e0b683924ddaabc6314483f9061d83e07c98 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 16 Aug 2022 07:54:38 +0000 Subject: [PATCH 001/669] Generated: ci: lang repo branch renaming Generated SDK source code using: - Generator version 3.51.0 - Specification version 1.0.0-dev0.0.45 - Automation (cloudant-sdks) version 979e410 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .github/pull_request_template.md | 2 +- CONTRIBUTING.md | 2 +- Jenkinsfile | 8 ++++---- README.md | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4ea2852a..24d034ed 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,7 +4,7 @@ Fixes: -**Note: An existing issue is [required](https://github.com/IBM/cloudant-python-sdk/blob/master/CONTRIBUTING.md#PRs) before opening a PR.** +**Note: An existing issue is [required](https://github.com/IBM/cloudant-python-sdk/blob/main/CONTRIBUTING.md#PRs) before opening a PR.** ## PR Checklist diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00e5ead0..1a83b20e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,4 +21,4 @@ _should not_ be modified. # General Information For general guidance on contributing to this project, please see the -[general guidance for contributing](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/CONTRIBUTING_python.md). +[general guidance for contributing](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/CONTRIBUTING_python.md). diff --git a/Jenkinsfile b/Jenkinsfile index b6555e9b..d77c98ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -109,7 +109,7 @@ pipeline { string(name: 'SDK_RUN_LANG', value: "$libName"), string(name: "SDK_VERSION_${libName.toUpperCase()}", value: "$prefixedSdkVersion")] } catch (hudson.AbortException ae) { - // only run build in sdks-gauge master branch if BRANCH_NAME doesn't exist + // only run build in sdks-gauge default branch if BRANCH_NAME doesn't exist if (ae.getMessage().contains("No item named /${env.SDKS_GAUGE_PIPELINE_PROJECT}/${gaugeBranchName} found")) { echo "No matching branch named '${gaugeBranchName}' in sdks-gauge, building ${fallbackBranchName} branch" build job: "/${env.SDKS_GAUGE_PIPELINE_PROJECT}/${fallbackBranchName}", parameters: [ @@ -126,8 +126,8 @@ pipeline { when { beforeAgent true allOf { - // We only bump the version and create a tag when building master with a TARGET_VERSION - branch 'master' + // We only bump the version and create a tag when building the default primary branch with a TARGET_VERSION + expression { env.BRANCH_IS_PRIMARY } not { equals expected: 'NONE', actual: "${params.TARGET_VERSION}" } @@ -137,7 +137,7 @@ pipeline { // bump the version bumpVersion(false) // Push the version bump and release tag - sh 'git push --tags origin HEAD:master' + sh 'git push --tags origin HEAD:main' } } stage('Publish[repository]') { diff --git a/README.md b/README.md index 619999b1..8a899e8d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://github.com/IBM/cloudant-python-sdk/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/IBM/cloudant-python-sdk/actions/workflows/test.yml) +[![Build Status](https://github.com/IBM/cloudant-python-sdk/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/IBM/cloudant-python-sdk/actions/workflows/test.yml) [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) @@ -209,16 +209,16 @@ To learn more about how to use programmatic authentication, see the related documentation in the [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#programmatic-authentication) or in the -[Python SDK Core document](https://github.com/IBM/python-sdk-core/blob/master/Authentication.md) about authentication. +[Python SDK Core document](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md) about authentication. ## Using the SDK -For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md) documentation. +For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) documentation. ### Request timeout configuration No request timeout is defined, but a 2.5m read and a 60s connect timeout are set by default. Be sure to set a request timeout appropriate to your application usage and environment. -The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md) section contains details on how to change the value. +The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) section contains details on how to change the value. **Note:** System settings may take precedence over configured timeout values. From 80fbce86fd8e6708e6b60e3e149d6ae0a001f06f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 16 Aug 2022 13:50:30 +0000 Subject: [PATCH 002/669] Generated: ci: use default checkout Generated SDK source code using: - Generator version 3.51.0 - Specification version 1.0.0-dev0.0.45 - Automation (cloudant-sdks) version ca6eaa8 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d77c98ae..54c173e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,6 @@ pipeline { agent { label 'sdks-executor' } - options { - skipDefaultCheckout() - } parameters { validatingString( name: 'TARGET_VERSION', defaultValue: 'NONE', @@ -18,13 +15,12 @@ pipeline { GH_CREDS = credentials('gh-sdks-automation') } stages { - stage('Checkout') { + stage('Init') { steps { script { defaultInit() applyCustomizations() - checkoutResult = checkout scm - commitHash = "${checkoutResult.GIT_COMMIT[0..6]}" + commitHash = "${env.GIT_COMMIT.take(7)}" sh ''' git config --global user.email $GH_SDKS_AUTOMATION_MAIL git config --global user.name $GH_CREDS_USR From a88a9b95c0bbee2d7334a42a33fc62d5d89b7b79 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 16 Aug 2022 17:06:05 +0100 Subject: [PATCH 003/669] docs(generated): Remove examples account in replication code examples (#307) Generated SDK source code using: - Generator version 3.51.0 - Specification version 1.0.0-dev0.0.45 - Automation (cloudant-sdks) version 198ec4c Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- examples/putReplicationDocument/example_request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/putReplicationDocument/example_request.py b/examples/putReplicationDocument/example_request.py index 1a06e3b6..da020e3f 100644 --- a/examples/putReplicationDocument/example_request.py +++ b/examples/putReplicationDocument/example_request.py @@ -4,7 +4,7 @@ service = CloudantV1.new_instance() source_db = ReplicationDatabase( - url='https://examples.cloudant.com/animaldb' + url='/animaldb' ) target_auth_iam = ReplicationDatabaseAuthIam( @@ -15,7 +15,7 @@ ) target_db = ReplicationDatabase( auth=target_auth, - url='/animaldb-target' + url='/animaldb-target' ) replication_document = ReplicationDocument( From b90db438d26a214b6cca2ed6ee971729f1ed8037 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Aug 2022 16:57:36 -0400 Subject: [PATCH 004/669] build(deps-dev): Bump coverage from 6.4.3 to 6.4.4 (#313) Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4.3 to 6.4.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/6.4.3...6.4.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f24d39f8..ed8f127d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==3.25.1 pytest-rerunfailures==10.2 # code coverage -coverage==6.4.3 +coverage==6.4.4 pytest-cov==3.0.0 # documentation From a7d2e09ccedb38e48ac48309e5e5dd79cae9b183 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 19 Aug 2022 14:56:09 +0000 Subject: [PATCH 005/669] Generated: feat: update API definition to 0.0.46 Generated SDK source code using: - Generator version 3.54.1 - Specification version 1.0.0-dev0.0.46 - Automation (cloudant-sdks) version 0f07026 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 1176 +-------------------------------- test/unit/test_cloudant_v1.py | 1087 +++--------------------------- 2 files changed, 98 insertions(+), 2165 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index e6a86258..151c8ec1 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -5617,361 +5617,6 @@ def get_search_info(self, response = self.send(request, **kwargs) return response - ######################### - # Geospatial - ######################### - - - def get_geo(self, - db: str, - ddoc: str, - index: str, - *, - bbox: str = None, - bookmark: str = None, - format: str = None, - g: str = None, - include_docs: bool = None, - lat: float = None, - limit: int = None, - lon: float = None, - nearest: bool = None, - radius: float = None, - rangex: float = None, - rangey: float = None, - relation: str = None, - skip: int = None, - stale: str = None, - **kwargs - ) -> DetailedResponse: - """ - Query a geospatial index. - - Executes a query against the requested geospatial index from the specified design - document. - - :param str db: Path parameter to specify the database name. - :param str ddoc: Path parameter to specify the design document name. The - design document name is the design document ID excluding the `_design/` - prefix. - :param str index: Path parameter to specify the index name. - :param str bbox: (optional) Query parameter to specify a geospatial query - bounding box with two latitude,longitude coordinates for the lower-left and - upper-right corners. An example is - `-11.05987446,12.28339928,-101.05987446,62.28339928`. - :param str bookmark: (optional) Query parameter to specify a bookmark that - was received from a previous request. This parameter enables paging through - the results. If there are no more results after the bookmark, you get a - response containing no further results and the same bookmark, confirming - the end of the result list. - :param str format: (optional) Query parameter that causes the geospatial - query output to be returned in the specified format. - :param str g: (optional) Query parameter to specify a Well Known Text (WKT) - representation of a geospatial query geometry. The valid values for the WKT - parameter include `Point`, `LineString`, `Polygon`, `MultiPoint`, - `MultiLineString`, `MultiPolygon`, and `GeometryCollection`. - :param bool include_docs: (optional) Query parameter to specify whether to - include the full content of the documents in the response. - :param float lat: (optional) Query parameter to specify a latitude - coordinate for use with radius or ellipse geospatial queries. - :param int limit: (optional) Query parameter to specify the number of - returned documents to limit the result to. - :param float lon: (optional) Query parameter to specify a longitude - coordinate for use with radius or ellipse geospatial queries. - :param bool nearest: (optional) Query parameter to specify whether to - perform a nearest neighbour (NN) search. If provided, the `nearest=true` - search returns all results by sorting their distances to the center of the - query geometry. NN search can be used alone or with any of the supported - DE-9IM (Dimensionally Extended nine-Intersection Model) specification - geometric relations documented. - :param float radius: (optional) Query parameter to specify the radius, in - meters, to search from a lat,lon coordinate point in a circular geospatial - query. - :param float rangex: (optional) Query parameter to specify the first - radius, in meters, to search from a lat,lon coordinate point in an ellipse - geospatial query. - :param float rangey: (optional) Query parameter to specify the second - radius, in meters, to search from a lat,lon coordinate point in an ellipse - geospatial query. - :param str relation: (optional) Query parameter to specify the DE-9IM - (Dimensionally Extended nine-Intersection Model)geospatial relationship - between the query geometry and the result documents. - :param int skip: (optional) Query parameter to specify the number of - records before starting to return the results. - :param str stale: (optional) Query parameter to specify to not wait for the - index to finish building before returning results. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `GeoResult` object - """ - - if db is None: - raise ValueError('db must be provided') - if ddoc is None: - raise ValueError('ddoc must be provided') - if index is None: - raise ValueError('index must be provided') - headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_geo') - headers.update(sdk_headers) - - params = { - 'bbox': bbox, - 'bookmark': bookmark, - 'format': format, - 'g': g, - 'include_docs': include_docs, - 'lat': lat, - 'limit': limit, - 'lon': lon, - 'nearest': nearest, - 'radius': radius, - 'rangex': rangex, - 'rangey': rangey, - 'relation': relation, - 'skip': skip, - 'stale': stale - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['db', 'ddoc', 'index'] - path_param_values = self.encode_path_vars(db, ddoc, index) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/{db}/_design/{ddoc}/_geo/{index}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) - - response = self.send(request, **kwargs) - return response - - - def get_geo_as_stream(self, - db: str, - ddoc: str, - index: str, - *, - bbox: str = None, - bookmark: str = None, - format: str = None, - g: str = None, - include_docs: bool = None, - lat: float = None, - limit: int = None, - lon: float = None, - nearest: bool = None, - radius: float = None, - rangex: float = None, - rangey: float = None, - relation: str = None, - skip: int = None, - stale: str = None, - **kwargs - ) -> DetailedResponse: - """ - Query a geospatial index as stream. - - Executes a query against the requested geospatial index from the specified design - document. - - :param str db: Path parameter to specify the database name. - :param str ddoc: Path parameter to specify the design document name. The - design document name is the design document ID excluding the `_design/` - prefix. - :param str index: Path parameter to specify the index name. - :param str bbox: (optional) Query parameter to specify a geospatial query - bounding box with two latitude,longitude coordinates for the lower-left and - upper-right corners. An example is - `-11.05987446,12.28339928,-101.05987446,62.28339928`. - :param str bookmark: (optional) Query parameter to specify a bookmark that - was received from a previous request. This parameter enables paging through - the results. If there are no more results after the bookmark, you get a - response containing no further results and the same bookmark, confirming - the end of the result list. - :param str format: (optional) Query parameter that causes the geospatial - query output to be returned in the specified format. - :param str g: (optional) Query parameter to specify a Well Known Text (WKT) - representation of a geospatial query geometry. The valid values for the WKT - parameter include `Point`, `LineString`, `Polygon`, `MultiPoint`, - `MultiLineString`, `MultiPolygon`, and `GeometryCollection`. - :param bool include_docs: (optional) Query parameter to specify whether to - include the full content of the documents in the response. - :param float lat: (optional) Query parameter to specify a latitude - coordinate for use with radius or ellipse geospatial queries. - :param int limit: (optional) Query parameter to specify the number of - returned documents to limit the result to. - :param float lon: (optional) Query parameter to specify a longitude - coordinate for use with radius or ellipse geospatial queries. - :param bool nearest: (optional) Query parameter to specify whether to - perform a nearest neighbour (NN) search. If provided, the `nearest=true` - search returns all results by sorting their distances to the center of the - query geometry. NN search can be used alone or with any of the supported - DE-9IM (Dimensionally Extended nine-Intersection Model) specification - geometric relations documented. - :param float radius: (optional) Query parameter to specify the radius, in - meters, to search from a lat,lon coordinate point in a circular geospatial - query. - :param float rangex: (optional) Query parameter to specify the first - radius, in meters, to search from a lat,lon coordinate point in an ellipse - geospatial query. - :param float rangey: (optional) Query parameter to specify the second - radius, in meters, to search from a lat,lon coordinate point in an ellipse - geospatial query. - :param str relation: (optional) Query parameter to specify the DE-9IM - (Dimensionally Extended nine-Intersection Model)geospatial relationship - between the query geometry and the result documents. - :param int skip: (optional) Query parameter to specify the number of - records before starting to return the results. - :param str stale: (optional) Query parameter to specify to not wait for the - index to finish building before returning results. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `BinaryIO` result - """ - - if db is None: - raise ValueError('db must be provided') - if ddoc is None: - raise ValueError('ddoc must be provided') - if index is None: - raise ValueError('index must be provided') - headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_geo_as_stream') - headers.update(sdk_headers) - - params = { - 'bbox': bbox, - 'bookmark': bookmark, - 'format': format, - 'g': g, - 'include_docs': include_docs, - 'lat': lat, - 'limit': limit, - 'lon': lon, - 'nearest': nearest, - 'radius': radius, - 'rangex': rangex, - 'rangey': rangey, - 'relation': relation, - 'skip': skip, - 'stale': stale - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['db', 'ddoc', 'index'] - path_param_values = self.encode_path_vars(db, ddoc, index) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/{db}/_design/{ddoc}/_geo/{index}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) - - response = self.send(request, stream=True, **kwargs) - return response - - - def post_geo_cleanup(self, - db: str, - **kwargs - ) -> DetailedResponse: - """ - Cleanup old geospatial indexes. - - Cleanup old geospatial indexes from disk that have been superseded by newer index - builds. - - :param str db: Path parameter to specify the database name. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `Ok` object - """ - - if db is None: - raise ValueError('db must be provided') - headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_geo_cleanup') - headers.update(sdk_headers) - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['db'] - path_param_values = self.encode_path_vars(db) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/{db}/_geo_cleanup'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers) - - response = self.send(request, **kwargs) - return response - - - def get_geo_index_information(self, - db: str, - ddoc: str, - index: str, - **kwargs - ) -> DetailedResponse: - """ - Retrieve information about a geospatial index. - - :param str db: Path parameter to specify the database name. - :param str ddoc: Path parameter to specify the design document name. The - design document name is the design document ID excluding the `_design/` - prefix. - :param str index: Path parameter to specify the index name. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `GeoIndexInformation` object - """ - - if db is None: - raise ValueError('db must be provided') - if ddoc is None: - raise ValueError('ddoc must be provided') - if index is None: - raise ValueError('index must be provided') - headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_geo_index_information') - headers.update(sdk_headers) - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['db', 'ddoc', 'index'] - path_param_values = self.encode_path_vars(db, ddoc, index) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/{db}/_design/{ddoc}/_geo_info/{index}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) - - response = self.send(request, **kwargs) - return response - ######################### # Replication ######################### @@ -7976,80 +7621,6 @@ class Type(str, Enum): TEXT = 'text' -class GetGeoEnums: - """ - Enums for get_geo parameters. - """ - - class Format(str, Enum): - """ - Query parameter that causes the geospatial query output to be returned in the - specified format. - """ - LEGACY = 'legacy' - GEOJSON = 'geojson' - VIEW = 'view' - APPLICATION_VND_GEO_JSON = 'application/vnd.geo+json' - class Relation(str, Enum): - """ - Query parameter to specify the DE-9IM (Dimensionally Extended nine-Intersection - Model)geospatial relationship between the query geometry and the result documents. - """ - CONTAINS = 'contains' - CONTAINS_PROPERLY = 'contains_properly' - COVERED_BY = 'covered_by' - COVERS = 'covers' - CROSSES = 'crosses' - DISJOINT = 'disjoint' - INTERSECTS = 'intersects' - OVERLAPS = 'overlaps' - TOUCHES = 'touches' - WITHIN = 'within' - class Stale(str, Enum): - """ - Query parameter to specify to not wait for the index to finish building before - returning results. - """ - OK = 'ok' - - -class GetGeoEnums: - """ - Enums for get_geo_as_stream parameters. - """ - - class Format(str, Enum): - """ - Query parameter that causes the geospatial query output to be returned in the - specified format. - """ - LEGACY = 'legacy' - GEOJSON = 'geojson' - VIEW = 'view' - APPLICATION_VND_GEO_JSON = 'application/vnd.geo+json' - class Relation(str, Enum): - """ - Query parameter to specify the DE-9IM (Dimensionally Extended nine-Intersection - Model)geospatial relationship between the query geometry and the result documents. - """ - CONTAINS = 'contains' - CONTAINS_PROPERLY = 'contains_properly' - COVERED_BY = 'covered_by' - COVERS = 'covers' - CROSSES = 'crosses' - DISJOINT = 'disjoint' - INTERSECTS = 'intersects' - OVERLAPS = 'overlaps' - TOUCHES = 'touches' - WITHIN = 'within' - class Stale(str, Enum): - """ - Query parameter to specify to not wait for the index to finish building before - returning results. - """ - OK = 'ok' - - class DeleteReplicationDocumentEnums: """ Enums for delete_replication_document parameters. @@ -10863,12 +10434,10 @@ class DesignDocument(): * `secObj` - Security Object, with lists of database security roles, see the `SecurityObject`. :attr dict views: (optional) Schema for design document views. - :attr dict st_indexes: (optional) Schema for geospatial index function - definitions. """ # The set of defined properties for the class - _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'autoupdate', 'filters', 'indexes', 'language', 'options', 'validate_doc_update', 'views', 'st_indexes']) + _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'autoupdate', 'filters', 'indexes', 'language', 'options', 'validate_doc_update', 'views']) def __init__(self, *, @@ -10888,7 +10457,6 @@ def __init__(self, options: 'DesignDocumentOptions' = None, validate_doc_update: str = None, views: dict = None, - st_indexes: dict = None, **kwargs) -> None: """ Initialize a DesignDocument object. @@ -10980,8 +10548,6 @@ def __init__(self, * `secObj` - Security Object, with lists of database security roles, see the `SecurityObject`. :param dict views: (optional) Schema for design document views. - :param dict st_indexes: (optional) Schema for geospatial index function - definitions. :param **kwargs: (optional) Any additional properties. """ self.attachments = attachments @@ -11000,7 +10566,6 @@ def __init__(self, self.options = options self.validate_doc_update = validate_doc_update self.views = views - self.st_indexes = st_indexes for _key, _value in kwargs.items(): setattr(self, _key, _value) @@ -11040,8 +10605,6 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': args['validate_doc_update'] = _dict.get('validate_doc_update') if 'views' in _dict: args['views'] = {k : DesignDocumentViewsMapReduce.from_dict(v) for k, v in _dict.get('views').items()} - if 'st_indexes' in _dict: - args['st_indexes'] = {k : GeoIndexDefinition.from_dict(v) for k, v in _dict.get('st_indexes').items()} args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -11085,8 +10648,6 @@ def to_dict(self) -> Dict: _dict['validate_doc_update'] = self.validate_doc_update if hasattr(self, 'views') and self.views is not None: _dict['views'] = {k : v.to_dict() for k, v in self.views.items()} - if hasattr(self, 'st_indexes') and self.st_indexes is not None: - _dict['st_indexes'] = {k : v.to_dict() for k, v in self.st_indexes.items()} for _key in [k for k in vars(self).keys() if k not in DesignDocument._properties]: if getattr(self, _key, None) is not None: _dict[_key] = getattr(self, _key) @@ -12449,553 +12010,12 @@ def __ne__(self, other: 'FindResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class GeoIndexDefinition(): - """ - Schema for a geospatial index definition. - - :attr 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 geospatial data from it, and then calls the `st_index` function to - index that data. The `st_index` takes a GeoJSON geometry as a parameter. +class IndexDefinition(): """ - - def __init__(self, - index: str) -> None: - """ - Initialize a GeoIndexDefinition object. - - :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 geospatial data from it, and then calls the - `st_index` function to index that data. The `st_index` takes a GeoJSON - geometry as a parameter. - """ - self.index = index - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoIndexDefinition': - """Initialize a GeoIndexDefinition object from a json dictionary.""" - args = {} - if 'index' in _dict: - args['index'] = _dict.get('index') - else: - raise ValueError('Required property \'index\' not present in GeoIndexDefinition JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoIndexDefinition object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'index') and self.index is not None: - _dict['index'] = self.index - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoIndexDefinition object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoIndexDefinition') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoIndexDefinition') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class GeoIndexInformation(): - """ - Schema for information about a geospatial index. - - :attr GeoIndexStats geo_index: Schema for geospatial index statistics. - :attr str name: The name of the geospatial index design document. - """ - - def __init__(self, - geo_index: 'GeoIndexStats', - name: str) -> None: - """ - Initialize a GeoIndexInformation object. - - :param GeoIndexStats geo_index: Schema for geospatial index statistics. - :param str name: The name of the geospatial index design document. - """ - self.geo_index = geo_index - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoIndexInformation': - """Initialize a GeoIndexInformation object from a json dictionary.""" - args = {} - if 'geo_index' in _dict: - args['geo_index'] = GeoIndexStats.from_dict(_dict.get('geo_index')) - else: - raise ValueError('Required property \'geo_index\' not present in GeoIndexInformation JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in GeoIndexInformation JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoIndexInformation object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'geo_index') and self.geo_index is not None: - _dict['geo_index'] = self.geo_index.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoIndexInformation object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoIndexInformation') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoIndexInformation') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class GeoIndexStats(): - """ - Schema for geospatial index statistics. - - :attr int data_size: The size of the geospatial index, in bytes. - :attr int disk_size: The size of the geospatial index, as stored on disk, in - bytes. - :attr int doc_count: Number of documents in the geospatial index. - """ - - def __init__(self, - data_size: int, - disk_size: int, - doc_count: int) -> None: - """ - Initialize a GeoIndexStats object. - - :param int data_size: The size of the geospatial index, in bytes. - :param int disk_size: The size of the geospatial index, as stored on disk, - in bytes. - :param int doc_count: Number of documents in the geospatial index. - """ - self.data_size = data_size - self.disk_size = disk_size - self.doc_count = doc_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoIndexStats': - """Initialize a GeoIndexStats object from a json dictionary.""" - args = {} - if 'data_size' in _dict: - args['data_size'] = _dict.get('data_size') - else: - raise ValueError('Required property \'data_size\' not present in GeoIndexStats JSON') - if 'disk_size' in _dict: - args['disk_size'] = _dict.get('disk_size') - else: - raise ValueError('Required property \'disk_size\' not present in GeoIndexStats JSON') - if 'doc_count' in _dict: - args['doc_count'] = _dict.get('doc_count') - else: - raise ValueError('Required property \'doc_count\' not present in GeoIndexStats JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoIndexStats object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'data_size') and self.data_size is not None: - _dict['data_size'] = self.data_size - if hasattr(self, 'disk_size') and self.disk_size is not None: - _dict['disk_size'] = self.disk_size - if hasattr(self, 'doc_count') and self.doc_count is not None: - _dict['doc_count'] = self.doc_count - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoIndexStats object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoIndexStats') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoIndexStats') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class GeoJsonFeature(): - """ - Schema for a GeoJSON feature object. Note that the content of the feature objects - varies depending on the response format chosen and whether the `include_docs` - parameter is `true`. - - :attr str id: (optional) Schema for a document ID. - :attr str rev: (optional) Schema for a document revision identifier. - :attr List[float] bbox: (optional) Schema for a GeoJSON bounding box. - :attr GeoJsonGeometryObject geometry: Schema for a GeoJSON geometry object. - :attr dict properties: (optional) Schema for the properties of a GeoJSON feature - object. - :attr str type: Declaration of the GeoJSON type: Feature Object. - """ - - # The set of defined properties for the class - _properties = frozenset(['id', '_id', 'rev', '_rev', 'bbox', 'geometry', 'properties', 'type']) - - def __init__(self, - geometry: 'GeoJsonGeometryObject', - type: str, - *, - id: str = None, - rev: str = None, - bbox: List[float] = None, - properties: dict = None, - **kwargs) -> None: - """ - Initialize a GeoJsonFeature object. - - :param GeoJsonGeometryObject geometry: Schema for a GeoJSON geometry - object. - :param str type: Declaration of the GeoJSON type: Feature Object. - :param str id: (optional) Schema for a document ID. - :param str rev: (optional) Schema for a document revision identifier. - :param List[float] bbox: (optional) Schema for a GeoJSON bounding box. - :param dict properties: (optional) Schema for the properties of a GeoJSON - feature object. - :param **kwargs: (optional) Any additional properties. - """ - self.id = id - self.rev = rev - self.bbox = bbox - self.geometry = geometry - self.properties = properties - self.type = type - for _key, _value in kwargs.items(): - setattr(self, _key, _value) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoJsonFeature': - """Initialize a GeoJsonFeature object from a json dictionary.""" - args = {} - if '_id' in _dict: - args['id'] = _dict.get('_id') - if '_rev' in _dict: - args['rev'] = _dict.get('_rev') - if 'bbox' in _dict: - args['bbox'] = _dict.get('bbox') - if 'geometry' in _dict: - args['geometry'] = _dict.get('geometry') - else: - raise ValueError('Required property \'geometry\' not present in GeoJsonFeature JSON') - if 'properties' in _dict: - args['properties'] = _dict.get('properties') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in GeoJsonFeature JSON') - args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoJsonFeature object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['_id'] = self.id - if hasattr(self, 'rev') and self.rev is not None: - _dict['_rev'] = self.rev - if hasattr(self, 'bbox') and self.bbox is not None: - _dict['bbox'] = self.bbox - if hasattr(self, 'geometry') and self.geometry is not None: - if isinstance(self.geometry, dict): - _dict['geometry'] = self.geometry - else: - _dict['geometry'] = self.geometry.to_dict() - if hasattr(self, 'properties') and self.properties is not None: - _dict['properties'] = self.properties - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - for _key in [k for k in vars(self).keys() if k not in GeoJsonFeature._properties]: - if getattr(self, _key, None) is not None: - _dict[_key] = getattr(self, _key) - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of GeoJsonFeature""" - _dict = {} - - for _key in [k for k in vars(self).keys() if k not in GeoJsonFeature._properties]: - _dict[_key] = getattr(self, _key) - return _dict - - def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of GeoJsonFeature""" - for _key in [k for k in vars(self).keys() if k not in GeoJsonFeature._properties]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in GeoJsonFeature._properties: - setattr(self, _key, _value) - - def __str__(self) -> str: - """Return a `str` version of this GeoJsonFeature object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoJsonFeature') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoJsonFeature') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TypeEnum(str, Enum): - """ - Declaration of the GeoJSON type: Feature Object. - """ - FEATURE = 'Feature' - - -class GeoJsonGeometryObject(): - """ - Schema for a GeoJSON geometry object. - - """ - - def __init__(self) -> None: - """ - Initialize a GeoJsonGeometryObject object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['GeoJsonGeometry', 'GeoJsonGeometryCollection'])) - raise Exception(msg) - -class GeoResult(): - """ - Schema for the result of a geospatial query operation. For the `legacy`, `geojson`, or - `application/vnd.geo+json` format this is a GeoJson FeatureCollection with additional - metadata in foreign members. - - :attr str bookmark: Opaque bookmark token used when paginating results. - :attr List[GeoJsonFeature] features: (optional) The array of GeoJSON Feature - Objects matching the geospatial query. - :attr List[GeoResultRow] rows: The array of rows matching the geospatial query. - Present only when using `view` format. - :attr str type: (optional) Declaration of the GeoJSON type: FeatureCollection - Object. - """ - - def __init__(self, - bookmark: str, - rows: List['GeoResultRow'], - *, - features: List['GeoJsonFeature'] = None, - type: str = None) -> None: - """ - Initialize a GeoResult object. - - :param str bookmark: Opaque bookmark token used when paginating results. - :param List[GeoResultRow] rows: The array of rows matching the geospatial - query. Present only when using `view` format. - :param List[GeoJsonFeature] features: (optional) The array of GeoJSON - Feature Objects matching the geospatial query. - :param str type: (optional) Declaration of the GeoJSON type: - FeatureCollection Object. - """ - self.bookmark = bookmark - self.features = features - self.rows = rows - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoResult': - """Initialize a GeoResult object from a json dictionary.""" - args = {} - if 'bookmark' in _dict: - args['bookmark'] = _dict.get('bookmark') - else: - raise ValueError('Required property \'bookmark\' not present in GeoResult JSON') - if 'features' in _dict: - args['features'] = [GeoJsonFeature.from_dict(x) for x in _dict.get('features')] - if 'rows' in _dict: - args['rows'] = [GeoResultRow.from_dict(x) for x in _dict.get('rows')] - else: - raise ValueError('Required property \'rows\' not present in GeoResult JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoResult object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'bookmark') and self.bookmark is not None: - _dict['bookmark'] = self.bookmark - if hasattr(self, 'features') and self.features is not None: - _dict['features'] = [x.to_dict() for x in self.features] - if hasattr(self, 'rows') and self.rows is not None: - _dict['rows'] = [x.to_dict() for x in self.rows] - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoResult object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoResult') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoResult') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TypeEnum(str, Enum): - """ - Declaration of the GeoJSON type: FeatureCollection Object. - """ - FEATURECOLLECTION = 'FeatureCollection' - - -class GeoResultRow(): - """ - Schema for a row of a geospatial result using view format. - - :attr Document doc: (optional) Schema for a document. - :attr GeoJsonGeometry geometry: (optional) Schema for a GeoJSON geometry. - :attr str id: (optional) Schema for a document ID. - :attr str rev: (optional) Schema for a document revision identifier. - """ - - def __init__(self, - *, - doc: 'Document' = None, - geometry: 'GeoJsonGeometry' = None, - id: str = None, - rev: str = None) -> None: - """ - Initialize a GeoResultRow object. - - :param Document doc: (optional) Schema for a document. - :param GeoJsonGeometry geometry: (optional) Schema for a GeoJSON geometry. - :param str id: (optional) Schema for a document ID. - :param str rev: (optional) Schema for a document revision identifier. - """ - self.doc = doc - self.geometry = geometry - self.id = id - self.rev = rev - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoResultRow': - """Initialize a GeoResultRow object from a json dictionary.""" - args = {} - if 'doc' in _dict: - args['doc'] = Document.from_dict(_dict.get('doc')) - if 'geometry' in _dict: - args['geometry'] = GeoJsonGeometry.from_dict(_dict.get('geometry')) - if 'id' in _dict: - args['id'] = _dict.get('id') - if 'rev' in _dict: - args['rev'] = _dict.get('rev') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoResultRow object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'doc') and self.doc is not None: - _dict['doc'] = self.doc.to_dict() - if hasattr(self, 'geometry') and self.geometry is not None: - _dict['geometry'] = self.geometry.to_dict() - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'rev') and self.rev is not None: - _dict['rev'] = self.rev - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoResultRow object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoResultRow') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoResultRow') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -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. + 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. :attr Analyzer default_analyzer: (optional) Schema for a full text search analyzer. @@ -14457,6 +13477,11 @@ class ReplicationDocument(): during replication. Using checkpoints means a replication can be efficiently resumed. :attr UserContext user_ctx: (optional) Schema for the user context of a session. + :attr bool winning_revs_only: (optional) Replicate only the winning revisions. + Replication with this mode discards conflicting revisions. Replication IDs and + checkpoints generated by this mode are different to those generated by default, + so it is possible to first replicate the winning revisions then later backfill + remaining revisions with a regular replication job. :attr int worker_batch_size: (optional) Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs. @@ -14466,7 +13491,7 @@ class ReplicationDocument(): """ # The set of defined properties for the class - _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_checkpoints', 'user_ctx', 'worker_batch_size', 'worker_processes']) + _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) def __init__(self, source: 'ReplicationDatabase', @@ -14499,6 +13524,7 @@ def __init__(self, target_proxy: str = None, use_checkpoints: bool = None, user_ctx: 'UserContext' = None, + winning_revs_only: bool = None, worker_batch_size: int = None, worker_processes: int = None, **kwargs) -> None: @@ -14595,6 +13621,12 @@ def __init__(self, efficiently resumed. :param UserContext user_ctx: (optional) Schema for the user context of a session. + :param bool winning_revs_only: (optional) Replicate only the winning + revisions. Replication with this mode discards conflicting revisions. + Replication IDs and checkpoints generated by this mode are different to + those generated by default, so it is possible to first replicate the + winning revisions then later backfill remaining revisions with a regular + replication job. :param int worker_batch_size: (optional) Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs. @@ -14632,6 +13664,7 @@ def __init__(self, self.target_proxy = target_proxy self.use_checkpoints = use_checkpoints self.user_ctx = user_ctx + self.winning_revs_only = winning_revs_only self.worker_batch_size = worker_batch_size self.worker_processes = worker_processes for _key, _value in kwargs.items(): @@ -14703,6 +13736,8 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': args['use_checkpoints'] = _dict.get('use_checkpoints') if 'user_ctx' in _dict: args['user_ctx'] = UserContext.from_dict(_dict.get('user_ctx')) + if 'winning_revs_only' in _dict: + args['winning_revs_only'] = _dict.get('winning_revs_only') if 'worker_batch_size' in _dict: args['worker_batch_size'] = _dict.get('worker_batch_size') if 'worker_processes' in _dict: @@ -14776,6 +13811,8 @@ def to_dict(self) -> Dict: _dict['use_checkpoints'] = self.use_checkpoints if hasattr(self, 'user_ctx') and self.user_ctx is not None: _dict['user_ctx'] = self.user_ctx.to_dict() + if hasattr(self, 'winning_revs_only') and self.winning_revs_only is not None: + _dict['winning_revs_only'] = self.winning_revs_only if hasattr(self, 'worker_batch_size') and self.worker_batch_size is not None: _dict['worker_batch_size'] = self.worker_batch_size if hasattr(self, 'worker_processes') and self.worker_processes is not None: @@ -17694,168 +16731,3 @@ def __eq__(self, other: 'ViewResultRow') -> bool: def __ne__(self, other: 'ViewResultRow') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class GeoJsonGeometry(GeoJsonGeometryObject): - """ - Schema for a GeoJSON geometry. - - :attr str type: The type of GeoJSON Geometry. - :attr List[object] coordinates: Used for all geometry types except - `GeometryCollection`. The structure of the elements in the array varies by - geometry type. - """ - - def __init__(self, - type: str, - coordinates: List[object]) -> None: - """ - Initialize a GeoJsonGeometry object. - - :param str type: The type of GeoJSON Geometry. - :param List[object] coordinates: Used for all geometry types except - `GeometryCollection`. The structure of the elements in the array varies by - geometry type. - """ - # pylint: disable=super-init-not-called - self.type = type - self.coordinates = coordinates - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoJsonGeometry': - """Initialize a GeoJsonGeometry object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in GeoJsonGeometry JSON') - if 'coordinates' in _dict: - args['coordinates'] = _dict.get('coordinates') - else: - raise ValueError('Required property \'coordinates\' not present in GeoJsonGeometry JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoJsonGeometry object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'coordinates') and self.coordinates is not None: - _dict['coordinates'] = self.coordinates - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoJsonGeometry object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoJsonGeometry') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoJsonGeometry') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TypeEnum(str, Enum): - """ - The type of GeoJSON Geometry. - """ - POINT = 'Point' - MULTIPOINT = 'MultiPoint' - LINESTRING = 'LineString' - MULTILINESTRING = 'MultiLineString' - POLYGON = 'Polygon' - MULTIPOLYGON = 'MultiPolygon' - GEOMETRYCOLLECTION = 'GeometryCollection' - - -class GeoJsonGeometryCollection(GeoJsonGeometryObject): - """ - Schema for a GeoJSON GeometryCollection type geometry. - - :attr str type: The type of GeoJSON Geometry. - :attr List[GeoJsonGeometry] geometries: Used for the `GeometryCollection` type. - """ - - def __init__(self, - type: str, - geometries: List['GeoJsonGeometry']) -> None: - """ - Initialize a GeoJsonGeometryCollection object. - - :param str type: The type of GeoJSON Geometry. - :param List[GeoJsonGeometry] geometries: Used for the `GeometryCollection` - type. - """ - # pylint: disable=super-init-not-called - self.type = type - self.geometries = geometries - - @classmethod - def from_dict(cls, _dict: Dict) -> 'GeoJsonGeometryCollection': - """Initialize a GeoJsonGeometryCollection object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in GeoJsonGeometryCollection JSON') - if 'geometries' in _dict: - args['geometries'] = [GeoJsonGeometry.from_dict(x) for x in _dict.get('geometries')] - else: - raise ValueError('Required property \'geometries\' not present in GeoJsonGeometryCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a GeoJsonGeometryCollection object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'geometries') and self.geometries is not None: - _dict['geometries'] = [x.to_dict() for x in self.geometries] - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this GeoJsonGeometryCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'GeoJsonGeometryCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'GeoJsonGeometryCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TypeEnum(str, Enum): - """ - The type of GeoJSON Geometry. - """ - POINT = 'Point' - MULTIPOINT = 'MultiPoint' - LINESTRING = 'LineString' - MULTILINESTRING = 'MultiLineString' - POLYGON = 'Polygon' - MULTIPOLYGON = 'MultiPolygon' - GEOMETRYCOLLECTION = 'GeometryCollection' - diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 0348b653..04e779ee 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -4467,7 +4467,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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}, "st_indexes": {"mapKey": {"index": "index"}}}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}}' responses.add(responses.GET, url, body=mock_response, @@ -4540,7 +4540,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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}, "st_indexes": {"mapKey": {"index": "index"}}}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}}' responses.add(responses.GET, url, body=mock_response, @@ -4578,7 +4578,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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}, "st_indexes": {"mapKey": {"index": "index"}}}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}}' responses.add(responses.GET, url, body=mock_response, @@ -4674,10 +4674,6 @@ def test_put_design_document_all_params(self): design_document_views_map_reduce_model['map'] = 'testString' design_document_views_map_reduce_model['reduce'] = 'testString' - # Construct a dict representation of a GeoIndexDefinition model - geo_index_definition_model = {} - geo_index_definition_model['index'] = 'testString' - # Construct a dict representation of a DesignDocument model design_document_model = {} design_document_model['_attachments'] = {'key1': attachment_model} @@ -4696,7 +4692,6 @@ def test_put_design_document_all_params(self): design_document_model['options'] = design_document_options_model design_document_model['validate_doc_update'] = 'testString' design_document_model['views'] = {'key1': design_document_views_map_reduce_model} - design_document_model['st_indexes'] = {'key1': geo_index_definition_model} design_document_model['foo'] = 'testString' # Set up parameter values @@ -4806,10 +4801,6 @@ def test_put_design_document_required_params(self): design_document_views_map_reduce_model['map'] = 'testString' design_document_views_map_reduce_model['reduce'] = 'testString' - # Construct a dict representation of a GeoIndexDefinition model - geo_index_definition_model = {} - geo_index_definition_model['index'] = 'testString' - # Construct a dict representation of a DesignDocument model design_document_model = {} design_document_model['_attachments'] = {'key1': attachment_model} @@ -4828,7 +4819,6 @@ def test_put_design_document_required_params(self): design_document_model['options'] = design_document_options_model design_document_model['validate_doc_update'] = 'testString' design_document_model['views'] = {'key1': design_document_views_map_reduce_model} - design_document_model['st_indexes'] = {'key1': geo_index_definition_model} design_document_model['foo'] = 'testString' # Set up parameter values @@ -4924,10 +4914,6 @@ def test_put_design_document_value_error(self): design_document_views_map_reduce_model['map'] = 'testString' design_document_views_map_reduce_model['reduce'] = 'testString' - # Construct a dict representation of a GeoIndexDefinition model - geo_index_definition_model = {} - geo_index_definition_model['index'] = 'testString' - # Construct a dict representation of a DesignDocument model design_document_model = {} design_document_model['_attachments'] = {'key1': attachment_model} @@ -4946,7 +4932,6 @@ def test_put_design_document_value_error(self): design_document_model['options'] = design_document_options_model design_document_model['validate_doc_update'] = 'testString' design_document_model['views'] = {'key1': design_document_views_map_reduce_model} - design_document_model['st_indexes'] = {'key1': geo_index_definition_model} design_document_model['foo'] = 'testString' # Set up parameter values @@ -8556,642 +8541,89 @@ def test_post_search_as_stream_all_params(self): # Verify streamed JSON response result = response.get_result() assert isinstance(result, requests.models.Response) - response_buf = result.iter_content(chunk_size=1024) - assert str(next(response_buf), "utf-8") == mock_response - - def test_post_search_as_stream_all_params_with_retries(self): - # Enable retries and run test_post_search_as_stream_all_params. - _service.enable_retries() - self.test_post_search_as_stream_all_params() - - # Disable retries and run test_post_search_as_stream_all_params. - _service.disable_retries() - self.test_post_search_as_stream_all_params() - - @responses.activate - def test_post_search_as_stream_value_error(self): - """ - test_post_search_as_stream_value_error() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - query = 'testString' - bookmark = 'testString' - highlight_fields = ['testString'] - highlight_number = 1 - highlight_post_tag = '' - highlight_pre_tag = '' - highlight_size = 1 - include_docs = False - include_fields = ['testString'] - limit = 0 - sort = ['testString'] - stale = 'ok' - counts = ['testString'] - drilldown = [['testString']] - group_field = 'testString' - group_limit = 1 - group_sort = ['testString'] - ranges = {'key1': {'key1': {'key1': 'testString'}}} - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "db": db, - "ddoc": ddoc, - "index": index, - "query": query, - } - for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.post_search_as_stream(**req_copy) - - def test_post_search_as_stream_value_error_with_retries(self): - # Enable retries and run test_post_search_as_stream_value_error. - _service.enable_retries() - self.test_post_search_as_stream_value_error() - - # Disable retries and run test_post_search_as_stream_value_error. - _service.disable_retries() - self.test_post_search_as_stream_value_error() - -class TestGetSearchInfo(): - """ - Test Class for get_search_info - """ - - @responses.activate - def test_get_search_info_all_params(self): - """ - get_search_info() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_search_info/testString') - mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - - # Invoke method - response = _service.get_search_info( - db, - ddoc, - index, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_search_info_all_params_with_retries(self): - # Enable retries and run test_get_search_info_all_params. - _service.enable_retries() - self.test_get_search_info_all_params() - - # Disable retries and run test_get_search_info_all_params. - _service.disable_retries() - self.test_get_search_info_all_params() - - @responses.activate - def test_get_search_info_value_error(self): - """ - test_get_search_info_value_error() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_search_info/testString') - mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "db": db, - "ddoc": ddoc, - "index": index, - } - for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.get_search_info(**req_copy) - - def test_get_search_info_value_error_with_retries(self): - # Enable retries and run test_get_search_info_value_error. - _service.enable_retries() - self.test_get_search_info_value_error() - - # Disable retries and run test_get_search_info_value_error. - _service.disable_retries() - self.test_get_search_info_value_error() - -# endregion -############################################################################## -# End of Service: Searches -############################################################################## - -############################################################################## -# Start of Service: Geospatial -############################################################################## -# region - -class TestNewInstance(): - """ - Test Class for new_instance - """ - - def test_new_instance(self): - """ - new_instance() - """ - os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' - - service = CloudantV1.new_instance( - service_name='TEST_SERVICE', - ) - - assert service is not None - assert isinstance(service, CloudantV1) - - def test_new_instance_without_authenticator(self): - """ - new_instance_without_authenticator() - """ - with pytest.raises(ValueError, match='authenticator must be provided'): - service = CloudantV1.new_instance( - service_name='TEST_SERVICE_NOT_FOUND', - ) - -class TestGetGeo(): - """ - Test Class for get_geo - """ - - @responses.activate - def test_get_geo_all_params(self): - """ - get_geo() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_geo/testString') - mock_response = '{"bookmark": "bookmark", "features": [{"_id": "id", "_rev": "rev", "bbox": [4], "geometry": {"type": "Point", "coordinates": ["anyValue"]}, "properties": {"mapKey": "anyValue"}, "type": "Feature"}], "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "geometry": {"type": "Point", "coordinates": ["anyValue"]}, "id": "id", "rev": "rev"}], "type": "FeatureCollection"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - bbox = 'testString' - bookmark = 'testString' - format = 'view' - g = 'testString' - include_docs = False - lat = -90 - limit = 0 - lon = -180 - nearest = False - radius = 0 - rangex = 0 - rangey = 0 - relation = 'intersects' - skip = 0 - stale = 'ok' - - # Invoke method - response = _service.get_geo( - db, - ddoc, - index, - bbox=bbox, - bookmark=bookmark, - format=format, - g=g, - include_docs=include_docs, - lat=lat, - limit=limit, - lon=lon, - nearest=nearest, - radius=radius, - rangex=rangex, - rangey=rangey, - relation=relation, - skip=skip, - stale=stale, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'bbox={}'.format(bbox) in query_string - assert 'bookmark={}'.format(bookmark) in query_string - assert 'format={}'.format(format) in query_string - assert 'g={}'.format(g) in query_string - assert 'include_docs={}'.format('true' if include_docs else 'false') in query_string - assert 'lat={}'.format(lat) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'lon={}'.format(lon) in query_string - assert 'nearest={}'.format('true' if nearest else 'false') in query_string - assert 'radius={}'.format(radius) in query_string - assert 'rangex={}'.format(rangex) in query_string - assert 'rangey={}'.format(rangey) in query_string - assert 'relation={}'.format(relation) in query_string - assert 'skip={}'.format(skip) in query_string - assert 'stale={}'.format(stale) in query_string - - def test_get_geo_all_params_with_retries(self): - # Enable retries and run test_get_geo_all_params. - _service.enable_retries() - self.test_get_geo_all_params() - - # Disable retries and run test_get_geo_all_params. - _service.disable_retries() - self.test_get_geo_all_params() - - @responses.activate - def test_get_geo_required_params(self): - """ - test_get_geo_required_params() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_geo/testString') - mock_response = '{"bookmark": "bookmark", "features": [{"_id": "id", "_rev": "rev", "bbox": [4], "geometry": {"type": "Point", "coordinates": ["anyValue"]}, "properties": {"mapKey": "anyValue"}, "type": "Feature"}], "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "geometry": {"type": "Point", "coordinates": ["anyValue"]}, "id": "id", "rev": "rev"}], "type": "FeatureCollection"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - - # Invoke method - response = _service.get_geo( - db, - ddoc, - index, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_geo_required_params_with_retries(self): - # Enable retries and run test_get_geo_required_params. - _service.enable_retries() - self.test_get_geo_required_params() - - # Disable retries and run test_get_geo_required_params. - _service.disable_retries() - self.test_get_geo_required_params() - - @responses.activate - def test_get_geo_value_error(self): - """ - test_get_geo_value_error() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_geo/testString') - mock_response = '{"bookmark": "bookmark", "features": [{"_id": "id", "_rev": "rev", "bbox": [4], "geometry": {"type": "Point", "coordinates": ["anyValue"]}, "properties": {"mapKey": "anyValue"}, "type": "Feature"}], "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "geometry": {"type": "Point", "coordinates": ["anyValue"]}, "id": "id", "rev": "rev"}], "type": "FeatureCollection"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "db": db, - "ddoc": ddoc, - "index": index, - } - for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.get_geo(**req_copy) - - def test_get_geo_value_error_with_retries(self): - # Enable retries and run test_get_geo_value_error. - _service.enable_retries() - self.test_get_geo_value_error() - - # Disable retries and run test_get_geo_value_error. - _service.disable_retries() - self.test_get_geo_value_error() - -class TestGetGeoAsStream(): - """ - Test Class for get_geo_as_stream - """ - - @responses.activate - def test_get_geo_as_stream_all_params(self): - """ - get_geo_as_stream() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_geo/testString') - mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - bbox = 'testString' - bookmark = 'testString' - format = 'view' - g = 'testString' - include_docs = False - lat = -90 - limit = 0 - lon = -180 - nearest = False - radius = 0 - rangex = 0 - rangey = 0 - relation = 'intersects' - skip = 0 - stale = 'ok' - - # Invoke method - response = _service.get_geo_as_stream( - db, - ddoc, - index, - bbox=bbox, - bookmark=bookmark, - format=format, - g=g, - include_docs=include_docs, - lat=lat, - limit=limit, - lon=lon, - nearest=nearest, - radius=radius, - rangex=rangex, - rangey=rangey, - relation=relation, - skip=skip, - stale=stale, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'bbox={}'.format(bbox) in query_string - assert 'bookmark={}'.format(bookmark) in query_string - assert 'format={}'.format(format) in query_string - assert 'g={}'.format(g) in query_string - assert 'include_docs={}'.format('true' if include_docs else 'false') in query_string - assert 'lat={}'.format(lat) in query_string - assert 'limit={}'.format(limit) in query_string - assert 'lon={}'.format(lon) in query_string - assert 'nearest={}'.format('true' if nearest else 'false') in query_string - assert 'radius={}'.format(radius) in query_string - assert 'rangex={}'.format(rangex) in query_string - assert 'rangey={}'.format(rangey) in query_string - assert 'relation={}'.format(relation) in query_string - assert 'skip={}'.format(skip) in query_string - assert 'stale={}'.format(stale) in query_string - - # Verify streamed JSON response - result = response.get_result() - assert isinstance(result, requests.models.Response) - response_buf = result.iter_content(chunk_size=1024) - assert str(next(response_buf), "utf-8") == mock_response - - def test_get_geo_as_stream_all_params_with_retries(self): - # Enable retries and run test_get_geo_as_stream_all_params. - _service.enable_retries() - self.test_get_geo_as_stream_all_params() - - # Disable retries and run test_get_geo_as_stream_all_params. - _service.disable_retries() - self.test_get_geo_as_stream_all_params() - - @responses.activate - def test_get_geo_as_stream_required_params(self): - """ - test_get_geo_as_stream_required_params() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_geo/testString') - mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - - # Invoke method - response = _service.get_geo_as_stream( - db, - ddoc, - index, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - # Verify streamed JSON response - result = response.get_result() - assert isinstance(result, requests.models.Response) - response_buf = result.iter_content(chunk_size=1024) - assert str(next(response_buf), "utf-8") == mock_response - - def test_get_geo_as_stream_required_params_with_retries(self): - # Enable retries and run test_get_geo_as_stream_required_params. - _service.enable_retries() - self.test_get_geo_as_stream_required_params() - - # Disable retries and run test_get_geo_as_stream_required_params. - _service.disable_retries() - self.test_get_geo_as_stream_required_params() - - @responses.activate - def test_get_geo_as_stream_value_error(self): - """ - test_get_geo_as_stream_value_error() - """ - # Set up mock - url = preprocess_url('/testString/_design/testString/_geo/testString') - mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - db = 'testString' - ddoc = 'testString' - index = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "db": db, - "ddoc": ddoc, - "index": index, - } - for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.get_geo_as_stream(**req_copy) - - def test_get_geo_as_stream_value_error_with_retries(self): - # Enable retries and run test_get_geo_as_stream_value_error. - _service.enable_retries() - self.test_get_geo_as_stream_value_error() - - # Disable retries and run test_get_geo_as_stream_value_error. - _service.disable_retries() - self.test_get_geo_as_stream_value_error() - -class TestPostGeoCleanup(): - """ - Test Class for post_geo_cleanup - """ - - @responses.activate - def test_post_geo_cleanup_all_params(self): - """ - post_geo_cleanup() - """ - # Set up mock - url = preprocess_url('/testString/_geo_cleanup') - mock_response = '{"ok": true}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=202) - - # Set up parameter values - db = 'testString' - - # Invoke method - response = _service.post_geo_cleanup( - db, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 202 + response_buf = result.iter_content(chunk_size=1024) + assert str(next(response_buf), "utf-8") == mock_response - def test_post_geo_cleanup_all_params_with_retries(self): - # Enable retries and run test_post_geo_cleanup_all_params. + def test_post_search_as_stream_all_params_with_retries(self): + # Enable retries and run test_post_search_as_stream_all_params. _service.enable_retries() - self.test_post_geo_cleanup_all_params() + self.test_post_search_as_stream_all_params() - # Disable retries and run test_post_geo_cleanup_all_params. + # Disable retries and run test_post_search_as_stream_all_params. _service.disable_retries() - self.test_post_geo_cleanup_all_params() + self.test_post_search_as_stream_all_params() @responses.activate - def test_post_geo_cleanup_value_error(self): + def test_post_search_as_stream_value_error(self): """ - test_post_geo_cleanup_value_error() + test_post_search_as_stream_value_error() """ # Set up mock - url = preprocess_url('/testString/_geo_cleanup') - mock_response = '{"ok": true}' + url = preprocess_url('/testString/_design/testString/_search/testString') + mock_response = '{"foo": "this is a mock response for JSON streaming"}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', - status=202) + status=200) # Set up parameter values db = 'testString' + ddoc = 'testString' + index = 'testString' + query = 'testString' + bookmark = 'testString' + highlight_fields = ['testString'] + highlight_number = 1 + highlight_post_tag = '' + highlight_pre_tag = '' + highlight_size = 1 + include_docs = False + include_fields = ['testString'] + limit = 0 + sort = ['testString'] + stale = 'ok' + counts = ['testString'] + drilldown = [['testString']] + group_field = 'testString' + group_limit = 1 + group_sort = ['testString'] + ranges = {'key1': {'key1': {'key1': 'testString'}}} # Pass in all but one required param and check for a ValueError req_param_dict = { "db": db, + "ddoc": ddoc, + "index": index, + "query": query, } for param in req_param_dict.keys(): req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.post_geo_cleanup(**req_copy) + _service.post_search_as_stream(**req_copy) - def test_post_geo_cleanup_value_error_with_retries(self): - # Enable retries and run test_post_geo_cleanup_value_error. + def test_post_search_as_stream_value_error_with_retries(self): + # Enable retries and run test_post_search_as_stream_value_error. _service.enable_retries() - self.test_post_geo_cleanup_value_error() + self.test_post_search_as_stream_value_error() - # Disable retries and run test_post_geo_cleanup_value_error. + # Disable retries and run test_post_search_as_stream_value_error. _service.disable_retries() - self.test_post_geo_cleanup_value_error() + self.test_post_search_as_stream_value_error() -class TestGetGeoIndexInformation(): +class TestGetSearchInfo(): """ - Test Class for get_geo_index_information + Test Class for get_search_info """ @responses.activate - def test_get_geo_index_information_all_params(self): + def test_get_search_info_all_params(self): """ - get_geo_index_information() + get_search_info() """ # Set up mock - url = preprocess_url('/testString/_design/testString/_geo_info/testString') - mock_response = '{"geo_index": {"data_size": 0, "disk_size": 0, "doc_count": 0}, "name": "name"}' + url = preprocess_url('/testString/_design/testString/_search_info/testString') + mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' responses.add(responses.GET, url, body=mock_response, @@ -9204,7 +8636,7 @@ def test_get_geo_index_information_all_params(self): index = 'testString' # Invoke method - response = _service.get_geo_index_information( + response = _service.get_search_info( db, ddoc, index, @@ -9215,23 +8647,23 @@ def test_get_geo_index_information_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_get_geo_index_information_all_params_with_retries(self): - # Enable retries and run test_get_geo_index_information_all_params. + def test_get_search_info_all_params_with_retries(self): + # Enable retries and run test_get_search_info_all_params. _service.enable_retries() - self.test_get_geo_index_information_all_params() + self.test_get_search_info_all_params() - # Disable retries and run test_get_geo_index_information_all_params. + # Disable retries and run test_get_search_info_all_params. _service.disable_retries() - self.test_get_geo_index_information_all_params() + self.test_get_search_info_all_params() @responses.activate - def test_get_geo_index_information_value_error(self): + def test_get_search_info_value_error(self): """ - test_get_geo_index_information_value_error() + test_get_search_info_value_error() """ # Set up mock - url = preprocess_url('/testString/_design/testString/_geo_info/testString') - mock_response = '{"geo_index": {"data_size": 0, "disk_size": 0, "doc_count": 0}, "name": "name"}' + url = preprocess_url('/testString/_design/testString/_search_info/testString') + mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' responses.add(responses.GET, url, body=mock_response, @@ -9252,20 +8684,20 @@ def test_get_geo_index_information_value_error(self): for param in req_param_dict.keys(): req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_geo_index_information(**req_copy) + _service.get_search_info(**req_copy) - def test_get_geo_index_information_value_error_with_retries(self): - # Enable retries and run test_get_geo_index_information_value_error. + def test_get_search_info_value_error_with_retries(self): + # Enable retries and run test_get_search_info_value_error. _service.enable_retries() - self.test_get_geo_index_information_value_error() + self.test_get_search_info_value_error() - # Disable retries and run test_get_geo_index_information_value_error. + # Disable retries and run test_get_search_info_value_error. _service.disable_retries() - self.test_get_geo_index_information_value_error() + self.test_get_search_info_value_error() # endregion ############################################################################## -# End of Service: Geospatial +# End of Service: Searches ############################################################################## ############################################################################## @@ -9680,7 +9112,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9751,7 +9183,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9787,7 +9219,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9919,6 +9351,7 @@ def test_put_replication_document_all_params(self): replication_document_model['target_proxy'] = 'testString' replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model + replication_document_model['winning_revs_only'] = False replication_document_model['worker_batch_size'] = 1 replication_document_model['worker_processes'] = 1 replication_document_model['foo'] = 'testString' @@ -10066,6 +9499,7 @@ def test_put_replication_document_required_params(self): replication_document_model['target_proxy'] = 'testString' replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model + replication_document_model['winning_revs_only'] = False replication_document_model['worker_batch_size'] = 1 replication_document_model['worker_processes'] = 1 replication_document_model['foo'] = 'testString' @@ -10199,6 +9633,7 @@ def test_put_replication_document_value_error(self): replication_document_model['target_proxy'] = 'testString' replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model + replication_document_model['winning_revs_only'] = False replication_document_model['worker_batch_size'] = 1 replication_document_model['worker_processes'] = 1 replication_document_model['foo'] = 'testString' @@ -14395,9 +13830,6 @@ def test_design_document_serialization(self): design_document_views_map_reduce_model['map'] = 'testString' design_document_views_map_reduce_model['reduce'] = 'testString' - geo_index_definition_model = {} # GeoIndexDefinition - geo_index_definition_model['index'] = 'testString' - # Construct a json representation of a DesignDocument model design_document_model_json = {} design_document_model_json['_attachments'] = {'key1': attachment_model} @@ -14416,7 +13848,6 @@ def test_design_document_serialization(self): design_document_model_json['options'] = design_document_options_model design_document_model_json['validate_doc_update'] = 'testString' design_document_model_json['views'] = {'key1': design_document_views_map_reduce_model} - design_document_model_json['st_indexes'] = {'key1': geo_index_definition_model} design_document_model_json['foo'] = 'testString' # Construct a model instance of DesignDocument by calling from_dict on the json representation @@ -15059,311 +14490,6 @@ def test_find_result_serialization(self): find_result_model_json2 = find_result_model.to_dict() assert find_result_model_json2 == find_result_model_json -class TestModel_GeoIndexDefinition(): - """ - Test Class for GeoIndexDefinition - """ - - def test_geo_index_definition_serialization(self): - """ - Test serialization/deserialization for GeoIndexDefinition - """ - - # Construct a json representation of a GeoIndexDefinition model - geo_index_definition_model_json = {} - geo_index_definition_model_json['index'] = 'testString' - - # Construct a model instance of GeoIndexDefinition by calling from_dict on the json representation - geo_index_definition_model = GeoIndexDefinition.from_dict(geo_index_definition_model_json) - assert geo_index_definition_model != False - - # Construct a model instance of GeoIndexDefinition by calling from_dict on the json representation - geo_index_definition_model_dict = GeoIndexDefinition.from_dict(geo_index_definition_model_json).__dict__ - geo_index_definition_model2 = GeoIndexDefinition(**geo_index_definition_model_dict) - - # Verify the model instances are equivalent - assert geo_index_definition_model == geo_index_definition_model2 - - # Convert model instance back to dict and verify no loss of data - geo_index_definition_model_json2 = geo_index_definition_model.to_dict() - assert geo_index_definition_model_json2 == geo_index_definition_model_json - -class TestModel_GeoIndexInformation(): - """ - Test Class for GeoIndexInformation - """ - - def test_geo_index_information_serialization(self): - """ - Test serialization/deserialization for GeoIndexInformation - """ - - # Construct dict forms of any model objects needed in order to build this model. - - geo_index_stats_model = {} # GeoIndexStats - geo_index_stats_model['data_size'] = 0 - geo_index_stats_model['disk_size'] = 0 - geo_index_stats_model['doc_count'] = 0 - - # Construct a json representation of a GeoIndexInformation model - geo_index_information_model_json = {} - geo_index_information_model_json['geo_index'] = geo_index_stats_model - geo_index_information_model_json['name'] = 'testString' - - # Construct a model instance of GeoIndexInformation by calling from_dict on the json representation - geo_index_information_model = GeoIndexInformation.from_dict(geo_index_information_model_json) - assert geo_index_information_model != False - - # Construct a model instance of GeoIndexInformation by calling from_dict on the json representation - geo_index_information_model_dict = GeoIndexInformation.from_dict(geo_index_information_model_json).__dict__ - geo_index_information_model2 = GeoIndexInformation(**geo_index_information_model_dict) - - # Verify the model instances are equivalent - assert geo_index_information_model == geo_index_information_model2 - - # Convert model instance back to dict and verify no loss of data - geo_index_information_model_json2 = geo_index_information_model.to_dict() - assert geo_index_information_model_json2 == geo_index_information_model_json - -class TestModel_GeoIndexStats(): - """ - Test Class for GeoIndexStats - """ - - def test_geo_index_stats_serialization(self): - """ - Test serialization/deserialization for GeoIndexStats - """ - - # Construct a json representation of a GeoIndexStats model - geo_index_stats_model_json = {} - geo_index_stats_model_json['data_size'] = 0 - geo_index_stats_model_json['disk_size'] = 0 - geo_index_stats_model_json['doc_count'] = 0 - - # Construct a model instance of GeoIndexStats by calling from_dict on the json representation - geo_index_stats_model = GeoIndexStats.from_dict(geo_index_stats_model_json) - assert geo_index_stats_model != False - - # Construct a model instance of GeoIndexStats by calling from_dict on the json representation - geo_index_stats_model_dict = GeoIndexStats.from_dict(geo_index_stats_model_json).__dict__ - geo_index_stats_model2 = GeoIndexStats(**geo_index_stats_model_dict) - - # Verify the model instances are equivalent - assert geo_index_stats_model == geo_index_stats_model2 - - # Convert model instance back to dict and verify no loss of data - geo_index_stats_model_json2 = geo_index_stats_model.to_dict() - assert geo_index_stats_model_json2 == geo_index_stats_model_json - -class TestModel_GeoJsonFeature(): - """ - Test Class for GeoJsonFeature - """ - - def test_geo_json_feature_serialization(self): - """ - Test serialization/deserialization for GeoJsonFeature - """ - - # Construct dict forms of any model objects needed in order to build this model. - - geo_json_geometry_object_model = {} # GeoJsonGeometry - geo_json_geometry_object_model['type'] = 'Point' - geo_json_geometry_object_model['coordinates'] = ['testString'] - - # Construct a json representation of a GeoJsonFeature model - geo_json_feature_model_json = {} - geo_json_feature_model_json['_id'] = 'testString' - geo_json_feature_model_json['_rev'] = 'testString' - geo_json_feature_model_json['bbox'] = [72.5] - geo_json_feature_model_json['geometry'] = geo_json_geometry_object_model - geo_json_feature_model_json['properties'] = {'key1': 'testString'} - geo_json_feature_model_json['type'] = 'Feature' - geo_json_feature_model_json['foo'] = 'testString' - - # Construct a model instance of GeoJsonFeature by calling from_dict on the json representation - geo_json_feature_model = GeoJsonFeature.from_dict(geo_json_feature_model_json) - assert geo_json_feature_model != False - - # Construct a model instance of GeoJsonFeature by calling from_dict on the json representation - geo_json_feature_model_dict = GeoJsonFeature.from_dict(geo_json_feature_model_json).__dict__ - geo_json_feature_model2 = GeoJsonFeature(**geo_json_feature_model_dict) - - # Verify the model instances are equivalent - assert geo_json_feature_model == geo_json_feature_model2 - - # Convert model instance back to dict and verify no loss of data - geo_json_feature_model_json2 = geo_json_feature_model.to_dict() - assert geo_json_feature_model_json2 == geo_json_feature_model_json - - # Test get_properties and set_properties methods. - geo_json_feature_model.set_properties({}) - actual_dict = geo_json_feature_model.get_properties() - assert actual_dict == {} - - expected_dict = {'foo': 'testString'} - geo_json_feature_model.set_properties(expected_dict) - actual_dict = geo_json_feature_model.get_properties() - assert actual_dict == expected_dict - -class TestModel_GeoResult(): - """ - Test Class for GeoResult - """ - - def test_geo_result_serialization(self): - """ - Test serialization/deserialization for GeoResult - """ - - # Construct dict forms of any model objects needed in order to build this model. - - geo_json_geometry_object_model = {} # GeoJsonGeometry - geo_json_geometry_object_model['type'] = 'Point' - geo_json_geometry_object_model['coordinates'] = ['testString'] - - geo_json_feature_model = {} # GeoJsonFeature - geo_json_feature_model['_id'] = 'testString' - geo_json_feature_model['_rev'] = 'testString' - geo_json_feature_model['bbox'] = [72.5] - geo_json_feature_model['geometry'] = geo_json_geometry_object_model - geo_json_feature_model['properties'] = {'key1': 'testString'} - geo_json_feature_model['type'] = 'Feature' - geo_json_feature_model['foo'] = 'testString' - - attachment_model = {} # Attachment - attachment_model['content_type'] = 'testString' - attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' - attachment_model['digest'] = 'testString' - attachment_model['encoded_length'] = 0 - attachment_model['encoding'] = 'testString' - attachment_model['follows'] = True - attachment_model['length'] = 0 - attachment_model['revpos'] = 1 - attachment_model['stub'] = True - - revisions_model = {} # Revisions - revisions_model['ids'] = ['testString'] - revisions_model['start'] = 1 - - document_revision_status_model = {} # DocumentRevisionStatus - document_revision_status_model['rev'] = 'testString' - document_revision_status_model['status'] = 'available' - - document_model = {} # Document - document_model['_attachments'] = {'key1': attachment_model} - document_model['_conflicts'] = ['testString'] - document_model['_deleted'] = True - document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' - document_model['_local_seq'] = 'testString' - document_model['_rev'] = 'testString' - document_model['_revisions'] = revisions_model - document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' - - geo_json_geometry_model = {} # GeoJsonGeometry - geo_json_geometry_model['type'] = 'Point' - geo_json_geometry_model['coordinates'] = ['testString'] - - geo_result_row_model = {} # GeoResultRow - geo_result_row_model['doc'] = document_model - geo_result_row_model['geometry'] = geo_json_geometry_model - geo_result_row_model['id'] = 'testString' - geo_result_row_model['rev'] = 'testString' - - # Construct a json representation of a GeoResult model - geo_result_model_json = {} - geo_result_model_json['bookmark'] = 'testString' - geo_result_model_json['features'] = [geo_json_feature_model] - geo_result_model_json['rows'] = [geo_result_row_model] - geo_result_model_json['type'] = 'FeatureCollection' - - # Construct a model instance of GeoResult by calling from_dict on the json representation - geo_result_model = GeoResult.from_dict(geo_result_model_json) - assert geo_result_model != False - - # Construct a model instance of GeoResult by calling from_dict on the json representation - geo_result_model_dict = GeoResult.from_dict(geo_result_model_json).__dict__ - geo_result_model2 = GeoResult(**geo_result_model_dict) - - # Verify the model instances are equivalent - assert geo_result_model == geo_result_model2 - - # Convert model instance back to dict and verify no loss of data - geo_result_model_json2 = geo_result_model.to_dict() - assert geo_result_model_json2 == geo_result_model_json - -class TestModel_GeoResultRow(): - """ - Test Class for GeoResultRow - """ - - def test_geo_result_row_serialization(self): - """ - Test serialization/deserialization for GeoResultRow - """ - - # Construct dict forms of any model objects needed in order to build this model. - - attachment_model = {} # Attachment - attachment_model['content_type'] = 'testString' - attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' - attachment_model['digest'] = 'testString' - attachment_model['encoded_length'] = 0 - attachment_model['encoding'] = 'testString' - attachment_model['follows'] = True - attachment_model['length'] = 0 - attachment_model['revpos'] = 1 - attachment_model['stub'] = True - - revisions_model = {} # Revisions - revisions_model['ids'] = ['testString'] - revisions_model['start'] = 1 - - document_revision_status_model = {} # DocumentRevisionStatus - document_revision_status_model['rev'] = 'testString' - document_revision_status_model['status'] = 'available' - - document_model = {} # Document - document_model['_attachments'] = {'key1': attachment_model} - document_model['_conflicts'] = ['testString'] - document_model['_deleted'] = True - document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' - document_model['_local_seq'] = 'testString' - document_model['_rev'] = 'testString' - document_model['_revisions'] = revisions_model - document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' - - geo_json_geometry_model = {} # GeoJsonGeometry - geo_json_geometry_model['type'] = 'Point' - geo_json_geometry_model['coordinates'] = ['testString'] - - # Construct a json representation of a GeoResultRow model - geo_result_row_model_json = {} - geo_result_row_model_json['doc'] = document_model - geo_result_row_model_json['geometry'] = geo_json_geometry_model - geo_result_row_model_json['id'] = 'testString' - geo_result_row_model_json['rev'] = 'testString' - - # Construct a model instance of GeoResultRow by calling from_dict on the json representation - geo_result_row_model = GeoResultRow.from_dict(geo_result_row_model_json) - assert geo_result_row_model != False - - # Construct a model instance of GeoResultRow by calling from_dict on the json representation - geo_result_row_model_dict = GeoResultRow.from_dict(geo_result_row_model_json).__dict__ - geo_result_row_model2 = GeoResultRow(**geo_result_row_model_dict) - - # Verify the model instances are equivalent - assert geo_result_row_model == geo_result_row_model2 - - # Convert model instance back to dict and verify no loss of data - geo_result_row_model_json2 = geo_result_row_model.to_dict() - assert geo_result_row_model_json2 == geo_result_row_model_json - class TestModel_IndexDefinition(): """ Test Class for IndexDefinition @@ -16098,6 +15224,7 @@ def test_replication_document_serialization(self): replication_document_model_json['target_proxy'] = 'testString' replication_document_model_json['use_checkpoints'] = True replication_document_model_json['user_ctx'] = user_context_model + replication_document_model_json['winning_revs_only'] = False replication_document_model_json['worker_batch_size'] = 1 replication_document_model_json['worker_processes'] = 1 replication_document_model_json['foo'] = 'testString' @@ -17483,72 +16610,6 @@ def test_view_result_row_serialization(self): view_result_row_model_json2 = view_result_row_model.to_dict() assert view_result_row_model_json2 == view_result_row_model_json -class TestModel_GeoJsonGeometry(): - """ - Test Class for GeoJsonGeometry - """ - - def test_geo_json_geometry_serialization(self): - """ - Test serialization/deserialization for GeoJsonGeometry - """ - - # Construct a json representation of a GeoJsonGeometry model - geo_json_geometry_model_json = {} - geo_json_geometry_model_json['type'] = 'Point' - geo_json_geometry_model_json['coordinates'] = ['testString'] - - # Construct a model instance of GeoJsonGeometry by calling from_dict on the json representation - geo_json_geometry_model = GeoJsonGeometry.from_dict(geo_json_geometry_model_json) - assert geo_json_geometry_model != False - - # Construct a model instance of GeoJsonGeometry by calling from_dict on the json representation - geo_json_geometry_model_dict = GeoJsonGeometry.from_dict(geo_json_geometry_model_json).__dict__ - geo_json_geometry_model2 = GeoJsonGeometry(**geo_json_geometry_model_dict) - - # Verify the model instances are equivalent - assert geo_json_geometry_model == geo_json_geometry_model2 - - # Convert model instance back to dict and verify no loss of data - geo_json_geometry_model_json2 = geo_json_geometry_model.to_dict() - assert geo_json_geometry_model_json2 == geo_json_geometry_model_json - -class TestModel_GeoJsonGeometryCollection(): - """ - Test Class for GeoJsonGeometryCollection - """ - - def test_geo_json_geometry_collection_serialization(self): - """ - Test serialization/deserialization for GeoJsonGeometryCollection - """ - - # Construct dict forms of any model objects needed in order to build this model. - - geo_json_geometry_model = {} # GeoJsonGeometry - geo_json_geometry_model['type'] = 'Point' - geo_json_geometry_model['coordinates'] = ['testString'] - - # Construct a json representation of a GeoJsonGeometryCollection model - geo_json_geometry_collection_model_json = {} - geo_json_geometry_collection_model_json['type'] = 'Point' - geo_json_geometry_collection_model_json['geometries'] = [geo_json_geometry_model] - - # Construct a model instance of GeoJsonGeometryCollection by calling from_dict on the json representation - geo_json_geometry_collection_model = GeoJsonGeometryCollection.from_dict(geo_json_geometry_collection_model_json) - assert geo_json_geometry_collection_model != False - - # Construct a model instance of GeoJsonGeometryCollection by calling from_dict on the json representation - geo_json_geometry_collection_model_dict = GeoJsonGeometryCollection.from_dict(geo_json_geometry_collection_model_json).__dict__ - geo_json_geometry_collection_model2 = GeoJsonGeometryCollection(**geo_json_geometry_collection_model_dict) - - # Verify the model instances are equivalent - assert geo_json_geometry_collection_model == geo_json_geometry_collection_model2 - - # Convert model instance back to dict and verify no loss of data - geo_json_geometry_collection_model_json2 = geo_json_geometry_collection_model.to_dict() - assert geo_json_geometry_collection_model_json2 == geo_json_geometry_collection_model_json - # endregion ############################################################################## From 26650b4692fb90e7c38717f33f0d7edc6c8feb0d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 23 Aug 2022 13:32:49 +0000 Subject: [PATCH 006/669] Generated: ci: use branch name for tagging stage condition Generated SDK source code using: - Generator version 3.54.1 - Specification version 1.0.0-dev0.0.46 - Automation (cloudant-sdks) version 2e57ce6 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 54c173e9..b4a69365 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -123,7 +123,7 @@ pipeline { beforeAgent true allOf { // We only bump the version and create a tag when building the default primary branch with a TARGET_VERSION - expression { env.BRANCH_IS_PRIMARY } + branch 'main' not { equals expected: 'NONE', actual: "${params.TARGET_VERSION}" } From ff0788c0a653bbfafd638b80b106942dab9f6477 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:45:06 +0000 Subject: [PATCH 007/669] Update version 0.1.4 -> 0.2.0 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 861d505b..d1820bcf 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.4 +current_version = 0.2.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 8a899e8d..b0d32967 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.1.4 +# IBM Cloudant Python SDK Version 0.2.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -103,13 +103,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.1.4" +pip install --upgrade "ibmcloudant>=0.2.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.1.4" +easy_install --upgrade "ibmcloudant>=0.2.0" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 8f8a95f9..99b6de66 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.1.4' +__version__ = '0.2.0' diff --git a/setup.py b/setup.py index 7c1099c8..aff3506a 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.1.4' +__version__ = '0.2.0' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From b7c8828c3c3d536e7f28636b201922bc5027bb4d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 23 Aug 2022 21:44:44 +0100 Subject: [PATCH 008/669] test: modify wiremock stubs for updated readme integration test (#318) Generated SDK source code using: - Generator version 3.54.1 - Specification version 1.0.0-dev0.0.46 - Automation (cloudant-sdks) version 10007f5 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- stubs/mappings.json | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/stubs/mappings.json b/stubs/mappings.json index 2be7b778..ef50d50b 100644 --- a/stubs/mappings.json +++ b/stubs/mappings.json @@ -253,7 +253,7 @@ "uuid" : "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", "persistent" : true, "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "Started", + "requiredScenarioState" : "scenario-2-orders-example-2", "newScenarioState" : "scenario-2-orders-example-3", "insertionIndex" : 8 },{ @@ -336,37 +336,40 @@ "insertionIndex" : 4 },{ "id" : "af927fc5-341a-4f9d-9c48-83a57aa7b505", - "name" : "animaldb_zebra", + "name" : "orders_example", "request" : { - "url" : "/animaldb/zebra", + "url" : "/orders/example", "method" : "GET" }, "response" : { "status" : 200, - "body" : "{\"_id\":\"zebra\",\"_rev\":\"3-750dac460a6cc41e6999f8943b8e603e\",\"wiki_page\":\"http://en.wikipedia.org/wiki/Plains_zebra\",\"min_length\":2,\"max_length\":2.5,\"min_weight\":175,\"max_weight\":387,\"class\":\"mammal\",\"diet\":\"herbivore\"}\n", + "body" : "{\"_id\":\"example\",\"_rev\":\"1-1b403633540686aa32d013fda9041a5d\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}\n", "headers" : { "Cache-Control" : "must-revalidate", "Content-Type" : "application/json", "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"3-750dac460a6cc41e6999f8943b8e603e\"", + "ETag" : "\"1-1b403633540686aa32d013fda9041a5d\"", "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "59a32f4530", + "X-Couch-Request-ID" : "f9bef554c3", "X-CouchDB-Body-Time" : "0" } }, "uuid" : "af927fc5-341a-4f9d-9c48-83a57aa7b505", "persistent" : true, + "scenarioName" : "scenario-2-orders-example", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-2-orders-example-2", "insertionIndex" : 3 },{ "id" : "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", - "name" : "animaldb", + "name" : "orders", "request" : { - "url" : "/animaldb", + "url" : "/orders", "method" : "GET" }, "response" : { "status" : 200, - "body" : "{\"db_name\":\"animaldb\",\"purge_seq\":\"0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4\",\"update_seq\":\"15-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEjlxqEtkSKoHK2DLAgCGPRlt\",\"sizes\":{\"file\":57751,\"external\":3450,\"active\":7355},\"props\":{},\"doc_del_count\":3,\"doc_count\":11,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":2,\"n\":1,\"w\":1,\"r\":1},\"instance_start_time\":\"0\"}\n", + "body" : "{\"db_name\":\"orders\",\"purge_seq\":\"0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4\",\"update_seq\":\"1-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEjlxqEtkSKoHK2DLAgCGPRlt\",\"sizes\":{\"file\":57751,\"external\":3450,\"active\":7355},\"props\":{},\"doc_del_count\":0,\"doc_count\":1,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":2,\"n\":1,\"w\":1,\"r\":1},\"instance_start_time\":\"0\"}\n", "headers" : { "Cache-Control" : "must-revalidate", "Content-Type" : "application/json", From 3e2d954a29c085d931b081326bd47d7361805317 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 23 Aug 2022 18:24:51 -0300 Subject: [PATCH 009/669] docs: update get_info examples (#316) --- .../output/get_info_from_existing_database.txt | 15 +++++---------- .../src/get_info_from_existing_database.py | 16 ++++++++-------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/test/examples/output/get_info_from_existing_database.txt b/test/examples/output/get_info_from_existing_database.txt index c7564307..f9074276 100644 --- a/test/examples/output/get_info_from_existing_database.txt +++ b/test/examples/output/get_info_from_existing_database.txt @@ -1,14 +1,9 @@ Server Version: 2.1.1 -Document count in "animaldb" database is 11. +Document count in "orders" database is 1. Document retrieved from database: { - "_id": "zebra", - "_rev": "3-750dac460a6cc41e6999f8943b8e603e", - "wiki_page": "http://en.wikipedia.org/wiki/Plains_zebra", - "min_length": 2, - "max_length": 2.5, - "min_weight": 175, - "max_weight": 387, - "class": "mammal", - "diet": "herbivore" + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:99.000Z" } \ No newline at end of file diff --git a/test/examples/src/get_info_from_existing_database.py b/test/examples/src/get_info_from_existing_database.py index a789371d..08ad38bd 100644 --- a/test/examples/src/get_info_from_existing_database.py +++ b/test/examples/src/get_info_from_existing_database.py @@ -18,8 +18,8 @@ from ibmcloudant.cloudant_v1 import CloudantV1 -# 1. Create a Cloudant client with "EXAMPLES" service name ============ -client = CloudantV1.new_instance(service_name="EXAMPLES") +# 1. Create a client with `CLOUDANT` default service name ============ +client = CloudantV1.new_instance() # 2. Get server information =========================================== server_information = client.get_server_information( @@ -27,8 +27,8 @@ print(f'Server Version: {server_information["version"]}') -# 3. Get database information for "animaldb" ========================== -db_name = "animaldb" +# 3. Get database information for "orders" ========================== +db_name = "orders" db_information = client.get_database_information( db=db_name @@ -40,11 +40,11 @@ print(f'Document count in \"{db_information["db_name"]}\" ' f'database is {document_count}.') -# 5. Get zebra document out of the database by document id ============ -document_about_zebra = client.get_document( +# 5. Get "example" document out of the database by document id ============ +document_example = client.get_document( db=db_name, - doc_id="zebra" + doc_id="example" ).get_result() print(f'Document retrieved from database:\n' - f'{json.dumps(document_about_zebra, indent=2)}') + f'{json.dumps(document_example, indent=2)}') From 8f73be71a940ab8fd2e3a0f97306390b5d774515 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 24 Aug 2022 19:20:39 +0100 Subject: [PATCH 010/669] docs(generated): remove examples.cloudant.com from README (#315) Generated SDK source code using: - Generator version 3.54.1 - Specification version 1.0.0-dev0.0.46 - Automation (cloudant-sdks) version 9f434c7 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 164 +++++++++++++++++++++++++----------------------------- 1 file changed, 76 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index b0d32967..cce423f4 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ to avoid surprises. - [Using the SDK](#using-the-sdk) * [Request timeout configuration](#request-timeout-configuration) * [Code examples](#code-examples) - + [1. Retrieve information from an existing database](#1-retrieve-information-from-an-existing-database) - + [2. Create your own database and add a document](#2-create-your-own-database-and-add-a-document) + + [1. Create a database and add a document](#1-create-a-database-and-add-a-document) + + [2. Retrieve information from an existing database](#2-retrieve-information-from-an-existing-database) + [3. Update your previously created document](#3-update-your-previously-created-document) + [4. Delete your previously created document](#4-delete-your-previously-created-document) + [Further code examples](#further-code-examples) @@ -227,16 +227,14 @@ The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/READ The following code examples [authenticate with the environment variables](#authenticate-with-environment-variables). -#### 1. Retrieve information from an existing database +#### 1. Create a database and add a document -**Note:** This example code assumes that `animaldb` database does not exist in your account. +**Note:** This example code assumes that `orders` database does not exist in your account. -This example code gathers information about an existing database hosted on -the https://examples.cloudant.com/ service `url`. To connect, you must -extend your environment variables with the *service url* and *authentication -type* to use `NOAUTH` authentication while you connect to the `animaldb` database. -This step is necessary for the SDK to distinguish the `EXAMPLES` custom service -name from the default service name which is `CLOUDANT`. +This example code creates `orders` database and adds a new document "example" +into it. To connect, you must set your environment variables with +the *service url*, *authentication type* and *authentication credentials* +of your Cloudant service. Cloudant environment variable naming starts with a *service name* prefix that identifies your service. By default this is `CLOUDANT`, see the settings in the @@ -244,83 +242,9 @@ By default this is `CLOUDANT`, see the settings in the If you would like to rename your Cloudant service from `CLOUDANT`, you must use your defined service name as the prefix for all Cloudant related environment variables. -The code block below provides an example of instantiating a user-defined `EXAMPLES` service name. - -```bash -EXAMPLES_URL=https://examples.cloudant.com -EXAMPLES_AUTH_TYPE=NOAUTH -``` Once the environment variables are set, you can try out the code examples. -[embedmd]:# (test/examples/src/get_info_from_existing_database.py /import/ $) -```py -import json - -from ibmcloudant.cloudant_v1 import CloudantV1 - -# 1. Create a Cloudant client with "EXAMPLES" service name ============ -client = CloudantV1.new_instance(service_name="EXAMPLES") - -# 2. Get server information =========================================== -server_information = client.get_server_information( -).get_result() - -print(f'Server Version: {server_information["version"]}') - -# 3. Get database information for "animaldb" ========================== -db_name = "animaldb" - -db_information = client.get_database_information( - db=db_name -).get_result() - -# 4. Show document count in database ================================== -document_count = db_information["doc_count"] - -print(f'Document count in \"{db_information["db_name"]}\" ' - f'database is {document_count}.') - -# 5. Get zebra document out of the database by document id ============ -document_about_zebra = client.get_document( - db=db_name, - doc_id="zebra" -).get_result() - -print(f'Document retrieved from database:\n' - f'{json.dumps(document_about_zebra, indent=2)}') -``` - -When you run the code, you see a result similar to the following output. - -[embedmd]:# (test/examples/output/get_info_from_existing_database.txt) -```txt -Server Version: 2.1.1 -Document count in "animaldb" database is 11. -Document retrieved from database: -{ - "_id": "zebra", - "_rev": "3-750dac460a6cc41e6999f8943b8e603e", - "wiki_page": "http://en.wikipedia.org/wiki/Plains_zebra", - "min_length": 2, - "max_length": 2.5, - "min_weight": 175, - "max_weight": 387, - "class": "mammal", - "diet": "herbivore" -} -``` - -#### 2. Create your own database and add a document - -**Note:** This example code assumes that `orders` database does not exist in your account. - -Now comes the exciting part, you create your own `orders` database and add a document about *Bob Smith* with your own [IAM](#iam-authentication) or -[Basic](#basic-authentication) service credentials. - -
-Create code example - [embedmd]:# (test/examples/src/create_db_and_doc.py /import/ $) ```py import logging @@ -385,8 +309,6 @@ example_document.rev = create_document_response["rev"] print(f'You have created the document:\n{example_document}') ``` - -
When you run the code, you see a result similar to the following output. [embedmd]:# (test/examples/output/create_db_and_doc.txt) @@ -401,11 +323,77 @@ You have created the document: } ``` +#### 2. Retrieve information from an existing database + +**Note**: This example code assumes that you have created both the `orders` +database and the `example` document by +[running the previous example code](#1-create-a-database-and-add-a-document) +successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' +database or 'example' document was not found." + +
+Gather database information example + +[embedmd]:# (test/examples/src/get_info_from_existing_database.py /import/ $) +```py +import json + +from ibmcloudant.cloudant_v1 import CloudantV1 + +# 1. Create a client with `CLOUDANT` default service name ============ +client = CloudantV1.new_instance() + +# 2. Get server information =========================================== +server_information = client.get_server_information( +).get_result() + +print(f'Server Version: {server_information["version"]}') + +# 3. Get database information for "orders" ========================== +db_name = "orders" + +db_information = client.get_database_information( + db=db_name +).get_result() + +# 4. Show document count in database ================================== +document_count = db_information["doc_count"] + +print(f'Document count in \"{db_information["db_name"]}\" ' + f'database is {document_count}.') + +# 5. Get "example" document out of the database by document id ============ +document_example = client.get_document( + db=db_name, + doc_id="example" +).get_result() + +print(f'Document retrieved from database:\n' + f'{json.dumps(document_example, indent=2)}') +``` + + +
+When you run the code, you see a result similar to the following output. + +[embedmd]:# (test/examples/output/get_info_from_existing_database.txt) +```txt +Server Version: 2.1.1 +Document count in "orders" database is 1. +Document retrieved from database: +{ + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:99.000Z" +} +``` + #### 3. Update your previously created document **Note**: This example code assumes that you have created both the `orders` database and the `example` document by -[running the previous example code](#2-create-your-own-database-and-add-a-document) +[running the previous example code](#1-create-a-database-and-add-a-document) successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders' database or 'example' document was not found." @@ -516,7 +504,7 @@ When you run the code, you see a result similar to the following output. **Note**: This example code assumes that you have created both the `orders` database and the `example` document by -[running the previous example code](#2-create-your-own-database-and-add-a-document) +[running the previous example code](#1-create-a-database-and-add-a-document) successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' database or 'example' document was not found." From 6c302a09c5bc988ee462c7453a5e813b76596ba9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Aug 2022 17:04:13 +0000 Subject: [PATCH 011/669] build(deps-dev): Bump pylint from 2.14.5 to 2.15.0 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.14.5 to 2.15.0. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ed8f127d..c9295cd4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.1.2 responses==0.21.0 python_dotenv==0.20.0 -pylint==2.14.5 +pylint==2.15.0 tox==3.25.1 pytest-rerunfailures==10.2 From d4b06bf0ed818769bd1778ff12ffaa591bd15a2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Sep 2022 17:04:15 +0000 Subject: [PATCH 012/669] build(deps-dev): Bump pytest from 7.1.2 to 7.1.3 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.2 to 7.1.3. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.1.3) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c9295cd4..7d9debd0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.1.2 +pytest==7.1.3 responses==0.21.0 python_dotenv==0.20.0 pylint==2.15.0 From 05ce46cdc163f29661e47e96bc8e9a38462f8026 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 17:13:59 +0000 Subject: [PATCH 013/669] build(deps-dev): Bump python-dotenv from 0.20.0 to 0.21.0 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v0.20.0...v0.21.0) --- updated-dependencies: - dependency-name: python-dotenv dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7d9debd0..6e027f7a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # test dependencies pytest==7.1.3 responses==0.21.0 -python_dotenv==0.20.0 +python_dotenv==0.21.0 pylint==2.15.0 tox==3.25.1 pytest-rerunfailures==10.2 From 4ee308ea8cccbca8d2b21f4af2f16aa0ef3c61c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:19:51 +0100 Subject: [PATCH 014/669] build(deps-dev): Bump pylint from 2.15.0 to 2.15.2 (#324) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.0 to 2.15.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.0...v2.15.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 6e027f7a..36c830c1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.1.3 responses==0.21.0 python_dotenv==0.21.0 -pylint==2.15.0 +pylint==2.15.2 tox==3.25.1 pytest-rerunfailures==10.2 From ff2907df207a160001c67f4c7e3591ac727b810e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Sep 2022 12:46:25 +0100 Subject: [PATCH 015/669] build(deps-dev): Bump tox from 3.25.1 to 3.26.0 (#325) Bumps [tox](https://github.com/tox-dev/tox) from 3.25.1 to 3.26.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.25.1...3.26.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 36c830c1..d43175f8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.1.3 responses==0.21.0 python_dotenv==0.21.0 pylint==2.15.2 -tox==3.25.1 +tox==3.26.0 pytest-rerunfailures==10.2 # code coverage From e1c196b5a708be662b20c2b497b60942b1336248 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:38:44 -0400 Subject: [PATCH 016/669] build(deps-dev): Bump pylint from 2.15.2 to 2.15.3 (#327) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.2 to 2.15.3. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.2...v2.15.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d43175f8..1d9d5892 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.1.3 responses==0.21.0 python_dotenv==0.21.0 -pylint==2.15.2 +pylint==2.15.3 tox==3.26.0 pytest-rerunfailures==10.2 From 1c05a6a00ce69a081b8b7b56581cfbb6a26be7b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:08:15 +0000 Subject: [PATCH 017/669] build(deps-dev): Bump sphinx from 5.1.1 to 5.2.1 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.1.1 to 5.2.1. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.1.1...v5.2.1) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1d9d5892..07c77001 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ pytest-cov==3.0.0 # documentation recommonmark==0.7.1 -Sphinx==5.1.1 +Sphinx==5.2.1 From dc2a65b441706e8150c0af6e318c8207e3a7a64f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:04:08 +0000 Subject: [PATCH 018/669] build(deps-dev): Bump sphinx from 5.2.1 to 5.2.2 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.2.1 to 5.2.2. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.2.1...v5.2.2) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 07c77001..5d39284a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ pytest-cov==3.0.0 # documentation recommonmark==0.7.1 -Sphinx==5.2.1 +Sphinx==5.2.2 From 388a519e64bbec7ecad5d7cb418fd764de005764 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 28 Sep 2022 14:58:05 +0100 Subject: [PATCH 019/669] Generated: Update generator version to 3.57.0 (#611) (#328) Generated SDK source code using: - Generator version 3.57.0 - Specification version 1.0.0-dev0.0.46 - Automation (cloudant-sdks) version 14b2129 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 288 +++++++++++++++++----------------- test/unit/test_cloudant_v1.py | 102 ++++++------ 2 files changed, 193 insertions(+), 197 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 151c8ec1..d4a2731c 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -484,7 +484,7 @@ def post_changes(self, :rtype: DetailedResponse with `dict` result representing a `ChangesResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = { 'Last-Event-ID': last_event_id @@ -674,7 +674,7 @@ def post_changes_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') headers = { 'Last-Event-ID': last_event_id @@ -750,7 +750,7 @@ def head_database(self, :rtype: DetailedResponse """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -898,7 +898,7 @@ def delete_database(self, :rtype: DetailedResponse with `dict` result representing a `Ok` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -936,7 +936,7 @@ def get_database_information(self, :rtype: DetailedResponse with `dict` result representing a `DatabaseInformation` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -983,7 +983,7 @@ def put_database(self, :rtype: DetailedResponse with `dict` result representing a `Ok` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1049,9 +1049,9 @@ def head_document(self, :rtype: DetailedResponse """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -1115,7 +1115,7 @@ def post_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if document is None: raise ValueError('document must be provided') @@ -1219,7 +1219,7 @@ def post_all_docs(self, :rtype: DetailedResponse with `dict` result representing a `AllDocsResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1323,7 +1323,7 @@ def post_all_docs_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1392,7 +1392,7 @@ def post_all_docs_queries(self, :rtype: DetailedResponse with `dict` result representing a `AllDocsQueriesResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if queries is None: raise ValueError('queries must be provided') @@ -1452,7 +1452,7 @@ def post_all_docs_queries_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') if queries is None: raise ValueError('queries must be provided') @@ -1508,7 +1508,7 @@ def post_bulk_docs(self, :rtype: DetailedResponse with `List[DocumentResult]` result """ - if db is None: + if not db: raise ValueError('db must be provided') if bulk_docs is None: raise ValueError('bulk_docs must be provided') @@ -1577,7 +1577,7 @@ def post_bulk_get(self, :rtype: DetailedResponse with `dict` result representing a `BulkGetResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if docs is None: raise ValueError('docs must be provided') @@ -1654,7 +1654,7 @@ def post_bulk_get_as_mixed(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') if docs is None: raise ValueError('docs must be provided') @@ -1731,7 +1731,7 @@ def post_bulk_get_as_related(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') if docs is None: raise ValueError('docs must be provided') @@ -1808,7 +1808,7 @@ def post_bulk_get_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') if docs is None: raise ValueError('docs must be provided') @@ -1883,9 +1883,9 @@ def delete_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-Match': if_match @@ -1974,9 +1974,9 @@ def get_document(self, :rtype: DetailedResponse with `dict` result representing a `Document` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -2073,9 +2073,9 @@ def get_document_as_mixed(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -2172,9 +2172,9 @@ def get_document_as_related(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -2271,9 +2271,9 @@ def get_document_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -2354,9 +2354,9 @@ def put_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') if document is None: raise ValueError('document must be provided') @@ -2437,9 +2437,9 @@ def head_design_document(self, :rtype: DetailedResponse """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') headers = { 'If-None-Match': if_none_match @@ -2498,9 +2498,9 @@ def delete_design_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') headers = { 'If-Match': if_match @@ -2591,9 +2591,9 @@ def get_design_document(self, :rtype: DetailedResponse with `dict` result representing a `DesignDocument` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') headers = { 'If-None-Match': if_none_match @@ -2673,9 +2673,9 @@ def put_design_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') if design_document is None: raise ValueError('design_document must be provided') @@ -2738,9 +2738,9 @@ def get_design_document_information(self, :rtype: DetailedResponse with `dict` result representing a `DesignDocumentInformation` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2827,7 +2827,7 @@ def post_design_docs(self, :rtype: DetailedResponse with `dict` result representing a `AllDocsResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = { 'Accept': accept @@ -2899,7 +2899,7 @@ def post_design_docs_queries(self, :rtype: DetailedResponse with `dict` result representing a `AllDocsQueriesResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if queries is None: raise ValueError('queries must be provided') @@ -3045,11 +3045,11 @@ def post_view(self, :rtype: DetailedResponse with `dict` result representing a `ViewResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if view is None: + if not view: raise ValueError('view must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3206,11 +3206,11 @@ def post_view_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if view is None: + if not view: raise ValueError('view must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3290,11 +3290,11 @@ def post_view_queries(self, :rtype: DetailedResponse with `dict` result representing a `ViewQueriesResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if view is None: + if not view: raise ValueError('view must be provided') if queries is None: raise ValueError('queries must be provided') @@ -3358,11 +3358,11 @@ def post_view_queries_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if view is None: + if not view: raise ValueError('view must be provided') if queries is None: raise ValueError('queries must be provided') @@ -3421,9 +3421,9 @@ def get_partition_information(self, :rtype: DetailedResponse with `dict` result representing a `PartitionInformation` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3510,9 +3510,9 @@ def post_partition_all_docs(self, :rtype: DetailedResponse with `dict` result representing a `AllDocsResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3619,9 +3619,9 @@ def post_partition_all_docs_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3741,13 +3741,13 @@ def post_partition_search(self, :rtype: DetailedResponse with `dict` result representing a `SearchResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if index is None: + if not index: raise ValueError('index must be provided') if query is None: raise ValueError('query must be provided') @@ -3868,13 +3868,13 @@ def post_partition_search_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if index is None: + if not index: raise ValueError('index must be provided') if query is None: raise ValueError('query must be provided') @@ -4027,13 +4027,13 @@ def post_partition_view(self, :rtype: DetailedResponse with `dict` result representing a `ViewResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if view is None: + if not view: raise ValueError('view must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4192,13 +4192,13 @@ def post_partition_view_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if view is None: + if not view: raise ValueError('view must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4351,9 +4351,9 @@ def post_partition_find(self, :rtype: DetailedResponse with `dict` result representing a `FindResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') if selector is None: raise ValueError('selector must be provided') @@ -4499,9 +4499,9 @@ def post_partition_find_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if partition_key is None: + if not partition_key: raise ValueError('partition_key must be provided') if selector is None: raise ValueError('selector must be provided') @@ -4650,7 +4650,7 @@ def post_explain(self, :rtype: DetailedResponse with `dict` result representing a `ExplainResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if selector is None: raise ValueError('selector must be provided') @@ -4802,7 +4802,7 @@ def post_find(self, :rtype: DetailedResponse with `dict` result representing a `FindResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if selector is None: raise ValueError('selector must be provided') @@ -4954,7 +4954,7 @@ def post_find_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') if selector is None: raise ValueError('selector must be provided') @@ -5018,7 +5018,7 @@ def get_indexes_information(self, :rtype: DetailedResponse with `dict` result representing a `IndexesInformation` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5085,7 +5085,7 @@ def post_index(self, :rtype: DetailedResponse with `dict` result representing a `IndexResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') if index is None: raise ValueError('index must be provided') @@ -5149,13 +5149,13 @@ def delete_index(self, :rtype: DetailedResponse with `dict` result representing a `Ok` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if type is None: + if not type: raise ValueError('type must be provided') - if index is None: + if not index: raise ValueError('index must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5346,11 +5346,11 @@ def post_search(self, :rtype: DetailedResponse with `dict` result representing a `SearchResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if index is None: + if not index: raise ValueError('index must be provided') if query is None: raise ValueError('query must be provided') @@ -5512,11 +5512,11 @@ def post_search_as_stream(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if index is None: + if not index: raise ValueError('index must be provided') if query is None: raise ValueError('query must be provided') @@ -5589,11 +5589,11 @@ def get_search_info(self, :rtype: DetailedResponse with `dict` result representing a `SearchInfoResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if ddoc is None: + if not ddoc: raise ValueError('ddoc must be provided') - if index is None: + if not index: raise ValueError('index must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5644,7 +5644,7 @@ def head_replication_document(self, :rtype: DetailedResponse """ - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -5688,7 +5688,7 @@ def head_scheduler_document(self, :rtype: DetailedResponse """ - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5728,7 +5728,7 @@ def head_scheduler_job(self, :rtype: DetailedResponse """ - if job_id is None: + if not job_id: raise ValueError('job_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5778,7 +5778,7 @@ def delete_replication_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-Match': if_match @@ -5865,7 +5865,7 @@ def get_replication_document(self, :rtype: DetailedResponse with `dict` result representing a `ReplicationDocument` object """ - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -5941,7 +5941,7 @@ def put_replication_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') if replication_document is None: raise ValueError('replication_document must be provided') @@ -6053,7 +6053,7 @@ def get_scheduler_document(self, :rtype: DetailedResponse with `dict` result representing a `SchedulerDocument` object """ - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6143,7 +6143,7 @@ def get_scheduler_job(self, :rtype: DetailedResponse with `dict` result representing a `SchedulerJob` object """ - if job_id is None: + if not job_id: raise ValueError('job_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6228,7 +6228,7 @@ def get_security(self, :rtype: DetailedResponse with `dict` result representing a `Security` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6290,7 +6290,7 @@ def put_security(self, :rtype: DetailedResponse with `dict` result representing a `Ok` object """ - if db is None: + if not db: raise ValueError('db must be provided') if admins is not None: admins = convert_model(admins) @@ -6401,7 +6401,7 @@ def put_cloudant_security_configuration(self, :rtype: DetailedResponse with `dict` result representing a `Ok` object """ - if db is None: + if not db: raise ValueError('db must be provided') if cloudant is None: raise ValueError('cloudant must be provided') @@ -6575,11 +6575,11 @@ def head_attachment(self, :rtype: DetailedResponse """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') - if attachment_name is None: + if not attachment_name: raise ValueError('attachment_name must be provided') headers = { 'If-Match': if_match, @@ -6642,11 +6642,11 @@ def delete_attachment(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') - if attachment_name is None: + if not attachment_name: raise ValueError('attachment_name must be provided') headers = { 'If-Match': if_match @@ -6714,11 +6714,11 @@ def get_attachment(self, :rtype: DetailedResponse with `BinaryIO` result """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') - if attachment_name is None: + if not attachment_name: raise ValueError('attachment_name must be provided') headers = { 'If-Match': if_match, @@ -6789,15 +6789,15 @@ def put_attachment(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') - if attachment_name is None: + if not attachment_name: raise ValueError('attachment_name must be provided') if attachment is None: raise ValueError('attachment must be provided') - if content_type is None: + if not content_type: raise ValueError('content_type must be provided') headers = { 'Content-Type': content_type, @@ -6860,9 +6860,9 @@ def head_local_document(self, :rtype: DetailedResponse """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'If-None-Match': if_none_match @@ -6912,9 +6912,9 @@ def delete_local_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6980,9 +6980,9 @@ def get_local_document(self, :rtype: DetailedResponse with `dict` result representing a `Document` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = { 'Accept': accept, @@ -7044,9 +7044,9 @@ def put_local_document(self, :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') if document is None: raise ValueError('document must be provided') @@ -7116,7 +7116,7 @@ def post_revs_diff(self, :rtype: DetailedResponse with `dict` result representing a `dict` object """ - if db is None: + if not db: raise ValueError('db must be provided') if document_revisions is None: raise ValueError('document_revisions must be provided') @@ -7162,7 +7162,7 @@ def get_shards_information(self, :rtype: DetailedResponse with `dict` result representing a `ShardsInformation` object """ - if db is None: + if not db: raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7205,9 +7205,9 @@ def get_document_shards_info(self, :rtype: DetailedResponse with `dict` result representing a `DocumentShardInfo` object """ - if db is None: + if not db: raise ValueError('db must be provided') - if doc_id is None: + if not doc_id: raise ValueError('doc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7485,7 +7485,7 @@ class Feed(str, Enum): NORMAL = 'normal' -class PostChangesEnums: +class PostChangesAsStreamEnums: """ Enums for post_changes_as_stream parameters. """ @@ -10649,8 +10649,7 @@ def to_dict(self) -> Dict: if hasattr(self, 'views') and self.views is not None: _dict['views'] = {k : v.to_dict() for k, v in self.views.items()} for _key in [k for k in vars(self).keys() if k not in DesignDocument._properties]: - if getattr(self, _key, None) is not None: - _dict[_key] = getattr(self, _key) + _dict[_key] = getattr(self, _key) return _dict def _to_dict(self): @@ -11297,8 +11296,7 @@ def to_dict(self) -> Dict: if hasattr(self, 'revs_info') and self.revs_info is not None: _dict['_revs_info'] = [x.to_dict() for x in self.revs_info] for _key in [k for k in vars(self).keys() if k not in Document._properties]: - if getattr(self, _key, None) is not None: - _dict[_key] = getattr(self, _key) + _dict[_key] = getattr(self, _key) return _dict def _to_dict(self): @@ -12241,8 +12239,7 @@ def to_dict(self) -> Dict: if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type for _key in [k for k in vars(self).keys() if k not in IndexField._properties]: - if getattr(self, _key, None) is not None: - _dict[_key] = getattr(self, _key) + _dict[_key] = getattr(self, _key) return _dict def _to_dict(self): @@ -13818,8 +13815,7 @@ def to_dict(self) -> Dict: if hasattr(self, 'worker_processes') and self.worker_processes is not None: _dict['worker_processes'] = self.worker_processes for _key in [k for k in vars(self).keys() if k not in ReplicationDocument._properties]: - if getattr(self, _key, None) is not None: - _dict[_key] = getattr(self, _key) + _dict[_key] = getattr(self, _key) return _dict def _to_dict(self): @@ -15982,17 +15978,17 @@ class UpInformation(): """ Schema for information about the up state of the server. - :attr object seeds: seeds. + :attr dict seeds: seeds. :attr str status: status. """ def __init__(self, - seeds: object, + seeds: dict, status: str) -> None: """ Initialize a UpInformation object. - :param object seeds: seeds. + :param dict seeds: seeds. :param str status: status. """ self.seeds = seeds diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 04e779ee..b5677db7 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -513,7 +513,7 @@ def test_post_changes_all_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} last_event_id = 'testString' att_encoding_info = False attachments = False @@ -581,7 +581,7 @@ def test_post_changes_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} def test_post_changes_all_params_with_retries(self): # Enable retries and run test_post_changes_all_params. @@ -610,7 +610,7 @@ def test_post_changes_required_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} # Invoke method response = _service.post_changes( @@ -631,7 +631,7 @@ def test_post_changes_required_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} def test_post_changes_required_params_with_retries(self): # Enable retries and run test_post_changes_required_params. @@ -660,7 +660,7 @@ def test_post_changes_value_error(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -703,7 +703,7 @@ def test_post_changes_as_stream_all_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} last_event_id = 'testString' att_encoding_info = False attachments = False @@ -771,7 +771,7 @@ def test_post_changes_as_stream_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} # Verify streamed JSON response result = response.get_result() @@ -806,7 +806,7 @@ def test_post_changes_as_stream_required_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} # Invoke method response = _service.post_changes_as_stream( @@ -827,7 +827,7 @@ def test_post_changes_as_stream_required_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} # Verify streamed JSON response result = response.get_result() @@ -862,7 +862,7 @@ def test_post_changes_as_stream_value_error(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -6510,7 +6510,7 @@ def test_post_partition_search_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add(responses.POST, url, body=mock_response, @@ -6593,7 +6593,7 @@ def test_post_partition_search_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add(responses.POST, url, body=mock_response, @@ -7162,7 +7162,7 @@ def test_post_partition_find_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7200,7 +7200,7 @@ def test_post_partition_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7238,7 +7238,7 @@ def test_post_partition_find_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7292,7 +7292,7 @@ def test_post_partition_find_as_stream_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7330,7 +7330,7 @@ def test_post_partition_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7374,7 +7374,7 @@ def test_post_partition_find_as_stream_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7455,7 +7455,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"mapKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"mapKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"mapKey": "anyValue"}, "skip": 0}' + mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add(responses.POST, url, body=mock_response, @@ -7464,7 +7464,7 @@ def test_post_explain_all_params(self): # Set up parameter values db = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7503,7 +7503,7 @@ def test_post_explain_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7532,7 +7532,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"mapKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"mapKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"mapKey": "anyValue"}, "skip": 0}' + mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add(responses.POST, url, body=mock_response, @@ -7541,7 +7541,7 @@ def test_post_explain_value_error(self): # Set up parameter values db = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7594,7 +7594,7 @@ def test_post_find_all_params(self): # Set up parameter values db = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7633,7 +7633,7 @@ def test_post_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7671,7 +7671,7 @@ def test_post_find_value_error(self): # Set up parameter values db = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7724,7 +7724,7 @@ def test_post_find_as_stream_all_params(self): # Set up parameter values db = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7763,7 +7763,7 @@ def test_post_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'key1': 'testString'} + assert req_body['selector'] == {'foo': 'bar'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7807,7 +7807,7 @@ def test_post_find_as_stream_value_error(self): # Set up parameter values db = 'testString' - selector = {'key1': 'testString'} + selector = {'foo': 'bar'} bookmark = 'testString' conflicts = True execution_stats = True @@ -7851,7 +7851,7 @@ def test_get_indexes_information_all_params(self): """ # Set up mock url = preprocess_url('/testString/_index') - mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"mapKey": "anyValue"}}, "name": "name", "type": "json"}]}' + mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}]}' responses.add(responses.GET, url, body=mock_response, @@ -7887,7 +7887,7 @@ def test_get_indexes_information_value_error(self): """ # Set up mock url = preprocess_url('/testString/_index') - mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"mapKey": "anyValue"}}, "name": "name", "type": "json"}]}' + mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}]}' responses.add(responses.GET, url, body=mock_response, @@ -7956,7 +7956,7 @@ def test_post_index_all_params(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'key1': 'testString'} + index_definition_model['partial_filter_selector'] = {'foo': 'bar'} # Set up parameter values db = 'testString' @@ -8039,7 +8039,7 @@ def test_post_index_value_error(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'key1': 'testString'} + index_definition_model['partial_filter_selector'] = {'foo': 'bar'} # Set up parameter values db = 'testString' @@ -8293,7 +8293,7 @@ def test_post_search_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add(responses.POST, url, body=mock_response, @@ -8392,7 +8392,7 @@ def test_post_search_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"mapKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add(responses.POST, url, body=mock_response, @@ -9112,7 +9112,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9183,7 +9183,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9219,7 +9219,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"mapKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9342,7 +9342,7 @@ def test_put_replication_document_all_params(self): replication_document_model['http_connections'] = 1 replication_document_model['query_params'] = {'key1': 'testString'} replication_document_model['retries_per_request'] = 0 - replication_document_model['selector'] = {'key1': 'testString'} + replication_document_model['selector'] = {'foo': 'bar'} replication_document_model['since_seq'] = 'testString' replication_document_model['socket_options'] = 'testString' replication_document_model['source'] = replication_database_model @@ -9490,7 +9490,7 @@ def test_put_replication_document_required_params(self): replication_document_model['http_connections'] = 1 replication_document_model['query_params'] = {'key1': 'testString'} replication_document_model['retries_per_request'] = 0 - replication_document_model['selector'] = {'key1': 'testString'} + replication_document_model['selector'] = {'foo': 'bar'} replication_document_model['since_seq'] = 'testString' replication_document_model['socket_options'] = 'testString' replication_document_model['source'] = replication_database_model @@ -9624,7 +9624,7 @@ def test_put_replication_document_value_error(self): replication_document_model['http_connections'] = 1 replication_document_model['query_params'] = {'key1': 'testString'} replication_document_model['retries_per_request'] = 0 - replication_document_model['selector'] = {'key1': 'testString'} + replication_document_model['selector'] = {'foo': 'bar'} replication_document_model['since_seq'] = 'testString' replication_document_model['socket_options'] = 'testString' replication_document_model['source'] = replication_database_model @@ -14350,7 +14350,7 @@ def test_explain_result_serialization(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'key1': 'testString'} + index_definition_model['partial_filter_selector'] = {'foo': 'bar'} index_information_model = {} # IndexInformation index_information_model['ddoc'] = 'testString' @@ -14368,9 +14368,9 @@ def test_explain_result_serialization(self): explain_result_model_json['fields'] = ['testString'] explain_result_model_json['index'] = index_information_model explain_result_model_json['limit'] = 0 - explain_result_model_json['opts'] = {'key1': 'testString'} + explain_result_model_json['opts'] = {'foo': 'bar'} explain_result_model_json['range'] = explain_result_range_model - explain_result_model_json['selector'] = {'key1': 'testString'} + explain_result_model_json['selector'] = {'foo': 'bar'} explain_result_model_json['skip'] = 0 # Construct a model instance of ExplainResult by calling from_dict on the json representation @@ -14521,7 +14521,7 @@ def test_index_definition_serialization(self): index_definition_model_json['default_field'] = index_text_operator_default_field_model index_definition_model_json['fields'] = [index_field_model] index_definition_model_json['index_array_lengths'] = True - index_definition_model_json['partial_filter_selector'] = {'key1': 'testString'} + index_definition_model_json['partial_filter_selector'] = {'foo': 'bar'} # Construct a model instance of IndexDefinition by calling from_dict on the json representation index_definition_model = IndexDefinition.from_dict(index_definition_model_json) @@ -14609,7 +14609,7 @@ def test_index_information_serialization(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'key1': 'testString'} + index_definition_model['partial_filter_selector'] = {'foo': 'bar'} # Construct a json representation of a IndexInformation model index_information_model_json = {} @@ -14730,7 +14730,7 @@ def test_indexes_information_serialization(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'key1': 'testString'} + index_definition_model['partial_filter_selector'] = {'foo': 'bar'} index_information_model = {} # IndexInformation index_information_model['ddoc'] = 'testString' @@ -15215,7 +15215,7 @@ def test_replication_document_serialization(self): replication_document_model_json['http_connections'] = 1 replication_document_model_json['query_params'] = {'key1': 'testString'} replication_document_model_json['retries_per_request'] = 0 - replication_document_model_json['selector'] = {'key1': 'testString'} + replication_document_model_json['selector'] = {'foo': 'bar'} replication_document_model_json['since_seq'] = 'testString' replication_document_model_json['socket_options'] = 'testString' replication_document_model_json['source'] = replication_database_model @@ -15806,7 +15806,7 @@ def test_search_result_serialization(self): search_result_row_model = {} # SearchResultRow search_result_row_model['doc'] = document_model - search_result_row_model['fields'] = {'key1': 'testString'} + search_result_row_model['fields'] = {'foo': 'bar'} search_result_row_model['highlights'] = {'key1': ['testString']} search_result_row_model['id'] = 'testString' @@ -15888,7 +15888,7 @@ def test_search_result_properties_serialization(self): search_result_row_model = {} # SearchResultRow search_result_row_model['doc'] = document_model - search_result_row_model['fields'] = {'key1': 'testString'} + search_result_row_model['fields'] = {'foo': 'bar'} search_result_row_model['highlights'] = {'key1': ['testString']} search_result_row_model['id'] = 'testString' @@ -15962,7 +15962,7 @@ def test_search_result_row_serialization(self): # Construct a json representation of a SearchResultRow model search_result_row_model_json = {} search_result_row_model_json['doc'] = document_model - search_result_row_model_json['fields'] = {'key1': 'testString'} + search_result_row_model_json['fields'] = {'foo': 'bar'} search_result_row_model_json['highlights'] = {'key1': ['testString']} search_result_row_model_json['id'] = 'testString' From c3f260bf9de95c56934920412e078c7b84e73b68 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 29 Sep 2022 16:05:12 +0100 Subject: [PATCH 020/669] Generated: feat: update API definition to 0.0.47 (#613) (#331) Generated SDK source code using: - Generator version 3.57.0 - Specification version 1.0.0-dev0.0.47 - Automation (cloudant-sdks) version 95d895b Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index d4a2731c..d4b90f53 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -6094,7 +6094,7 @@ def get_scheduler_jobs(self, replication ID, history of recent events, and other information. :param int limit: (optional) Query parameter to specify the number of - returned documents to limit the result to. + returned jobs to limit the result to. :param int skip: (optional) Query parameter to specify the number of records before starting to return the results. :param dict headers: A `dict` containing the request headers From 85b1915874d22f4df5f564df4f0fe650089c2a10 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 30 Sep 2022 08:56:36 +0000 Subject: [PATCH 021/669] Update version 0.2.0 -> 0.2.1 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d1820bcf..727941db 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.0 +current_version = 0.2.1 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index cce423f4..2ce6e03c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.2.0 +# IBM Cloudant Python SDK Version 0.2.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -103,13 +103,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.2.0" +pip install --upgrade "ibmcloudant>=0.2.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.2.0" +easy_install --upgrade "ibmcloudant>=0.2.1" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 99b6de66..f77a6a3f 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.2.0' +__version__ = '0.2.1' diff --git a/setup.py b/setup.py index aff3506a..76c60e84 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.2.0' +__version__ = '0.2.1' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From 3346b31ae22fa9d5d02e076bf4a9088649edc49e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 08:57:42 +0000 Subject: [PATCH 022/669] build(deps-dev): Bump pytest-cov from 3.0.0 to 4.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 3.0.0 to 4.0.0. - [Release notes](https://github.com/pytest-dev/pytest-cov/releases) - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v3.0.0...v4.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5d39284a..fde67301 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ pytest-rerunfailures==10.2 # code coverage coverage==6.4.4 -pytest-cov==3.0.0 +pytest-cov==4.0.0 # documentation recommonmark==0.7.1 From 5dedcf6788433a8c35a461a9a675a04114407e86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:04:46 +0000 Subject: [PATCH 023/669] build(deps-dev): Bump sphinx from 5.2.2 to 5.2.3 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.2.2 to 5.2.3. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/5.x/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.2.2...v5.2.3) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fde67301..537496d2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ pytest-cov==4.0.0 # documentation recommonmark==0.7.1 -Sphinx==5.2.2 +Sphinx==5.2.3 From 5388825094e7bce45a6a40074bcec5cb992ae50d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:32:46 +0000 Subject: [PATCH 024/669] build(deps-dev): Bump coverage from 6.4.4 to 6.5.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4.4 to 6.5.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/6.4.4...6.5.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 537496d2..d96b2951 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==3.26.0 pytest-rerunfailures==10.2 # code coverage -coverage==6.4.4 +coverage==6.5.0 pytest-cov==4.0.0 # documentation From 7cb3ee6e5b3cf44f0ce348fd1a53ac86a3c30875 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 10:04:35 +0100 Subject: [PATCH 025/669] build(deps-dev): Bump pylint from 2.15.3 to 2.15.4 (#336) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.3 to 2.15.4. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.3...v2.15.4) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d96b2951..58039b61 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.1.3 responses==0.21.0 python_dotenv==0.21.0 -pylint==2.15.3 +pylint==2.15.4 tox==3.26.0 pytest-rerunfailures==10.2 From be726c97f391b3b37fd36aa792342bfe3aa98795 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:09:05 +0100 Subject: [PATCH 026/669] build(deps-dev): Bump responses from 0.21.0 to 0.22.0 (#338) Bumps [responses](https://github.com/getsentry/responses) from 0.21.0 to 0.22.0. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.21.0...0.22.0) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 58039b61..2240ba2e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ # test dependencies pytest==7.1.3 -responses==0.21.0 +responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.4 tox==3.26.0 From d31051fd86047a8a4814b04c33b92aebb743b6b7 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Wed, 12 Oct 2022 10:23:59 -0300 Subject: [PATCH 027/669] ci: reduce actions trigger scope for push to main only (#337) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 754502c6..1fa5dfab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: test on: push: - branches-ignore: ['gh-pages'] + branches: ['main'] pull_request: branches-ignore: ['gh-pages'] env: From 2de2c3dafbe25cd46baccf8a3383299166d08afd Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:17:37 +0000 Subject: [PATCH 028/669] docs(generated): remove transaction engine Generated SDK source code using: - Generator version 3.57.0 - Specification version 1.0.0-dev0.0.47 - Automation (cloudant-sdks) version 276717f Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ce6e03c..75e71d58 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,7 @@ project: - Supported by IBM Cloudant. - Server compatibility with: - - IBM Cloudant "Classic". - - [Cloudant "Standard on Transaction Engine"](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te) for APIs compatible with Cloudant "Classic". For more information, see the [Feature Parity](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te#feature-parity-between-ibm-cloudant-on-the-transaction-engine-vs-classic-architecture) page. + - IBM Cloudant. - [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. - Includes all the most popular and latest supported endpoints for applications. From 826c9385f3053e41cf0734f43be7b73ca58f214f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 14:04:34 -0400 Subject: [PATCH 029/669] build(deps-dev): Bump sphinx from 5.2.3 to 5.3.0 (#340) Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.2.3 to 5.3.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v5.2.3...v5.3.0) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2240ba2e..cec4bb5a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,4 +12,4 @@ pytest-cov==4.0.0 # documentation recommonmark==0.7.1 -Sphinx==5.2.3 +Sphinx==5.3.0 From 170f253ff843a3d6c936bc3633fe84510b371eb3 Mon Sep 17 00:00:00 2001 From: Tom Blench Date: Thu, 20 Oct 2022 08:09:55 +0100 Subject: [PATCH 030/669] fix: add missing operation names to path validator (#341) Co-authored-by: Thomas Blench --- ibmcloudant/cloudant_base_service.py | 5 ++++- test/unit/test_cloudant_base_validation.py | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index 4c73073f..591009c3 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2021. +# © Copyright IBM Corporation 2020, 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -43,6 +43,9 @@ def __hash__(self): doc_id_rule = ValidationRule(path_segment_index=1, error_parameter_name='Document ID', operation_ids= [ 'delete_document', 'get_document', + 'get_document_as_mixed', + 'get_document_as_related', + 'get_document_as_stream', 'head_document', 'put_document', 'delete_attachment', diff --git a/test/unit/test_cloudant_base_validation.py b/test/unit/test_cloudant_base_validation.py index 59f95fd5..629bf456 100644 --- a/test/unit/test_cloudant_base_validation.py +++ b/test/unit/test_cloudant_base_validation.py @@ -28,6 +28,14 @@ def test_validates_doc_id(self): with self.assertRaisesRegex(ValueError, '.+_testDocument.+') as cm: service.get_document('testDatabase', '_testDocument') + def test_validates_doc_id_with_as_stream_operation(self): + service = CloudantV1( + authenticator=NoAuthAuthenticator() + ) + service.set_service_url('https://cloudant.example') + with self.assertRaisesRegex(ValueError, '.+_testDocument.+') as cm: + service.get_document_as_stream('testDatabase', '_testDocument') + def test_validates_doc_id_at_long_service_path(self): service = CloudantV1( authenticator=NoAuthAuthenticator() From 9bb045ec2128ad4b30ef616d6cb847749d3f5a7b Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 20 Oct 2022 12:30:23 -0300 Subject: [PATCH 031/669] fix: make couch session authenticator to support `AUTH_DISABLE_SSL` env var (#342) --- ibmcloudant/cloudant_base_service.py | 4 +- ibmcloudant/couchdb_session_authenticator.py | 16 +++- ...couchdb_session_get_authenticator_patch.py | 7 +- ibmcloudant/couchdb_session_token_manager.py | 6 +- test/unit/test_couchdb_session_auth.py | 75 ++++++++++++++++++- 5 files changed, 99 insertions(+), 9 deletions(-) diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index 591009c3..cd39059e 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -116,7 +116,7 @@ def new_set_default_headers(self, headers: Dict[str, str]): old_set_disable_ssl_verification = CloudantV1.set_disable_ssl_verification -def new_set_disable_ssl_verification(self, status: bool = False) -> None: +def new_set_disable_ssl_verification(self, status: bool = False) -> None: old_set_disable_ssl_verification(self, status) if isinstance(self.authenticator, CouchDbSessionAuthenticator): self.authenticator.token_manager.set_disable_ssl_verification(status) @@ -157,6 +157,6 @@ def new_prepare_request(self, if len(request_url_path_segments) > rule.path_segment_index: segment_to_validate = request_url_path_segments[rule.path_segment_index] if segment_to_validate.startswith('_'): - raise ValueError('{0} {1} starts with the invalid _ character.'.format(rule.error_parameter_name, + raise ValueError('{0} {1} starts with the invalid _ character.'.format(rule.error_parameter_name, unquote(segment_to_validate))) return old_prepare_request(self, method, url, *args, headers=headers, params=params, data=data, files=files, **kwargs) diff --git a/ibmcloudant/couchdb_session_authenticator.py b/ibmcloudant/couchdb_session_authenticator.py index 0e7dbede..815a5f8e 100644 --- a/ibmcloudant/couchdb_session_authenticator.py +++ b/ibmcloudant/couchdb_session_authenticator.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020. +# © Copyright IBM Corporation 2020, 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,10 +39,20 @@ class CouchDbSessionAuthenticator(Authenticator): AUTHTYPE_COUCHDB_SESSION = 'COUCHDB_SESSION' - def __init__(self, username: str, password: str): + def __init__(self, + username: str, + password: str, + disable_ssl_verification: bool = False) -> None: + if not isinstance(disable_ssl_verification, bool): + raise TypeError('disable_ssl_verification must be a bool') + self.jar = None - self.token_manager = CouchDbSessionTokenManager(username, password) + self.token_manager = CouchDbSessionTokenManager( + username, + password, + disable_ssl_verification=disable_ssl_verification + ) self.validate() def set_jar(self, jar): diff --git a/ibmcloudant/couchdb_session_get_authenticator_patch.py b/ibmcloudant/couchdb_session_get_authenticator_patch.py index d9038227..f917fe1e 100644 --- a/ibmcloudant/couchdb_session_get_authenticator_patch.py +++ b/ibmcloudant/couchdb_session_get_authenticator_patch.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2021. +# © Copyright IBM Corporation 2020, 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,6 +33,9 @@ def new_construct_authenticator(config): # pylint: disable=missing-docstring if auth_type == 'COUCHDB_SESSION': return CouchDbSessionAuthenticator( username=config.get('USERNAME'), - password=config.get('PASSWORD') + password=config.get('PASSWORD'), + disable_ssl_verification=config.get( + 'AUTH_DISABLE_SSL', + config.get('DISABLE_SSL', 'false')).lower() == 'true' ) return old_construct_authenticator(config) diff --git a/ibmcloudant/couchdb_session_token_manager.py b/ibmcloudant/couchdb_session_token_manager.py index 5badcf00..d39005f7 100644 --- a/ibmcloudant/couchdb_session_token_manager.py +++ b/ibmcloudant/couchdb_session_token_manager.py @@ -41,8 +41,12 @@ class CouchDbSessionTokenManager(TokenManager): def __init__(self, username: str, password: str, url: str = None, + disable_ssl_verification: bool = False, ): - super().__init__(url) + super().__init__( + url, + disable_ssl_verification=disable_ssl_verification, + ) self.username = username self.password = password diff --git a/test/unit/test_couchdb_session_auth.py b/test/unit/test_couchdb_session_auth.py index 1c42842c..6738943b 100644 --- a/test/unit/test_couchdb_session_auth.py +++ b/test/unit/test_couchdb_session_auth.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2021. +# © Copyright IBM Corporation 2020, 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -108,6 +108,32 @@ def test_disable_ssl_verification_off(self): finally: self.client.set_http_client(original_http_client) + def test_valid_disable_ssl_verification_type(self): + authenticator = CouchDbSessionAuthenticator("adm", "pass") + self.assertFalse(authenticator.token_manager.disable_ssl_verification) + authenticator = CouchDbSessionAuthenticator( + "adm", + "pass", + disable_ssl_verification=False + ) + self.assertFalse(authenticator.token_manager.disable_ssl_verification) + authenticator = CouchDbSessionAuthenticator( + "adm", + "pass", + disable_ssl_verification=True + ) + self.assertTrue(authenticator.token_manager.disable_ssl_verification) + + def test_invalid_disable_ssl_verification_type(self): + with self.assertRaisesRegex( + TypeError, 'disable_ssl_verification must be a bool' + ): + CouchDbSessionAuthenticator( + "adm", + "pass", + disable_ssl_verification='True' + ) + @responses.activate def test_cookie_refresh(self): self.client.get_session_information() @@ -168,6 +194,10 @@ def test_set_service_url(self): class TestCouchDbSessionAuthPatch(unittest.TestCase): + def setUp(self) -> None: + for key in os.environ: + del os.environ[key] + def test_new_instance(self): os.environ['TEST_SERVICE_AUTH_TYPE'] = 'couchdb_session' os.environ['TEST_SERVICE_USERNAME'] = 'adm' @@ -176,6 +206,9 @@ def test_new_instance(self): self.assertIsNotNone(service) self.assertIsInstance(service, CloudantV1) self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) + self.assertFalse(service.disable_ssl_verification) + self.assertFalse( + service.authenticator.token_manager.disable_ssl_verification) def test_new_instance_auth_alias(self): os.environ['TEST_SERVICE_AUTHTYPE'] = 'couchdb_session' @@ -185,3 +218,43 @@ def test_new_instance_auth_alias(self): self.assertIsNotNone(service) self.assertIsInstance(service, CloudantV1) self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) + + def test_disable_ssl(self): + os.environ['TEST_SERVICE_AUTHTYPE'] = 'couchdb_session' + os.environ['TEST_SERVICE_USERNAME'] = 'adm' + os.environ['TEST_SERVICE_PASSWORD'] = 'pass' + os.environ['TEST_SERVICE_DISABLE_SSL'] = 'true' + service = CloudantV1.new_instance(service_name='TEST_SERVICE') + self.assertIsNotNone(service) + self.assertIsInstance(service, CloudantV1) + self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) + self.assertTrue(service.disable_ssl_verification) + self.assertTrue( + service.authenticator.token_manager.disable_ssl_verification) + + def test_auth_disable_ssl(self): + os.environ['TEST_SERVICE_AUTHTYPE'] = 'couchdb_session' + os.environ['TEST_SERVICE_USERNAME'] = 'adm' + os.environ['TEST_SERVICE_PASSWORD'] = 'pass' + os.environ['TEST_SERVICE_AUTH_DISABLE_SSL'] = 'true' + service = CloudantV1.new_instance(service_name='TEST_SERVICE') + self.assertIsNotNone(service) + self.assertIsInstance(service, CloudantV1) + self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) + self.assertFalse(service.disable_ssl_verification) + self.assertTrue( + service.authenticator.token_manager.disable_ssl_verification) + + def test_auth_disable_ssl_only(self): + os.environ['TEST_SERVICE_AUTHTYPE'] = 'couchdb_session' + os.environ['TEST_SERVICE_USERNAME'] = 'adm' + os.environ['TEST_SERVICE_PASSWORD'] = 'pass' + os.environ['TEST_SERVICE_DISABLE_SSL'] = 'false' + os.environ['TEST_SERVICE_AUTH_DISABLE_SSL'] = 'true' + service = CloudantV1.new_instance(service_name='TEST_SERVICE') + self.assertIsNotNone(service) + self.assertIsInstance(service, CloudantV1) + self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) + self.assertFalse(service.disable_ssl_verification) + self.assertTrue( + service.authenticator.token_manager.disable_ssl_verification) From db403c0ef6951424e97c008bacfe74c2ca96f89d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:29:17 +0100 Subject: [PATCH 032/669] feat(generated): Consume Cloudant OpenAPI specs 0.0.48 (#345) Generated SDK source code using: - Generator version 3.57.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 2520f1f Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- examples/README.md | 18 --------- examples/getGeo/example_request.py | 15 -------- .../getGeoIndexInformation/example_request.py | 12 ------ examples/postGeoCleanup/example_request.py | 10 ----- ibmcloudant/cloudant_v1.py | 31 +++++++++++++-- test/unit/test_cloudant_v1.py | 38 +++++++++++-------- 6 files changed, 50 insertions(+), 74 deletions(-) delete mode 100644 examples/getGeo/example_request.py delete mode 100644 examples/getGeoIndexInformation/example_request.py delete mode 100644 examples/postGeoCleanup/example_request.py diff --git a/examples/README.md b/examples/README.md index 39e5efe8..44fdb504 100644 --- a/examples/README.md +++ b/examples/README.md @@ -258,18 +258,6 @@ - [Example request](./putDesignDocument/example_request.py) -## getGeo - -### get `/{db}/_design/{ddoc}/_geo/{index}` - -- [Example request](./getGeo/example_request.py) - -## getGeoIndexInformation - -### get `/{db}/_design/{ddoc}/_geo_info/{index}` - -- [Example request](./getGeoIndexInformation/example_request.py) - ## getDesignDocumentInformation ### get `/{db}/_design/{ddoc}/_info` @@ -325,12 +313,6 @@ - [Example request for "json" index type](./postFind/example_request_for_json_index_type.py) - [Example request for "text" index type](./postFind/example_request_for_text_index_type.py) -## postGeoCleanup - -### post `/{db}/_geo_cleanup` - -- [Example request](./postGeoCleanup/example_request.py) - ## getIndexesInformation ### get `/{db}/_index` diff --git a/examples/getGeo/example_request.py b/examples/getGeo/example_request.py deleted file mode 100644 index 0e59fc60..00000000 --- a/examples/getGeo/example_request.py +++ /dev/null @@ -1,15 +0,0 @@ -# section: code -from ibmcloudant.cloudant_v1 import CloudantV1 - -service = CloudantV1.new_instance() - -response = service.get_geo( - db='stores', - ddoc='places', - index='pointsInEngland', - bbox='-50.52,-4.46,54.59,1.45', - include_docs=True, - nearest=True -).get_result() - -print(response) diff --git a/examples/getGeoIndexInformation/example_request.py b/examples/getGeoIndexInformation/example_request.py deleted file mode 100644 index 45436c6c..00000000 --- a/examples/getGeoIndexInformation/example_request.py +++ /dev/null @@ -1,12 +0,0 @@ -# section: code -from ibmcloudant.cloudant_v1 import CloudantV1 - -service = CloudantV1.new_instance() - -response = service.get_geo_index_information( - db='stores', - ddoc='places', - index='pointsInEngland' -).get_result() - -print(response) diff --git a/examples/postGeoCleanup/example_request.py b/examples/postGeoCleanup/example_request.py deleted file mode 100644 index 6f067877..00000000 --- a/examples/postGeoCleanup/example_request.py +++ /dev/null @@ -1,10 +0,0 @@ -# section: code -from ibmcloudant.cloudant_v1 import CloudantV1 - -service = CloudantV1.new_instance() - -response = service.post_geo_cleanup( - db='stores' -).get_result() - -print(response) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index d4b90f53..c48848f5 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -381,7 +381,7 @@ def post_changes(self, ### Note Before using the changes feed we recommend reading the [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) - to understand the limitations and appropriate use cases.". + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param List[str] doc_ids: (optional) Schema for a list of document IDs. @@ -571,7 +571,7 @@ def post_changes_as_stream(self, ### Note Before using the changes feed we recommend reading the [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) - to understand the limitations and appropriate use cases.". + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param List[str] doc_ids: (optional) Schema for a list of document IDs. @@ -11124,22 +11124,31 @@ class DocsResultRowValue(): """ Value of built-in `/_all_docs` style view. + :attr bool deleted: (optional) If `true` then the document is deleted. Not + present for undeleted documents. :attr str rev: Schema for a document revision identifier. """ def __init__(self, - rev: str) -> None: + rev: str, + *, + deleted: bool = None) -> None: """ Initialize a DocsResultRowValue object. :param str rev: Schema for a document revision identifier. + :param bool deleted: (optional) If `true` then the document is deleted. Not + present for undeleted documents. """ + self.deleted = deleted self.rev = rev @classmethod def from_dict(cls, _dict: Dict) -> 'DocsResultRowValue': """Initialize a DocsResultRowValue object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = _dict.get('deleted') if 'rev' in _dict: args['rev'] = _dict.get('rev') else: @@ -11154,6 +11163,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + _dict['deleted'] = self.deleted if hasattr(self, 'rev') and self.rev is not None: _dict['rev'] = self.rev return _dict @@ -13470,6 +13481,9 @@ class ReplicationDocument(): database. :attr str target_proxy: (optional) Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur. + :attr bool use_bulk_get: (optional) Specify whether to use _bulk_get for + fetching documents from the source. If unset, the server configured default will + be used. :attr bool use_checkpoints: (optional) Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed. @@ -13488,7 +13502,7 @@ class ReplicationDocument(): """ # The set of defined properties for the class - _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) + _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_bulk_get', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) def __init__(self, source: 'ReplicationDatabase', @@ -13519,6 +13533,7 @@ def __init__(self, socket_options: str = None, source_proxy: str = None, target_proxy: str = None, + use_bulk_get: bool = None, use_checkpoints: bool = None, user_ctx: 'UserContext' = None, winning_revs_only: bool = None, @@ -13613,6 +13628,9 @@ def __init__(self, :param str target_proxy: (optional) Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur. + :param bool use_bulk_get: (optional) Specify whether to use _bulk_get for + fetching documents from the source. If unset, the server configured default + will be used. :param bool use_checkpoints: (optional) Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed. @@ -13659,6 +13677,7 @@ def __init__(self, self.source_proxy = source_proxy self.target = target self.target_proxy = target_proxy + self.use_bulk_get = use_bulk_get self.use_checkpoints = use_checkpoints self.user_ctx = user_ctx self.winning_revs_only = winning_revs_only @@ -13729,6 +13748,8 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': raise ValueError('Required property \'target\' not present in ReplicationDocument JSON') if 'target_proxy' in _dict: args['target_proxy'] = _dict.get('target_proxy') + if 'use_bulk_get' in _dict: + args['use_bulk_get'] = _dict.get('use_bulk_get') if 'use_checkpoints' in _dict: args['use_checkpoints'] = _dict.get('use_checkpoints') if 'user_ctx' in _dict: @@ -13804,6 +13825,8 @@ def to_dict(self) -> Dict: _dict['target'] = self.target.to_dict() if hasattr(self, 'target_proxy') and self.target_proxy is not None: _dict['target_proxy'] = self.target_proxy + if hasattr(self, 'use_bulk_get') and self.use_bulk_get is not None: + _dict['use_bulk_get'] = self.use_bulk_get if hasattr(self, 'use_checkpoints') and self.use_checkpoints is not None: _dict['use_checkpoints'] = self.use_checkpoints if hasattr(self, 'user_ctx') and self.user_ctx is not None: diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index b5677db7..deafae1f 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1840,7 +1840,7 @@ def test_post_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -1920,7 +1920,7 @@ def test_post_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -2112,7 +2112,7 @@ def test_post_all_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add(responses.POST, url, body=mock_response, @@ -2172,7 +2172,7 @@ def test_post_all_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add(responses.POST, url, body=mock_response, @@ -5051,7 +5051,7 @@ def test_post_design_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -5133,7 +5133,7 @@ def test_post_design_docs_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -5213,7 +5213,7 @@ def test_post_design_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -5266,7 +5266,7 @@ def test_post_design_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add(responses.POST, url, body=mock_response, @@ -5328,7 +5328,7 @@ def test_post_design_docs_queries_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add(responses.POST, url, body=mock_response, @@ -5388,7 +5388,7 @@ def test_post_design_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add(responses.POST, url, body=mock_response, @@ -6230,7 +6230,7 @@ def test_post_partition_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -6312,7 +6312,7 @@ def test_post_partition_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add(responses.POST, url, body=mock_response, @@ -9112,7 +9112,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9183,7 +9183,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9219,7 +9219,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' responses.add(responses.GET, url, body=mock_response, @@ -9349,6 +9349,7 @@ def test_put_replication_document_all_params(self): replication_document_model['source_proxy'] = 'testString' replication_document_model['target'] = replication_database_model replication_document_model['target_proxy'] = 'testString' + replication_document_model['use_bulk_get'] = True replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False @@ -9497,6 +9498,7 @@ def test_put_replication_document_required_params(self): replication_document_model['source_proxy'] = 'testString' replication_document_model['target'] = replication_database_model replication_document_model['target_proxy'] = 'testString' + replication_document_model['use_bulk_get'] = True replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False @@ -9631,6 +9633,7 @@ def test_put_replication_document_value_error(self): replication_document_model['source_proxy'] = 'testString' replication_document_model['target'] = replication_database_model replication_document_model['target_proxy'] = 'testString' + replication_document_model['use_bulk_get'] = True replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False @@ -12507,6 +12510,7 @@ def test_all_docs_queries_result_serialization(self): document_model['foo'] = 'testString' docs_result_row_value_model = {} # DocsResultRowValue + docs_result_row_value_model['deleted'] = True docs_result_row_value_model['rev'] = 'testString' docs_result_row_model = {} # DocsResultRow @@ -12627,6 +12631,7 @@ def test_all_docs_result_serialization(self): document_model['foo'] = 'testString' docs_result_row_value_model = {} # DocsResultRowValue + docs_result_row_value_model['deleted'] = True docs_result_row_value_model['rev'] = 'testString' docs_result_row_model = {} # DocsResultRow @@ -14068,6 +14073,7 @@ def test_docs_result_row_serialization(self): document_model['foo'] = 'testString' docs_result_row_value_model = {} # DocsResultRowValue + docs_result_row_value_model['deleted'] = True docs_result_row_value_model['rev'] = 'testString' # Construct a json representation of a DocsResultRow model @@ -14107,6 +14113,7 @@ def test_docs_result_row_value_serialization(self): # Construct a json representation of a DocsResultRowValue model docs_result_row_value_model_json = {} + docs_result_row_value_model_json['deleted'] = True docs_result_row_value_model_json['rev'] = 'testString' # Construct a model instance of DocsResultRowValue by calling from_dict on the json representation @@ -15222,6 +15229,7 @@ def test_replication_document_serialization(self): replication_document_model_json['source_proxy'] = 'testString' replication_document_model_json['target'] = replication_database_model replication_document_model_json['target_proxy'] = 'testString' + replication_document_model_json['use_bulk_get'] = True replication_document_model_json['use_checkpoints'] = True replication_document_model_json['user_ctx'] = user_context_model replication_document_model_json['winning_revs_only'] = False From bbf4f1b0207f66a719230ad76d79316ec832fa0e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 24 Oct 2022 18:23:00 +0100 Subject: [PATCH 033/669] chore(generated): update exemplum to 0.6.0 (#346) Generated SDK source code using: - Generator version 3.60.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version b6ce4a3 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- examples/README.md | 1667 +++++++++++++++-- .../deleteAttachment/example_request.py | 0 .../deleteDatabase/example_request.py | 0 .../deleteDesignDocument/example_request.py | 0 .../deleteDocument/example_request.py | 0 .../deleteIndex/example_request.py | 0 .../deleteLocalDocument/example_request.py | 0 .../example_request.py | 0 .../getActiveTasks/example_request.py | 0 .../example_request.py | 0 .../getAllDbs/example_request.py | 0 .../getAttachment/example_request.py | 0 .../example_request.py | 0 .../getCorsInformation/example_request.py | 0 .../example_request.py | 0 .../getDatabaseInformation/example_request.py | 0 .../getDbUpdates/example_request.py | 0 .../getDesignDocument/example_request.py | 0 .../example_request.py | 0 .../getDocument/example_request.py | 0 .../getDocumentShardsInfo/example_request.py | 0 .../getIndexesInformation/example_request.py | 0 .../getLocalDocument/example_request.py | 0 .../example_request.py | 0 .../example_request.py | 0 .../getReplicationDocument/example_request.py | 0 .../getSchedulerDocs/example_request.py | 0 .../getSchedulerDocument/example_request.py | 0 .../getSchedulerJob/example_request.py | 0 .../getSchedulerJobs/example_request.py | 0 .../getSearchInfo/example_request.py | 0 .../getSecurity/example_request.py | 0 .../getServerInformation/example_request.py | 0 .../getSessionInformation/example_request.py | 0 .../getShardsInformation/example_request.py | 0 .../getUpInformation/example_request.py | 0 .../getUuids/example_request.py | 0 .../headAttachment/example_request.py | 0 .../headDatabase/example_request.py | 0 .../headDesignDocument/example_request.py | 0 .../headDocument/example_request.py | 0 .../example_request.py | 0 .../headSchedulerJob/example_request.py | 0 .../example_request.py | 0 .../postAllDocs/example_request.py | 0 .../example_request_as_a_stream.py | 0 .../postAllDocsQueries/example_request.py | 0 .../postApiKeys/example_request.py | 0 .../example_request_as_a_stream.py | 0 .../example_request_create_documents.py | 0 .../example_request_delete_documents.py | 0 ...ernative_example_request_for_atts_since.py | 0 ...ative_example_request_for_open_revs_all.py | 0 .../postBulkGet/example_request.py | 0 .../postChanges/example_request.py | 0 .../example_request_as_a_stream.py | 0 .../postDbsInfo/example_request.py | 0 .../postDesignDocs/example_request.py | 0 .../postDesignDocsQueries/example_request.py | 0 .../postDocument/example_request.py | 0 .../postExplain/example_request.py | 0 .../example_request_for_json_index_type.py | 0 .../example_request_for_text_index_type.py | 0 .../example_request_using_json_type_index.py | 0 .../example_request_using_text_type_index.py | 0 .../postMissingRevs/example_request.py | 0 .../postPartitionAllDocs/example_request.py | 0 .../postPartitionFind/example_request.py | 0 .../postPartitionSearch/example_request.py | 0 .../postPartitionView/example_request.py | 0 .../postRevsDiff/example_request.py | 0 .../postSearch/example_request.py | 0 .../postSearchAnalyze/example_request.py | 0 .../postView/example_request.py | 0 .../postViewQueries/example_request.py | 0 .../putAttachment/example_request.py | 0 .../example_request.py | 0 .../putCloudantSecurity/example_request.py | 0 .../putCorsConfiguration/example_request.py | 0 .../putDatabase/example_request.py | 0 .../putDesignDocument/example_request.py | 0 .../putDocument/example_request.py | 0 .../putLocalDocument/example_request.py | 0 .../putReplicationDocument/example_request.py | 0 .../putSecurity/example_request.py | 0 85 files changed, 1506 insertions(+), 161 deletions(-) rename examples/{ => snippets}/deleteAttachment/example_request.py (100%) rename examples/{ => snippets}/deleteDatabase/example_request.py (100%) rename examples/{ => snippets}/deleteDesignDocument/example_request.py (100%) rename examples/{ => snippets}/deleteDocument/example_request.py (100%) rename examples/{ => snippets}/deleteIndex/example_request.py (100%) rename examples/{ => snippets}/deleteLocalDocument/example_request.py (100%) rename examples/{ => snippets}/deleteReplicationDocument/example_request.py (100%) rename examples/{ => snippets}/getActiveTasks/example_request.py (100%) rename examples/{ => snippets}/getActivityTrackerEvents/example_request.py (100%) rename examples/{ => snippets}/getAllDbs/example_request.py (100%) rename examples/{ => snippets}/getAttachment/example_request.py (100%) rename examples/{ => snippets}/getCapacityThroughputInformation/example_request.py (100%) rename examples/{ => snippets}/getCorsInformation/example_request.py (100%) rename examples/{ => snippets}/getCurrentThroughputInformation/example_request.py (100%) rename examples/{ => snippets}/getDatabaseInformation/example_request.py (100%) rename examples/{ => snippets}/getDbUpdates/example_request.py (100%) rename examples/{ => snippets}/getDesignDocument/example_request.py (100%) rename examples/{ => snippets}/getDesignDocumentInformation/example_request.py (100%) rename examples/{ => snippets}/getDocument/example_request.py (100%) rename examples/{ => snippets}/getDocumentShardsInfo/example_request.py (100%) rename examples/{ => snippets}/getIndexesInformation/example_request.py (100%) rename examples/{ => snippets}/getLocalDocument/example_request.py (100%) rename examples/{ => snippets}/getMembershipInformation/example_request.py (100%) rename examples/{ => snippets}/getPartitionInformation/example_request.py (100%) rename examples/{ => snippets}/getReplicationDocument/example_request.py (100%) rename examples/{ => snippets}/getSchedulerDocs/example_request.py (100%) rename examples/{ => snippets}/getSchedulerDocument/example_request.py (100%) rename examples/{ => snippets}/getSchedulerJob/example_request.py (100%) rename examples/{ => snippets}/getSchedulerJobs/example_request.py (100%) rename examples/{ => snippets}/getSearchInfo/example_request.py (100%) rename examples/{ => snippets}/getSecurity/example_request.py (100%) rename examples/{ => snippets}/getServerInformation/example_request.py (100%) rename examples/{ => snippets}/getSessionInformation/example_request.py (100%) rename examples/{ => snippets}/getShardsInformation/example_request.py (100%) rename examples/{ => snippets}/getUpInformation/example_request.py (100%) rename examples/{ => snippets}/getUuids/example_request.py (100%) rename examples/{ => snippets}/headAttachment/example_request.py (100%) rename examples/{ => snippets}/headDatabase/example_request.py (100%) rename examples/{ => snippets}/headDesignDocument/example_request.py (100%) rename examples/{ => snippets}/headDocument/example_request.py (100%) rename examples/{ => snippets}/headReplicationDocument/example_request.py (100%) rename examples/{ => snippets}/headSchedulerJob/example_request.py (100%) rename examples/{ => snippets}/postActivityTrackerEvents/example_request.py (100%) rename examples/{ => snippets}/postAllDocs/example_request.py (100%) rename examples/{ => snippets}/postAllDocs/example_request_as_a_stream.py (100%) rename examples/{ => snippets}/postAllDocsQueries/example_request.py (100%) rename examples/{ => snippets}/postApiKeys/example_request.py (100%) rename examples/{ => snippets}/postBulkDocs/example_request_as_a_stream.py (100%) rename examples/{ => snippets}/postBulkDocs/example_request_create_documents.py (100%) rename examples/{ => snippets}/postBulkDocs/example_request_delete_documents.py (100%) rename examples/{ => snippets}/postBulkGet/alternative_example_request_for_atts_since.py (100%) rename examples/{ => snippets}/postBulkGet/alternative_example_request_for_open_revs_all.py (100%) rename examples/{ => snippets}/postBulkGet/example_request.py (100%) rename examples/{ => snippets}/postChanges/example_request.py (100%) rename examples/{ => snippets}/postChanges/example_request_as_a_stream.py (100%) rename examples/{ => snippets}/postDbsInfo/example_request.py (100%) rename examples/{ => snippets}/postDesignDocs/example_request.py (100%) rename examples/{ => snippets}/postDesignDocsQueries/example_request.py (100%) rename examples/{ => snippets}/postDocument/example_request.py (100%) rename examples/{ => snippets}/postExplain/example_request.py (100%) rename examples/{ => snippets}/postFind/example_request_for_json_index_type.py (100%) rename examples/{ => snippets}/postFind/example_request_for_text_index_type.py (100%) rename examples/{ => snippets}/postIndex/example_request_using_json_type_index.py (100%) rename examples/{ => snippets}/postIndex/example_request_using_text_type_index.py (100%) rename examples/{ => snippets}/postMissingRevs/example_request.py (100%) rename examples/{ => snippets}/postPartitionAllDocs/example_request.py (100%) rename examples/{ => snippets}/postPartitionFind/example_request.py (100%) rename examples/{ => snippets}/postPartitionSearch/example_request.py (100%) rename examples/{ => snippets}/postPartitionView/example_request.py (100%) rename examples/{ => snippets}/postRevsDiff/example_request.py (100%) rename examples/{ => snippets}/postSearch/example_request.py (100%) rename examples/{ => snippets}/postSearchAnalyze/example_request.py (100%) rename examples/{ => snippets}/postView/example_request.py (100%) rename examples/{ => snippets}/postViewQueries/example_request.py (100%) rename examples/{ => snippets}/putAttachment/example_request.py (100%) rename examples/{ => snippets}/putCapacityThroughputConfiguration/example_request.py (100%) rename examples/{ => snippets}/putCloudantSecurity/example_request.py (100%) rename examples/{ => snippets}/putCorsConfiguration/example_request.py (100%) rename examples/{ => snippets}/putDatabase/example_request.py (100%) rename examples/{ => snippets}/putDesignDocument/example_request.py (100%) rename examples/{ => snippets}/putDocument/example_request.py (100%) rename examples/{ => snippets}/putLocalDocument/example_request.py (100%) rename examples/{ => snippets}/putReplicationDocument/example_request.py (100%) rename examples/{ => snippets}/putSecurity/example_request.py (100%) diff --git a/examples/README.md b/examples/README.md index 44fdb504..148c492f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,464 +2,1809 @@ ## getServerInformation -### get `/` +_GET `/`_ -- [Example request](./getServerInformation/example_request.py) +### [Example request](./snippets/getServerInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_server_information().get_result() + +print(response) +``` ## getActiveTasks -### get `/_active_tasks` +_GET `/_active_tasks`_ + +### [Example request](./snippets/getActiveTasks/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getActiveTasks/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_active_tasks().get_result() + +print(response) +``` ## getAllDbs -### get `/_all_dbs` +_GET `/_all_dbs`_ + +### [Example request](./snippets/getAllDbs/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_all_dbs().get_result() -- [Example request](./getAllDbs/example_request.py) +print(response) +``` ## postApiKeys -### post `/_api/v2/api_keys` +_POST `/_api/v2/api_keys`_ -- [Example request](./postApiKeys/example_request.py) +### [Example request](./snippets/postApiKeys/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_api_keys().get_result() + +print(response) +``` ## putCloudantSecurity -### put `/_api/v2/db/{db}/_security` +_PUT `/_api/v2/db/{db}/_security`_ + +### [Example request](./snippets/putCloudantSecurity/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./putCloudantSecurity/example_request.py) +service = CloudantV1.new_instance() + +security_object = {'nobody':['_reader']} +response = service.put_cloudant_security_configuration( + db='products', + cloudant=security_object +).get_result() + +print(response) +``` + +The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if the `nobody` user has the role `_reader`. + +If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB `_users` database (that is using legacy credentials _and_ the `couchdb_auth_only:true` option) then be aware that the user must already exist in `_users` database before adding permissions. For information on the `_users` database, see Using the `_users` database with Cloudant. ## getActivityTrackerEvents -### get `/_api/v2/user/activity_tracker/events` +_GET `/_api/v2/user/activity_tracker/events`_ + +### [Example request](./snippets/getActivityTrackerEvents/example_request.py) -- [Example request](./getActivityTrackerEvents/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_activity_tracker_events().get_result() + +print(response) +``` ## postActivityTrackerEvents -### post `/_api/v2/user/activity_tracker/events` +_POST `/_api/v2/user/activity_tracker/events`_ + +### [Example request](./snippets/postActivityTrackerEvents/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./postActivityTrackerEvents/example_request.py) +response = service.post_activity_tracker_events( + types=['management'] +).get_result() + +print(response) +``` ## getCapacityThroughputInformation -### get `/_api/v2/user/capacity/throughput` +_GET `/_api/v2/user/capacity/throughput`_ + +### [Example request](./snippets/getCapacityThroughputInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getCapacityThroughputInformation/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_capacity_throughput_information().get_result() + +print(response) +``` ## putCapacityThroughputConfiguration -### put `/_api/v2/user/capacity/throughput` +_PUT `/_api/v2/user/capacity/throughput`_ + +### [Example request](./snippets/putCapacityThroughputConfiguration/example_request.py) -- [Example request](./putCapacityThroughputConfiguration/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.put_capacity_throughput_configuration( + blocks=1 +).get_result() + +print(response) +``` ## getCorsInformation -### get `/_api/v2/user/config/cors` +_GET `/_api/v2/user/config/cors`_ + +### [Example request](./snippets/getCorsInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./getCorsInformation/example_request.py) +response = service.get_cors_information().get_result() + +print(response) +``` ## putCorsConfiguration -### put `/_api/v2/user/config/cors` +_PUT `/_api/v2/user/config/cors`_ + +### [Example request](./snippets/putCorsConfiguration/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.put_cors_configuration( + enable_cors=True, + origins=['https://example.com'] +).get_result() -- [Example request](./putCorsConfiguration/example_request.py) +print(response) +``` ## getCurrentThroughputInformation -### get `/_api/v2/user/current/throughput` +_GET `/_api/v2/user/current/throughput`_ -- [Example request](./getCurrentThroughputInformation/example_request.py) +### [Example request](./snippets/getCurrentThroughputInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_current_throughput_information().get_result() + +print(response) +``` ## getDbUpdates -### get `/_db_updates` +_GET `/_db_updates`_ + +### [Example request](./snippets/getDbUpdates/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getDbUpdates/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_db_updates( + feed='normal', + heartbeat=10000, + since='now' +).get_result() + +print(response) +``` + +This request requires `server_admin` access. ## postDbsInfo -### post `/_dbs_info` +_POST `/_dbs_info`_ + +### [Example request](./snippets/postDbsInfo/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./postDbsInfo/example_request.py) +response = service.post_dbs_info( + keys=['products', 'users', 'orders'] +).get_result() + +print(response) +``` ## getMembershipInformation -### get `/_membership` +_GET `/_membership`_ + +### [Example request](./snippets/getMembershipInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getMembershipInformation/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_membership_information().get_result() + +print(response) +``` ## deleteReplicationDocument -### delete `/_replicator/{doc_id}` +_DELETE `/_replicator/{doc_id}`_ + +### [Example request](./snippets/deleteReplicationDocument/example_request.py) -- [Example request](./deleteReplicationDocument/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.delete_replication_document( +doc_id='repldoc-example', +rev='3-a0ccbdc6fe95b4184f9031d086034d85' +).get_result() + +print(response) +``` ## getReplicationDocument -### get `/_replicator/{doc_id}` +_GET `/_replicator/{doc_id}`_ + +### [Example request](./snippets/getReplicationDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getReplicationDocument/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_replication_document( + doc_id='repldoc-example' +).get_result() + +print(response) +``` ## headReplicationDocument -### head `/_replicator/{doc_id}` +_HEAD `/_replicator/{doc_id}`_ + +### [Example request](./snippets/headReplicationDocument/example_request.py) -- [Example request](./headReplicationDocument/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.head_replication_document( + doc_id='repldoc-example' +) +print(response.get_status_code()) +print(response.get_headers()['ETag']) +``` ## putReplicationDocument -### put `/_replicator/{doc_id}` +_PUT `/_replicator/{doc_id}`_ + +### [Example request](./snippets/putReplicationDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1, ReplicationDocument, ReplicationDatabase, ReplicationDatabaseAuthIam, ReplicationDatabaseAuth + +service = CloudantV1.new_instance() + +source_db = ReplicationDatabase( + url='/animaldb' +) + +target_auth_iam = ReplicationDatabaseAuthIam( + api_key='' +) +target_auth = ReplicationDatabaseAuth( + iam=target_auth_iam +) +target_db = ReplicationDatabase( + auth=target_auth, + url='/animaldb-target' +) + +replication_document = ReplicationDocument( + id='repldoc-example', + create_target=True, + source=source_db, + target=target_db +) + +response = service.put_replication_document( + doc_id='repldoc-example', + replication_document=replication_document +).get_result() -- [Example request](./putReplicationDocument/example_request.py) +print(response) +``` ## getSchedulerDocs -### get `/_scheduler/docs` +_GET `/_scheduler/docs`_ -- [Example request](./getSchedulerDocs/example_request.py) +### [Example request](./snippets/getSchedulerDocs/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_scheduler_docs( + limit=100, + states=['completed'] +).get_result() + +print(response) +``` ## getSchedulerDocument -### get `/_scheduler/docs/_replicator/{doc_id}` +_GET `/_scheduler/docs/_replicator/{doc_id}`_ + +### [Example request](./snippets/getSchedulerDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getSchedulerDocument/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_scheduler_document(doc_id='repldoc-example').get_result() + +print(response) +``` ## getSchedulerJobs -### get `/_scheduler/jobs` +_GET `/_scheduler/jobs`_ + +### [Example request](./snippets/getSchedulerJobs/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./getSchedulerJobs/example_request.py) +response = service.get_scheduler_jobs( + limit=100 +).get_result() + +print(response) +``` ## getSchedulerJob -### get `/_scheduler/jobs/{job_id}` +_GET `/_scheduler/jobs/{job_id}`_ + +### [Example request](./snippets/getSchedulerJob/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getSchedulerJob/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_scheduler_job( + job_id='7b94915cd8c4a0173c77c55cd0443939+continuous' +).get_result() + +print(response) +``` ## headSchedulerJob -### head `/_scheduler/jobs/{job_id}` +_HEAD `/_scheduler/jobs/{job_id}`_ + +### [Example request](./snippets/headSchedulerJob/example_request.py) -- [Example request](./headSchedulerJob/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.head_scheduler_job( + job_id='7b94915cd8c4a0173c77c55cd0443939+continuous' +).get_result() + +print(response.get_status_code()) +``` ## postSearchAnalyze -### post `/_search_analyze` +_POST `/_search_analyze`_ + +### [Example request](./snippets/postSearchAnalyze/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./postSearchAnalyze/example_request.py) +response = service.post_search_analyze( + analyzer='english', + text='running is fun' +).get_result() + +print(response) +``` ## getSessionInformation -### get `/_session` +_GET `/_session`_ + +### [Example request](./snippets/getSessionInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_session_information().get_result() + +print(response) +``` -- [Example request](./getSessionInformation/example_request.py) +For more details on Session Authentication, see [Authentication.](#authentication) ## getUpInformation -### get `/_up` +_GET `/_up`_ -- [Example request](./getUpInformation/example_request.py) +### [Example request](./snippets/getUpInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_up_information().get_result() + +print(response) +``` ## getUuids -### get `/_uuids` +_GET `/_uuids`_ + +### [Example request](./snippets/getUuids/example_request.py) -- [Example request](./getUuids/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_uuids(count=10).get_result() + +print(response) +``` ## deleteDatabase -### delete `/{db}` +_DELETE `/{db}`_ + +### [Example request](./snippets/deleteDatabase/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./deleteDatabase/example_request.py) +response = service.delete_database(db='').get_result() + +print(response) +``` ## getDatabaseInformation -### get `/{db}` +_GET `/{db}`_ + +### [Example request](./snippets/getDatabaseInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getDatabaseInformation/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_database_information(db='products').get_result() + +print(response) +``` ## headDatabase -### head `/{db}` +_HEAD `/{db}`_ + +### [Example request](./snippets/headDatabase/example_request.py) -- [Example request](./headDatabase/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.head_database(db='products') +print(response.get_status_code()) +``` ## postDocument -### post `/{db}` +_POST `/{db}`_ + +### [Example request](./snippets/postDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +products_doc = Document( + id="small-appliances:1000042", + type="product", + productid="1000042", + brand="Salter", + name="Digital Kitchen Scales", + description="Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green", + price=14.99, + image="assets/img/0gmsnghhew.jpg") -- [Example request](./postDocument/example_request.py) +response = service.post_document(db='products', document=products_doc).get_result() + +print(response) +``` ## putDatabase -### put `/{db}` +_PUT `/{db}`_ + +### [Example request](./snippets/putDatabase/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.put_database(db='products', partitioned=True).get_result() -- [Example request](./putDatabase/example_request.py) +print(response) +``` ## postAllDocs -### post `/{db}/_all_docs` +_POST `/{db}/_all_docs`_ -- [Example request](./postAllDocs/example_request.py) -- [Example request as a stream](./postAllDocs/example_request_as_a_stream.py) +### [Example request](./snippets/postAllDocs/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_all_docs( + db='orders', + include_docs=True, + start_key='abc', + limit=10 +).get_result() + +print(response) +``` + +### [Example request as a stream](./snippets/postAllDocs/example_request_as_a_stream.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +result = service.post_all_docs_as_stream( + db='orders', + include_docs=True, + start_key='abc', + limit=10 +).get_result() + +with open('result.json', 'wb') as f: + for chunk in result.iter_content(): + f.write(chunk) +``` ## postAllDocsQueries -### post `/{db}/_all_docs/queries` +_POST `/{db}/_all_docs/queries`_ -- [Example request](./postAllDocsQueries/example_request.py) +### [Example request](./snippets/postAllDocsQueries/example_request.py) -## postBulkDocs +```python +from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 + +service = CloudantV1.new_instance() + +all_docs_query1 = AllDocsQuery( + keys=['small-appliances:1000042', 'small-appliances:1000043'] +) -### post `/{db}/_bulk_docs` +all_docs_query2 = AllDocsQuery( + limit=3, + skip=2 +) -- [Example request: create documents](./postBulkDocs/example_request_create_documents.py) -- [Example request: delete documents](./postBulkDocs/example_request_delete_documents.py) -- [Example request as a stream](./postBulkDocs/example_request_as_a_stream.py) +response = service.post_all_docs_queries( + db='products', + queries=[all_docs_query1, all_docs_query2] +).get_result() + +print(response) +``` + +## postBulkDocs + +_POST `/{db}/_bulk_docs`_ + +### [Example request: create documents](./snippets/postBulkDocs/example_request_create_documents.py) + +```python +from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs + +service = CloudantV1.new_instance() + +event_doc_1 = Document( + id="0007241142412418284", + type="event", + userid="abc123", + eventType="addedToBasket", + productId="1000042", + date="2019-01-28T10:44:22.000Z" +) +event_doc_2 = Document( + id="0007241142412418285", + type="event", + userid="abc234", + eventType="addedToBasket", + productId="1000050", + date="2019-01-25T20:00:00.000Z" +) + +bulk_docs = BulkDocs(docs=[event_doc_1, event_doc_2]) + +response = service.post_bulk_docs( + db='events', + bulk_docs=bulk_docs +).get_result() + +print(response) +``` + +### [Example request: delete documents](./snippets/postBulkDocs/example_request_delete_documents.py) + +```python +from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs + +service = CloudantV1.new_instance() + +event_doc_1 = Document( + id="0007241142412418284", + rev="1-5005d65514fe9e90f8eccf174af5dd64", + deleted=True, +) +event_doc_2 = Document( + id="0007241142412418285", + rev="1-2d7810b054babeda4812b3924428d6d6", + deleted=True, +) + +bulk_docs = BulkDocs(docs=[event_doc_1, event_doc_2]) + +response = service.post_bulk_docs( + db='events', + bulk_docs=bulk_docs +).get_result() + +print(response) +``` + +### [Example request as a stream](./snippets/postBulkDocs/example_request_as_a_stream.py) + +```python +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +with open('upload.json', 'rb') as f: + response = service.post_bulk_docs( + db='events', + bulk_docs=f + ).get_result() + +print(response) +``` + +Content of upload.json +```python +{ + "docs": [ + { + "_id": "0007241142412418284", + "type": "event", + "userid": "abc123", + "eventType": "addedToBasket", + "productId": "1000042", + "date": "2019-01-28T10:44:22.000Z" + }, + { + "_id": "0007241142412418285", + "type": "event", + "userid": "abc123", + "eventType": "addedToBasket", + "productId": "1000050", + "date": "2019-01-25T20:00:00.000Z" + } + ] +} +``` ## postBulkGet -### post `/{db}/_bulk_get` +_POST `/{db}/_bulk_get`_ + +### [Example request](./snippets/postBulkGet/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 + +service = CloudantV1.new_instance() + +doc_id = 'order00067' +bulk_get_doc_1 = BulkGetQueryDocument( + id=doc_id, + rev='3-917fa2381192822767f010b95b45325b') +bulk_get_doc_2 = BulkGetQueryDocument( + id=doc_id, + rev='4-a5be949eeb7296747cc271766e9a498b') + +response = service.post_bulk_get( + db='orders', + docs=[bulk_get_doc_1, bulk_get_doc_2], +).get_result() + +print(response) +``` + +### [Alternative example request for `open_revs=all`](./snippets/postBulkGet/alternative_example_request_for_open_revs_all.py) -- [Example request](./postBulkGet/example_request.py) -- [Alternative example request for `open_revs=all`](./postBulkGet/alternative_example_request_for_open_revs_all.py) -- [Alternative example request for `atts_since`](./postBulkGet/alternative_example_request_for_atts_since.py) +```python +from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 + +service = CloudantV1.new_instance() + +bulk_get_doc = BulkGetQueryDocument(id='order00067') +response = service.post_bulk_get( + db='orders', + docs=[bulk_get_doc], +).get_result() + +print(response) +``` + +### [Alternative example request for `atts_since`](./snippets/postBulkGet/alternative_example_request_for_atts_since.py) + +```python +from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 + +service = CloudantV1.new_instance() + +bulk_get_doc = BulkGetQueryDocument( + id='order00058', + atts_since=['1-99b02e08da151943c2dcb40090160bb8']) +response = service.post_bulk_get( + db='orders', + docs=[bulk_get_doc] +).get_result() + +print(response) +``` ## postChanges -### post `/{db}/_changes` +_POST `/{db}/_changes`_ + +### [Example request](./snippets/postChanges/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() +response = service.post_changes( + db='orders' +).get_result() -- [Example request](./postChanges/example_request.py) -- [Example request as a stream](./postChanges/example_request_as_a_stream.py) +print(response) +``` + +### [Example request as a stream](./snippets/postChanges/example_request_as_a_stream.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +result = service.post_changes_as_stream( + db='orders' +).get_result() + +with open('result.json', 'wb') as f: + for chunk in result.iter_content(): + f.write(chunk) +``` ## deleteDesignDocument -### delete `/{db}/_design/{ddoc}` +_DELETE `/{db}/_design/{ddoc}`_ + +### [Example request](./snippets/deleteDesignDocument/example_request.py) -- [Example request](./deleteDesignDocument/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.delete_design_document( + db='products', + ddoc='appliances', + rev='1-98e6a25b3b45df62e7d47095ac15b16a' +).get_result() + +print(response) +``` ## getDesignDocument -### get `/{db}/_design/{ddoc}` +_GET `/{db}/_design/{ddoc}`_ + +### [Example request](./snippets/getDesignDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getDesignDocument/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_design_document( + db='products', + ddoc='appliances', + latest=True +).get_result() + +print(response) +``` ## headDesignDocument -### head `/{db}/_design/{ddoc}` +_HEAD `/{db}/_design/{ddoc}`_ + +### [Example request](./snippets/headDesignDocument/example_request.py) -- [Example request](./headDesignDocument/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.head_design_document( + db='products', + ddoc='appliances' +) +print(response.get_status_code()) +print(response.get_headers()['ETag']) +``` ## putDesignDocument -### put `/{db}/_design/{ddoc}` +_PUT `/{db}/_design/{ddoc}`_ + +### [Example request](./snippets/putDesignDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import Analyzer, AnalyzerConfiguration, CloudantV1, DesignDocument, DesignDocumentOptions, DesignDocumentViewsMapReduce, SearchIndexDefinition + +service = CloudantV1.new_instance() + +email_view_map_reduce = DesignDocumentViewsMapReduce( + map='function(doc) { if(doc.email_verified === true){\n emit(doc.email, [doc.name, doc.email_verified, doc.joined]) }}' +) + +user_index = SearchIndexDefinition( + index='function (doc) { index("name", doc.name); index("active", doc.active); }', + analyzer=AnalyzerConfiguration(name="standard", fields={"email": Analyzer(name="email")})) + +design_document = DesignDocument( + views={'getVerifiedEmails': email_view_map_reduce}, + indexes={'activeUsers': user_index} +) + +response = service.put_design_document( + db='users', + design_document=design_document, + ddoc='allusers' +).get_result() -- [Example request](./putDesignDocument/example_request.py) +print(response) + +# Partitioned DesignDocument Example + +product_map = DesignDocumentViewsMapReduce( + map='function(doc) { emit(doc.productId, [doc.brand, doc.name, doc.description]) }' +) + +price_index = SearchIndexDefinition( + index='function (doc) { index("price", doc.price);}', + analyzer=AnalyzerConfiguration(name="classic", fields={"description": Analyzer(name="english")}) +) + +design_document_options = DesignDocumentOptions( + partitioned=True +) + +partitioned_design_doc = DesignDocument( + views={'byApplianceProdId': product_map}, + indexes={'findByPrice': price_index}, + options=design_document_options +) + +response = service.put_design_document( + db='products', + design_document=partitioned_design_doc, + ddoc='appliances' +).get_result() + +print(response) +``` + +This example creates `allusers` design document in the `users` database and `appliances` design document in the partitioned `products` database. ## getDesignDocumentInformation -### get `/{db}/_design/{ddoc}/_info` +_GET `/{db}/_design/{ddoc}/_info`_ + +### [Example request](./snippets/getDesignDocumentInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./getDesignDocumentInformation/example_request.py) +response = service.get_design_document_information( + db='products', + ddoc='appliances' +).get_result() + +print(response) +``` ## postSearch -### post `/{db}/_design/{ddoc}/_search/{index}` +_POST `/{db}/_design/{ddoc}/_search/{index}`_ + +### [Example request](./snippets/postSearch/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_search( + db='users', + ddoc='allusers', + index='activeUsers', + query='name:Jane* AND active:True' +).get_result() + +print(response) +``` -- [Example request](./postSearch/example_request.py) +This example requires the `activeUsers` Cloudant Search index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ## getSearchInfo -### get `/{db}/_design/{ddoc}/_search_info/{index}` +_GET `/{db}/_design/{ddoc}/_search_info/{index}`_ -- [Example request](./getSearchInfo/example_request.py) +### [Example request](./snippets/getSearchInfo/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_search_info( + db='products', + ddoc='appliances', + index='findByPrice' +).get_result() + +print(response) +``` + +This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ## postView -### post `/{db}/_design/{ddoc}/_view/{view}` +_POST `/{db}/_design/{ddoc}/_view/{view}`_ + +### [Example request](./snippets/postView/example_request.py) -- [Example request](./postView/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_view( + db='users', + ddoc='allusers', + view='getVerifiedEmails' +).get_result() + +print(response) +``` + +This example requires the `getVerifiedEmails` view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) ## postViewQueries -### post `/{db}/_design/{ddoc}/_view/{view}/queries` +_POST `/{db}/_design/{ddoc}/_view/{view}/queries`_ + +### [Example request](./snippets/postViewQueries/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1, ViewQuery -- [Example request](./postViewQueries/example_request.py) +service = CloudantV1.new_instance() + +query1 = ViewQuery( + include_docs=True, + limit=5 +) +query2 = ViewQuery( + descending=True, + skip=1 +) + +response = service.post_view_queries( + db='users', + ddoc='allusers', + queries=[query1, query2], + view='getVerifiedEmails' +).get_result() + +print(response) +``` + +This example requires the `getVerifiedEmails` view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) ## postDesignDocs -### post `/{db}/_design_docs` +_POST `/{db}/_design_docs`_ + +### [Example request](./snippets/postDesignDocs/example_request.py) -- [Example request](./postDesignDocs/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_design_docs( + attachments=True, + db='users' +).get_result() + +print(response) +``` ## postDesignDocsQueries -### post `/{db}/_design_docs/queries` +_POST `/{db}/_design_docs/queries`_ + +### [Example request](./snippets/postDesignDocsQueries/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./postDesignDocsQueries/example_request.py) +doc1 = AllDocsQuery( + descending=True, + include_docs=True, + limit=10 +) +doc2 = AllDocsQuery( + inclusive_end=True, + key='_design/allusers', + skip=1 +) + +response = service.post_design_docs_queries( + db='users', + queries=[doc1, doc2] +).get_result() + +print(response) +``` ## postExplain -### post `/{db}/_explain` +_POST `/{db}/_explain`_ + +### [Example request](./snippets/postExplain/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_explain( + db='users', + execution_stats=True, + limit=10, + selector={'type': {"$eq": "user"}} +).get_result() -- [Example request](./postExplain/example_request.py) +print(response) +``` ## postFind -### post `/{db}/_find` +_POST `/{db}/_find`_ -- [Example request for "json" index type](./postFind/example_request_for_json_index_type.py) -- [Example request for "text" index type](./postFind/example_request_for_text_index_type.py) +### [Example request for "json" index type](./snippets/postFind/example_request_for_json_index_type.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_find( + db='users', + selector={'email_verified': {'$eq': True}}, + fields=["_id", "type", "name", "email"], + sort=[{'email': 'desc'}], + limit=3 +).get_result() +print(response) +``` + +This example requires the `getUserByAddress` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) + +### [Example request for "text" index type](./snippets/postFind/example_request_for_text_index_type.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_find( + db='users', + selector={'address': {'$regex': 'Street'}}, + fields=["_id", "type", "name", "email", "address"], + limit=3 +).get_result() +print(response) +``` + +This example requires the `getUserByVerifiedEmail` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) ## getIndexesInformation -### get `/{db}/_index` +_GET `/{db}/_index`_ + +### [Example request](./snippets/getIndexesInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getIndexesInformation/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_indexes_information( + db='users' +).get_result() + +print(response) +``` ## postIndex -### post `/{db}/_index` +_POST `/{db}/_index`_ + +### [Example request using "json" type index](./snippets/postIndex/example_request_using_json_type_index.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1, IndexDefinition, IndexField + +service = CloudantV1.new_instance() + +# Type "json" index fields require an object that maps the name of a field to a sort direction. +index_field = IndexField( + email="asc" +) +index = IndexDefinition( + fields=[index_field] +) + +response = service.post_index( + db='users', + ddoc='json-index', + name='getUserByEmail', + index=index, + type='json' +).get_result() + +print(response) +``` + +### [Example request using "text" type index](./snippets/postIndex/example_request_using_text_type_index.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1, IndexDefinition, IndexField + +service = CloudantV1.new_instance() + +# Type "text" index fields require an object with a name and type properties for the field. +index_field = IndexField( + name="address", + type="string" +) +index = IndexDefinition( + fields=[index_field] +) -- [Example request using "json" type index](./postIndex/example_request_using_json_type_index.py) -- [Example request using "text" type index](./postIndex/example_request_using_text_type_index.py) +response = service.post_index( + db='users', + ddoc='text-index', + name='getUserByAddress', + index=index, + type='text' +).get_result() + +print(response) +``` ## deleteIndex -### delete `/{db}/_index/_design/{ddoc}/{type}/{index}` +_DELETE `/{db}/_index/_design/{ddoc}/{type}/{index}`_ + +### [Example request](./snippets/deleteIndex/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.delete_index( + db='users', + ddoc='json-index', + index='getUserByName', + type='json' +).get_result() + +print(response) +``` -- [Example request](./deleteIndex/example_request.py) +This example will fail if `getUserByName` index doesn't exist. To create the index, see [Create a new index on a database.](#postindex) ## deleteLocalDocument -### delete `/{db}/_local/{doc_id}` +_DELETE `/{db}/_local/{doc_id}`_ -- [Example request](./deleteLocalDocument/example_request.py) +### [Example request](./snippets/deleteLocalDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.delete_local_document( + db='orders', + doc_id='local-0007741142412418284' +).get_result() + +print(response) +``` ## getLocalDocument -### get `/{db}/_local/{doc_id}` +_GET `/{db}/_local/{doc_id}`_ + +### [Example request](./snippets/getLocalDocument/example_request.py) -- [Example request](./getLocalDocument/example_request.py) +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_local_document( + db='orders', + doc_id='local-0007741142412418284' +).get_result() + +print(response) +``` ## putLocalDocument -### put `/{db}/_local/{doc_id}` +_PUT `/{db}/_local/{doc_id}`_ + +### [Example request](./snippets/putLocalDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./putLocalDocument/example_request.py) +local_document = Document( + type='order', + user='Bob Smith', + orderid='0007741142412418284', + userid='abc123', + total=214.98, + deliveryAddress='19 Front Street, Darlington, DL5 1TY', + delivered='true', + courier='UPS', + courierid='15125425151261289', + date='2019-01-28T10:44:22.000Z' +) + +response = service.put_local_document( + db='orders', + doc_id='local-0007741142412418284', + document=local_document, +).get_result() + +print(response) +``` ## postMissingRevs -### post `/{db}/_missing_revs` +_POST `/{db}/_missing_revs`_ + +### [Example request](./snippets/postMissingRevs/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 + +service = CloudantV1.new_instance() + +revs = DocumentRevisions(order00077=['', '<2-missing-revision>']) +response = service.post_missing_revs( + db='orders', + missing_revs=revs.to_dict() +).get_result() -- [Example request](./postMissingRevs/example_request.py) +print(response) +``` ## getPartitionInformation -### get `/{db}/_partition/{partition_key}` +_GET `/{db}/_partition/{partition_key}`_ -- [Example request](./getPartitionInformation/example_request.py) +### [Example request](./snippets/getPartitionInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_partition_information( + db='products', + partition_key='small-appliances' +).get_result() + +print(response) +``` ## postPartitionAllDocs -### post `/{db}/_partition/{partition_key}/_all_docs` +_POST `/{db}/_partition/{partition_key}/_all_docs`_ + +### [Example request](./snippets/postPartitionAllDocs/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./postPartitionAllDocs/example_request.py) +service = CloudantV1.new_instance() + +response = service.post_partition_all_docs( + db='products', + partition_key='small-appliances', + include_docs=True +).get_result() + +print(response) +``` ## postPartitionSearch -### post `/{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}` +_POST `/{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}`_ + +### [Example request](./snippets/postPartitionSearch/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./postPartitionSearch/example_request.py) +response = service.post_partition_search( + db='products', + partition_key='small-appliances', + ddoc='appliances', + index='findByPrice', + query='price:[14 TO 20]' +).get_result() + +print(response) +``` + +This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ## postPartitionView -### post `/{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}` +_POST `/{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}`_ + +### [Example request](./snippets/postPartitionView/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_partition_view( + db='products', + ddoc='appliances', + limit=10, + partition_key='small-appliances', + view='byApplianceProdId' +).get_result() -- [Example request](./postPartitionView/example_request.py) +print(response) +``` + +This example requires the `byApplianceProdId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) ## postPartitionFind -### post `/{db}/_partition/{partition_key}/_find` +_POST `/{db}/_partition/{partition_key}/_find`_ + +### [Example request](./snippets/postPartitionFind/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./postPartitionFind/example_request.py) +service = CloudantV1.new_instance() + +response = service.post_partition_find( + db='products', + partition_key='small-appliances', + fields=['productid', 'name', 'description'], + selector={'type': {'$eq': 'product'}} +).get_result() + +print(response) +``` ## postRevsDiff -### post `/{db}/_revs_diff` +_POST `/{db}/_revs_diff`_ + +### [Example request](./snippets/postRevsDiff/example_request.py) -- [Example request](./postRevsDiff/example_request.py) +```python +from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 + +service = CloudantV1.new_instance() + +revs_diff = DocumentRevisions( + order00077=[ + "<1-missing-revision>", + "<2-missing-revision>", + "<3-possible-ancestor-revision>" +] +) + +response = service.post_revs_diff( + db='orders', + revs_diff_request=revs_diff.to_dict() +).get_result() + +print(response) +``` ## getSecurity -### get `/{db}/_security` +_GET `/{db}/_security`_ + +### [Example request](./snippets/getSecurity/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getSecurity/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_security( + db='products' +).get_result() + +print(response) +``` ## putSecurity -### put `/{db}/_security` +_PUT `/{db}/_security`_ + +### [Example request](./snippets/putSecurity/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1, SecurityObject + +service = CloudantV1.new_instance() -- [Example request](./putSecurity/example_request.py) +members = SecurityObject( + names=['user1', 'user2'], + roles=['developers'] +) + +response = service.put_security( + db='products', + members=members +).get_result() + +print(response) +``` + +The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if the `nobody` user has the role `_reader`. + +If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB `_users` database (that is using legacy credentials _and_ the `couchdb_auth_only:true` option) then be aware that the user must already exist in `_users` database before adding permissions. For information on the `_users` database, see Using the `_users` database with Cloudant. ## getShardsInformation -### get `/{db}/_shards` +_GET `/{db}/_shards`_ + +### [Example request](./snippets/getShardsInformation/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getShardsInformation/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_shards_information( + db='products' +).get_result() + +print(response) +``` ## getDocumentShardsInfo -### get `/{db}/_shards/{doc_id}` +_GET `/{db}/_shards/{doc_id}`_ + +### [Example request](./snippets/getDocumentShardsInfo/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.get_document_shards_info( + db='products', + doc_id='small-appliances:1000042' +).get_result() -- [Example request](./getDocumentShardsInfo/example_request.py) +print(response) +``` ## deleteDocument -### delete `/{db}/{doc_id}` +_DELETE `/{db}/{doc_id}`_ -- [Example request](./deleteDocument/example_request.py) +### [Example request](./snippets/deleteDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.delete_document( + db='events', + doc_id='0007241142412418284', + rev='2-9a0d1cd9f40472509e9aac6461837367' +).get_result() + +print(response) +``` ## getDocument -### get `/{db}/{doc_id}` +_GET `/{db}/{doc_id}`_ + +### [Example request](./snippets/getDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getDocument/example_request.py) +service = CloudantV1.new_instance() + +response = service.get_document( + db='products', + doc_id='small-appliances:1000042' +).get_result() + +print(response) +``` ## headDocument -### head `/{db}/{doc_id}` +_HEAD `/{db}/{doc_id}`_ + +### [Example request](./snippets/headDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./headDocument/example_request.py) +response = service.head_document( + db='events', + doc_id='0007241142412418284' +) +print(response.get_status_code()) +print(response.get_headers()['ETag']) +``` ## putDocument -### put `/{db}/{doc_id}` +_PUT `/{db}/{doc_id}`_ -- [Example request](./putDocument/example_request.py) +### [Example request](./snippets/putDocument/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +event_doc = Document( + type='event', + userid='abc123', + eventType='addedToBasket', + productId='1000042', + date='2019-01-28T10:44:22.000Z' +) +response = service.put_document( + db='events', + doc_id='0007241142412418284', + document=event_doc +).get_result() + +print(response) +``` ## deleteAttachment -### delete `/{db}/{doc_id}/{attachment_name}` +_DELETE `/{db}/{doc_id}/{attachment_name}`_ + +### [Example request](./snippets/deleteAttachment/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./deleteAttachment/example_request.py) +service = CloudantV1.new_instance() + +response = service.delete_attachment( + db='products', + doc_id='small-appliances:100001', + attachment_name='product_details.txt', + rev='4-1a0d1cd6f40472509e9aac646183736a' +).get_result() + +print(response) +``` + +This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ## getAttachment -### get `/{db}/{doc_id}/{attachment_name}` +_GET `/{db}/{doc_id}/{attachment_name}`_ + +### [Example request](./snippets/getAttachment/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 -- [Example request](./getAttachment/example_request.py) +service = CloudantV1.new_instance() + +response_attachment = service.get_attachment( + db='products', + doc_id='small-appliances:100001', + attachment_name='product_details.txt' +).get_result().content + +print(response_attachment) +``` + +This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ## headAttachment -### head `/{db}/{doc_id}/{attachment_name}` +_HEAD `/{db}/{doc_id}/{attachment_name}`_ + +### [Example request](./snippets/headAttachment/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() -- [Example request](./headAttachment/example_request.py) +response = service.head_attachment( + db='products', + doc_id='small-appliances:100001', + attachment_name='product_details.txt' +) +print(response.get_status_code()) +print(response.get_headers()['Content-Length']) +print(response.get_headers()['Content-Type']) +``` + +This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ## putAttachment -### put `/{db}/{doc_id}/{attachment_name}` +_PUT `/{db}/{doc_id}/{attachment_name}`_ + +### [Example request](./snippets/putAttachment/example_request.py) + +```python +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +detailed_description = "This appliance includes..." +response = service.put_attachment( + db='products', + doc_id='small-appliances:100001', + attachment_name='product_details.txt', + attachment=detailed_description, + content_type='text/plain' +).get_result() -- [Example request](./putAttachment/example_request.py) +print(response) +``` diff --git a/examples/deleteAttachment/example_request.py b/examples/snippets/deleteAttachment/example_request.py similarity index 100% rename from examples/deleteAttachment/example_request.py rename to examples/snippets/deleteAttachment/example_request.py diff --git a/examples/deleteDatabase/example_request.py b/examples/snippets/deleteDatabase/example_request.py similarity index 100% rename from examples/deleteDatabase/example_request.py rename to examples/snippets/deleteDatabase/example_request.py diff --git a/examples/deleteDesignDocument/example_request.py b/examples/snippets/deleteDesignDocument/example_request.py similarity index 100% rename from examples/deleteDesignDocument/example_request.py rename to examples/snippets/deleteDesignDocument/example_request.py diff --git a/examples/deleteDocument/example_request.py b/examples/snippets/deleteDocument/example_request.py similarity index 100% rename from examples/deleteDocument/example_request.py rename to examples/snippets/deleteDocument/example_request.py diff --git a/examples/deleteIndex/example_request.py b/examples/snippets/deleteIndex/example_request.py similarity index 100% rename from examples/deleteIndex/example_request.py rename to examples/snippets/deleteIndex/example_request.py diff --git a/examples/deleteLocalDocument/example_request.py b/examples/snippets/deleteLocalDocument/example_request.py similarity index 100% rename from examples/deleteLocalDocument/example_request.py rename to examples/snippets/deleteLocalDocument/example_request.py diff --git a/examples/deleteReplicationDocument/example_request.py b/examples/snippets/deleteReplicationDocument/example_request.py similarity index 100% rename from examples/deleteReplicationDocument/example_request.py rename to examples/snippets/deleteReplicationDocument/example_request.py diff --git a/examples/getActiveTasks/example_request.py b/examples/snippets/getActiveTasks/example_request.py similarity index 100% rename from examples/getActiveTasks/example_request.py rename to examples/snippets/getActiveTasks/example_request.py diff --git a/examples/getActivityTrackerEvents/example_request.py b/examples/snippets/getActivityTrackerEvents/example_request.py similarity index 100% rename from examples/getActivityTrackerEvents/example_request.py rename to examples/snippets/getActivityTrackerEvents/example_request.py diff --git a/examples/getAllDbs/example_request.py b/examples/snippets/getAllDbs/example_request.py similarity index 100% rename from examples/getAllDbs/example_request.py rename to examples/snippets/getAllDbs/example_request.py diff --git a/examples/getAttachment/example_request.py b/examples/snippets/getAttachment/example_request.py similarity index 100% rename from examples/getAttachment/example_request.py rename to examples/snippets/getAttachment/example_request.py diff --git a/examples/getCapacityThroughputInformation/example_request.py b/examples/snippets/getCapacityThroughputInformation/example_request.py similarity index 100% rename from examples/getCapacityThroughputInformation/example_request.py rename to examples/snippets/getCapacityThroughputInformation/example_request.py diff --git a/examples/getCorsInformation/example_request.py b/examples/snippets/getCorsInformation/example_request.py similarity index 100% rename from examples/getCorsInformation/example_request.py rename to examples/snippets/getCorsInformation/example_request.py diff --git a/examples/getCurrentThroughputInformation/example_request.py b/examples/snippets/getCurrentThroughputInformation/example_request.py similarity index 100% rename from examples/getCurrentThroughputInformation/example_request.py rename to examples/snippets/getCurrentThroughputInformation/example_request.py diff --git a/examples/getDatabaseInformation/example_request.py b/examples/snippets/getDatabaseInformation/example_request.py similarity index 100% rename from examples/getDatabaseInformation/example_request.py rename to examples/snippets/getDatabaseInformation/example_request.py diff --git a/examples/getDbUpdates/example_request.py b/examples/snippets/getDbUpdates/example_request.py similarity index 100% rename from examples/getDbUpdates/example_request.py rename to examples/snippets/getDbUpdates/example_request.py diff --git a/examples/getDesignDocument/example_request.py b/examples/snippets/getDesignDocument/example_request.py similarity index 100% rename from examples/getDesignDocument/example_request.py rename to examples/snippets/getDesignDocument/example_request.py diff --git a/examples/getDesignDocumentInformation/example_request.py b/examples/snippets/getDesignDocumentInformation/example_request.py similarity index 100% rename from examples/getDesignDocumentInformation/example_request.py rename to examples/snippets/getDesignDocumentInformation/example_request.py diff --git a/examples/getDocument/example_request.py b/examples/snippets/getDocument/example_request.py similarity index 100% rename from examples/getDocument/example_request.py rename to examples/snippets/getDocument/example_request.py diff --git a/examples/getDocumentShardsInfo/example_request.py b/examples/snippets/getDocumentShardsInfo/example_request.py similarity index 100% rename from examples/getDocumentShardsInfo/example_request.py rename to examples/snippets/getDocumentShardsInfo/example_request.py diff --git a/examples/getIndexesInformation/example_request.py b/examples/snippets/getIndexesInformation/example_request.py similarity index 100% rename from examples/getIndexesInformation/example_request.py rename to examples/snippets/getIndexesInformation/example_request.py diff --git a/examples/getLocalDocument/example_request.py b/examples/snippets/getLocalDocument/example_request.py similarity index 100% rename from examples/getLocalDocument/example_request.py rename to examples/snippets/getLocalDocument/example_request.py diff --git a/examples/getMembershipInformation/example_request.py b/examples/snippets/getMembershipInformation/example_request.py similarity index 100% rename from examples/getMembershipInformation/example_request.py rename to examples/snippets/getMembershipInformation/example_request.py diff --git a/examples/getPartitionInformation/example_request.py b/examples/snippets/getPartitionInformation/example_request.py similarity index 100% rename from examples/getPartitionInformation/example_request.py rename to examples/snippets/getPartitionInformation/example_request.py diff --git a/examples/getReplicationDocument/example_request.py b/examples/snippets/getReplicationDocument/example_request.py similarity index 100% rename from examples/getReplicationDocument/example_request.py rename to examples/snippets/getReplicationDocument/example_request.py diff --git a/examples/getSchedulerDocs/example_request.py b/examples/snippets/getSchedulerDocs/example_request.py similarity index 100% rename from examples/getSchedulerDocs/example_request.py rename to examples/snippets/getSchedulerDocs/example_request.py diff --git a/examples/getSchedulerDocument/example_request.py b/examples/snippets/getSchedulerDocument/example_request.py similarity index 100% rename from examples/getSchedulerDocument/example_request.py rename to examples/snippets/getSchedulerDocument/example_request.py diff --git a/examples/getSchedulerJob/example_request.py b/examples/snippets/getSchedulerJob/example_request.py similarity index 100% rename from examples/getSchedulerJob/example_request.py rename to examples/snippets/getSchedulerJob/example_request.py diff --git a/examples/getSchedulerJobs/example_request.py b/examples/snippets/getSchedulerJobs/example_request.py similarity index 100% rename from examples/getSchedulerJobs/example_request.py rename to examples/snippets/getSchedulerJobs/example_request.py diff --git a/examples/getSearchInfo/example_request.py b/examples/snippets/getSearchInfo/example_request.py similarity index 100% rename from examples/getSearchInfo/example_request.py rename to examples/snippets/getSearchInfo/example_request.py diff --git a/examples/getSecurity/example_request.py b/examples/snippets/getSecurity/example_request.py similarity index 100% rename from examples/getSecurity/example_request.py rename to examples/snippets/getSecurity/example_request.py diff --git a/examples/getServerInformation/example_request.py b/examples/snippets/getServerInformation/example_request.py similarity index 100% rename from examples/getServerInformation/example_request.py rename to examples/snippets/getServerInformation/example_request.py diff --git a/examples/getSessionInformation/example_request.py b/examples/snippets/getSessionInformation/example_request.py similarity index 100% rename from examples/getSessionInformation/example_request.py rename to examples/snippets/getSessionInformation/example_request.py diff --git a/examples/getShardsInformation/example_request.py b/examples/snippets/getShardsInformation/example_request.py similarity index 100% rename from examples/getShardsInformation/example_request.py rename to examples/snippets/getShardsInformation/example_request.py diff --git a/examples/getUpInformation/example_request.py b/examples/snippets/getUpInformation/example_request.py similarity index 100% rename from examples/getUpInformation/example_request.py rename to examples/snippets/getUpInformation/example_request.py diff --git a/examples/getUuids/example_request.py b/examples/snippets/getUuids/example_request.py similarity index 100% rename from examples/getUuids/example_request.py rename to examples/snippets/getUuids/example_request.py diff --git a/examples/headAttachment/example_request.py b/examples/snippets/headAttachment/example_request.py similarity index 100% rename from examples/headAttachment/example_request.py rename to examples/snippets/headAttachment/example_request.py diff --git a/examples/headDatabase/example_request.py b/examples/snippets/headDatabase/example_request.py similarity index 100% rename from examples/headDatabase/example_request.py rename to examples/snippets/headDatabase/example_request.py diff --git a/examples/headDesignDocument/example_request.py b/examples/snippets/headDesignDocument/example_request.py similarity index 100% rename from examples/headDesignDocument/example_request.py rename to examples/snippets/headDesignDocument/example_request.py diff --git a/examples/headDocument/example_request.py b/examples/snippets/headDocument/example_request.py similarity index 100% rename from examples/headDocument/example_request.py rename to examples/snippets/headDocument/example_request.py diff --git a/examples/headReplicationDocument/example_request.py b/examples/snippets/headReplicationDocument/example_request.py similarity index 100% rename from examples/headReplicationDocument/example_request.py rename to examples/snippets/headReplicationDocument/example_request.py diff --git a/examples/headSchedulerJob/example_request.py b/examples/snippets/headSchedulerJob/example_request.py similarity index 100% rename from examples/headSchedulerJob/example_request.py rename to examples/snippets/headSchedulerJob/example_request.py diff --git a/examples/postActivityTrackerEvents/example_request.py b/examples/snippets/postActivityTrackerEvents/example_request.py similarity index 100% rename from examples/postActivityTrackerEvents/example_request.py rename to examples/snippets/postActivityTrackerEvents/example_request.py diff --git a/examples/postAllDocs/example_request.py b/examples/snippets/postAllDocs/example_request.py similarity index 100% rename from examples/postAllDocs/example_request.py rename to examples/snippets/postAllDocs/example_request.py diff --git a/examples/postAllDocs/example_request_as_a_stream.py b/examples/snippets/postAllDocs/example_request_as_a_stream.py similarity index 100% rename from examples/postAllDocs/example_request_as_a_stream.py rename to examples/snippets/postAllDocs/example_request_as_a_stream.py diff --git a/examples/postAllDocsQueries/example_request.py b/examples/snippets/postAllDocsQueries/example_request.py similarity index 100% rename from examples/postAllDocsQueries/example_request.py rename to examples/snippets/postAllDocsQueries/example_request.py diff --git a/examples/postApiKeys/example_request.py b/examples/snippets/postApiKeys/example_request.py similarity index 100% rename from examples/postApiKeys/example_request.py rename to examples/snippets/postApiKeys/example_request.py diff --git a/examples/postBulkDocs/example_request_as_a_stream.py b/examples/snippets/postBulkDocs/example_request_as_a_stream.py similarity index 100% rename from examples/postBulkDocs/example_request_as_a_stream.py rename to examples/snippets/postBulkDocs/example_request_as_a_stream.py diff --git a/examples/postBulkDocs/example_request_create_documents.py b/examples/snippets/postBulkDocs/example_request_create_documents.py similarity index 100% rename from examples/postBulkDocs/example_request_create_documents.py rename to examples/snippets/postBulkDocs/example_request_create_documents.py diff --git a/examples/postBulkDocs/example_request_delete_documents.py b/examples/snippets/postBulkDocs/example_request_delete_documents.py similarity index 100% rename from examples/postBulkDocs/example_request_delete_documents.py rename to examples/snippets/postBulkDocs/example_request_delete_documents.py diff --git a/examples/postBulkGet/alternative_example_request_for_atts_since.py b/examples/snippets/postBulkGet/alternative_example_request_for_atts_since.py similarity index 100% rename from examples/postBulkGet/alternative_example_request_for_atts_since.py rename to examples/snippets/postBulkGet/alternative_example_request_for_atts_since.py diff --git a/examples/postBulkGet/alternative_example_request_for_open_revs_all.py b/examples/snippets/postBulkGet/alternative_example_request_for_open_revs_all.py similarity index 100% rename from examples/postBulkGet/alternative_example_request_for_open_revs_all.py rename to examples/snippets/postBulkGet/alternative_example_request_for_open_revs_all.py diff --git a/examples/postBulkGet/example_request.py b/examples/snippets/postBulkGet/example_request.py similarity index 100% rename from examples/postBulkGet/example_request.py rename to examples/snippets/postBulkGet/example_request.py diff --git a/examples/postChanges/example_request.py b/examples/snippets/postChanges/example_request.py similarity index 100% rename from examples/postChanges/example_request.py rename to examples/snippets/postChanges/example_request.py diff --git a/examples/postChanges/example_request_as_a_stream.py b/examples/snippets/postChanges/example_request_as_a_stream.py similarity index 100% rename from examples/postChanges/example_request_as_a_stream.py rename to examples/snippets/postChanges/example_request_as_a_stream.py diff --git a/examples/postDbsInfo/example_request.py b/examples/snippets/postDbsInfo/example_request.py similarity index 100% rename from examples/postDbsInfo/example_request.py rename to examples/snippets/postDbsInfo/example_request.py diff --git a/examples/postDesignDocs/example_request.py b/examples/snippets/postDesignDocs/example_request.py similarity index 100% rename from examples/postDesignDocs/example_request.py rename to examples/snippets/postDesignDocs/example_request.py diff --git a/examples/postDesignDocsQueries/example_request.py b/examples/snippets/postDesignDocsQueries/example_request.py similarity index 100% rename from examples/postDesignDocsQueries/example_request.py rename to examples/snippets/postDesignDocsQueries/example_request.py diff --git a/examples/postDocument/example_request.py b/examples/snippets/postDocument/example_request.py similarity index 100% rename from examples/postDocument/example_request.py rename to examples/snippets/postDocument/example_request.py diff --git a/examples/postExplain/example_request.py b/examples/snippets/postExplain/example_request.py similarity index 100% rename from examples/postExplain/example_request.py rename to examples/snippets/postExplain/example_request.py diff --git a/examples/postFind/example_request_for_json_index_type.py b/examples/snippets/postFind/example_request_for_json_index_type.py similarity index 100% rename from examples/postFind/example_request_for_json_index_type.py rename to examples/snippets/postFind/example_request_for_json_index_type.py diff --git a/examples/postFind/example_request_for_text_index_type.py b/examples/snippets/postFind/example_request_for_text_index_type.py similarity index 100% rename from examples/postFind/example_request_for_text_index_type.py rename to examples/snippets/postFind/example_request_for_text_index_type.py diff --git a/examples/postIndex/example_request_using_json_type_index.py b/examples/snippets/postIndex/example_request_using_json_type_index.py similarity index 100% rename from examples/postIndex/example_request_using_json_type_index.py rename to examples/snippets/postIndex/example_request_using_json_type_index.py diff --git a/examples/postIndex/example_request_using_text_type_index.py b/examples/snippets/postIndex/example_request_using_text_type_index.py similarity index 100% rename from examples/postIndex/example_request_using_text_type_index.py rename to examples/snippets/postIndex/example_request_using_text_type_index.py diff --git a/examples/postMissingRevs/example_request.py b/examples/snippets/postMissingRevs/example_request.py similarity index 100% rename from examples/postMissingRevs/example_request.py rename to examples/snippets/postMissingRevs/example_request.py diff --git a/examples/postPartitionAllDocs/example_request.py b/examples/snippets/postPartitionAllDocs/example_request.py similarity index 100% rename from examples/postPartitionAllDocs/example_request.py rename to examples/snippets/postPartitionAllDocs/example_request.py diff --git a/examples/postPartitionFind/example_request.py b/examples/snippets/postPartitionFind/example_request.py similarity index 100% rename from examples/postPartitionFind/example_request.py rename to examples/snippets/postPartitionFind/example_request.py diff --git a/examples/postPartitionSearch/example_request.py b/examples/snippets/postPartitionSearch/example_request.py similarity index 100% rename from examples/postPartitionSearch/example_request.py rename to examples/snippets/postPartitionSearch/example_request.py diff --git a/examples/postPartitionView/example_request.py b/examples/snippets/postPartitionView/example_request.py similarity index 100% rename from examples/postPartitionView/example_request.py rename to examples/snippets/postPartitionView/example_request.py diff --git a/examples/postRevsDiff/example_request.py b/examples/snippets/postRevsDiff/example_request.py similarity index 100% rename from examples/postRevsDiff/example_request.py rename to examples/snippets/postRevsDiff/example_request.py diff --git a/examples/postSearch/example_request.py b/examples/snippets/postSearch/example_request.py similarity index 100% rename from examples/postSearch/example_request.py rename to examples/snippets/postSearch/example_request.py diff --git a/examples/postSearchAnalyze/example_request.py b/examples/snippets/postSearchAnalyze/example_request.py similarity index 100% rename from examples/postSearchAnalyze/example_request.py rename to examples/snippets/postSearchAnalyze/example_request.py diff --git a/examples/postView/example_request.py b/examples/snippets/postView/example_request.py similarity index 100% rename from examples/postView/example_request.py rename to examples/snippets/postView/example_request.py diff --git a/examples/postViewQueries/example_request.py b/examples/snippets/postViewQueries/example_request.py similarity index 100% rename from examples/postViewQueries/example_request.py rename to examples/snippets/postViewQueries/example_request.py diff --git a/examples/putAttachment/example_request.py b/examples/snippets/putAttachment/example_request.py similarity index 100% rename from examples/putAttachment/example_request.py rename to examples/snippets/putAttachment/example_request.py diff --git a/examples/putCapacityThroughputConfiguration/example_request.py b/examples/snippets/putCapacityThroughputConfiguration/example_request.py similarity index 100% rename from examples/putCapacityThroughputConfiguration/example_request.py rename to examples/snippets/putCapacityThroughputConfiguration/example_request.py diff --git a/examples/putCloudantSecurity/example_request.py b/examples/snippets/putCloudantSecurity/example_request.py similarity index 100% rename from examples/putCloudantSecurity/example_request.py rename to examples/snippets/putCloudantSecurity/example_request.py diff --git a/examples/putCorsConfiguration/example_request.py b/examples/snippets/putCorsConfiguration/example_request.py similarity index 100% rename from examples/putCorsConfiguration/example_request.py rename to examples/snippets/putCorsConfiguration/example_request.py diff --git a/examples/putDatabase/example_request.py b/examples/snippets/putDatabase/example_request.py similarity index 100% rename from examples/putDatabase/example_request.py rename to examples/snippets/putDatabase/example_request.py diff --git a/examples/putDesignDocument/example_request.py b/examples/snippets/putDesignDocument/example_request.py similarity index 100% rename from examples/putDesignDocument/example_request.py rename to examples/snippets/putDesignDocument/example_request.py diff --git a/examples/putDocument/example_request.py b/examples/snippets/putDocument/example_request.py similarity index 100% rename from examples/putDocument/example_request.py rename to examples/snippets/putDocument/example_request.py diff --git a/examples/putLocalDocument/example_request.py b/examples/snippets/putLocalDocument/example_request.py similarity index 100% rename from examples/putLocalDocument/example_request.py rename to examples/snippets/putLocalDocument/example_request.py diff --git a/examples/putReplicationDocument/example_request.py b/examples/snippets/putReplicationDocument/example_request.py similarity index 100% rename from examples/putReplicationDocument/example_request.py rename to examples/snippets/putReplicationDocument/example_request.py diff --git a/examples/putSecurity/example_request.py b/examples/snippets/putSecurity/example_request.py similarity index 100% rename from examples/putSecurity/example_request.py rename to examples/snippets/putSecurity/example_request.py From 58e1513994f21dc7ae29193c6396d0a2a282a4fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 08:12:06 +0000 Subject: [PATCH 034/669] build(deps-dev): Bump pylint from 2.15.4 to 2.15.5 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.4 to 2.15.5. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.4...v2.15.5) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index cec4bb5a..33eee284 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.1.3 responses==0.22.0 python_dotenv==0.21.0 -pylint==2.15.4 +pylint==2.15.5 tox==3.26.0 pytest-rerunfailures==10.2 From 4913f64f478d4fe60ac0e5add22e2c509847e456 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 25 Oct 2022 09:56:09 -0300 Subject: [PATCH 035/669] ci: add python 3.11 to test matrix (#349) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fa5dfab..1ab3e48b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: test: strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] runs-on: ubuntu-latest services: couchdb: From 1937e39f3d0d4786acf2d7b4505038f7caf38640 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 17:06:09 +0000 Subject: [PATCH 036/669] build(deps-dev): Bump pytest from 7.1.3 to 7.2.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.3 to 7.2.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.1.3...7.2.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 33eee284..5336deac 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.1.3 +pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.5 From f1e2dd0c2576f5d7a65f023a92f28c46f4d528c2 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 26 Oct 2022 10:54:19 +0100 Subject: [PATCH 037/669] chore: update secrets baseline --- .secrets.baseline | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 1677433e..5ea1313a 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "stubs/.+\\.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2022-06-08T07:56:57Z", + "generated_at": "2022-10-26T09:53:42Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -138,7 +138,7 @@ } ] }, - "version": "0.13.1+ibm.48.dss", + "version": "0.13.1+ibm.55.dss", "word_list": { "file": null, "hash": null From 202f399390463438b3cf3f301d0aade9c6738613 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 26 Oct 2022 10:54:38 +0100 Subject: [PATCH 038/669] chore: support Python 3.11.0 --- setup.py | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 76c60e84..7ca98a84 100644 --- a/setup.py +++ b/setup.py @@ -83,6 +83,7 @@ def finalize_options(self): 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', diff --git a/tox.ini b/tox.ini index 9c65c5db..fb811755 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py39-lint, py37, py38, py39, py310 +envlist = py39-lint, py37, py38, py39, py310, py311 [testenv:py39-lint] basepython = python3.9 From d5b4e1955c07f811e8fa596bbd01d67bd451fd41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Oct 2022 17:05:10 +0000 Subject: [PATCH 039/669] build(deps-dev): Bump tox from 3.26.0 to 3.27.0 Bumps [tox](https://github.com/tox-dev/tox) from 3.26.0 to 3.27.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.26.0...3.27.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5336deac..19a997f1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.5 -tox==3.26.0 +tox==3.27.0 pytest-rerunfailures==10.2 # code coverage From 6ad857ca94319f2e8c5e1ec5cf389c6b74be110c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 27 Oct 2022 15:12:49 +0000 Subject: [PATCH 040/669] Update version 0.2.1 -> 0.3.0 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 727941db..2bfa9a8e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.1 +current_version = 0.3.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 75e71d58..ec108b0c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.2.1 +# IBM Cloudant Python SDK Version 0.3.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.2.1" +pip install --upgrade "ibmcloudant>=0.3.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.2.1" +easy_install --upgrade "ibmcloudant>=0.3.0" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index f77a6a3f..6863e2ff 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.2.1' +__version__ = '0.3.0' diff --git a/setup.py b/setup.py index 7ca98a84..05dac929 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.2.1' +__version__ = '0.3.0' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From e1966c99a882a1dbe35a908ee839ebe3e8807a7c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:39:28 +0000 Subject: [PATCH 041/669] chore(generated): add mend (whitesource) file (#353) Generated SDK source code using: - Generator version 3.60.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 65920e9 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .github/CODEOWNERS | 1 + .whitesource | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 .whitesource diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 90a42520..d7ca9e43 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,6 +5,7 @@ .github/dco.yml @IBM/cloudant-sdks .github/dependabot.yml @IBM/cloudant-sdks .github/pull_request_template.md @IBM/cloudant-sdks +.whitesource @IBM/cloudant-sdks CODE_OF_CONDUCT.md @IBM/cloudant-sdks CONTRIBUTING.md @IBM/cloudant-sdks Jenkinsfile @IBM/cloudant-sdks diff --git a/.whitesource b/.whitesource new file mode 100644 index 00000000..c42d1f0e --- /dev/null +++ b/.whitesource @@ -0,0 +1,6 @@ +{ + "settingsInheritedFrom": "whitesource-config/whitesource-config@master", + "issueSettings": { + "issueRepoName": "sdks" + } +} From 3bcd9621549a376f343260307c73324703017171 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 11 Nov 2022 16:01:31 +0000 Subject: [PATCH 042/669] ci(generated): update rt env vars Generated SDK source code using: - Generator version 3.60.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version d87aa26 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 45 ++++++++++++++++++------------------ scripts/publish_buildinfo.sh | 10 ++++---- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b4a69365..5a2b3b84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,9 @@ pipeline { } environment { GH_CREDS = credentials('gh-sdks-automation') + ARTIFACTORY_CREDS = credentials('artifactory') + ARTIFACTORY_URL_UP = "${Artifactory.server('taas-artifactory-upload').getUrl()}" + ARTIFACTORY_URL_DOWN = "${Artifactory.server('taas-artifactory').getUrl()}" } stages { stage('Init') { @@ -60,7 +63,7 @@ pipeline { } stage('Publish[staging]') { environment { - STAGE_ROOT = 'https://na.artifactory.swg-devops.com/artifactory/api/' + STAGE_ROOT = "${ARTIFACTORY_URL_UP}/api/" } steps { bumpVersion(true) @@ -228,24 +231,22 @@ void defaultInit() { "ARTIFACT_URL=${artifactUrl}", "MODULE_ID=${moduleId}", "BUILD_NAME=${buildName}"]) { - withCredentials([usernamePassword(credentialsId: 'artifactory', passwordVariable: 'ARTIFACTORY_APIKEY', usernameVariable: 'ARTIFACTORY_USER')]) { - // create base build info - rtBuildInfo ( - buildName: "${env.BUILD_NAME}", - buildNumber: "${env.BUILD_NUMBER}", - includeEnvPatterns: ['BRANCH_NAME'], - maxDays: 90, - deleteBuildArtifacts: true, - asyncBuildRetention: true - ) - rtPublishBuildInfo ( - buildName: "${env.BUILD_NAME}", - buildNumber: "${env.BUILD_NUMBER}", - serverId: 'taas-artifactory-upload' - ) - // put build info on module/artifacts then overwrite and publish artifactory build - sh './scripts/publish_buildinfo.sh' - } + // create base build info + rtBuildInfo ( + buildName: "${env.BUILD_NAME}", + buildNumber: "${env.BUILD_NUMBER}", + includeEnvPatterns: ['BRANCH_NAME'], + maxDays: 90, + deleteBuildArtifacts: true, + asyncBuildRetention: true + ) + rtPublishBuildInfo ( + buildName: "${env.BUILD_NAME}", + buildNumber: "${env.BUILD_NUMBER}", + serverId: 'taas-artifactory-upload' + ) + // put build info on module/artifacts then overwrite and publish artifactory build + sh './scripts/publish_buildinfo.sh' } } } @@ -278,10 +279,8 @@ void runTests() { } void publishStaging() { - withCredentials([usernamePassword(credentialsId: 'artifactory', passwordVariable: 'TWINE_PASSWORD', usernameVariable: 'TWINE_USERNAME')]) { - withEnv(["TWINE_REPOSITORY_URL=${env.STAGE_ROOT}pypi/cloudant-sdks-pypi-local"]) { - publishTwine() - } + withEnv(["TWINE_REPOSITORY_URL=${env.STAGE_ROOT}pypi/cloudant-sdks-pypi-local", 'TWINE_USERNAME=' + env.ARTIFACTORY_CREDS_USR, 'TWINE_PASSWORD=' + env.ARTIFACTORY_CREDS_PSW]) { + publishTwine() } } diff --git a/scripts/publish_buildinfo.sh b/scripts/publish_buildinfo.sh index c757ef08..f4ab1f46 100755 --- a/scripts/publish_buildinfo.sh +++ b/scripts/publish_buildinfo.sh @@ -5,7 +5,7 @@ file="/tmp/build.json" tmpfile="/tmp/build.json.tmp" printf "Current values set:\n Module ID: $MODULE_ID\nBuild name: $BUILD_NAME\nBuild URL: $BUILD_URL\nBuild timestamp: $BUILD_TIMESTAMP\nBuild number: $BUILD_NUMBER\n" printf "Artifactory URL: $ARTIFACT_URL\n" -ARTIFACTS=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_APIKEY" "$ARTIFACT_URL") +ARTIFACTS=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" "$ARTIFACT_URL") HAS_CHILDREN_RESULT=$(echo $ARTIFACTS | jq 'has("children")') # if 'children' array exists then grab all aritfact uris, else grab parent uri if [[ "$HAS_CHILDREN_RESULT" == "false" ]]; then @@ -22,14 +22,14 @@ fi # create new (or write over existing) build.json file echo -n "" > $file # get current published build -CURRENT_BUILD=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_APIKEY" "$STAGE_ROOT"build/"$BUILD_NAME"/"$BUILD_NUMBER") +CURRENT_BUILD=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" "$STAGE_ROOT"build/"$BUILD_NAME"/"$BUILD_NUMBER") echo $CURRENT_BUILD CURRENT_BUILD_INFO=$(echo "$CURRENT_BUILD" | jq -r '.buildInfo') echo $CURRENT_BUILD_INFO | tee $file # put build name, number, and url on published artifacts URL_WITH_PROPS="$ARTIFACT_URL?properties=build.name=$BUILD_NAME;build.number=$BUILD_NUMBER;build.url=$BUILD_URL" -curl -i -X PUT -H "X-JFrog-Art-Api:$ARTIFACTORY_APIKEY" "$URL_WITH_PROPS" +curl -i -X PUT -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" "$URL_WITH_PROPS" # add artifact type and module id to build info file jq --arg type "$TYPE" '.type = $type' $file > $tmpfile && mv $tmpfile $file @@ -43,7 +43,7 @@ for artifact in $ARTIFACTS_URI; do else ARTIFACT_INFO_URL="$ARTIFACT_URL$artifact" fi - GET_ARTIFACT=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_APIKEY" $ARTIFACT_INFO_URL | jq -r .checksums) + GET_ARTIFACT=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" $ARTIFACT_INFO_URL | jq -r .checksums) MD5=$(echo $GET_ARTIFACT | jq -r .md5) SHA1=$(echo $GET_ARTIFACT | jq -r .sha1) NAME="${artifact#*/}" @@ -57,4 +57,4 @@ else exit 1 fi -curl -i -X PUT -H "X-JFrog-Art-Api:$ARTIFACTORY_APIKEY" -H "Content-Type: application/json" "$STAGE_ROOT"build --upload-file $file +curl -i -X PUT -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" -H "Content-Type: application/json" "$STAGE_ROOT"build --upload-file $file From 4aa2b6b62e140a23d4212cd0d268684d23be7218 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 17:01:31 +0000 Subject: [PATCH 043/669] build(deps-dev): Bump tox from 3.27.0 to 3.27.1 Bumps [tox](https://github.com/tox-dev/tox) from 3.27.0 to 3.27.1. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.27.0...3.27.1) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 19a997f1..da0d8ce4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.5 -tox==3.27.0 +tox==3.27.1 pytest-rerunfailures==10.2 # code coverage From d6364d9aa2f6848a9ba667930db511e51dad1b00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 10:04:34 +0000 Subject: [PATCH 044/669] build(deps-dev): Bump pylint from 2.15.5 to 2.15.6 (#358) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.5 to 2.15.6. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.5...v2.15.6) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index da0d8ce4..dcdc9fcc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 -pylint==2.15.5 +pylint==2.15.6 tox==3.27.1 pytest-rerunfailures==10.2 From 652d08703c10088d145bb351fad78d670502bc40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 09:09:16 +0000 Subject: [PATCH 045/669] build(deps-dev): Bump pytest-rerunfailures from 10.2 to 10.3 (#359) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 10.2 to 10.3. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/10.2...10.3) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dcdc9fcc..374a7e96 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.6 tox==3.27.1 -pytest-rerunfailures==10.2 +pytest-rerunfailures==10.3 # code coverage coverage==6.5.0 From e76845eff587d8121b243c6506fa8f3d294fedbf Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 28 Nov 2022 14:49:10 +0000 Subject: [PATCH 046/669] ci(generated): move customizePublishInfo Generated SDK source code using: - Generator version 3.60.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 9517fa5 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 83 +++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5a2b3b84..de0ce925 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,8 +67,15 @@ pipeline { } steps { bumpVersion(true) - publishStaging() - publishArtifactoryBuildInfo() + customizePublishingInfo() + withEnv(["LIB_NAME=${libName}", + "TYPE=${buildType}", + "ARTIFACT_URL=${artifactUrl}", + "MODULE_ID=${moduleId}", + "BUILD_NAME=${env.JOB_NAME}"]) { + publishStaging() + publishArtifactoryBuildInfo() + } } // This post stage resets the temporary version bump used to publish to staging post { @@ -81,16 +88,7 @@ pipeline { steps { script { buildResults = null - prefixedSdkVersion = '' - if (libName == 'go') { - prefixedSdkVersion = "@$commitHash" - } else if (libName == 'node') { - prefixedSdkVersion = "@${env.NEW_SDK_VERSION}" - } else if (libName == 'python') { - prefixedSdkVersion = "==${env.NEW_SDK_VERSION}" - } else if (libName == 'java') { - prefixedSdkVersion = "${env.NEW_SDK_VERSION}" - } + prefixedSdkVersion = "${testVersionPrefix}${env.NEW_SDK_VERSION}" // For standard builds attempt to run on a matching env.BRANCH_NAME branch first and if it doesn't exist // then fallback to TARGET_GAUGE_RELEASE_BRANCH_NAME if set or env.TARGET_GAUGE_DEFAULT_BRANCH_NAME. @@ -158,18 +156,19 @@ pipeline { } } +// Note default values cannot be assigned here. def libName def commitHash def bumpVersion def customizeVersion def getNewVersion -// Default no-op, may be overridden -def customizePublishingInfo = {} +def testVersionPrefix +def customizePublishingInfo def publishArtifactoryBuildInfo -def artifactUrl = '' -def moduleId = '' -def buildName = '' -def buildType = '' +def publishArtifactoryBuildInfoScript +def artifactUrl +def moduleId +def buildType void defaultInit() { // Default to using bump2version @@ -221,33 +220,27 @@ void defaultInit() { semverFormatVersion } - publishArtifactoryBuildInfo = { - // create custom build name e.g. cloudant-sdks/cloudant-node-sdk/generated-branch - buildName = "${env.JOB_NAME}" - buildType = 'GENERIC' // default, may be overridden - customizePublishingInfo() - withEnv(["LIB_NAME=${libName}", - "TYPE=${buildType}", - "ARTIFACT_URL=${artifactUrl}", - "MODULE_ID=${moduleId}", - "BUILD_NAME=${buildName}"]) { - // create base build info - rtBuildInfo ( - buildName: "${env.BUILD_NAME}", - buildNumber: "${env.BUILD_NUMBER}", - includeEnvPatterns: ['BRANCH_NAME'], - maxDays: 90, - deleteBuildArtifacts: true, - asyncBuildRetention: true - ) - rtPublishBuildInfo ( - buildName: "${env.BUILD_NAME}", - buildNumber: "${env.BUILD_NUMBER}", - serverId: 'taas-artifactory-upload' - ) + publishArtifactoryBuildInfoScript = { // put build info on module/artifacts then overwrite and publish artifactory build sh './scripts/publish_buildinfo.sh' - } + } + + publishArtifactoryBuildInfo = { + // create base build info + rtBuildInfo ( + buildName: "${env.BUILD_NAME}", + buildNumber: "${env.BUILD_NUMBER}", + includeEnvPatterns: ['BRANCH_NAME'], + maxDays: 90, + deleteBuildArtifacts: true, + asyncBuildRetention: true + ) + rtPublishBuildInfo ( + buildName: "${env.BUILD_NAME}", + buildNumber: "${env.BUILD_NUMBER}", + serverId: 'taas-artifactory-upload' + ) + publishArtifactoryBuildInfoScript() } } @@ -260,14 +253,16 @@ void defaultInit() { // + other customizations void applyCustomizations() { libName = 'python' + testVersionPrefix = '==' customizeVersion = { semverFormatVersion -> // Use a python format version semverFormatVersion.replace('-a','a').replace('-b','b').replace('-rc', 'rc').replace('-','.') } customizePublishingInfo = { // Set the publishing names and types + buildType = 'GENERIC' artifactUrl = "${STAGE_ROOT}storage/cloudant-sdks-pypi-local/ibmcloudant/${env.NEW_SDK_VERSION}" - moduleId = "ibmcloudant-${env.NEW_SDK_VERSION}" + moduleId = "ibmcloudant:${env.NEW_SDK_VERSION}" } } From 5b266c60dc88d321af868f707e77b06d5b49a36e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 28 Nov 2022 16:23:23 +0000 Subject: [PATCH 047/669] chore(generated): use artifactory pip index when running `tox` (#361) Generated SDK source code using: - Generator version 3.60.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 569ef32 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index de0ce925..90cb76e2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -268,6 +268,7 @@ void applyCustomizations() { void runTests() { sh ''' + export PIP_INDEX_URL=https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL_DOWN##'https://'}/api/pypi/cloudant-sdks-pypi-virtual/simple . /home/jenkins/pythonvenv/bin/activate python3 -m tox -e py310 ''' From 451da32561645887cd6ac837e176e58c8a546b8e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 29 Nov 2022 16:33:34 +0000 Subject: [PATCH 048/669] chore(generated): update generator version (#362) Generated SDK source code using: - Generator version 3.62.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 784eca9 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 508 ++++++++++++++++++++++++++++++------- 1 file changed, 410 insertions(+), 98 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index c48848f5..535d9c09 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -7974,7 +7974,7 @@ def from_dict(cls, _dict: Dict) -> 'AllDocsQueriesResult': """Initialize a AllDocsQueriesResult object from a json dictionary.""" args = {} if 'results' in _dict: - args['results'] = [AllDocsResult.from_dict(x) for x in _dict.get('results')] + args['results'] = [AllDocsResult.from_dict(v) for v in _dict.get('results')] else: raise ValueError('Required property \'results\' not present in AllDocsQueriesResult JSON') return cls(**args) @@ -7988,7 +7988,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'results') and self.results is not None: - _dict['results'] = [x.to_dict() for x in self.results] + results_list = [] + for v in self.results: + if isinstance(v, dict): + results_list.append(v) + else: + results_list.append(v.to_dict()) + _dict['results'] = results_list return _dict def _to_dict(self): @@ -8218,7 +8224,7 @@ def from_dict(cls, _dict: Dict) -> 'AllDocsResult': else: raise ValueError('Required property \'total_rows\' not present in AllDocsResult JSON') if 'rows' in _dict: - args['rows'] = [DocsResultRow.from_dict(x) for x in _dict.get('rows')] + args['rows'] = [DocsResultRow.from_dict(v) for v in _dict.get('rows')] else: raise ValueError('Required property \'rows\' not present in AllDocsResult JSON') if 'update_seq' in _dict: @@ -8236,7 +8242,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'total_rows') and self.total_rows is not None: _dict['total_rows'] = self.total_rows if hasattr(self, 'rows') and self.rows is not None: - _dict['rows'] = [x.to_dict() for x in self.rows] + rows_list = [] + for v in self.rows: + if isinstance(v, dict): + rows_list.append(v) + else: + rows_list.append(v.to_dict()) + _dict['rows'] = rows_list if hasattr(self, 'update_seq') and self.update_seq is not None: _dict['update_seq'] = self.update_seq return _dict @@ -8447,7 +8459,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'stopwords') and self.stopwords is not None: _dict['stopwords'] = self.stopwords if hasattr(self, 'fields') and self.fields is not None: - _dict['fields'] = {k : v.to_dict() for k, v in self.fields.items()} + fields_map = {} + for k, v in self.fields.items(): + if isinstance(v, dict): + fields_map[k] = v + else: + fields_map[k] = v.to_dict() + _dict['fields'] = fields_map return _dict def _to_dict(self): @@ -8771,7 +8789,7 @@ def from_dict(cls, _dict: Dict) -> 'BulkDocs': """Initialize a BulkDocs object from a json dictionary.""" args = {} if 'docs' in _dict: - args['docs'] = [Document.from_dict(x) for x in _dict.get('docs')] + args['docs'] = [Document.from_dict(v) for v in _dict.get('docs')] else: raise ValueError('Required property \'docs\' not present in BulkDocs JSON') if 'new_edits' in _dict: @@ -8787,7 +8805,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'docs') and self.docs is not None: - _dict['docs'] = [x.to_dict() for x in self.docs] + docs_list = [] + for v in self.docs: + if isinstance(v, dict): + docs_list.append(v) + else: + docs_list.append(v.to_dict()) + _dict['docs'] = docs_list if hasattr(self, 'new_edits') and self.new_edits is not None: _dict['new_edits'] = self.new_edits return _dict @@ -8906,7 +8930,7 @@ def from_dict(cls, _dict: Dict) -> 'BulkGetResult': """Initialize a BulkGetResult object from a json dictionary.""" args = {} if 'results' in _dict: - args['results'] = [BulkGetResultItem.from_dict(x) for x in _dict.get('results')] + args['results'] = [BulkGetResultItem.from_dict(v) for v in _dict.get('results')] else: raise ValueError('Required property \'results\' not present in BulkGetResult JSON') return cls(**args) @@ -8920,7 +8944,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'results') and self.results is not None: - _dict['results'] = [x.to_dict() for x in self.results] + results_list = [] + for v in self.results: + if isinstance(v, dict): + results_list.append(v) + else: + results_list.append(v.to_dict()) + _dict['results'] = results_list return _dict def _to_dict(self): @@ -8984,9 +9014,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'error') and self.error is not None: - _dict['error'] = self.error.to_dict() + if isinstance(self.error, dict): + _dict['error'] = self.error + else: + _dict['error'] = self.error.to_dict() if hasattr(self, 'ok') and self.ok is not None: - _dict['ok'] = self.ok.to_dict() + if isinstance(self.ok, dict): + _dict['ok'] = self.ok + else: + _dict['ok'] = self.ok.to_dict() return _dict def _to_dict(self): @@ -9034,7 +9070,7 @@ def from_dict(cls, _dict: Dict) -> 'BulkGetResultItem': """Initialize a BulkGetResultItem object from a json dictionary.""" args = {} if 'docs' in _dict: - args['docs'] = [BulkGetResultDocument.from_dict(x) for x in _dict.get('docs')] + args['docs'] = [BulkGetResultDocument.from_dict(v) for v in _dict.get('docs')] else: raise ValueError('Required property \'docs\' not present in BulkGetResultItem JSON') if 'id' in _dict: @@ -9052,7 +9088,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'docs') and self.docs is not None: - _dict['docs'] = [x.to_dict() for x in self.docs] + docs_list = [] + for v in self.docs: + if isinstance(v, dict): + docs_list.append(v) + else: + docs_list.append(v.to_dict()) + _dict['docs'] = docs_list if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id return _dict @@ -9121,9 +9163,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'current') and self.current is not None: - _dict['current'] = self.current.to_dict() + if isinstance(self.current, dict): + _dict['current'] = self.current + else: + _dict['current'] = self.current.to_dict() if hasattr(self, 'target') and self.target is not None: - _dict['target'] = self.target.to_dict() + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -9182,7 +9230,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'throughput') and self.throughput is not None: - _dict['throughput'] = self.throughput.to_dict() + if isinstance(self.throughput, dict): + _dict['throughput'] = self.throughput + else: + _dict['throughput'] = self.throughput.to_dict() return _dict def _to_dict(self): @@ -9241,7 +9292,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'throughput') and self.throughput is not None: - _dict['throughput'] = self.throughput.to_dict() + if isinstance(self.throughput, dict): + _dict['throughput'] = self.throughput + else: + _dict['throughput'] = self.throughput.to_dict() return _dict def _to_dict(self): @@ -9355,7 +9409,7 @@ def from_dict(cls, _dict: Dict) -> 'ChangesResult': else: raise ValueError('Required property \'pending\' not present in ChangesResult JSON') if 'results' in _dict: - args['results'] = [ChangesResultItem.from_dict(x) for x in _dict.get('results')] + args['results'] = [ChangesResultItem.from_dict(v) for v in _dict.get('results')] else: raise ValueError('Required property \'results\' not present in ChangesResult JSON') return cls(**args) @@ -9373,7 +9427,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'pending') and self.pending is not None: _dict['pending'] = self.pending if hasattr(self, 'results') and self.results is not None: - _dict['results'] = [x.to_dict() for x in self.results] + results_list = [] + for v in self.results: + if isinstance(v, dict): + results_list.append(v) + else: + results_list.append(v.to_dict()) + _dict['results'] = results_list return _dict def _to_dict(self): @@ -9433,7 +9493,7 @@ def from_dict(cls, _dict: Dict) -> 'ChangesResultItem': """Initialize a ChangesResultItem object from a json dictionary.""" args = {} if 'changes' in _dict: - args['changes'] = [Change.from_dict(x) for x in _dict.get('changes')] + args['changes'] = [Change.from_dict(v) for v in _dict.get('changes')] else: raise ValueError('Required property \'changes\' not present in ChangesResultItem JSON') if 'deleted' in _dict: @@ -9459,11 +9519,20 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'changes') and self.changes is not None: - _dict['changes'] = [x.to_dict() for x in self.changes] + changes_list = [] + for v in self.changes: + if isinstance(v, dict): + changes_list.append(v) + else: + changes_list.append(v.to_dict()) + _dict['changes'] = changes_list if hasattr(self, 'deleted') and self.deleted is not None: _dict['deleted'] = self.deleted if hasattr(self, 'doc') and self.doc is not None: - _dict['doc'] = self.doc.to_dict() + if isinstance(self.doc, dict): + _dict['doc'] = self.doc + else: + _dict['doc'] = self.doc.to_dict() if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'seq') and self.seq is not None: @@ -9686,7 +9755,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'throughput') and self.throughput is not None: - _dict['throughput'] = self.throughput.to_dict() + if isinstance(self.throughput, dict): + _dict['throughput'] = self.throughput + else: + _dict['throughput'] = self.throughput.to_dict() return _dict def _to_dict(self): @@ -9926,7 +9998,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'cluster') and self.cluster is not None: - _dict['cluster'] = self.cluster.to_dict() + if isinstance(self.cluster, dict): + _dict['cluster'] = self.cluster + else: + _dict['cluster'] = self.cluster.to_dict() if hasattr(self, 'committed_update_seq') and self.committed_update_seq is not None: _dict['committed_update_seq'] = self.committed_update_seq if hasattr(self, 'compact_running') and self.compact_running is not None: @@ -9944,9 +10019,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'engine') and self.engine is not None: _dict['engine'] = self.engine if hasattr(self, 'props') and self.props is not None: - _dict['props'] = self.props.to_dict() + if isinstance(self.props, dict): + _dict['props'] = self.props + else: + _dict['props'] = self.props.to_dict() if hasattr(self, 'sizes') and self.sizes is not None: - _dict['sizes'] = self.sizes.to_dict() + if isinstance(self.sizes, dict): + _dict['sizes'] = self.sizes + else: + _dict['sizes'] = self.sizes.to_dict() if hasattr(self, 'update_seq') and self.update_seq is not None: _dict['update_seq'] = self.update_seq if hasattr(self, 'uuid') and self.uuid is not None: @@ -10234,7 +10315,7 @@ def from_dict(cls, _dict: Dict) -> 'DbUpdates': else: raise ValueError('Required property \'last_seq\' not present in DbUpdates JSON') if 'results' in _dict: - args['results'] = [DbEvent.from_dict(x) for x in _dict.get('results')] + args['results'] = [DbEvent.from_dict(v) for v in _dict.get('results')] else: raise ValueError('Required property \'results\' not present in DbUpdates JSON') return cls(**args) @@ -10250,7 +10331,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'last_seq') and self.last_seq is not None: _dict['last_seq'] = self.last_seq if hasattr(self, 'results') and self.results is not None: - _dict['results'] = [x.to_dict() for x in self.results] + results_list = [] + for v in self.results: + if isinstance(v, dict): + results_list.append(v) + else: + results_list.append(v.to_dict()) + _dict['results'] = results_list return _dict def _to_dict(self): @@ -10323,7 +10410,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'error') and self.error is not None: _dict['error'] = self.error if hasattr(self, 'info') and self.info is not None: - _dict['info'] = self.info.to_dict() + if isinstance(self.info, dict): + _dict['info'] = self.info + else: + _dict['info'] = self.info.to_dict() if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key return _dict @@ -10590,7 +10680,7 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': if '_revisions' in _dict: args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) if '_revs_info' in _dict: - args['revs_info'] = [DocumentRevisionStatus.from_dict(x) for x in _dict.get('_revs_info')] + args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] if 'autoupdate' in _dict: args['autoupdate'] = _dict.get('autoupdate') if 'filters' in _dict: @@ -10617,7 +10707,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'attachments') and self.attachments is not None: - _dict['_attachments'] = {k : v.to_dict() for k, v in self.attachments.items()} + _attachments_map = {} + for k, v in self.attachments.items(): + if isinstance(v, dict): + _attachments_map[k] = v + else: + _attachments_map[k] = v.to_dict() + _dict['_attachments'] = _attachments_map if hasattr(self, 'conflicts') and self.conflicts is not None: _dict['_conflicts'] = self.conflicts if hasattr(self, 'deleted') and self.deleted is not None: @@ -10631,23 +10727,47 @@ def to_dict(self) -> Dict: if hasattr(self, 'rev') and self.rev is not None: _dict['_rev'] = self.rev if hasattr(self, 'revisions') and self.revisions is not None: - _dict['_revisions'] = self.revisions.to_dict() + if isinstance(self.revisions, dict): + _dict['_revisions'] = self.revisions + else: + _dict['_revisions'] = self.revisions.to_dict() if hasattr(self, 'revs_info') and self.revs_info is not None: - _dict['_revs_info'] = [x.to_dict() for x in self.revs_info] + _revs_info_list = [] + for v in self.revs_info: + if isinstance(v, dict): + _revs_info_list.append(v) + else: + _revs_info_list.append(v.to_dict()) + _dict['_revs_info'] = _revs_info_list if hasattr(self, 'autoupdate') and self.autoupdate is not None: _dict['autoupdate'] = self.autoupdate if hasattr(self, 'filters') and self.filters is not None: _dict['filters'] = self.filters if hasattr(self, 'indexes') and self.indexes is not None: - _dict['indexes'] = {k : v.to_dict() for k, v in self.indexes.items()} + indexes_map = {} + for k, v in self.indexes.items(): + if isinstance(v, dict): + indexes_map[k] = v + else: + indexes_map[k] = v.to_dict() + _dict['indexes'] = indexes_map if hasattr(self, 'language') and self.language is not None: _dict['language'] = self.language if hasattr(self, 'options') and self.options is not None: - _dict['options'] = self.options.to_dict() + if isinstance(self.options, dict): + _dict['options'] = self.options + else: + _dict['options'] = self.options.to_dict() if hasattr(self, 'validate_doc_update') and self.validate_doc_update is not None: _dict['validate_doc_update'] = self.validate_doc_update if hasattr(self, 'views') and self.views is not None: - _dict['views'] = {k : v.to_dict() for k, v in self.views.items()} + views_map = {} + for k, v in self.views.items(): + if isinstance(v, dict): + views_map[k] = v + else: + views_map[k] = v.to_dict() + _dict['views'] = views_map for _key in [k for k in vars(self).keys() if k not in DesignDocument._properties]: _dict[_key] = getattr(self, _key) return _dict @@ -10732,7 +10852,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'view_index') and self.view_index is not None: - _dict['view_index'] = self.view_index.to_dict() + if isinstance(self.view_index, dict): + _dict['view_index'] = self.view_index + else: + _dict['view_index'] = self.view_index.to_dict() return _dict def _to_dict(self): @@ -10921,7 +11044,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'signature') and self.signature is not None: _dict['signature'] = self.signature if hasattr(self, 'sizes') and self.sizes is not None: - _dict['sizes'] = self.sizes.to_dict() + if isinstance(self.sizes, dict): + _dict['sizes'] = self.sizes + else: + _dict['sizes'] = self.sizes.to_dict() if hasattr(self, 'updater_running') and self.updater_running is not None: _dict['updater_running'] = self.updater_running if hasattr(self, 'waiting_clients') and self.waiting_clients is not None: @@ -11093,13 +11219,19 @@ def to_dict(self) -> Dict: if hasattr(self, 'reason') and self.reason is not None: _dict['reason'] = self.reason if hasattr(self, 'doc') and self.doc is not None: - _dict['doc'] = self.doc.to_dict() + if isinstance(self.doc, dict): + _dict['doc'] = self.doc + else: + _dict['doc'] = self.doc.to_dict() if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value.to_dict() + if isinstance(self.value, dict): + _dict['value'] = self.value + else: + _dict['value'] = self.value.to_dict() return _dict def _to_dict(self): @@ -11276,7 +11408,7 @@ def from_dict(cls, _dict: Dict) -> 'Document': if '_revisions' in _dict: args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) if '_revs_info' in _dict: - args['revs_info'] = [DocumentRevisionStatus.from_dict(x) for x in _dict.get('_revs_info')] + args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -11289,7 +11421,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'attachments') and self.attachments is not None: - _dict['_attachments'] = {k : v.to_dict() for k, v in self.attachments.items()} + _attachments_map = {} + for k, v in self.attachments.items(): + if isinstance(v, dict): + _attachments_map[k] = v + else: + _attachments_map[k] = v.to_dict() + _dict['_attachments'] = _attachments_map if hasattr(self, 'conflicts') and self.conflicts is not None: _dict['_conflicts'] = self.conflicts if hasattr(self, 'deleted') and self.deleted is not None: @@ -11303,9 +11441,18 @@ def to_dict(self) -> Dict: if hasattr(self, 'rev') and self.rev is not None: _dict['_rev'] = self.rev if hasattr(self, 'revisions') and self.revisions is not None: - _dict['_revisions'] = self.revisions.to_dict() + if isinstance(self.revisions, dict): + _dict['_revisions'] = self.revisions + else: + _dict['_revisions'] = self.revisions.to_dict() if hasattr(self, 'revs_info') and self.revs_info is not None: - _dict['_revs_info'] = [x.to_dict() for x in self.revs_info] + _revs_info_list = [] + for v in self.revs_info: + if isinstance(v, dict): + _revs_info_list.append(v) + else: + _revs_info_list.append(v.to_dict()) + _dict['_revs_info'] = _revs_info_list for _key in [k for k in vars(self).keys() if k not in Document._properties]: _dict[_key] = getattr(self, _key) return _dict @@ -11840,13 +11987,19 @@ def to_dict(self) -> Dict: if hasattr(self, 'fields') and self.fields is not None: _dict['fields'] = self.fields if hasattr(self, 'index') and self.index is not None: - _dict['index'] = self.index.to_dict() + if isinstance(self.index, dict): + _dict['index'] = self.index + else: + _dict['index'] = self.index.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'opts') and self.opts is not None: _dict['opts'] = self.opts if hasattr(self, 'range') and self.range is not None: - _dict['range'] = self.range.to_dict() + if isinstance(self.range, dict): + _dict['range'] = self.range + else: + _dict['range'] = self.range.to_dict() if hasattr(self, 'selector') and self.selector is not None: _dict['selector'] = self.selector if hasattr(self, 'skip') and self.skip is not None: @@ -11974,7 +12127,7 @@ def from_dict(cls, _dict: Dict) -> 'FindResult': else: raise ValueError('Required property \'bookmark\' not present in FindResult JSON') if 'docs' in _dict: - args['docs'] = [Document.from_dict(x) for x in _dict.get('docs')] + args['docs'] = [Document.from_dict(v) for v in _dict.get('docs')] else: raise ValueError('Required property \'docs\' not present in FindResult JSON') if 'execution_stats' in _dict: @@ -11994,9 +12147,18 @@ def to_dict(self) -> Dict: if hasattr(self, 'bookmark') and self.bookmark is not None: _dict['bookmark'] = self.bookmark if hasattr(self, 'docs') and self.docs is not None: - _dict['docs'] = [x.to_dict() for x in self.docs] + docs_list = [] + for v in self.docs: + if isinstance(v, dict): + docs_list.append(v) + else: + docs_list.append(v.to_dict()) + _dict['docs'] = docs_list if hasattr(self, 'execution_stats') and self.execution_stats is not None: - _dict['execution_stats'] = self.execution_stats.to_dict() + if isinstance(self.execution_stats, dict): + _dict['execution_stats'] = self.execution_stats + else: + _dict['execution_stats'] = self.execution_stats.to_dict() if hasattr(self, 'warning') and self.warning is not None: _dict['warning'] = self.warning return _dict @@ -12153,7 +12315,7 @@ def from_dict(cls, _dict: Dict) -> 'IndexDefinition': if 'default_field' in _dict: args['default_field'] = IndexTextOperatorDefaultField.from_dict(_dict.get('default_field')) if 'fields' in _dict: - args['fields'] = [IndexField.from_dict(x) for x in _dict.get('fields')] + args['fields'] = [IndexField.from_dict(v) for v in _dict.get('fields')] if 'index_array_lengths' in _dict: args['index_array_lengths'] = _dict.get('index_array_lengths') if 'partial_filter_selector' in _dict: @@ -12169,11 +12331,23 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'default_analyzer') and self.default_analyzer is not None: - _dict['default_analyzer'] = self.default_analyzer.to_dict() + if isinstance(self.default_analyzer, dict): + _dict['default_analyzer'] = self.default_analyzer + else: + _dict['default_analyzer'] = self.default_analyzer.to_dict() if hasattr(self, 'default_field') and self.default_field is not None: - _dict['default_field'] = self.default_field.to_dict() + if isinstance(self.default_field, dict): + _dict['default_field'] = self.default_field + else: + _dict['default_field'] = self.default_field.to_dict() if hasattr(self, 'fields') and self.fields is not None: - _dict['fields'] = [x.to_dict() for x in self.fields] + fields_list = [] + for v in self.fields: + if isinstance(v, dict): + fields_list.append(v) + else: + fields_list.append(v.to_dict()) + _dict['fields'] = fields_list if hasattr(self, 'index_array_lengths') and self.index_array_lengths is not None: _dict['index_array_lengths'] = self.index_array_lengths if hasattr(self, 'partial_filter_selector') and self.partial_filter_selector is not None: @@ -12368,7 +12542,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'ddoc') and self.ddoc is not None: _dict['ddoc'] = self.ddoc if hasattr(self, 'def_') and self.def_ is not None: - _dict['def'] = self.def_.to_dict() + if isinstance(self.def_, dict): + _dict['def'] = self.def_ + else: + _dict['def'] = self.def_.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'type') and self.type is not None: @@ -12531,7 +12708,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'analyzer') and self.analyzer is not None: - _dict['analyzer'] = self.analyzer.to_dict() + if isinstance(self.analyzer, dict): + _dict['analyzer'] = self.analyzer + else: + _dict['analyzer'] = self.analyzer.to_dict() if hasattr(self, 'enabled') and self.enabled is not None: _dict['enabled'] = self.enabled return _dict @@ -12583,7 +12763,7 @@ def from_dict(cls, _dict: Dict) -> 'IndexesInformation': else: raise ValueError('Required property \'total_rows\' not present in IndexesInformation JSON') if 'indexes' in _dict: - args['indexes'] = [IndexInformation.from_dict(x) for x in _dict.get('indexes')] + args['indexes'] = [IndexInformation.from_dict(v) for v in _dict.get('indexes')] else: raise ValueError('Required property \'indexes\' not present in IndexesInformation JSON') return cls(**args) @@ -12599,7 +12779,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'total_rows') and self.total_rows is not None: _dict['total_rows'] = self.total_rows if hasattr(self, 'indexes') and self.indexes is not None: - _dict['indexes'] = [x.to_dict() for x in self.indexes] + indexes_list = [] + for v in self.indexes: + if isinstance(v, dict): + indexes_list.append(v) + else: + indexes_list.append(v.to_dict()) + _dict['indexes'] = indexes_list return _dict def _to_dict(self): @@ -12831,9 +13017,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'partition') and self.partition is not None: _dict['partition'] = self.partition if hasattr(self, 'partitioned_indexes') and self.partitioned_indexes is not None: - _dict['partitioned_indexes'] = self.partitioned_indexes.to_dict() + if isinstance(self.partitioned_indexes, dict): + _dict['partitioned_indexes'] = self.partitioned_indexes + else: + _dict['partitioned_indexes'] = self.partitioned_indexes.to_dict() if hasattr(self, 'sizes') and self.sizes is not None: - _dict['sizes'] = self.sizes.to_dict() + if isinstance(self.sizes, dict): + _dict['sizes'] = self.sizes + else: + _dict['sizes'] = self.sizes.to_dict() return _dict def _to_dict(self): @@ -12904,7 +13096,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'count') and self.count is not None: _dict['count'] = self.count if hasattr(self, 'indexes') and self.indexes is not None: - _dict['indexes'] = self.indexes.to_dict() + if isinstance(self.indexes, dict): + _dict['indexes'] = self.indexes + else: + _dict['indexes'] = self.indexes.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict @@ -13184,7 +13379,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'auth') and self.auth is not None: - _dict['auth'] = self.auth.to_dict() + if isinstance(self.auth, dict): + _dict['auth'] = self.auth + else: + _dict['auth'] = self.auth.to_dict() if hasattr(self, 'headers_') and self.headers_ is not None: _dict['headers'] = self.headers_ if hasattr(self, 'url') and self.url is not None: @@ -13253,9 +13451,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'basic') and self.basic is not None: - _dict['basic'] = self.basic.to_dict() + if isinstance(self.basic, dict): + _dict['basic'] = self.basic + else: + _dict['basic'] = self.basic.to_dict() if hasattr(self, 'iam') and self.iam is not None: - _dict['iam'] = self.iam.to_dict() + if isinstance(self.iam, dict): + _dict['iam'] = self.iam + else: + _dict['iam'] = self.iam.to_dict() return _dict def _to_dict(self): @@ -13707,7 +13911,7 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': if '_revisions' in _dict: args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) if '_revs_info' in _dict: - args['revs_info'] = [DocumentRevisionStatus.from_dict(x) for x in _dict.get('_revs_info')] + args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] if 'cancel' in _dict: args['cancel'] = _dict.get('cancel') if 'checkpoint_interval' in _dict: @@ -13772,7 +13976,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'attachments') and self.attachments is not None: - _dict['_attachments'] = {k : v.to_dict() for k, v in self.attachments.items()} + _attachments_map = {} + for k, v in self.attachments.items(): + if isinstance(v, dict): + _attachments_map[k] = v + else: + _attachments_map[k] = v.to_dict() + _dict['_attachments'] = _attachments_map if hasattr(self, 'conflicts') and self.conflicts is not None: _dict['_conflicts'] = self.conflicts if hasattr(self, 'deleted') and self.deleted is not None: @@ -13786,9 +13996,18 @@ def to_dict(self) -> Dict: if hasattr(self, 'rev') and self.rev is not None: _dict['_rev'] = self.rev if hasattr(self, 'revisions') and self.revisions is not None: - _dict['_revisions'] = self.revisions.to_dict() + if isinstance(self.revisions, dict): + _dict['_revisions'] = self.revisions + else: + _dict['_revisions'] = self.revisions.to_dict() if hasattr(self, 'revs_info') and self.revs_info is not None: - _dict['_revs_info'] = [x.to_dict() for x in self.revs_info] + _revs_info_list = [] + for v in self.revs_info: + if isinstance(v, dict): + _revs_info_list.append(v) + else: + _revs_info_list.append(v.to_dict()) + _dict['_revs_info'] = _revs_info_list if hasattr(self, 'cancel') and self.cancel is not None: _dict['cancel'] = self.cancel if hasattr(self, 'checkpoint_interval') and self.checkpoint_interval is not None: @@ -13800,7 +14019,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'create_target') and self.create_target is not None: _dict['create_target'] = self.create_target if hasattr(self, 'create_target_params') and self.create_target_params is not None: - _dict['create_target_params'] = self.create_target_params.to_dict() + if isinstance(self.create_target_params, dict): + _dict['create_target_params'] = self.create_target_params + else: + _dict['create_target_params'] = self.create_target_params.to_dict() if hasattr(self, 'doc_ids') and self.doc_ids is not None: _dict['doc_ids'] = self.doc_ids if hasattr(self, 'filter') and self.filter is not None: @@ -13818,11 +14040,17 @@ def to_dict(self) -> Dict: if hasattr(self, 'socket_options') and self.socket_options is not None: _dict['socket_options'] = self.socket_options if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source.to_dict() + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() if hasattr(self, 'source_proxy') and self.source_proxy is not None: _dict['source_proxy'] = self.source_proxy if hasattr(self, 'target') and self.target is not None: - _dict['target'] = self.target.to_dict() + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() if hasattr(self, 'target_proxy') and self.target_proxy is not None: _dict['target_proxy'] = self.target_proxy if hasattr(self, 'use_bulk_get') and self.use_bulk_get is not None: @@ -13830,7 +14058,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'use_checkpoints') and self.use_checkpoints is not None: _dict['use_checkpoints'] = self.use_checkpoints if hasattr(self, 'user_ctx') and self.user_ctx is not None: - _dict['user_ctx'] = self.user_ctx.to_dict() + if isinstance(self.user_ctx, dict): + _dict['user_ctx'] = self.user_ctx + else: + _dict['user_ctx'] = self.user_ctx.to_dict() if hasattr(self, 'winning_revs_only') and self.winning_revs_only is not None: _dict['winning_revs_only'] = self.winning_revs_only if hasattr(self, 'worker_batch_size') and self.worker_batch_size is not None: @@ -14039,7 +14270,7 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerDocsResult': else: raise ValueError('Required property \'total_rows\' not present in SchedulerDocsResult JSON') if 'docs' in _dict: - args['docs'] = [SchedulerDocument.from_dict(x) for x in _dict.get('docs')] + args['docs'] = [SchedulerDocument.from_dict(v) for v in _dict.get('docs')] else: raise ValueError('Required property \'docs\' not present in SchedulerDocsResult JSON') return cls(**args) @@ -14055,7 +14286,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'total_rows') and self.total_rows is not None: _dict['total_rows'] = self.total_rows if hasattr(self, 'docs') and self.docs is not None: - _dict['docs'] = [x.to_dict() for x in self.docs] + docs_list = [] + for v in self.docs: + if isinstance(v, dict): + docs_list.append(v) + else: + docs_list.append(v.to_dict()) + _dict['docs'] = docs_list return _dict def _to_dict(self): @@ -14224,7 +14461,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'info') and self.info is not None: - _dict['info'] = self.info.to_dict() + if isinstance(self.info, dict): + _dict['info'] = self.info + else: + _dict['info'] = self.info.to_dict() if hasattr(self, 'last_updated') and self.last_updated is not None: _dict['last_updated'] = datetime_to_string(self.last_updated) if hasattr(self, 'node') and self.node is not None: @@ -14495,7 +14735,7 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerJob': else: raise ValueError('Required property \'doc_id\' not present in SchedulerJob JSON') if 'history' in _dict: - args['history'] = [SchedulerJobEvent.from_dict(x) for x in _dict.get('history')] + args['history'] = [SchedulerJobEvent.from_dict(v) for v in _dict.get('history')] else: raise ValueError('Required property \'history\' not present in SchedulerJob JSON') if 'id' in _dict: @@ -14545,11 +14785,20 @@ def to_dict(self) -> Dict: if hasattr(self, 'doc_id') and self.doc_id is not None: _dict['doc_id'] = self.doc_id if hasattr(self, 'history') and self.history is not None: - _dict['history'] = [x.to_dict() for x in self.history] + history_list = [] + for v in self.history: + if isinstance(v, dict): + history_list.append(v) + else: + history_list.append(v.to_dict()) + _dict['history'] = history_list if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'info') and self.info is not None: - _dict['info'] = self.info.to_dict() + if isinstance(self.info, dict): + _dict['info'] = self.info + else: + _dict['info'] = self.info.to_dict() if hasattr(self, 'node') and self.node is not None: _dict['node'] = self.node if hasattr(self, 'pid') and self.pid is not None: @@ -14686,7 +14935,7 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerJobsResult': else: raise ValueError('Required property \'total_rows\' not present in SchedulerJobsResult JSON') if 'jobs' in _dict: - args['jobs'] = [SchedulerJob.from_dict(x) for x in _dict.get('jobs')] + args['jobs'] = [SchedulerJob.from_dict(v) for v in _dict.get('jobs')] else: raise ValueError('Required property \'jobs\' not present in SchedulerJobsResult JSON') return cls(**args) @@ -14702,7 +14951,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'total_rows') and self.total_rows is not None: _dict['total_rows'] = self.total_rows if hasattr(self, 'jobs') and self.jobs is not None: - _dict['jobs'] = [x.to_dict() for x in self.jobs] + jobs_list = [] + for v in self.jobs: + if isinstance(v, dict): + jobs_list.append(v) + else: + jobs_list.append(v.to_dict()) + _dict['jobs'] = jobs_list return _dict def _to_dict(self): @@ -14858,7 +15113,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'analyzer') and self.analyzer is not None: - _dict['analyzer'] = self.analyzer.to_dict() + if isinstance(self.analyzer, dict): + _dict['analyzer'] = self.analyzer + else: + _dict['analyzer'] = self.analyzer.to_dict() if hasattr(self, 'index') and self.index is not None: _dict['index'] = self.index return _dict @@ -15036,7 +15294,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'search_index') and self.search_index is not None: - _dict['search_index'] = self.search_index.to_dict() + if isinstance(self.search_index, dict): + _dict['search_index'] = self.search_index + else: + _dict['search_index'] = self.search_index.to_dict() return _dict def _to_dict(self): @@ -15125,9 +15386,9 @@ def from_dict(cls, _dict: Dict) -> 'SearchResult': if 'ranges' in _dict: args['ranges'] = _dict.get('ranges') if 'rows' in _dict: - args['rows'] = [SearchResultRow.from_dict(x) for x in _dict.get('rows')] + args['rows'] = [SearchResultRow.from_dict(v) for v in _dict.get('rows')] if 'groups' in _dict: - args['groups'] = [SearchResultProperties.from_dict(x) for x in _dict.get('groups')] + args['groups'] = [SearchResultProperties.from_dict(v) for v in _dict.get('groups')] return cls(**args) @classmethod @@ -15149,9 +15410,21 @@ def to_dict(self) -> Dict: if hasattr(self, 'ranges') and self.ranges is not None: _dict['ranges'] = self.ranges if hasattr(self, 'rows') and self.rows is not None: - _dict['rows'] = [x.to_dict() for x in self.rows] + rows_list = [] + for v in self.rows: + if isinstance(v, dict): + rows_list.append(v) + else: + rows_list.append(v.to_dict()) + _dict['rows'] = rows_list if hasattr(self, 'groups') and self.groups is not None: - _dict['groups'] = [x.to_dict() for x in self.groups] + groups_list = [] + for v in self.groups: + if isinstance(v, dict): + groups_list.append(v) + else: + groups_list.append(v.to_dict()) + _dict['groups'] = groups_list return _dict def _to_dict(self): @@ -15234,7 +15507,7 @@ def from_dict(cls, _dict: Dict) -> 'SearchResultProperties': if 'ranges' in _dict: args['ranges'] = _dict.get('ranges') if 'rows' in _dict: - args['rows'] = [SearchResultRow.from_dict(x) for x in _dict.get('rows')] + args['rows'] = [SearchResultRow.from_dict(v) for v in _dict.get('rows')] return cls(**args) @classmethod @@ -15256,7 +15529,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'ranges') and self.ranges is not None: _dict['ranges'] = self.ranges if hasattr(self, 'rows') and self.rows is not None: - _dict['rows'] = [x.to_dict() for x in self.rows] + rows_list = [] + for v in self.rows: + if isinstance(v, dict): + rows_list.append(v) + else: + rows_list.append(v.to_dict()) + _dict['rows'] = rows_list return _dict def _to_dict(self): @@ -15338,7 +15617,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'doc') and self.doc is not None: - _dict['doc'] = self.doc.to_dict() + if isinstance(self.doc, dict): + _dict['doc'] = self.doc + else: + _dict['doc'] = self.doc.to_dict() if hasattr(self, 'fields') and self.fields is not None: _dict['fields'] = self.fields if hasattr(self, 'highlights') and self.highlights is not None: @@ -15425,9 +15707,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'admins') and self.admins is not None: - _dict['admins'] = self.admins.to_dict() + if isinstance(self.admins, dict): + _dict['admins'] = self.admins + else: + _dict['admins'] = self.admins.to_dict() if hasattr(self, 'members') and self.members is not None: - _dict['members'] = self.members.to_dict() + if isinstance(self.members, dict): + _dict['members'] = self.members + else: + _dict['members'] = self.members.to_dict() if hasattr(self, 'cloudant') and self.cloudant is not None: _dict['cloudant'] = self.cloudant if hasattr(self, 'couchdb_auth_only') and self.couchdb_auth_only is not None: @@ -15600,7 +15888,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'features') and self.features is not None: _dict['features'] = self.features if hasattr(self, 'vendor') and self.vendor is not None: - _dict['vendor'] = self.vendor.to_dict() + if isinstance(self.vendor, dict): + _dict['vendor'] = self.vendor + else: + _dict['vendor'] = self.vendor.to_dict() if hasattr(self, 'version') and self.version is not None: _dict['version'] = self.version if hasattr(self, 'features_flags') and self.features_flags is not None: @@ -15825,9 +16116,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'ok') and self.ok is not None: _dict['ok'] = self.ok if hasattr(self, 'info') and self.info is not None: - _dict['info'] = self.info.to_dict() + if isinstance(self.info, dict): + _dict['info'] = self.info + else: + _dict['info'] = self.info.to_dict() if hasattr(self, 'user_ctx') and self.user_ctx is not None: - _dict['userCtx'] = self.user_ctx.to_dict() + if isinstance(self.user_ctx, dict): + _dict['userCtx'] = self.user_ctx + else: + _dict['userCtx'] = self.user_ctx.to_dict() return _dict def _to_dict(self): @@ -16243,7 +16540,7 @@ def from_dict(cls, _dict: Dict) -> 'ViewQueriesResult': """Initialize a ViewQueriesResult object from a json dictionary.""" args = {} if 'results' in _dict: - args['results'] = [ViewResult.from_dict(x) for x in _dict.get('results')] + args['results'] = [ViewResult.from_dict(v) for v in _dict.get('results')] else: raise ValueError('Required property \'results\' not present in ViewQueriesResult JSON') return cls(**args) @@ -16257,7 +16554,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'results') and self.results is not None: - _dict['results'] = [x.to_dict() for x in self.results] + results_list = [] + for v in self.results: + if isinstance(v, dict): + results_list.append(v) + else: + results_list.append(v.to_dict()) + _dict['results'] = results_list return _dict def _to_dict(self): @@ -16605,7 +16908,7 @@ def from_dict(cls, _dict: Dict) -> 'ViewResult': if 'update_seq' in _dict: args['update_seq'] = _dict.get('update_seq') if 'rows' in _dict: - args['rows'] = [ViewResultRow.from_dict(x) for x in _dict.get('rows')] + args['rows'] = [ViewResultRow.from_dict(v) for v in _dict.get('rows')] else: raise ValueError('Required property \'rows\' not present in ViewResult JSON') return cls(**args) @@ -16623,7 +16926,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'update_seq') and self.update_seq is not None: _dict['update_seq'] = self.update_seq if hasattr(self, 'rows') and self.rows is not None: - _dict['rows'] = [x.to_dict() for x in self.rows] + rows_list = [] + for v in self.rows: + if isinstance(v, dict): + rows_list.append(v) + else: + rows_list.append(v.to_dict()) + _dict['rows'] = rows_list return _dict def _to_dict(self): @@ -16724,7 +17033,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'reason') and self.reason is not None: _dict['reason'] = self.reason if hasattr(self, 'doc') and self.doc is not None: - _dict['doc'] = self.doc.to_dict() + if isinstance(self.doc, dict): + _dict['doc'] = self.doc + else: + _dict['doc'] = self.doc.to_dict() if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'key') and self.key is not None: From eae3c1df2a8427884f9af8b6e58d23c5c0386c89 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 17:01:06 +0000 Subject: [PATCH 049/669] build(deps-dev): Bump pylint from 2.15.6 to 2.15.7 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.6 to 2.15.7. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.6...v2.15.7) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 374a7e96..1a5a7232 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 -pylint==2.15.6 +pylint==2.15.7 tox==3.27.1 pytest-rerunfailures==10.3 From 166658e640b8b82a90c63a82d9b8992fd78b62e1 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 30 Nov 2022 10:12:50 +0000 Subject: [PATCH 050/669] Update version 0.3.0 -> 0.3.1 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2bfa9a8e..67a1c1f7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.0 +current_version = 0.3.1 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index ec108b0c..cfe0ce8b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.3.0 +# IBM Cloudant Python SDK Version 0.3.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.3.0" +pip install --upgrade "ibmcloudant>=0.3.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.3.0" +easy_install --upgrade "ibmcloudant>=0.3.1" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 6863e2ff..22a5d73f 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.3.0' +__version__ = '0.3.1' diff --git a/setup.py b/setup.py index 05dac929..960044e6 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.3.0' +__version__ = '0.3.1' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From 6e2816c0919873acce12394ac73616739ecb6df6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 15:26:20 -0500 Subject: [PATCH 051/669] build(deps-dev): Bump pylint from 2.15.7 to 2.15.8 (#365) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.7 to 2.15.8. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.7...v2.15.8) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1a5a7232..580a3bb3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 -pylint==2.15.7 +pylint==2.15.8 tox==3.27.1 pytest-rerunfailures==10.3 From 0edfb371b966532f81c24e8b962dd929bd9cb7fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:07:41 -0500 Subject: [PATCH 052/669] build(deps-dev): Bump tox from 3.27.1 to 4.0.2 (#366) Bumps [tox](https://github.com/tox-dev/tox) from 3.27.1 to 4.0.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.27.1...4.0.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 580a3bb3..ef8c9bba 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.8 -tox==3.27.1 +tox==4.0.2 pytest-rerunfailures==10.3 # code coverage From 618e808dcc8b6bfc75c862797e9d0e69820f993a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:37:54 -0500 Subject: [PATCH 053/669] build(deps-dev): Bump tox from 4.0.2 to 4.0.3 (#367) Bumps [tox](https://github.com/tox-dev/tox) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.2...4.0.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ef8c9bba..e7bc1fe8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.8 -tox==4.0.2 +tox==4.0.3 pytest-rerunfailures==10.3 # code coverage From f6b7bcf461fe1d3a1b1947ba7168983479538e78 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Mon, 12 Dec 2022 14:26:55 -0400 Subject: [PATCH 054/669] fix: switch to comma separated passenv in tox config (#369) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index fb811755..37ca3351 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ commands = pylint --rcfile=.pylintrc ibmcloudant test setenv = PYTHONPATH = pylint/checkers [testenv] -passenv = TOXENV CI TRAVIS* +passenv = TOXENV, CI, TRAVIS* commands = py.test --reruns 3 -o junit_family=xunit2 --junitxml=junitreports/junit-{envname}.xml --cov=ibmcloudant {posargs} deps = From f31c98ea093cbbde4abbe386769ab55ba28ff21c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 18:28:36 +0000 Subject: [PATCH 055/669] build(deps-dev): Bump tox from 4.0.3 to 4.0.8 Bumps [tox](https://github.com/tox-dev/tox) from 4.0.3 to 4.0.8. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.3...4.0.8) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7bc1fe8..83cf11a3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.8 -tox==4.0.3 +tox==4.0.8 pytest-rerunfailures==10.3 # code coverage From e23241ae4c73376d7cfc21756773e1992691cbb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 17:01:07 +0000 Subject: [PATCH 056/669] build(deps-dev): Bump tox from 4.0.8 to 4.0.9 Bumps [tox](https://github.com/tox-dev/tox) from 4.0.8 to 4.0.9. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.8...4.0.9) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 83cf11a3..f908922a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.8 -tox==4.0.8 +tox==4.0.9 pytest-rerunfailures==10.3 # code coverage From 189e549059191258789cfd1adbc8b38418da474f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Dec 2022 17:00:58 +0000 Subject: [PATCH 057/669] build(deps-dev): Bump tox from 4.0.9 to 4.0.11 Bumps [tox](https://github.com/tox-dev/tox) from 4.0.9 to 4.0.11. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.9...4.0.11) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f908922a..873c9df4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.8 -tox==4.0.9 +tox==4.0.11 pytest-rerunfailures==10.3 # code coverage From 83d6a333849a3a00bb08bbfd42b21b77eb905916 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:45:51 +0000 Subject: [PATCH 058/669] fix(generated): update artifactory auth header in publish script (#371) Generated SDK source code using: - Generator version 3.62.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version efbb716 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- scripts/publish_buildinfo.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/publish_buildinfo.sh b/scripts/publish_buildinfo.sh index f4ab1f46..cb305903 100755 --- a/scripts/publish_buildinfo.sh +++ b/scripts/publish_buildinfo.sh @@ -5,12 +5,12 @@ file="/tmp/build.json" tmpfile="/tmp/build.json.tmp" printf "Current values set:\n Module ID: $MODULE_ID\nBuild name: $BUILD_NAME\nBuild URL: $BUILD_URL\nBuild timestamp: $BUILD_TIMESTAMP\nBuild number: $BUILD_NUMBER\n" printf "Artifactory URL: $ARTIFACT_URL\n" -ARTIFACTS=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" "$ARTIFACT_URL") +ARTIFACTS=$(curl -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$ARTIFACT_URL") HAS_CHILDREN_RESULT=$(echo $ARTIFACTS | jq 'has("children")') # if 'children' array exists then grab all aritfact uris, else grab parent uri if [[ "$HAS_CHILDREN_RESULT" == "false" ]]; then ARTIFACTS_URI=$(echo $ARTIFACTS | jq -r '.uri' | sed 's:.*/:/:') -else +else ARTIFACTS_URI=$(echo $ARTIFACTS | jq -r '.children[] | .uri') fi @@ -22,14 +22,14 @@ fi # create new (or write over existing) build.json file echo -n "" > $file # get current published build -CURRENT_BUILD=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" "$STAGE_ROOT"build/"$BUILD_NAME"/"$BUILD_NUMBER") +CURRENT_BUILD=$(curl -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$STAGE_ROOT"build/"$BUILD_NAME"/"$BUILD_NUMBER") echo $CURRENT_BUILD CURRENT_BUILD_INFO=$(echo "$CURRENT_BUILD" | jq -r '.buildInfo') echo $CURRENT_BUILD_INFO | tee $file # put build name, number, and url on published artifacts URL_WITH_PROPS="$ARTIFACT_URL?properties=build.name=$BUILD_NAME;build.number=$BUILD_NUMBER;build.url=$BUILD_URL" -curl -i -X PUT -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" "$URL_WITH_PROPS" +curl -i -X PUT -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$URL_WITH_PROPS" # add artifact type and module id to build info file jq --arg type "$TYPE" '.type = $type' $file > $tmpfile && mv $tmpfile $file @@ -40,10 +40,10 @@ for artifact in $ARTIFACTS_URI; do # node does not have 'children' artifacts if [[ "$HAS_CHILDREN_RESULT" == "false" ]]; then ARTIFACT_INFO_URL="$ARTIFACT_URL" - else + else ARTIFACT_INFO_URL="$ARTIFACT_URL$artifact" fi - GET_ARTIFACT=$(curl -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" $ARTIFACT_INFO_URL | jq -r .checksums) + GET_ARTIFACT=$(curl -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" $ARTIFACT_INFO_URL | jq -r .checksums) MD5=$(echo $GET_ARTIFACT | jq -r .md5) SHA1=$(echo $GET_ARTIFACT | jq -r .sha1) NAME="${artifact#*/}" @@ -57,4 +57,4 @@ else exit 1 fi -curl -i -X PUT -H "X-JFrog-Art-Api:$ARTIFACTORY_CREDS_PSW" -H "Content-Type: application/json" "$STAGE_ROOT"build --upload-file $file +curl -i -X PUT -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" -H "Content-Type: application/json" "$STAGE_ROOT"build --upload-file $file From 342ba1b661ab7320d4c3804760b61fa2e6887988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:01:45 +0000 Subject: [PATCH 059/669] build(deps-dev): Bump pylint from 2.15.8 to 2.15.9 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.8 to 2.15.9. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.8...v2.15.9) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 873c9df4..ac251637 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 -pylint==2.15.8 +pylint==2.15.9 tox==4.0.11 pytest-rerunfailures==10.3 From eb23f1fb3e405799cee9532ab6c8641093f3950e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:36:15 +0000 Subject: [PATCH 060/669] build(deps-dev): Bump coverage from 6.5.0 to 7.0.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.5.0 to 7.0.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/6.5.0...7.0.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ac251637..289ff98c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.0.11 pytest-rerunfailures==10.3 # code coverage -coverage==6.5.0 +coverage==7.0.0 pytest-cov==4.0.0 # documentation From cd01ef6f546c0d598ca762fb603ade3d897644c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:54:44 +0000 Subject: [PATCH 061/669] build(deps-dev): Bump tox from 4.0.11 to 4.0.14 Bumps [tox](https://github.com/tox-dev/tox) from 4.0.11 to 4.0.14. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.11...4.0.14) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 289ff98c..e970afbd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.9 -tox==4.0.11 +tox==4.0.14 pytest-rerunfailures==10.3 # code coverage From 4f7dba1ee8666631c577e8a7c657ba42cada3810 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Dec 2022 17:01:01 +0000 Subject: [PATCH 062/669] build(deps-dev): Bump tox from 4.0.14 to 4.0.15 Bumps [tox](https://github.com/tox-dev/tox) from 4.0.14 to 4.0.15. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.14...4.0.15) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e970afbd..bbe94d4c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.9 -tox==4.0.14 +tox==4.0.15 pytest-rerunfailures==10.3 # code coverage From e430c846472b153cd097e27e2647256b321c7af0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Dec 2022 17:01:25 +0000 Subject: [PATCH 063/669] build(deps-dev): Bump tox from 4.0.15 to 4.0.16 Bumps [tox](https://github.com/tox-dev/tox) from 4.0.15 to 4.0.16. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.15...4.0.16) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bbe94d4c..afe8e783 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.9 -tox==4.0.15 +tox==4.0.16 pytest-rerunfailures==10.3 # code coverage From 7061a49f3e928d898930fb29e1c3fdbde6ba610b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:01:19 +0000 Subject: [PATCH 064/669] build(deps-dev): Bump coverage from 7.0.0 to 7.0.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.0.0...7.0.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index afe8e783..914efd46 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.0.16 pytest-rerunfailures==10.3 # code coverage -coverage==7.0.0 +coverage==7.0.1 pytest-cov==4.0.0 # documentation From 3ecac3d6cfb8d05127babbf45cc023717c1c1ff3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 11:38:13 +0100 Subject: [PATCH 065/669] build(deps-dev): Bump tox from 4.0.16 to 4.2.2 (#390) Bumps [tox](https://github.com/tox-dev/tox) from 4.0.16 to 4.2.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.0.16...4.2.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 914efd46..250ad1b9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.9 -tox==4.0.16 +tox==4.2.2 pytest-rerunfailures==10.3 # code coverage From 48e834bfd44da00c725e364b570f2b2abaaf16c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 12:10:23 +0100 Subject: [PATCH 066/669] build(deps-dev): Bump coverage from 7.0.1 to 7.0.3 (#391) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.0.1 to 7.0.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.0.1...7.0.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 250ad1b9..5ecb3dd6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.2.2 pytest-rerunfailures==10.3 # code coverage -coverage==7.0.1 +coverage==7.0.3 pytest-cov==4.0.0 # documentation From 562fc12b93f16d99373c6683975fe1847599b980 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:16:20 +0000 Subject: [PATCH 067/669] chore(generated): update generator version to 3.62.2 (#392) Generated SDK source code using: - Generator version 3.62.2 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version b60d315 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 2 +- test/unit/test_cloudant_v1.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 535d9c09..1279a6aa 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2022. +# (C) Copyright IBM Corp. 2023. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index deafae1f..88f22e70 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2022. +# (C) Copyright IBM Corp. 2023. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From cec4c832569cff24a442ed2cd5cb176738a29438 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:48:27 +0000 Subject: [PATCH 068/669] Update version 0.3.1 -> 0.3.2 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 67a1c1f7..77e86c76 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.1 +current_version = 0.3.2 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index cfe0ce8b..f8ff6b5c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.3.1 +# IBM Cloudant Python SDK Version 0.3.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.3.1" +pip install --upgrade "ibmcloudant>=0.3.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.3.1" +easy_install --upgrade "ibmcloudant>=0.3.2" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 22a5d73f..dcd8ec48 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.3.1' +__version__ = '0.3.2' diff --git a/setup.py b/setup.py index 960044e6..7875532c 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.3.1' +__version__ = '0.3.2' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From a4b00c24c831b86e7238e675cb4cbf209b5999e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jan 2023 17:01:10 +0000 Subject: [PATCH 069/669] build(deps-dev): Bump tox from 4.2.2 to 4.2.3 Bumps [tox](https://github.com/tox-dev/tox) from 4.2.2 to 4.2.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.2.2...4.2.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5ecb3dd6..2b7a2116 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.9 -tox==4.2.2 +tox==4.2.3 pytest-rerunfailures==10.3 # code coverage From 430ce7f5c6f6cc11fd627a8d9d80c79f3f7513cb Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Jan 2023 20:46:10 +0000 Subject: [PATCH 070/669] docs(generated): fix brand name Github with GitHub (#393) Generated SDK source code using: - Generator version 3.62.2 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 2e1ec1f Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f8ff6b5c..9b9f3afe 100644 --- a/README.md +++ b/README.md @@ -231,9 +231,9 @@ The following code examples **Note:** This example code assumes that `orders` database does not exist in your account. This example code creates `orders` database and adds a new document "example" -into it. To connect, you must set your environment variables with +into it. To connect, you must set your environment variables with the *service url*, *authentication type* and *authentication credentials* -of your Cloudant service. +of your Cloudant service. Cloudant environment variable naming starts with a *service name* prefix that identifies your service. By default this is `CLOUDANT`, see the settings in the @@ -722,7 +722,7 @@ Before you submit a bug report, search for ## Open source at IBM -Find more open source projects on the [IBM Github](http://ibm.github.io/) page. +Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing From 04dc9d2cd45b143b9b88820194e7823d783ad09a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 10 Jan 2023 13:51:46 +0000 Subject: [PATCH 071/669] docs(generated): add vulnerability reporting policy (#395) Generated SDK source code using: - Generator version 3.62.2 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version fc95a7e Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .github/CODEOWNERS | 1 + README.md | 3 +++ SECURITY.md | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 SECURITY.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d7ca9e43..ee306949 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,6 +12,7 @@ Jenkinsfile @IBM/cloudant-sdks KNOWN_ISSUES.md @IBM/cloudant-sdks LICENSE @IBM/cloudant-sdks README.md @IBM/cloudant-sdks +SECURITY.md @IBM/cloudant-sdks scripts/publish_buildinfo.sh @IBM/cloudant-sdks scripts/pydoc/generate-index-html.sh @IBM/cloudant-sdks scripts/pydoc/publish-doc.sh @IBM/cloudant-sdks diff --git a/README.md b/README.md index 9b9f3afe..b2ce6341 100644 --- a/README.md +++ b/README.md @@ -716,10 +716,13 @@ IBM Cloud services, ask a question on If you encounter an issue with the project, you are welcome to submit a [bug report](https://github.com/IBM/cloudant-python-sdk/issues). + Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the [KNOWN_ISSUES file](KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. + ## Open source at IBM Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..97273e2f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| latest | :white_check_mark: | + +## Reporting a Vulnerability + +If you believe you have found a vulnerability please report it responsibly. IBM has documented the process for reporting vulnerabilities at https://www.ibm.com/trust/security-psirt. + +## Vulnerabilties in dependencies + +The SDK is regularly scanned for known CVEs in dependencies and updates to versions with remediations are applied and released as soon as possible. +Reporting known CVEs in dependencies in this repository is not necessary and will not lead to a faster resolution. From 84ae6326d7c99afa4620c9fb26364242240f107b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:12:10 +0000 Subject: [PATCH 072/669] build(deps-dev): Bump tox from 4.2.3 to 4.2.6 (#400) Bumps [tox](https://github.com/tox-dev/tox) from 4.2.3 to 4.2.6. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.2.3...4.2.6) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2b7a2116..78a8370c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.9 -tox==4.2.3 +tox==4.2.6 pytest-rerunfailures==10.3 # code coverage From a7afd591266d302f70cfd3c001ec71a7fca64d4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:29:25 +0000 Subject: [PATCH 073/669] build(deps-dev): Bump pylint from 2.15.9 to 2.15.10 (#399) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.9 to 2.15.10. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.9...v2.15.10) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 78a8370c..c5b22b67 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 -pylint==2.15.9 +pylint==2.15.10 tox==4.2.6 pytest-rerunfailures==10.3 From 1075cecc3df2b702483f8cd6caefbd662a7a3bb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 17:50:12 +0000 Subject: [PATCH 074/669] build(deps-dev): Bump coverage from 7.0.3 to 7.0.4 (#398) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.0.3 to 7.0.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.0.3...7.0.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c5b22b67..4283bf3e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.2.6 pytest-rerunfailures==10.3 # code coverage -coverage==7.0.3 +coverage==7.0.4 pytest-cov==4.0.0 # documentation From e7fd3e09da9e72b6cd3b8420caabd3c922614e8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 18:18:11 +0000 Subject: [PATCH 075/669] build(deps): Bump ibm-cloud-sdk-core from 3.16.0 to 3.16.1 (#397) Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.0 to 3.16.1. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.0...v3.16.1) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b8831881..afd6cf6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_cloud_sdk_core==3.16.0 +ibm_cloud_sdk_core==3.16.1 # dependencies of ibm_cloud_sdk_core: requests>=2.20,<3.0 python_dateutil>=2.5.3,<3.0.0 From 955568b8cad50e76b7e999ac16576328ceff8ee6 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:04:18 +0000 Subject: [PATCH 076/669] fix(generated): typo in SECURITY.md (#401) Generated SDK source code using: - Generator version 3.62.2 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 8f4bd54 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 97273e2f..eecdf578 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,7 +10,7 @@ If you believe you have found a vulnerability please report it responsibly. IBM has documented the process for reporting vulnerabilities at https://www.ibm.com/trust/security-psirt. -## Vulnerabilties in dependencies +## Vulnerabilities in dependencies The SDK is regularly scanned for known CVEs in dependencies and updates to versions with remediations are applied and released as soon as possible. Reporting known CVEs in dependencies in this repository is not necessary and will not lead to a faster resolution. From 292a1eb1eff8c984307c07d2cf99c2bea08ca54e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 12:04:42 +0000 Subject: [PATCH 077/669] build(deps-dev): Bump pytest-rerunfailures from 10.3 to 11.0 (#405) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 10.3 to 11.0. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/10.3...11.0) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4283bf3e..676bb53b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.10 tox==4.2.6 -pytest-rerunfailures==10.3 +pytest-rerunfailures==11.0 # code coverage coverage==7.0.4 From 3e5888849e9471398ff59b641dab6050d5743719 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Jan 2023 11:50:35 +0000 Subject: [PATCH 078/669] build(deps-dev): Bump tox from 4.2.6 to 4.2.8 (#404) Bumps [tox](https://github.com/tox-dev/tox) from 4.2.6 to 4.2.8. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.2.6...4.2.8) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 676bb53b..34c868a9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.0 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.10 -tox==4.2.6 +tox==4.2.8 pytest-rerunfailures==11.0 # code coverage From 463bf7cd67e7eb896764917fbed4c63304c365cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Jan 2023 12:03:15 +0000 Subject: [PATCH 079/669] build(deps-dev): Bump coverage from 7.0.4 to 7.0.5 (#403) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.0.4 to 7.0.5. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.0.4...7.0.5) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 34c868a9..249002bd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.2.8 pytest-rerunfailures==11.0 # code coverage -coverage==7.0.4 +coverage==7.0.5 pytest-cov==4.0.0 # documentation From 6b2c561bf37fa5cacfd4883c1f121a8d6163c761 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 17:01:13 +0000 Subject: [PATCH 080/669] build(deps-dev): Bump pytest from 7.2.0 to 7.2.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.0 to 7.2.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.2.0...7.2.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 249002bd..3c42d867 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.2.0 +pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.10 From 830e07a7e8713dbd3d9f97a3c01c158f7e70c866 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 17:26:30 +0000 Subject: [PATCH 081/669] build(deps-dev): Bump tox from 4.2.8 to 4.3.2 Bumps [tox](https://github.com/tox-dev/tox) from 4.2.8 to 4.3.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.2.8...4.3.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3c42d867..9ef585e9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.10 -tox==4.2.8 +tox==4.3.2 pytest-rerunfailures==11.0 # code coverage From 00051f4e26ee9db95a39be0aa142730cb1db2ece Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 17 Jan 2023 15:31:43 +0000 Subject: [PATCH 082/669] chore(generated): update generator version to 3.64.0 (#411) Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.48 - Automation (cloudant-sdks) version 7ac13f6 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 194 ++++++++++++++++++------------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 1279a6aa..3eeff61a 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -176,7 +176,7 @@ def get_uuids(self, headers.update(sdk_headers) params = { - 'count': count + 'count': count, } if 'headers' in kwargs: @@ -256,7 +256,7 @@ def put_capacity_throughput_configuration(self, headers.update(sdk_headers) data = { - 'blocks': blocks + 'blocks': blocks, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -331,7 +331,7 @@ def get_db_updates(self, 'feed': feed, 'heartbeat': heartbeat, 'timeout': timeout, - 'since': since + 'since': since, } if 'headers' in kwargs: @@ -487,7 +487,7 @@ def post_changes(self, if not db: raise ValueError('db must be provided') headers = { - 'Last-Event-ID': last_event_id + 'Last-Event-ID': last_event_id, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -508,13 +508,13 @@ def post_changes(self, 'since': since, 'style': style, 'timeout': timeout, - 'view': view + 'view': view, } data = { 'doc_ids': doc_ids, 'fields': fields, - 'selector': selector + 'selector': selector, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -677,7 +677,7 @@ def post_changes_as_stream(self, if not db: raise ValueError('db must be provided') headers = { - 'Last-Event-ID': last_event_id + 'Last-Event-ID': last_event_id, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -698,13 +698,13 @@ def post_changes_as_stream(self, 'since': since, 'style': style, 'timeout': timeout, - 'view': view + 'view': view, } data = { 'doc_ids': doc_ids, 'fields': fields, - 'selector': selector + 'selector': selector, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -814,7 +814,7 @@ def get_all_dbs(self, 'end_key': end_key, 'limit': limit, 'skip': skip, - 'start_key': start_key + 'start_key': start_key, } if 'headers' in kwargs: @@ -859,7 +859,7 @@ def post_dbs_info(self, headers.update(sdk_headers) data = { - 'keys': keys + 'keys': keys, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -993,7 +993,7 @@ def put_database(self, params = { 'partitioned': partitioned, - 'q': q + 'q': q, } if 'headers' in kwargs: @@ -1054,7 +1054,7 @@ def head_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -1063,7 +1063,7 @@ def head_document(self, params = { 'latest': latest, - 'rev': rev + 'rev': rev, } if 'headers' in kwargs: @@ -1123,7 +1123,7 @@ def post_document(self, document = convert_model(document) content_type = content_type or 'application/json' headers = { - 'Content-Type': content_type + 'Content-Type': content_type, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -1131,7 +1131,7 @@ def post_document(self, headers.update(sdk_headers) params = { - 'batch': batch + 'batch': batch, } if isinstance(document, dict): @@ -1240,7 +1240,7 @@ def post_all_docs(self, 'end_key': end_key, 'key': key, 'keys': keys, - 'start_key': start_key + 'start_key': start_key, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1344,7 +1344,7 @@ def post_all_docs_as_stream(self, 'end_key': end_key, 'key': key, 'keys': keys, - 'start_key': start_key + 'start_key': start_key, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1404,7 +1404,7 @@ def post_all_docs_queries(self, headers.update(sdk_headers) data = { - 'queries': queries + 'queries': queries, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1464,7 +1464,7 @@ def post_all_docs_queries_as_stream(self, headers.update(sdk_headers) data = { - 'queries': queries + 'queries': queries, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1592,11 +1592,11 @@ def post_bulk_get(self, 'attachments': attachments, 'att_encoding_info': att_encoding_info, 'latest': latest, - 'revs': revs + 'revs': revs, } data = { - 'docs': docs + 'docs': docs, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1669,11 +1669,11 @@ def post_bulk_get_as_mixed(self, 'attachments': attachments, 'att_encoding_info': att_encoding_info, 'latest': latest, - 'revs': revs + 'revs': revs, } data = { - 'docs': docs + 'docs': docs, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1746,11 +1746,11 @@ def post_bulk_get_as_related(self, 'attachments': attachments, 'att_encoding_info': att_encoding_info, 'latest': latest, - 'revs': revs + 'revs': revs, } data = { - 'docs': docs + 'docs': docs, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1823,11 +1823,11 @@ def post_bulk_get_as_stream(self, 'attachments': attachments, 'att_encoding_info': att_encoding_info, 'latest': latest, - 'revs': revs + 'revs': revs, } data = { - 'docs': docs + 'docs': docs, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -1888,7 +1888,7 @@ def delete_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -1897,7 +1897,7 @@ def delete_document(self, params = { 'batch': batch, - 'rev': rev + 'rev': rev, } if 'headers' in kwargs: @@ -1979,7 +1979,7 @@ def get_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -1996,7 +1996,7 @@ def get_document(self, 'meta': meta, 'rev': rev, 'revs': revs, - 'revs_info': revs_info + 'revs_info': revs_info, } if 'headers' in kwargs: @@ -2078,7 +2078,7 @@ def get_document_as_mixed(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2095,7 +2095,7 @@ def get_document_as_mixed(self, 'meta': meta, 'rev': rev, 'revs': revs, - 'revs_info': revs_info + 'revs_info': revs_info, } if 'headers' in kwargs: @@ -2177,7 +2177,7 @@ def get_document_as_related(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2194,7 +2194,7 @@ def get_document_as_related(self, 'meta': meta, 'rev': rev, 'revs': revs, - 'revs_info': revs_info + 'revs_info': revs_info, } if 'headers' in kwargs: @@ -2276,7 +2276,7 @@ def get_document_as_stream(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2293,7 +2293,7 @@ def get_document_as_stream(self, 'meta': meta, 'rev': rev, 'revs': revs, - 'revs_info': revs_info + 'revs_info': revs_info, } if 'headers' in kwargs: @@ -2365,7 +2365,7 @@ def put_document(self, content_type = content_type or 'application/json' headers = { 'Content-Type': content_type, - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2375,7 +2375,7 @@ def put_document(self, params = { 'batch': batch, 'new_edits': new_edits, - 'rev': rev + 'rev': rev, } if isinstance(document, dict): @@ -2442,7 +2442,7 @@ def head_design_document(self, if not ddoc: raise ValueError('ddoc must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2503,7 +2503,7 @@ def delete_design_document(self, if not ddoc: raise ValueError('ddoc must be provided') headers = { - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2512,7 +2512,7 @@ def delete_design_document(self, params = { 'batch': batch, - 'rev': rev + 'rev': rev, } if 'headers' in kwargs: @@ -2596,7 +2596,7 @@ def get_design_document(self, if not ddoc: raise ValueError('ddoc must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2613,7 +2613,7 @@ def get_design_document(self, 'meta': meta, 'rev': rev, 'revs': revs, - 'revs_info': revs_info + 'revs_info': revs_info, } if 'headers' in kwargs: @@ -2682,7 +2682,7 @@ def put_design_document(self, if isinstance(design_document, DesignDocument): design_document = convert_model(design_document) headers = { - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2692,7 +2692,7 @@ def put_design_document(self, params = { 'batch': batch, 'new_edits': new_edits, - 'rev': rev + 'rev': rev, } data = json.dumps(design_document) @@ -2830,7 +2830,7 @@ def post_design_docs(self, if not db: raise ValueError('db must be provided') headers = { - 'Accept': accept + 'Accept': accept, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2850,7 +2850,7 @@ def post_design_docs(self, 'end_key': end_key, 'key': key, 'keys': keys, - 'start_key': start_key + 'start_key': start_key, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -2905,7 +2905,7 @@ def post_design_docs_queries(self, raise ValueError('queries must be provided') queries = [convert_model(x) for x in queries] headers = { - 'Accept': accept + 'Accept': accept, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -2913,7 +2913,7 @@ def post_design_docs_queries(self, headers.update(sdk_headers) data = { - 'queries': queries + 'queries': queries, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3077,7 +3077,7 @@ def post_view(self, 'stable': stable, 'start_key': start_key, 'start_key_doc_id': start_key_doc_id, - 'update': update + 'update': update, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3238,7 +3238,7 @@ def post_view_as_stream(self, 'stable': stable, 'start_key': start_key, 'start_key_doc_id': start_key_doc_id, - 'update': update + 'update': update, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3306,7 +3306,7 @@ def post_view_queries(self, headers.update(sdk_headers) data = { - 'queries': queries + 'queries': queries, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3374,7 +3374,7 @@ def post_view_queries_as_stream(self, headers.update(sdk_headers) data = { - 'queries': queries + 'queries': queries, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3533,7 +3533,7 @@ def post_partition_all_docs(self, 'end_key': end_key, 'key': key, 'keys': keys, - 'start_key': start_key + 'start_key': start_key, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3642,7 +3642,7 @@ def post_partition_all_docs_as_stream(self, 'end_key': end_key, 'key': key, 'keys': keys, - 'start_key': start_key + 'start_key': start_key, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3769,7 +3769,7 @@ def post_partition_search(self, 'include_fields': include_fields, 'limit': limit, 'sort': sort, - 'stale': stale + 'stale': stale, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -3896,7 +3896,7 @@ def post_partition_search_as_stream(self, 'include_fields': include_fields, 'limit': limit, 'sort': sort, - 'stale': stale + 'stale': stale, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4061,7 +4061,7 @@ def post_partition_view(self, 'stable': stable, 'start_key': start_key, 'start_key_doc_id': start_key_doc_id, - 'update': update + 'update': update, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4226,7 +4226,7 @@ def post_partition_view_as_stream(self, 'stable': stable, 'start_key': start_key, 'start_key_doc_id': start_key_doc_id, - 'update': update + 'update': update, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4374,7 +4374,7 @@ def post_partition_find(self, 'sort': sort, 'stable': stable, 'update': update, - 'use_index': use_index + 'use_index': use_index, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4522,7 +4522,7 @@ def post_partition_find_as_stream(self, 'sort': sort, 'stable': stable, 'update': update, - 'use_index': use_index + 'use_index': use_index, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4672,7 +4672,7 @@ def post_explain(self, 'stable': stable, 'update': update, 'use_index': use_index, - 'r': r + 'r': r, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4824,7 +4824,7 @@ def post_find(self, 'stable': stable, 'update': update, 'use_index': use_index, - 'r': r + 'r': r, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -4976,7 +4976,7 @@ def post_find_as_stream(self, 'stable': stable, 'update': update, 'use_index': use_index, - 'r': r + 'r': r, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -5104,7 +5104,7 @@ def post_index(self, 'def': def_, 'name': name, 'partitioned': partitioned, - 'type': type + 'type': type, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -5215,7 +5215,7 @@ def post_search_analyze(self, data = { 'analyzer': analyzer, - 'text': text + 'text': text, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -5378,7 +5378,7 @@ def post_search(self, 'group_field': group_field, 'group_limit': group_limit, 'group_sort': group_sort, - 'ranges': ranges + 'ranges': ranges, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -5544,7 +5544,7 @@ def post_search_as_stream(self, 'group_field': group_field, 'group_limit': group_limit, 'group_sort': group_sort, - 'ranges': ranges + 'ranges': ranges, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -5647,7 +5647,7 @@ def head_replication_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -5781,7 +5781,7 @@ def delete_replication_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -5790,7 +5790,7 @@ def delete_replication_document(self, params = { 'batch': batch, - 'rev': rev + 'rev': rev, } if 'headers' in kwargs: @@ -5868,7 +5868,7 @@ def get_replication_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -5885,7 +5885,7 @@ def get_replication_document(self, 'meta': meta, 'rev': rev, 'revs': revs, - 'revs_info': revs_info + 'revs_info': revs_info, } if 'headers' in kwargs: @@ -5948,7 +5948,7 @@ def put_replication_document(self, if isinstance(replication_document, ReplicationDocument): replication_document = convert_model(replication_document) headers = { - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -5958,7 +5958,7 @@ def put_replication_document(self, params = { 'batch': batch, 'new_edits': new_edits, - 'rev': rev + 'rev': rev, } data = json.dumps(replication_document) @@ -6018,7 +6018,7 @@ def get_scheduler_docs(self, params = { 'limit': limit, 'skip': skip, - 'states': convert_list(states) + 'states': convert_list(states), } if 'headers' in kwargs: @@ -6110,7 +6110,7 @@ def get_scheduler_jobs(self, params = { 'limit': limit, - 'skip': skip + 'skip': skip, } if 'headers' in kwargs: @@ -6306,7 +6306,7 @@ def put_security(self, 'admins': admins, 'members': members, 'cloudant': cloudant, - 'couchdb_auth_only': couchdb_auth_only + 'couchdb_auth_only': couchdb_auth_only, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -6419,7 +6419,7 @@ def put_cloudant_security_configuration(self, 'cloudant': cloudant, 'admins': admins, 'members': members, - 'couchdb_auth_only': couchdb_auth_only + 'couchdb_auth_only': couchdb_auth_only, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -6519,7 +6519,7 @@ def put_cors_configuration(self, data = { 'origins': origins, 'allow_credentials': allow_credentials, - 'enable_cors': enable_cors + 'enable_cors': enable_cors, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -6583,7 +6583,7 @@ def head_attachment(self, raise ValueError('attachment_name must be provided') headers = { 'If-Match': if_match, - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -6591,7 +6591,7 @@ def head_attachment(self, headers.update(sdk_headers) params = { - 'rev': rev + 'rev': rev, } if 'headers' in kwargs: @@ -6649,7 +6649,7 @@ def delete_attachment(self, if not attachment_name: raise ValueError('attachment_name must be provided') headers = { - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -6658,7 +6658,7 @@ def delete_attachment(self, params = { 'rev': rev, - 'batch': batch + 'batch': batch, } if 'headers' in kwargs: @@ -6723,7 +6723,7 @@ def get_attachment(self, headers = { 'If-Match': if_match, 'If-None-Match': if_none_match, - 'Range': range + 'Range': range, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -6731,7 +6731,7 @@ def get_attachment(self, headers.update(sdk_headers) params = { - 'rev': rev + 'rev': rev, } if 'headers' in kwargs: @@ -6801,7 +6801,7 @@ def put_attachment(self, raise ValueError('content_type must be provided') headers = { 'Content-Type': content_type, - 'If-Match': if_match + 'If-Match': if_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -6809,7 +6809,7 @@ def put_attachment(self, headers.update(sdk_headers) params = { - 'rev': rev + 'rev': rev, } data = attachment @@ -6865,7 +6865,7 @@ def head_local_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = { - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -6923,7 +6923,7 @@ def delete_local_document(self, headers.update(sdk_headers) params = { - 'batch': batch + 'batch': batch, } if 'headers' in kwargs: @@ -6986,7 +6986,7 @@ def get_local_document(self, raise ValueError('doc_id must be provided') headers = { 'Accept': accept, - 'If-None-Match': if_none_match + 'If-None-Match': if_none_match, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -6996,7 +6996,7 @@ def get_local_document(self, params = { 'attachments': attachments, 'att_encoding_info': att_encoding_info, - 'local_seq': local_seq + 'local_seq': local_seq, } if 'headers' in kwargs: @@ -7054,7 +7054,7 @@ def put_local_document(self, document = convert_model(document) content_type = content_type or 'application/json' headers = { - 'Content-Type': content_type + 'Content-Type': content_type, } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -7062,7 +7062,7 @@ def put_local_document(self, headers.update(sdk_headers) params = { - 'batch': batch + 'batch': batch, } if isinstance(document, dict): @@ -7399,7 +7399,7 @@ def post_activity_tracker_events(self, headers.update(sdk_headers) data = { - 'types': types + 'types': types, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) From d8840398969685795922ceaa289332a6f781062b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 17 Jan 2023 20:30:31 +0000 Subject: [PATCH 083/669] feat(generated): update API definition to 0.0.49 Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version 708cf4a Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 3eeff61a..4e861d5c 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -90,6 +90,7 @@ def get_server_information(self, about the instance. The response includes a JSON structure that contains information about the server, including a welcome message and the server's version. + **Tip:** The authentication for this endpoint is only enforced when using IAM. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -161,6 +162,7 @@ def get_uuids(self, Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The response is a JSON object that provides a list of UUIDs. + **Tip:** The authentication for this endpoint is only enforced when using IAM. :param int count: (optional) Query parameter to specify the number of UUIDs to return. @@ -7312,6 +7314,7 @@ def get_up_information(self, Confirms that the server is up, running, and ready to respond to requests. If `maintenance_mode` is `true` or `nolb`, the endpoint returns a 404 response. + **Tip:** The authentication for this endpoint is only enforced when using IAM. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. From d926901f81c767a08e06e46b8af6b9338f0fbbc3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 18 Jan 2023 10:21:56 +0000 Subject: [PATCH 084/669] chore(generated): pull QA images from artifactory, if env var set (#407) Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version 8917a5c Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 8 ++++++-- scripts/setup_couch.sh | 3 ++- scripts/setup_wiremock.sh | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 90cb76e2..13627623 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -46,8 +46,12 @@ pipeline { usernameVariable: 'SERVER_USERNAME', passwordVariable: 'SERVER_PASSWORD') ]) { - sh './scripts/setup_couch.sh' - sh './scripts/setup_wiremock.sh' + script { + docker.withRegistry(env.ARTIFACTORY_DOCKER_REGISTRY,'artifactory') { + sh './scripts/setup_couch.sh' + sh './scripts/setup_wiremock.sh' + } + } runTests() } } diff --git a/scripts/setup_couch.sh b/scripts/setup_couch.sh index edbdf130..93e3c6b9 100755 --- a/scripts/setup_couch.sh +++ b/scripts/setup_couch.sh @@ -4,7 +4,8 @@ set -ev printenv | grep "^SERVER_" > cloudant.env # if you change the image version please regenerate example output captures -docker start couchdb || docker run --name couchdb --rm -e COUCHDB_USER="$SERVER_USERNAME" -e COUCHDB_PASSWORD="$SERVER_PASSWORD" -p 5984:5984 -d apache/couchdb:3 +# use image at ARTIFACTORY_DOCKER_REPO_VIRTUAL registry if set, otherwise use default registry +docker start couchdb || docker run --name couchdb --rm -e COUCHDB_USER="$SERVER_USERNAME" -e COUCHDB_PASSWORD="$SERVER_PASSWORD" -p 5984:5984 -d ${ARTIFACTORY_DOCKER_REPO_VIRTUAL:+${ARTIFACTORY_DOCKER_REPO_VIRTUAL}/}apache/couchdb:3 # shellcheck disable=SC2016 timeout 120 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${SERVER_URL}/_up)" != "200" ]]; do sleep 5; done' || false curl -XPUT -u "$SERVER_USERNAME":"$SERVER_PASSWORD" "$SERVER_URL"/_users diff --git a/scripts/setup_wiremock.sh b/scripts/setup_wiremock.sh index bad1c738..3233a512 100755 --- a/scripts/setup_wiremock.sh +++ b/scripts/setup_wiremock.sh @@ -4,7 +4,8 @@ set -ev printenv | grep "^WIREMOCK_" > wiremock.env -docker start wiremock || docker run --name wiremock --rm -d -p "$WIREMOCK_PORT":8080 wiremock/wiremock:latest +# use image at ARTIFACTORY_DOCKER_REPO_VIRTUAL registry if set, otherwise use default registry +docker start wiremock || docker run --name wiremock --rm -d -p "$WIREMOCK_PORT":8080 ${ARTIFACTORY_DOCKER_REPO_VIRTUAL:+${ARTIFACTORY_DOCKER_REPO_VIRTUAL}/}wiremock/wiremock:latest timeout 120 bash -c 'while [[ "$(curl -s --location -o /dev/null -w ''%{http_code}'' ${WIREMOCK_URL}/__admin)" != "200" ]]; do sleep 2; done' || false curl "$WIREMOCK_URL"/__admin/mappings/import -X POST -d @stubs/mappings.json echo "Wiremock started" From 80b6effe150f3d45085ef7b36385692c2889434f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:01:15 +0000 Subject: [PATCH 085/669] build(deps-dev): Bump tox from 4.3.2 to 4.3.5 Bumps [tox](https://github.com/tox-dev/tox) from 4.3.2 to 4.3.5. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.3.2...4.3.5) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9ef585e9..84a68b33 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.0 pylint==2.15.10 -tox==4.3.2 +tox==4.3.5 pytest-rerunfailures==11.0 # code coverage From 1a86637112899ee935e9b554d6f1ad86235b815f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:55:57 -0500 Subject: [PATCH 086/669] build(deps-dev): Bump python-dotenv from 0.21.0 to 0.21.1 (#416) Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.21.0 to 0.21.1. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v0.21.0...v0.21.1) --- updated-dependencies: - dependency-name: python-dotenv dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 84a68b33..389cb50c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # test dependencies pytest==7.2.1 responses==0.22.0 -python_dotenv==0.21.0 +python_dotenv==0.21.1 pylint==2.15.10 tox==4.3.5 pytest-rerunfailures==11.0 From 3da7ad0e52157e6dee9006ed75896efdc463df2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jan 2023 15:21:13 -0500 Subject: [PATCH 087/669] build(deps-dev): Bump coverage from 7.0.5 to 7.1.0 (#417) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.0.5 to 7.1.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.0.5...7.1.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 389cb50c..7b661bf7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.3.5 pytest-rerunfailures==11.0 # code coverage -coverage==7.0.5 +coverage==7.1.0 pytest-cov==4.0.0 # documentation From 7b4d0158b0c2674e8a04a1395cbc12d9fc22ad2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jan 2023 15:01:59 -0500 Subject: [PATCH 088/669] build(deps-dev): Bump tox from 4.3.5 to 4.4.2 (#419) Bumps [tox](https://github.com/tox-dev/tox) from 4.3.5 to 4.4.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.3.5...4.4.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7b661bf7..3b64abad 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 pylint==2.15.10 -tox==4.3.5 +tox==4.4.2 pytest-rerunfailures==11.0 # code coverage From 6d965f9835f09738be68bf08aa088211b41209a4 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:44:22 +0000 Subject: [PATCH 089/669] test(generated): add Wiremock stubs for gen ITs Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version f0a8858 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .github/CODEOWNERS | 1 + scripts/setup_couch.sh | 2 +- scripts/setup_wiremock.sh | 3 + stubs/gen-its-mappings.json | 2742 ++++++++++++++++++++++++++ test/integration/test_cloudant_v1.py | 2103 ++++++++++++++++++++ 5 files changed, 4850 insertions(+), 1 deletion(-) create mode 100644 stubs/gen-its-mappings.json create mode 100644 test/integration/test_cloudant_v1.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ee306949..72be677e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,6 +18,7 @@ scripts/pydoc/generate-index-html.sh @IBM/cloudant-sdks scripts/pydoc/publish-doc.sh @IBM/cloudant-sdks scripts/setup_couch.sh @IBM/cloudant-sdks scripts/setup_wiremock.sh @IBM/cloudant-sdks +stubs/gen-its-mappings.json @IBM/cloudant-sdks stubs/mappings.json @IBM/cloudant-sdks # Generated code files: diff --git a/scripts/setup_couch.sh b/scripts/setup_couch.sh index 93e3c6b9..8bf32ec7 100755 --- a/scripts/setup_couch.sh +++ b/scripts/setup_couch.sh @@ -2,7 +2,7 @@ set -ev -printenv | grep "^SERVER_" > cloudant.env +printenv | grep "^SERVER_" >> cloudant_v1.env # if you change the image version please regenerate example output captures # use image at ARTIFACTORY_DOCKER_REPO_VIRTUAL registry if set, otherwise use default registry docker start couchdb || docker run --name couchdb --rm -e COUCHDB_USER="$SERVER_USERNAME" -e COUCHDB_PASSWORD="$SERVER_PASSWORD" -p 5984:5984 -d ${ARTIFACTORY_DOCKER_REPO_VIRTUAL:+${ARTIFACTORY_DOCKER_REPO_VIRTUAL}/}apache/couchdb:3 diff --git a/scripts/setup_wiremock.sh b/scripts/setup_wiremock.sh index 3233a512..ea3b5bad 100755 --- a/scripts/setup_wiremock.sh +++ b/scripts/setup_wiremock.sh @@ -3,9 +3,12 @@ set -ev printenv | grep "^WIREMOCK_" > wiremock.env +# setup env file for gen ITs +echo -e "CLOUDANT_AUTH_TYPE=noauth\nCLOUDANT_URL=$WIREMOCK_URL" >> cloudant_v1.env # use image at ARTIFACTORY_DOCKER_REPO_VIRTUAL registry if set, otherwise use default registry docker start wiremock || docker run --name wiremock --rm -d -p "$WIREMOCK_PORT":8080 ${ARTIFACTORY_DOCKER_REPO_VIRTUAL:+${ARTIFACTORY_DOCKER_REPO_VIRTUAL}/}wiremock/wiremock:latest timeout 120 bash -c 'while [[ "$(curl -s --location -o /dev/null -w ''%{http_code}'' ${WIREMOCK_URL}/__admin)" != "200" ]]; do sleep 2; done' || false curl "$WIREMOCK_URL"/__admin/mappings/import -X POST -d @stubs/mappings.json +curl "$WIREMOCK_URL"/__admin/mappings/import -X POST -d @stubs/gen-its-mappings.json echo "Wiremock started" diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json new file mode 100644 index 00000000..c4a8a5f0 --- /dev/null +++ b/stubs/gen-its-mappings.json @@ -0,0 +1,2742 @@ +{"mappings": [ + { + "id": "3afba80c-759a-3356-acf2-93866111665b", + "request": { + "url": "/", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"couchdb\":\"Welcome\",\"version\":\"3.2.1\",\"vendor\":{\"name\":\"IBM Cloudant\",\"version\":\"8287\",\"variant\":\"paas\"},\"features\":[\"geo\",\"search\",\"access-ready\",\"iam\",\"partitioned\",\"pluggable-storage-engines\",\"scheduler\"],\"features_flags\":[\"partitioned\"]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:31 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "95afae62f0ea5c9f26c869d9d00e2b8a", + "X-Cloudant-Action": "cloudantnosqldb.account-meta-info.read", + "X-Couch-Request-ID": "95afae62f0", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "3afba80c-759a-3356-acf2-93866111665b" + }, + { + "id": "082f68f8-c053-36d3-9eb1-cb8686d296aa", + "request": { + "url": "/_active_tasks", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:00 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "249fc0a91bbf42406f8d93f1e20e401f", + "X-Cloudant-Action": "cloudantnosqldb.account-active-tasks.read", + "X-Couch-Request-ID": "249fc0a91b", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "082f68f8-c053-36d3-9eb1-cb8686d296aa" + }, + { + "id": "ad18e9e4-40a9-3cda-afe4-28217cbd04f5", + "request": { + "url": "/_all_dbs?descending=false&end_key=testString&limit=0&skip=0&start_key=testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[\"testString\"]", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "ETag": "W/\"8I1PKGO1BVSLINUMI3N4GOJTG\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3153310816b744a750175766d6c3c436", + "X-Cloudant-Action": "cloudantnosqldb.account-all-dbs.read", + "X-Couch-Request-ID": "3153310816", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ad18e9e4-40a9-3cda-afe4-28217cbd04f5" + }, + { + "id": "544965f4-c99a-38ac-8b9d-b8ae4eafc952", + "request": { + "url": "/_api/v2/api_keys", + "method": "POST" + }, + "response": { + "status": 201, + "body": "{\"ok\": true, \"key\": \"apikey-98d494672e2c47beaec43f4633411189\", \"password\": \"54fcd98b4bb1206afb7d9be049e81234c768ab4d\"}", + "headers": { + "Date": "Mon, 16 May 2022 21:08:53 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.apikeys", + "x-envoy-upstream-service-time": "1075", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717515d76586c-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "544965f4-c99a-38ac-8b9d-b8ae4eafc952" + }, + { + "id": "cf012f70-bff3-3596-bc47-c1f4cf97212d", + "request": { + "url": "/_api/v2/db/testString/_security", + "method": "PUT", + "bodyPatterns": [ + { + "matchesJsonPath": "$.[?(@.cloudant == null || @.cloudant.key1 != null)]", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"ok\":true}", + "headers": { + "Date": "Mon, 16 May 2022 21:08:54 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.db-security", + "x-envoy-upstream-service-time": "1461", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717591f00822a-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "cf012f70-bff3-3596-bc47-c1f4cf97212d" + }, + { + "id": "44f68031-9fad-3ed6-9871-d9e7c5fd396a", + "request": { + "url": "/_api/v2/user/activity_tracker/events", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"types\": [\"data\", \"management\"]}", + "headers": { + "Date": "Mon, 16 May 2022 21:09:05 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.activity-tracker-event-types.read", + "x-envoy-upstream-service-time": "5165", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c71787be096fd7-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "44f68031-9fad-3ed6-9871-d9e7c5fd396a" + }, + { + "id": "e42d0204-7e2b-3850-bab6-3188dad08068", + "request": { + "url": "/_api/v2/user/activity_tracker/events", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"types\": [\"management\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"ok\": true}", + "headers": { + "Date": "Mon, 16 May 2022 21:09:07 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.activity-tracker-event-types.write", + "x-envoy-upstream-service-time": "1396", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717a998cb5d80-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb1.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "e42d0204-7e2b-3850-bab6-3188dad08068" + }, + { + "id": "f3eef08d-1cac-3c95-90bb-e1d95690c74b", + "request": { + "url": "/_api/v2/user/capacity/throughput", + "method": "PUT", + "bodyPatterns": [ + { + "matchesJsonPath": "$.blocks", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"current\":{\"throughput\":{\"blocks\":5,\"query\":25,\"read\":500,\"write\":250}},\"target\":{\"throughput\":{\"blocks\":10,\"query\":50,\"read\":1000,\"write\":500}}}", + "headers": { + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.capacity-throughput.write", + "x-envoy-upstream-service-time": "838", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c716dc9fa05a2e-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "f3eef08d-1cac-3c95-90bb-e1d95690c74b" + }, + { + "id": "472c4134-a11c-3c72-980c-85518316a338", + "request": { + "url": "/_api/v2/user/capacity/throughput", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"current\": {\"throughput\": {\"read\": 20, \"write\": 10, \"query\": 5}}}", + "headers": { + "Date": "Mon, 16 May 2022 21:08:33 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.capacity-throughput.read", + "x-envoy-upstream-service-time": "1135", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c716d47ab17ffd-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "472c4134-a11c-3c72-980c-85518316a338" + }, + { + "id": "620fd692-b6a6-3b64-967c-ffee174c2cff", + "request": { + "url": "/_api/v2/user/config/cors", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{\"allow_credentials\": true, \"enable_cors\": true, \"origins\": [\"testString\"]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "body": "{\"ok\": true}", + "headers": { + "Date": "Fri, 20 May 2022 18:04:13 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.usercors", + "x-envoy-upstream-service-time": "2487", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70e6fe465b125962-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "620fd692-b6a6-3b64-967c-ffee174c2cff" + }, + { + "id": "a2e4e696-e631-33f8-b168-5015048cdad8", + "request": { + "url": "/_api/v2/user/config/cors", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"enable_cors\": true, \"origins\": [\"https://example.com\"], \"allow_credentials\": false}", + "headers": { + "Date": "Mon, 16 May 2022 21:08:56 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.usercors", + "x-envoy-upstream-service-time": "1371", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717635b6d82ea-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "a2e4e696-e631-33f8-b168-5015048cdad8" + }, + { + "id": "8c38b725-a6ac-3f63-a723-9f4925ae23fd", + "request": { + "url": "/_api/v2/user/current/throughput", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"throughput\": {\"read\": 0, \"write\": 0, \"query\": 0}}", + "headers": { + "Date": "Mon, 16 May 2022 21:09:09 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.current-throughput.read", + "x-envoy-upstream-service-time": "1269", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717b35e550660-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb1.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "8c38b725-a6ac-3f63-a723-9f4925ae23fd" + }, + { + "id": "1caf7257-c094-3a41-92ad-a6e49a376615", + "request": { + "urlPath": "/_db_updates", + "method": "GET", + "queryParameters": { + "feed": { + "equalTo": "normal" + }, + "heartbeat": { + "equalTo": "0" + }, + "since": { + "equalTo": "0" + }, + "timeout": { + "equalTo": "0" + } + } + }, + "response": { + "status": 200, + "body": "{\"last_seq\":\"1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0\",\"results\":[{\"dbname\":\"events\",\"seq\":\"1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0\",\"type\":\"created\"}]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "2d4a268c250238deeff1fe847741aca0", + "X-Cloudant-Action": "cloudantnosqldb.account-db-updates.read", + "X-Couch-Request-ID": "2d4a268c25", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "1caf7257-c094-3a41-92ad-a6e49a376615" + }, + { + "id": "0e3d6794-25ed-3bf2-90ea-34410b429c76", + "request": { + "url": "/_dbs_info", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"keys\": [\"testString\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "[{\"key\":\"testdb\",\"info\":{\"db_name\":\"testdb\",\"instance_start_time\":\"1652999321\",\"purge_seq\":\"0-g1AAAAQXeJzLYWBgEMhgTmHQSElKzi9KdUhJMtRLytVNTtYtLdZNTSwu0TUw1UvOyS9NScwr0ctLLckB6mDKYwGSDB-A1H8gyEpkABmhiTCCeDMeQMx4DzUD4QwToo24ADHiPoYR5kQbcQBixHkMI4j3yAaIEfspCYwFEDPWUxAYEyBGzKcgMBogRvSTFRhJBUAyqZ7sVJGUANKfj9BPWiAkBYC0x2PTTkwAJDmAtPtj006U4w1A2u3J97wCSL8-2Z4XAGmXJ9fziQxJ_BC9WQB5BlMh\",\"update_seq\":\"14-g1AAAAereJy908tNwzAYwHHT8jjSDeAIhxTbiWPnRDeADcCfH6qqPhBtz7ABbAAbwAawAWxAN4ANwI4jpbk1SG4OjhQl30_OPxkjhHrDrkYnGtTs1gw0kD5MEqWS5Twxcr5IMOur8Wyp5XTRn5rF2D3Rme66Ff240687RsOu7EzchQPLcJpp1mKct0_rmzfHVwH_9jgqcYazlGeizbzmzrON8c-Af9U4yWXGqGgxrmnzje33YH_UtmDCgCYtxv23-Guw32qbG4u5Ntso_hzwlxpXime8YNso_hjwp7XPrbAU22ILxe-D_bC2cWA5FjZqcbhxK9xV_3dVmyrCDI1bG649PGvAqSo01TJuabj08FUDNnmusSFRK8PAuxeVuxMKE0ssp3ELY--eN_Zrtdug4pELH3v4rIL3ShhEqhk1kQv3PHxUwfslTAtgTEDUwhLBYeM1C4GNkdBizugP-uNrDA\",\"sizes\":{\"file\":666707,\"external\":304,\"active\":12758},\"props\":{},\"doc_del_count\":1,\"doc_count\":3,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":16,\"n\":3,\"w\":2,\"r\":2}}}]", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "20e0a09fd367bbb1463ff32d6616f4e6", + "X-Cloudant-Action": "cloudantnosqldb.account-dbs-info.read", + "X-Couch-Request-ID": "20e0a09fd3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "0e3d6794-25ed-3bf2-90ea-34410b429c76" + }, + { + "id": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba", + "request": { + "url": "/_membership", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"all_nodes\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\",\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\",\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"cluster_nodes\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\",\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\",\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:31 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "fa692f7cfd6a091210084696d74c9e78", + "X-Cloudant-Action": "cloudantnosqldb.cluster-membership.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba" + }, + { + "id": "ea621c78-5215-34ac-94ce-95e13e1182bd", + "request": { + "url": "/_replicator/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:18:40 GMT", + "ETag": "\"2-2eb76179e2608844d7fab7a4ab67c5bf\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "a957f9a0e94e5cc392c318ddfd9530a1", + "X-Cloudant-Action": "cloudantnosqldb.replication.read", + "X-Couch-Request-ID": "a957f9a0e9", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)" + } + }, + "uuid": "ea621c78-5215-34ac-94ce-95e13e1182bd" + }, + { + "id": "ee208ab6-a73d-3325-b9b0-afcdaaaccab3", + "request": { + "urlPath": "/_replicator/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"3-364238f68a4eb90d4e10ad0ca5ad7772\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 19:04:39 GMT", + "ETag": "W/\"27-364238f68a4eb90d4e10ad0ca5ad7772\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "68250b09c2b37af95a2b3507bd887d90", + "X-Cloudant-Action": "cloudantnosqldb.replication.write", + "X-Couch-Request-ID": "68250b09c2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ee208ab6-a73d-3325-b9b0-afcdaaaccab3" + }, + { + "id": "109ff4b5-4d2a-32b8-890d-f15cfe54173a", + "request": { + "urlPath": "/_replicator/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + }, + "new_edits": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"source\": {\"url\": \"testString\"}, \"target\": {\"url\": \"testString\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"1-257d246167d34fcc2ca07926ba0213d1\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:54:50 GMT", + "ETag": "W/\"22-257d246167d34fcc2ca07926ba0213d1\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/_replicator/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "ce157aeb0e62a81f05c0e8c9e4d24c55", + "X-Cloudant-Action": "cloudantnosqldb.replication.write", + "X-Couch-Request-ID": "ce157aeb0e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "109ff4b5-4d2a-32b8-890d-f15cfe54173a" + }, + { + "id": "44eb7118-b9d0-38ee-8ada-9097415e6950", + "request": { + "urlPath": "/_replicator/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "deleted_conflicts": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + }, + "meta": { + "equalTo": "false" + }, + "rev": { + "equalTo": "testString" + }, + "revs": { + "equalTo": "false" + }, + "revs_info": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "body": "{\"_id\":\"testString\",\"_rev\":\"2-2eb76179e2608844d7fab7a4ab67c5bf\",\"source\":{\"url\":\"testString\"},\"target\":{\"url\":\"testString\"},\"owner\":\"iam-ServiceId-d3730bc8-88fb-4a35-9f1d-6e17f6cf369e\",\"_replication_state\":\"failed\",\"_replication_state_time\":\"2022-05-16T21:08:50Z\",\"_replication_state_reason\":\"{error,{case_clause,{error,invalid_uri}}}\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:20:06 GMT", + "ETag": "W/\"2-2eb76179e2608844d7fab7a4ab67c5bf\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "2211e195b24b7597aa72a5b7aa9bb756", + "X-Cloudant-Action": "cloudantnosqldb.replication.read", + "X-Couch-Request-ID": "2211e195b2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "44eb7118-b9d0-38ee-8ada-9097415e6950" + }, + { + "id": "13d8a8e0-e54e-3e8f-9649-d902a9950f31", + "request": { + "url": "/_scheduler/docs?limit=0&skip=0&states=initializing", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"total_rows\":1,\"offset\":0,\"docs\":[\r\n{\"database\":\"84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix/_replicator\",\"doc_id\":\"e945ba14464aef7dd519ba36ae6f9466\",\"id\":null,\"source\":\"https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/animaldb-target/\",\"target\":\"https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/animaldb/\",\"state\":\"completed\",\"error_count\":0,\"info\":{\"revisions_checked\":15,\"missing_revisions_found\":15,\"docs_read\":15,\"docs_written\":15,\"changes_pending\":null,\"doc_write_failures\":0,\"checkpointed_source_seq\":\"15-g1AAAAcaeJyt1MFNwzAUgGHTIiFOdAM4wiHFdmPHOdENYAPwsx2Vqk0Rbc-wAWwAG8AGsAFsQDeADYpTVyQ50CZuL4kUJf-nxM8ZIIRavaZGJxrU6NZ0NRDWhmGgVDAdB0aOJwEmbTUYTbVMJ-3UTAb2kYZEcDCfz_u9pmwM7YU9iIgxgDU6_gt1Vnc8VGjZIxwu4Z0FHCkBRIlSi25fPsrk05JsGAUFUHzlePswzuCzEiy5lFrSIhzWgnkVuJvB5yUYFOYCS_9FrgRfZPDlEkYLOCEmDIWF96epNsl1arRP-Sorj0pl2qGMJnjT8k1WviuVcRhzJfWK8pppWZTTXXtE9_Zk4w_5fpMMKGPKfymq448OfyoMYGSiiJsN9lx1_dnpL7muGO2EOPHfd9XxV4e_5d89hAg4Ft57j665u4C_O_wjxzmNRSi496LXwD8d_pXPc0woSUD8P8816jNX_87rSsSJYWQr9R9XL_4xATBwVWPV-r9_cTjG\"},\"start_time\":\"2021-11-07T23:54:45Z\",\"last_updated\":\"2021-11-07T23:54:49Z\"}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:50 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "95a00aef1c8f1b5d2ccd575501f38e8a", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "95a00aef1c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "13d8a8e0-e54e-3e8f-9649-d902a9950f31" + }, + { + "id": "775f4f0a-3b8a-37e2-aa47-140285fb2b1c", + "request": { + "url": "/_scheduler/docs/_replicator/testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"database\":\"_replicator\",\"doc_id\":\"testString\",\"id\":null,\"source\":null,\"target\":null,\"state\":\"failed\",\"error_count\":1,\"info\":{\"error\":\"{error,{case_clause,{error,invalid_uri}}}\"},\"start_time\":\"2022-05-16T21:08:50Z\",\"last_updated\":\"2022-05-16T21:08:50Z\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:50 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "2dd32790877ffef6279a3f9fe908836f", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "2dd3279087", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "775f4f0a-3b8a-37e2-aa47-140285fb2b1c" + }, + { + "id": "266af994-f5f5-31d5-bcda-15a9ea3c86b5", + "request": { + "url": "/_scheduler/docs/_replicator/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:22:17 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "da1acdc1a05b5d5bbaca269dca53b94d", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "da1acdc1a0", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)" + } + }, + "uuid": "266af994-f5f5-31d5-bcda-15a9ea3c86b5" + }, + { + "id": "5c158d49-97e6-3f2b-99ec-2f6629a13c77", + "request": { + "url": "/_scheduler/jobs?limit=0&skip=0", + "method": "GET" + }, + "response": { + "status": 200, + "jsonBody": { + "total_rows":1, + "offset":0, + "jobs":[ + { + "database":"_replicator", + "doc_id":"testString", + "history":[ + {"timestamp":"2022-05-16T21:08:50Z","type":"started"}, + {"timestamp":"2022-05-16T21:08:50Z","type":"error"} + ], + "id":"testString", + "info":{ + "changes_pending":null, + "checkpointed_source_seq":"113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ", + "doc_write_failures":0, + "docs_read":2, + "docs_written":2, + "missing_revisions_found":0, + "revisions_checked":2, + "source_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", + "through_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" + }, + "node":"node1@127.0.0.1", + "pid":"<0.1850.0>", + "source":"http://test.com/testString", + "start_time":"2022-05-16T21:08:50Z", + "target":"http://adm:*****@localhost:15984/testString/", + "user":null + } + ] + }, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:54:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "d97a5d3526ee45e215450a0abea76caf", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "d97a5d3526", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "5c158d49-97e6-3f2b-99ec-2f6629a13c77" + }, + { + "id": "e9f68b82-7693-38ea-bd6a-66227a0086bf", + "request": { + "url": "/_scheduler/jobs/testString", + "method": "GET" + }, + "response": { + "status": 200, + "jsonBody": { + "database":"_replicator", + "doc_id":"testString", + "history":[ + {"timestamp":"2022-05-16T21:08:50Z","type":"started"}, + {"timestamp":"2022-05-16T21:08:50Z","type":"error"} + ], + "id":"testString", + "info":{ + "changes_pending":null, + "checkpointed_source_seq":"113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ", + "doc_write_failures":0, + "docs_read":2, + "docs_written":2, + "missing_revisions_found":0, + "revisions_checked":2, + "source_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", + "through_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" + }, + "node":"node1@127.0.0.1", + "pid":"<0.1850.0>", + "source":"http://test.com/testString", + "start_time":"2022-05-16T21:08:50Z", + "target":"http://adm:*****@localhost:15984/testString/", + "user":null + }, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 17:07:47 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "7842b56965a4f079106b35134a6e7e7d", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "7842b56965", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "e9f68b82-7693-38ea-bd6a-66227a0086bf" + }, + { + "id": "e1623757-bf89-30e0-b209-1f5601bc039a", + "request": { + "url": "/_scheduler/jobs/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 17:06:24 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "397edf40473b25285c6c9048a9159f5d", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "397edf4047", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "e1623757-bf89-30e0-b209-1f5601bc039a" + }, + { + "id": "1244a623-9af3-3200-b5cf-72605afcbcdc", + "request": { + "url": "/_search_analyze", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"analyzer\": \"arabic\", \"text\": \"testString\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"tokens\":[\"teststring\"]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:45 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "752119aa13519496f4b8ca931ac9805d", + "X-Cloudant-Action": "cloudantnosqldb.account-search-analyze.execute", + "X-Couch-Request-ID": "752119aa13", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "1244a623-9af3-3200-b5cf-72605afcbcdc" + }, + { + "id": "7d66f494-6c33-3ad6-a9fb-478a37bdddb1", + "request": { + "url": "/_session", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"userCtx\":{\"roles\":[\"_reader\",\"_writer\",\"_admin\"],\"name\":\"iam-ServiceId-d3730bf4-80fx-4a35-9f1d-6e17f6cf369e\"},\"ok\":true,\"info\":{\"authentication_handlers\":[\"iam\",\"cookie\",\"default\",\"local\"],\"authenticated\":\"iam\",\"authentication_db\":\"bm-cc-us-east-05/users\"}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "09b190ce0497173c7cd117d33f0cbce0", + "X-Cloudant-Action": "cloudantnosqldb.session.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "7d66f494-6c33-3ad6-a9fb-478a37bdddb1" + }, + { + "id": "2dbb122f-e2d2-37ba-948d-dfb542bed417", + "request": { + "url": "/_up", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"status\":\"ok\",\"seeds\":{}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:00 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "54aa03b6b2f86864aeb66bb8880a7410", + "X-Cloudant-Action": "cloudantnosqldb.account-up.read", + "X-Couch-Request-ID": "54aa03b6b2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "2dbb122f-e2d2-37ba-948d-dfb542bed417" + }, + { + "id": "327b6531-390c-3921-8fa8-2d3a15a5c354", + "request": { + "url": "/_up", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:59 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "a3174645ff67c7323413c124304c3120", + "X-Cloudant-Action": "cloudantnosqldb.account-up.read", + "X-Couch-Request-ID": "a3174645ff", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "327b6531-390c-3921-8fa8-2d3a15a5c354" + }, + { + "id": "ff71d02c-9458-3cc5-8bda-10ef97e619e0", + "request": { + "url": "/_uuids?count=1", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"uuids\":[\"4cf311226d91632bf1480e4edeac069e\"]}", + "headers": { + "Cache-Control": "no-cache", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:31 GMT", + "ETag": "W/\"6QFC7LLFUJMXCK2CLNVW17C9T\"", + "Expires": "Mon, 01 Jan 1990 00:00:00 GMT", + "Pragma": "no-cache", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "7b3d88210d51e4558a56f0a18a17a185", + "X-Cloudant-Action": "cloudantnosqldb.account-uuids.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ff71d02c-9458-3cc5-8bda-10ef97e619e0" + }, + { + "id": "32a541c3-6915-3b1d-a8d8-26df21c8e3b4", + "request": { + "url": "/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5129cddfb161533246b92249c36bf908", + "X-Cloudant-Action": "cloudantnosqldb.database-info.read", + "X-Couch-Request-ID": "5129cddfb1", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "32a541c3-6915-3b1d-a8d8-26df21c8e3b4" + }, + { + "id": "28948775-8ce7-3d39-88ba-16ef4e7bf6f4", + "request": { + "url": "/testString/_all_docs/queries", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"queries\": [{}]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"results\":[\n{\"total_rows\":2,\"offset\":0,\"rows\":[\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}},\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":{\"rev\":\"6-80028e69ea6e259eba0b419c3750128b\"}}\n]}\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:36 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "1aa1063b6a539c0dfdc6fdc223e0e30e", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "1aa1063b6a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "28948775-8ce7-3d39-88ba-16ef4e7bf6f4" + }, + { + "id": "7be40bd0-8e36-3edd-a7b5-e45656e2e5ad", + "request": { + "url": "/testString/_all_docs", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":2,\"offset\":0,\"rows\":[\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}},\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":{\"rev\":\"6-80028e69ea6e259eba0b419c3750128b\"}}\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:35 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "aeee0214122f14bdb09aaca920bfb854", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "aeee021412", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "7be40bd0-8e36-3edd-a7b5-e45656e2e5ad" + }, + { + "id": "28b9ab32-ea1f-3dad-b95b-a7a4d85577a8", + "request": { + "url": "/testString/_bulk_docs", + "method": "POST", + "bodyPatterns": [ + { + "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "[{\"ok\":true,\"id\":\"a40deaed41325036f37b18a5c48e5c5c\",\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}]", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:37 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3e01e9903d1dc1d839031298207d4698", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "x-cloudant-cost-write": "1", + "X-Couch-Request-ID": "3e01e9903d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "28b9ab32-ea1f-3dad-b95b-a7a4d85577a8" + }, + { + "id": "74cf16a4-75b1-3914-a50d-014650c7140a", + "request": { + "urlPath": "/testString/_bulk_get", + "method": "POST", + "queryParameters": { + "attachments": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "revs": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"docs\": [{\"atts_since\": [\"1-99b02e08da151943c2dcb40090160bb8\"], \"id\": \"testString\"}]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"results\": [{\"id\": \"testString\", \"docs\": [{\"error\":{\"id\":\"testString\",\"rev\":\"undefined\",\"error\":\"not_found\",\"reason\":\"missing\"}}]}]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:37 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "e007ac087f2f353b5deac55d745bf37d", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "x-cloudant-cost-lookup": "1", + "X-Couch-Request-ID": "e007ac087f", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "74cf16a4-75b1-3914-a50d-014650c7140a" + }, + { + "id": "020940d2-536c-36f7-9bf8-67b3b3fce208", + "request": { + "urlPath": "/testString/_changes", + "method": "POST", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "descending": { + "equalTo": "false" + }, + "feed": { + "equalTo": "normal" + }, + "filter": { + "equalTo": "testString" + }, + "heartbeat": { + "equalTo": "0" + }, + "include_docs": { + "equalTo": "false" + }, + "limit": { + "equalTo": "0" + }, + "seq_interval": { + "equalTo": "1" + }, + "since": { + "equalTo": "0" + }, + "style": { + "equalTo": "main_only" + }, + "timeout": { + "equalTo": "0" + }, + "view": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "jsonBody": { + "results":[ + {"seq":"1-g1AAAAT7eJzLYWBgEMhgTmHQTElKzi9KdUhJMjTSS8rVTU7WLS3WTU0sLtE1MNVLzskvTUnMK9HLSy3JAWphSmRI4v___39WIgNIswZcsyURepMEgGSSPDbtZsRoVwBp1wdpz2BOZMgF8tiTks1NU9OMSDAK1V5ivJxkALLXHuFsEoMsyQGk35_sUAsAaY8nO9QSQNrzUUItNTEl1dLAkrahVgCyt57sUMtjAZIMDUAKaEQ_WSEHMWICxIj5ZIUexIgFECPWg0KQERyCholmaUlpqTQNQYjdGyB276ckFA9AzDhPQShegBhxn4JQfAAx4j0iHSZbmAETYhIdQvEDxG5QWswCAAkkmjk","id":"testString","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]}, + {"seq":"2-g1AAAAZVeJy9lM9NwzAYxQ1F4kg3gCMcEtz8c3yiG8AG4M_-oqpKE0TTM2wAG8AGsAFsABvABnSDYGOJ1LckKL04kpX3fk_fs50TQsazkSInCmR5g1MFk8CHhSelt1p6KJaVR2Nf5uVKiaLyC6xyLdkVBA7qup7PRoIs9MZ-lFBOFetiZLDHf3_zFlQY6xUODVgQV560kR8Z-amTGySLMQs6WLncNsMCarhnTeyOw4ap0Z87uVWKEiQMPO8LA750wGHMMGDYwapHUVeGWzpcFAo55cMWdW24t72LKvb0Su70R1vcN9klywIeZMOWZeEPFv64cVIYC6NUDVqYZT9Z9rNh7_yyJyLJIMNBS7PsF8t-_U9xb9bjvckf80ghhNso7sPCP3u9bNbiy1p8bxy8NNG3BrYw_7Vlm4sz_wEJbgPy","id":"_design/testString","changes":[{"rev":"1-7a60109c85ab05898824bb73aef71884"}]} + ], + "last_seq":"2-g1AAAAZVeJy9lM9NwzAYxQ1F4kg3gCMcEtz8c3yiG8AG4M_-oqpKE0TTM2wAG8AGsAFsABvABnSDYGOJ1LckKL04kpX3fk_fs50TQsazkSInCmR5g1MFk8CHhSelt1p6KJaVR2Nf5uVKiaLyC6xyLdkVBA7qup7PRoIs9MZ-lFBOFetiZLDHf3_zFlQY6xUODVgQV560kR8Z-amTGySLMQs6WLncNsMCarhnTeyOw4ap0Z87uVWKEiQMPO8LA750wGHMMGDYwapHUVeGWzpcFAo55cMWdW24t72LKvb0Su70R1vcN9klywIeZMOWZeEPFv64cVIYC6NUDVqYZT9Z9rNh7_yyJyLJIMNBS7PsF8t-_U9xb9bjvckf80ghhNso7sPCP3u9bNbiy1p8bxy8NNG3BrYw_7Vlm4sz_wEJbgPy", + "pending":0 + }, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "ETag": "W/\"8DLU1VJV4CEKAI17LB0GT0N6O\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "404db768c41f8545f254f1dfd0ea5629", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "404db768c4", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "020940d2-536c-36f7-9bf8-67b3b3fce208" + }, + { + "id": "461288f0-48dd-3060-9313-54cbccd47cad", + "request": { + "urlPath": "/testString/_design/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + }, + "new_edits": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"_design/testString\",\"rev\":\"3-7144018200809db9cf3c818ad73db361\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 21:27:49 GMT", + "ETag": "W/\"3-7144018200809db9cf3c818ad73db361\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/_design%2FtestString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "e124a1c51ad9305dc6b7d0c9b221b4e9", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "e124a1c51a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "461288f0-48dd-3060-9313-54cbccd47cad" + }, + { + "id": "b03a36c9-109f-32af-a3ce-fe7116672291", + "request": { + "url": "/testString/_design/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 20:45:03 GMT", + "ETag": "\"1-967a00dff5e02add41819138abb3284d\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "c44b096c253fb87b996ae27d08075657", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "c44b096c25", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "b03a36c9-109f-32af-a3ce-fe7116672291" + }, + { + "id": "fff55e78-260e-3b17-a8cf-1934e090287e", + "request": { + "urlPath": "/testString/_design/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "deleted_conflicts": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + }, + "meta": { + "equalTo": "false" + }, + "rev": { + "equalTo": "testString" + }, + "revs": { + "equalTo": "false" + }, + "revs_info": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "body": "{\"_id\":\"_design/testString\",\"_rev\":\"1-967a00dff5e02add41819138abb3284d\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 21:14:31 GMT", + "ETag": "W/\"1-967a00dff5e02add41819138abb3284d\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "c7fa2320139c35e187a736e478811ae0", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "c7fa232013", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "fff55e78-260e-3b17-a8cf-1934e090287e" + }, + { + "id": "720ca71a-295f-3d91-aa44-a7dddf28f915", + "request": { + "url": "/testString/_design/testString/_info", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"name\":\"testString\",\"view_index\":{\"updates_pending\":{\"minimum\":9,\"preferred\":7,\"total\":9},\"waiting_commit\":false,\"waiting_clients\":0,\"updater_running\":false,\"update_seq\":0,\"sizes\":{\"file\":816,\"external\":0,\"active\":0},\"signature\":\"3e823c2a4383ac0c18d4e574135a5b08\",\"purge_seq\":0,\"language\":\"javascript\",\"compact_running\":false,\"collator_versions\":[\"58.0.6.48\"]}}", + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:39 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "fd54336e518033cf53162cba352a86bb", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "fd54336e51", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "720ca71a-295f-3d91-aa44-a7dddf28f915" + }, + { + "id": "8e817ede-8647-3ada-ab72-58dfc263fc30", + "request": { + "url": "/testString/_design/testString/_search/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"query\": \"testString\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":0,\"bookmark\":\"g2o\",\"rows\":[]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 15:49:53 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "9b54ed06009bf95d8137e21ebc705792", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "9b54ed0600", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "8e817ede-8647-3ada-ab72-58dfc263fc30" + }, + { + "id": "e6c0db1b-cd2e-379e-b7a6-27ec75049831", + "request": { + "url": "/testString/_design/testString/_search_info/testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"name\":\"_design/testString/testString\",\"search_index\":{\"signature\":\"61f0b78b3e5e995c781fdf4314be424d\",\"pending_seq\":2,\"doc_del_count\":0,\"doc_count\":2,\"disk_size\":2919,\"committed_seq\":2}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 15:53:44 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3404cc7ff86fd35a4b20916886f83157", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "3404cc7ff8", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "e6c0db1b-cd2e-379e-b7a6-27ec75049831" + }, + { + "id": "d3c833ba-4501-3b32-b148-5bd28a803971", + "request": { + "url": "/testString/_design/testString/_view/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":1}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 21:36:38 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "32896eea2831f2fd3e9a395511d1ad9d", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "32896eea28", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "d3c833ba-4501-3b32-b148-5bd28a803971" + }, + { + "id": "c3486bd0-042f-355e-8981-2660f426fc78", + "request": { + "url": "/testString/_design/testString/_view/testString/queries", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"queries\": [{}]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"results\":[\r\n{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":1}\r\n]}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 21:34:23 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3dcd8e06f37f2c9447847b215a34c7bc", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "3dcd8e06f3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "c3486bd0-042f-355e-8981-2660f426fc78" + }, + { + "id": "4620004f-c409-3896-a6a9-8a2dacfa5356", + "request": { + "urlPath": "/testString/_design/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "body": "{\"ok\":true,\"id\":\"_design/testString\",\"rev\":\"2-111f03850e4f2067647dcc724ded6355\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:45:39 GMT", + "ETag": "W/\"4-111f03850e4f2067647dcc724ded6355\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "30bea87f8ef003389fe71c1bdcd9d60c", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "30bea87f8e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "4620004f-c409-3896-a6a9-8a2dacfa5356" + }, + { + "id": "e0812d78-e939-3d3b-b4d7-c0ec30388f56", + "request": { + "url": "/testString/_design_docs", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 24 May 2022 20:50:44 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "90a04990685e86a438d58f8341c53fbd", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "90a0499068", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "e0812d78-e939-3d3b-b4d7-c0ec30388f56" + }, + { + "id": "30c2e356-94cd-3c5a-b5a0-2396b5bc4eaf", + "request": { + "url": "/testString/_design_docs/queries", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"queries\": [{}]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"results\":[\r\n{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}}\r\n]}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Tue, 24 May 2022 20:53:32 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "abf1f943184e48e3667be3cc7bfecd92", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "abf1f94318", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "30c2e356-94cd-3c5a-b5a0-2396b5bc4eaf" + }, + { + "id": "83a8375b-20e0-36b2-ba07-cbc994140f3e", + "request": { + "url": "/testString/_explain", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 0, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"dbname\":\"account-bluemix/testString\",\"index\":{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},\"partitioned\":\"undefined\",\"selector\":{\"key1\":{\"$eq\":\"testString\"}},\"opts\":{\"use_index\":[],\"bookmark\":\"nil\",\"limit\":10000000000,\"skip\":0,\"sort\":{},\"fields\":[\"testString\"],\"partition\":\"\",\"r\":[49],\"conflicts\":false,\"stale\":false,\"update\":true,\"stable\":false,\"execution_stats\":false},\"limit\":10000000000,\"skip\":0,\"fields\":[\"testString\"],\"mrargs\":{\"include_docs\":true,\"view_type\":\"map\",\"reduce\":false,\"partition\":null,\"start_key\":null,\"end_key\":\"\",\"direction\":\"fwd\",\"stable\":false,\"update\":true,\"conflicts\":\"undefined\"}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:45 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5db5f421aa87d09bf677dab0df8b409b", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "5db5f421aa", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "83a8375b-20e0-36b2-ba07-cbc994140f3e" + }, + { + "id": "e63e760d-4bad-31e3-865c-4d4e2c3ab28a", + "request": { + "url": "/testString/_find", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 0, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"docs\":[\r\n],\r\n\"bookmark\": \"nil\",\r\n\"warning\": \"No matching index found, create an index to optimize query time.\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:44 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "131553237ddf5d488049455ff3c78c24", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "131553237d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "e63e760d-4bad-31e3-865c-4d4e2c3ab28a" + }, + { + "id": "0aae4e1b-4552-3154-8b80-76bd1e4fe0a4", + "request": { + "urlPattern": "/testString/_index/_design/(.*)/json/(.*)", + "method": "DELETE" + }, + "response": { + "status": 200, + "body": "{\"ok\":true}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:26:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "bdcc11a6e2426df69ea7f0dedeb61dc4", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "bdcc11a6e2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "0aae4e1b-4552-3154-8b80-76bd1e4fe0a4" + }, + { + "id": "8a7e9c07-5c90-37ff-a9ed-4374e25145ea", + "request": { + "url": "/testString/_index", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"total_rows\":2,\"indexes\":[{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},{\"ddoc\":\"_design/3fa64f0768edfd1dd7ec862c7415b3fe8138b393\",\"name\":\"3fa64f0768edfd1dd7ec862c7415b3fe8138b393\",\"type\":\"json\",\"partitioned\":false,\"def\":{\"fields\":[{\"_id\":\"asc\"}]}}]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:24:06 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "fb5312b548be009f9658ad7343f24efb", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "fb5312b548", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "8a7e9c07-5c90-37ff-a9ed-4374e25145ea" + }, + { + "id": "6026c807-3ad5-3944-a4cc-6a4906aaefd3", + "request": { + "url": "/testString/_index", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"index\": {}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"result\":\"created\",\"id\":\"_design/3fa64f0768edfd1dd7ec862c7415b3fe8138b393\",\"name\":\"3fa64f0768edfd1dd7ec862c7415b3fe8138b393\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 15:42:53 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "b4c0baceee481be0eb2174c4a9962c58", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "b4c0baceee", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "6026c807-3ad5-3944-a4cc-6a4906aaefd3" + }, + { + "id": "c8bd56cb-8f5b-3521-80a9-75231b5a5069", + "request": { + "urlPath": "/testString/_local/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"_local/testString\",\"rev\":\"0-1\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:32:13 GMT", + "ETag": "W/\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/_local%2FtestString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "6cb9599b2c12bc8ca784be001ad71f92", + "X-Cloudant-Action": "cloudantnosqldb.local-document.write", + "X-Couch-Request-ID": "6cb9599b2c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "c8bd56cb-8f5b-3521-80a9-75231b5a5069" + }, + { + "id": "e2fa7386-36e2-36f0-ad24-0b3e7ebd3585", + "request": { + "url": "/testString/_local/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:34:22 GMT", + "ETag": "\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "0acbffcb1d8029d190789dddd3521397", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "0acbffcb1d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "e2fa7386-36e2-36f0-ad24-0b3e7ebd3585" + }, + { + "id": "825527a5-47ec-355d-b00a-0877fbb0a29e", + "request": { + "urlPath": "/testString/_local/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + } + }, + "response": { + "status": 200, + "body": "{\"ok\":true,\"id\":\"_local/testString\",\"rev\":\"0-0\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:08 GMT", + "ETag": "W/\"DKGUB9HWEX2KQNSCSMV0JG1KK\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "758b33bb54b870dde75c57382a6bc1b6", + "X-Cloudant-Action": "cloudantnosqldb.local-document.write", + "X-Couch-Request-ID": "758b33bb54", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "825527a5-47ec-355d-b00a-0877fbb0a29e" + }, + { + "id": "a169db5c-1dd0-3bd6-a373-5422ecfd1509", + "request": { + "urlPath": "/testString/_local/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "body": "{\"_id\":\"_local/testString\",\"_rev\":\"0-1\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:34:22 GMT", + "ETag": "W/\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "eb9e1ce6c4a1d44b41dea28aa5136d02", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "eb9e1ce6c4", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "a169db5c-1dd0-3bd6-a373-5422ecfd1509" + }, + { + "id": "af6271d1-4985-3dc8-9662-501d6a81d30d", + "request": { + "url": "/testString/_partition/testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"db_name\":\"account-bluemix/testString\",\"sizes\":{\"active\":39,\"external\":2},\"partition\":\"testString\",\"doc_count\":1,\"doc_del_count\":0}", + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:19:26 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "9a31e19b4ed0ae92c12fdae6b2cfd5da", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "9a31e19b4e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "af6271d1-4985-3dc8-9662-501d6a81d30d" + }, + { + "id": "2c580fc6-7377-38e3-8356-c7f2a36cad84", + "request": { + "url": "/testString/_partition/testString/_all_docs", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString:testString\",\"key\":\"testString:testString\",\"value\":{\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:20:22 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3a686f700406d04e7fb1ace02dc471bc", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "3a686f7004", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "2c580fc6-7377-38e3-8356-c7f2a36cad84" + }, + { + "id": "7d36c625-d941-34ba-99bb-519bd6ca923f", + "request": { + "url": "/testString/_partition/testString/_design/testString/_search/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"query\": \"testString\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":0,\"bookmark\":\"g2o\",\"rows\":[]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:15:39 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "17165e96850d9d0e13b1278163366b94", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "17165e9685", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "7d36c625-d941-34ba-99bb-519bd6ca923f" + }, + { + "id": "ecaf4992-8865-3623-86d5-9181c46ed721", + "request": { + "url": "/testString/_partition/testString/_design/testString/_view/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString:testString\",\"key\":\"testString:testString\",\"value\":1}\r\n]}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:23:18 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "690674ef064cae7a0cd532056e85622c", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "690674ef06", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ecaf4992-8865-3623-86d5-9181c46ed721" + }, + { + "id": "337c4338-3094-3c88-a44e-981e449b1d7a", + "request": { + "url": "/testString/_partition/testString/_find", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 0, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"docs\":[\r\n],\r\n\"bookmark\": \"nil\",\r\n\"warning\": \"No matching index found, create an index to optimize query time.\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:26:19 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5ebc08e24c058f8a9d9793c32c226bf3", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "5ebc08e24c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "337c4338-3094-3c88-a44e-981e449b1d7a" + }, + { + "id": "acadaa2a-bebd-3daf-987b-a8eacc2227e0", + "request": { + "url": "/testString/_revs_diff", + "method": "POST", + "bodyPatterns": [ + { + "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"key1\":{\"missing\":[\"1-testString\"]}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:40:13 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "295ee11482f22ffa973e81daf2613898", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "295ee11482", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "acadaa2a-bebd-3daf-987b-a8eacc2227e0" + }, + { + "id": "60056468-bcb5-3b3f-9815-bf4c95c623b4", + "request": { + "url": "/testString/_security", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5d8b354c95486f5a0f06200096ca5612", + "X-Cloudant-Action": "cloudantnosqldb.database-security.read", + "X-Couch-Request-ID": "5d8b354c95", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "60056468-bcb5-3b3f-9815-bf4c95c623b4" + }, + { + "id": "28ac8e52-0af2-37e5-b22e-558da950be34", + "request": { + "url": "/testString/_security", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"ok\":true}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "a3973a0f6fe6cba29ecb9647fae801f3", + "X-Cloudant-Action": "cloudantnosqldb.database-security.write", + "X-Couch-Request-ID": "a3973a0f6f", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "28ac8e52-0af2-37e5-b22e-558da950be34" + }, + { + "id": "b8c0e06d-17c2-3810-9377-7c219ebe3dd9", + "request": { + "url": "/testString/_shards", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"shards\":{\"00000000-0fffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"10000000-1fffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"20000000-2fffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"30000000-3fffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"],\"40000000-4fffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"50000000-5fffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"60000000-6fffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"70000000-7fffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"],\"80000000-8fffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"90000000-9fffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"a0000000-afffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"b0000000-bfffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"],\"c0000000-cfffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"d0000000-dfffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"e0000000-efffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"f0000000-ffffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"]}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:59 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "c7a84aa69921ef4072d42ec31b0d3db3", + "X-Cloudant-Action": "cloudantnosqldb.database-shards.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "b8c0e06d-17c2-3810-9377-7c219ebe3dd9" + }, + { + "id": "d20bae36-5d48-3bf4-b14d-e954b7869d55", + "request": { + "url": "/testString/_shards/testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"range\":\"10000000-1fffffff\",\"nodes\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"]}", + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:59 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "b2f00c238f9bd4ffa701399e34d9bf54", + "X-Cloudant-Action": "cloudantnosqldb.database-shards.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "d20bae36-5d48-3bf4-b14d-e954b7869d55" + }, + { + "id": "d317807f-250c-3abd-804d-34e98eebdad8", + "request": { + "urlPath": "/testString", + "method": "POST", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + } + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"a27fe29f38cf3cf647d8575585706955\",\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 17:07:57 GMT", + "Location": "https://ACCOUNT.cloudant.com/testString/a27fe29f38cf3cf647d8575585706955", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "efbd92438c668c8d821a454cf4e27223", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "efbd92438c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "d317807f-250c-3abd-804d-34e98eebdad8" + }, + { + "id": "a2bd99a8-d38d-3c23-8e98-40d6cd029ff1", + "request": { + "url": "/testString", + "method": "DELETE" + }, + "response": { + "status": 200, + "body": "{\"ok\":true}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:10 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "992526e30a13656ec4e93001efa2eb7c", + "X-Cloudant-Action": "cloudantnosqldb.database.delete", + "X-Couch-Request-ID": "992526e30a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "a2bd99a8-d38d-3c23-8e98-40d6cd029ff1" + }, + { + "id": "660a0142-29dd-3918-a4aa-f77527e358c2", + "request": { + "url": "/testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"update_seq\":\"5-g1AAAAereJy91M1NwzAYgGFDkTjSDeAIhwTHSfxzohvABuDPdlRVbYNoeoYNYAPYADaADWAD2AA2ABtXpL4lSG4OiRQl36PkjTNFCA3HA40ONaj6yow0kBRmiVLJcpEYuWgSXKZqWi-1nDfp3DRTe8f2fMfu0Zc9fNttMh5INLMndnNpqNJlj3GhTTvbH97-bG3FqTYCeowLbdHZfvP2e2sTJQpamB7jnH30d3HW_aW_ePzV4Vu_eCkKbSDvM--_xZ88_ryG84xkQm6g-IO3H1s7k7SCymyg-J2379vimrG84HoTxW88frv2qbOKCFLFLQ6Xdg_Xq_W9qo1pmQsetTZcOLcO_itG2qWNRdTScObc8_B_VjJDWOR1DSMHnwaw5kaBgsiFsYNPgsKEcsI1i1v4wLnHwQODYqWpSNzCQ-fuBy7DojBExS0sEewFakGxwO4tdx80-QEwjmuB\",\"instance_start_time\":\"1637834313\",\"db_name\":\"testdb\",\"purge_seq\":0,\"sizes\":{\"file\":240670,\"external\":79,\"active\":7240},\"props\":{},\"doc_del_count\":0,\"doc_count\":5,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":16,\"n\":3,\"w\":2,\"r\":2}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "09ea19385a69e38e5ee30e9e87cb6062", + "X-Cloudant-Action": "cloudantnosqldb.database-info.read", + "X-Couch-Request-ID": "09ea19385a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "660a0142-29dd-3918-a4aa-f77527e358c2" + }, + { + "id": "939b8665-cf55-3a05-a46d-c208bcc4ada6", + "request": { + "urlPath": "/testString", + "method": "PUT", + "queryParameters": { + "partitioned": { + "equalTo": "false" + }, + "q": { + "equalTo": "26" + } + } + }, + "response": { + "status": 201, + "body": "{\"ok\":true}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 16:56:10 GMT", + "Location": "https://account-bluemix.cloudant.com/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "06ec2ee90406a602224231b8ab7d19aa", + "X-Cloudant-Action": "cloudantnosqldb.database.create", + "X-Couch-Request-ID": "06ec2ee904", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "939b8665-cf55-3a05-a46d-c208bcc4ada6" + }, + { + "id": "33f0d8ac-56f3-3a18-9366-761dcb30158f", + "request": { + "urlPath": "/testString/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"2-49754e12a5d2cbe03c4118bad6709779\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:31:45 GMT", + "ETag": "W/\"2-49754e12a5d2cbe03c4118bad6709779\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "6beab9bf70a274822c5bcf7dee330078", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "6beab9bf70", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "33f0d8ac-56f3-3a18-9366-761dcb30158f" + }, + { + "id": "ae2f6256-c33c-3e1a-9ed6-d16762069a0c", + "request": { + "urlPath": "/testString/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + }, + "deleted_conflicts": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "meta": { + "equalTo": "false" + }, + "rev": { + "equalTo": "testString" + }, + "revs": { + "equalTo": "false" + }, + "revs_info": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "body": "{\"_id\":\"testString\",\"_rev\":\"3-5570e8bbb34412db757c2df4bfa1099b\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 17:09:08 GMT", + "ETag": "W/\"3-5570e8bbb34412db757c2df4bfa1099b\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "bb234d40f358cc0ee3e8317890e8f065", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "bb234d40f3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ae2f6256-c33c-3e1a-9ed6-d16762069a0c" + }, + { + "id": "559c7479-f8d9-3c89-a91d-6f34122908ed", + "request": { + "url": "/testString/testString?latest=false&rev=testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:35 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "845550d983dcdb781e95385d4f92d4af", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "845550d983", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "559c7479-f8d9-3c89-a91d-6f34122908ed" + }, + { + "id": "aed0b4bd-1c80-35b2-b8f9-7da76c4cda69", + "request": { + "url": "/testString/testString/testString?rev=testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "This is a mock file.", + "headers": { + "Accept-Ranges": "none", + "Cache-Control": "must-revalidate", + "Content-MD5": "Vtnbf/a1yLJ4pm/eEB6fHA==", + "content-security-policy": "sandbox", + "Content-Type": "application/octet-stream", + "Date": "Fri, 20 May 2022 18:27:25 GMT", + "ETag": "\"Vtnbf/a1yLJ4pm/eEB6fHA==\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "ecd7339c8a26c3ed107b5284eb15a76b", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "ecd7339c8a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "aed0b4bd-1c80-35b2-b8f9-7da76c4cda69" + }, + { + "id": "efe03f6b-9784-3cd8-a4d3-ba2020661353", + "request": { + "url": "/testString/testString/testString?rev=testString", + "method": "PUT", + "bodyPatterns": [ + { + "equalTo": "This is a mock file." + } + ] + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"1-23085a965a5e50b32b00e57deb062932\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:25:16 GMT", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/testString/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "4326af6ec28e12fcf8eca683ba57da8e", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "4326af6ec2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "efe03f6b-9784-3cd8-a4d3-ba2020661353" + }, + { + "id": "ecfbef48-33ff-30fe-b848-d09c6c472eac", + "request": { + "url": "/testString/testString/testString?rev=testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Accept-Ranges": "none", + "Cache-Control": "must-revalidate", + "Content-MD5": "Vtnbf/a1yLJ4pm/eEB6fHA==", + "content-security-policy": "sandbox", + "Content-Type": "application/octet-stream", + "Date": "Fri, 20 May 2022 18:26:53 GMT", + "ETag": "\"Vtnbf/a1yLJ4pm/eEB6fHA==\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "4e77768c5d87bc873bbcc11961504516", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "4e77768c5d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "ecfbef48-33ff-30fe-b848-d09c6c472eac" + }, + { + "id": "bf49e660-6802-3a7c-9975-5e451f4e1204", + "request": { + "urlPath": "/testString/testString/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"4-6705bb55c13a40bb465ab96fd810d996\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:59:10 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "b00e9dd9c3835c3ca04049cc2c3deaeb", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "b00e9dd9c3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "bf49e660-6802-3a7c-9975-5e451f4e1204" + }, + { + "id": "5a60a196-eed3-33f2-9507-d6276639e89e", + "request": { + "urlPath": "/testString/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + }, + "new_edits": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"2-80028e69ea6e259eba0b419c3750128b\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 25 May 2022 19:15:19 GMT", + "ETag": "W/\"6-80028e69ea6e259eba0b419c3750128b\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "0d39f720ff6eca60e344f22d000060c5", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "0d39f720ff", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "5a60a196-eed3-33f2-9507-d6276639e89e" + } +]} diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py new file mode 100644 index 00000000..a64dc47d --- /dev/null +++ b/test/integration/test_cloudant_v1.py @@ -0,0 +1,2103 @@ +# -*- coding: utf-8 -*- +# (C) Copyright IBM Corp. 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Integration Tests for CloudantV1 +""" + +from ibm_cloud_sdk_core import * +import io +import os +import pytest +from ibmcloudant.cloudant_v1 import * + +# Config file name +config_file = 'cloudant_v1.env' + +class TestCloudantV1(): + """ + Integration Test Class for CloudantV1 + """ + + @classmethod + def setup_class(cls): + if os.path.exists(config_file): + os.environ['IBM_CREDENTIALS_FILE'] = config_file + + cls.cloudant_service = CloudantV1.new_instance( + ) + assert cls.cloudant_service is not None + + cls.config = read_external_sources( + CloudantV1.DEFAULT_SERVICE_NAME) + assert cls.config is not None + + cls.cloudant_service.enable_retries() + + print('Setup complete.') + + needscredentials = pytest.mark.skipif( + not os.path.exists(config_file), reason="External configuration not available, skipping..." + ) + + @needscredentials + def test_get_server_information(self): + + response = self.cloudant_service.get_server_information() + + assert response.get_status_code() == 200 + server_information = response.get_result() + assert server_information is not None + + @needscredentials + def test_get_membership_information(self): + + response = self.cloudant_service.get_membership_information() + + assert response.get_status_code() == 200 + membership_information = response.get_result() + assert membership_information is not None + + @needscredentials + def test_get_uuids(self): + + response = self.cloudant_service.get_uuids( + count=1, + ) + + assert response.get_status_code() == 200 + uuids_result = response.get_result() + assert uuids_result is not None + + @needscredentials + def test_get_capacity_throughput_information(self): + + response = self.cloudant_service.get_capacity_throughput_information() + + assert response.get_status_code() == 200 + capacity_throughput_information = response.get_result() + assert capacity_throughput_information is not None + + @needscredentials + def test_put_capacity_throughput_configuration(self): + + response = self.cloudant_service.put_capacity_throughput_configuration( + blocks=0, + ) + + assert response.get_status_code() == 200 + capacity_throughput_information = response.get_result() + assert capacity_throughput_information is not None + + @needscredentials + def test_get_db_updates(self): + + response = self.cloudant_service.get_db_updates( + feed='normal', + heartbeat=0, + timeout=0, + since='0', + ) + + assert response.get_status_code() == 200 + db_updates = response.get_result() + assert db_updates is not None + + @needscredentials + def test_post_changes(self): + + response = self.cloudant_service.post_changes( + db='testString', + doc_ids=['testString'], + fields=['testString'], + selector={'foo': 'bar'}, + last_event_id='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + feed='normal', + filter='testString', + heartbeat=0, + include_docs=False, + limit=0, + seq_interval=1, + since='0', + style='main_only', + timeout=0, + view='testString', + ) + + assert response.get_status_code() == 200 + changes_result = response.get_result() + assert changes_result is not None + + @needscredentials + def test_post_changes_as_stream(self): + + response = self.cloudant_service.post_changes_as_stream( + db='testString', + doc_ids=['testString'], + fields=['testString'], + selector={'foo': 'bar'}, + last_event_id='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + feed='normal', + filter='testString', + heartbeat=0, + include_docs=False, + limit=0, + seq_interval=1, + since='0', + style='main_only', + timeout=0, + view='testString', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_head_database(self): + + response = self.cloudant_service.head_database( + db='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_get_all_dbs(self): + + response = self.cloudant_service.get_all_dbs( + descending=False, + end_key='testString', + limit=0, + skip=0, + start_key='testString', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_dbs_info(self): + + response = self.cloudant_service.post_dbs_info( + keys=['testString'], + ) + + assert response.get_status_code() == 200 + list_dbs_info_result = response.get_result() + assert list_dbs_info_result is not None + + @needscredentials + def test_get_database_information(self): + + response = self.cloudant_service.get_database_information( + db='testString', + ) + + assert response.get_status_code() == 200 + database_information = response.get_result() + assert database_information is not None + + @needscredentials + def test_put_database(self): + + response = self.cloudant_service.put_database( + db='testString', + partitioned=False, + q=26, + ) + + assert response.get_status_code() == 201 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_head_document(self): + + response = self.cloudant_service.head_document( + db='testString', + doc_id='testString', + if_none_match='testString', + latest=False, + rev='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_post_document(self): + + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + + # Construct a dict representation of a Document model + document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'foo': 'testString', + } + + response = self.cloudant_service.post_document( + db='testString', + document=document_model, + content_type='application/json', + batch='ok', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_post_all_docs(self): + + response = self.cloudant_service.post_all_docs( + db='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + key='testString', + keys=['testString'], + start_key='testString', + ) + + assert response.get_status_code() == 200 + all_docs_result = response.get_result() + assert all_docs_result is not None + + @needscredentials + def test_post_all_docs_as_stream(self): + + response = self.cloudant_service.post_all_docs_as_stream( + db='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + key='testString', + keys=['testString'], + start_key='testString', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_all_docs_queries(self): + + # Construct a dict representation of a AllDocsQuery model + all_docs_query_model = { + 'att_encoding_info': False, + 'attachments': False, + 'conflicts': False, + 'descending': False, + 'include_docs': False, + 'inclusive_end': True, + 'limit': 0, + 'skip': 0, + 'update_seq': False, + 'end_key': 'testString', + 'key': 'testString', + 'keys': ['testString'], + 'start_key': 'testString', + } + + response = self.cloudant_service.post_all_docs_queries( + db='testString', + queries=[all_docs_query_model], + ) + + assert response.get_status_code() == 200 + all_docs_queries_result = response.get_result() + assert all_docs_queries_result is not None + + @needscredentials + def test_post_all_docs_queries_as_stream(self): + + # Construct a dict representation of a AllDocsQuery model + all_docs_query_model = { + 'att_encoding_info': False, + 'attachments': False, + 'conflicts': False, + 'descending': False, + 'include_docs': False, + 'inclusive_end': True, + 'limit': 0, + 'skip': 0, + 'update_seq': False, + 'end_key': 'testString', + 'key': 'testString', + 'keys': ['testString'], + 'start_key': 'testString', + } + + response = self.cloudant_service.post_all_docs_queries_as_stream( + db='testString', + queries=[all_docs_query_model], + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_bulk_docs(self): + + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + + # Construct a dict representation of a Document model + document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'foo': 'testString', + } + + # Construct a dict representation of a BulkDocs model + bulk_docs_model = { + 'docs': [document_model], + 'new_edits': True, + } + + response = self.cloudant_service.post_bulk_docs( + db='testString', + bulk_docs=bulk_docs_model, + ) + + assert response.get_status_code() == 201 + list_document_result = response.get_result() + assert list_document_result is not None + + @needscredentials + def test_post_bulk_get(self): + + # Construct a dict representation of a BulkGetQueryDocument model + bulk_get_query_document_model = { + 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], + 'id': 'testString', + 'rev': 'testString', + } + + response = self.cloudant_service.post_bulk_get( + db='testString', + docs=[bulk_get_query_document_model], + attachments=False, + att_encoding_info=False, + latest=False, + revs=False, + ) + + assert response.get_status_code() == 200 + bulk_get_result = response.get_result() + assert bulk_get_result is not None + + @needscredentials + def test_post_bulk_get_as_mixed(self): + + # Construct a dict representation of a BulkGetQueryDocument model + bulk_get_query_document_model = { + 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], + 'id': 'testString', + 'rev': 'testString', + } + + response = self.cloudant_service.post_bulk_get_as_mixed( + db='testString', + docs=[bulk_get_query_document_model], + attachments=False, + att_encoding_info=False, + latest=False, + revs=False, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_bulk_get_as_related(self): + + # Construct a dict representation of a BulkGetQueryDocument model + bulk_get_query_document_model = { + 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], + 'id': 'testString', + 'rev': 'testString', + } + + response = self.cloudant_service.post_bulk_get_as_related( + db='testString', + docs=[bulk_get_query_document_model], + attachments=False, + att_encoding_info=False, + latest=False, + revs=False, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_bulk_get_as_stream(self): + + # Construct a dict representation of a BulkGetQueryDocument model + bulk_get_query_document_model = { + 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], + 'id': 'testString', + 'rev': 'testString', + } + + response = self.cloudant_service.post_bulk_get_as_stream( + db='testString', + docs=[bulk_get_query_document_model], + attachments=False, + att_encoding_info=False, + latest=False, + revs=False, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_get_document(self): + + response = self.cloudant_service.get_document( + db='testString', + doc_id='testString', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + conflicts=False, + deleted_conflicts=False, + latest=False, + local_seq=False, + meta=False, + rev='testString', + revs=False, + revs_info=False, + ) + + assert response.get_status_code() == 200 + document = response.get_result() + assert document is not None + + @needscredentials + def test_get_document_as_mixed(self): + + response = self.cloudant_service.get_document_as_mixed( + db='testString', + doc_id='testString', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + conflicts=False, + deleted_conflicts=False, + latest=False, + local_seq=False, + meta=False, + rev='testString', + revs=False, + revs_info=False, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_get_document_as_related(self): + + response = self.cloudant_service.get_document_as_related( + db='testString', + doc_id='testString', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + conflicts=False, + deleted_conflicts=False, + latest=False, + local_seq=False, + meta=False, + rev='testString', + revs=False, + revs_info=False, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_get_document_as_stream(self): + + response = self.cloudant_service.get_document_as_stream( + db='testString', + doc_id='testString', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + conflicts=False, + deleted_conflicts=False, + latest=False, + local_seq=False, + meta=False, + rev='testString', + revs=False, + revs_info=False, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_put_document(self): + + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + + # Construct a dict representation of a Document model + document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'foo': 'testString', + } + + response = self.cloudant_service.put_document( + db='testString', + doc_id='testString', + document=document_model, + content_type='application/json', + if_match='testString', + batch='ok', + new_edits=False, + rev='testString', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_head_design_document(self): + + response = self.cloudant_service.head_design_document( + db='testString', + ddoc='testString', + if_none_match='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_get_design_document(self): + + response = self.cloudant_service.get_design_document( + db='testString', + ddoc='testString', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + conflicts=False, + deleted_conflicts=False, + latest=False, + local_seq=False, + meta=False, + rev='testString', + revs=False, + revs_info=False, + ) + + assert response.get_status_code() == 200 + design_document = response.get_result() + assert design_document is not None + + @needscredentials + def test_put_design_document(self): + + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + + # Construct a dict representation of a Analyzer model + analyzer_model = { + 'name': 'classic', + 'stopwords': ['testString'], + } + + # Construct a dict representation of a AnalyzerConfiguration model + analyzer_configuration_model = { + 'name': 'classic', + 'stopwords': ['testString'], + 'fields': {'key1': analyzer_model}, + } + + # Construct a dict representation of a SearchIndexDefinition model + search_index_definition_model = { + 'analyzer': analyzer_configuration_model, + 'index': 'testString', + } + + # Construct a dict representation of a DesignDocumentOptions model + design_document_options_model = { + 'partitioned': True, + } + + # Construct a dict representation of a DesignDocumentViewsMapReduce model + design_document_views_map_reduce_model = { + 'map': 'testString', + 'reduce': 'testString', + } + + # Construct a dict representation of a DesignDocument model + design_document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'autoupdate': True, + 'filters': {'key1': 'testString'}, + 'indexes': {'key1': search_index_definition_model}, + 'language': 'javascript', + 'options': design_document_options_model, + 'validate_doc_update': 'testString', + 'views': {'key1': design_document_views_map_reduce_model}, + 'foo': 'testString', + } + + response = self.cloudant_service.put_design_document( + db='testString', + ddoc='testString', + design_document=design_document_model, + if_match='testString', + batch='ok', + new_edits=False, + rev='testString', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_get_design_document_information(self): + + response = self.cloudant_service.get_design_document_information( + db='testString', + ddoc='testString', + ) + + assert response.get_status_code() == 200 + design_document_information = response.get_result() + assert design_document_information is not None + + @needscredentials + def test_post_design_docs(self): + + response = self.cloudant_service.post_design_docs( + db='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + key='testString', + keys=['testString'], + start_key='testString', + accept='application/json', + ) + + assert response.get_status_code() == 200 + all_docs_result = response.get_result() + assert all_docs_result is not None + + @needscredentials + def test_post_design_docs_queries(self): + + # Construct a dict representation of a AllDocsQuery model + all_docs_query_model = { + 'att_encoding_info': False, + 'attachments': False, + 'conflicts': False, + 'descending': False, + 'include_docs': False, + 'inclusive_end': True, + 'limit': 0, + 'skip': 0, + 'update_seq': False, + 'end_key': 'testString', + 'key': 'testString', + 'keys': ['testString'], + 'start_key': 'testString', + } + + response = self.cloudant_service.post_design_docs_queries( + db='testString', + queries=[all_docs_query_model], + accept='application/json', + ) + + assert response.get_status_code() == 200 + all_docs_queries_result = response.get_result() + assert all_docs_queries_result is not None + + @needscredentials + def test_post_view(self): + + response = self.cloudant_service.post_view( + db='testString', + ddoc='testString', + view='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + end_key_doc_id='testString', + group=False, + group_level=1, + key='testString', + keys=['testString'], + reduce=True, + stable=False, + start_key='testString', + start_key_doc_id='testString', + update='true', + ) + + assert response.get_status_code() == 200 + view_result = response.get_result() + assert view_result is not None + + @needscredentials + def test_post_view_as_stream(self): + + response = self.cloudant_service.post_view_as_stream( + db='testString', + ddoc='testString', + view='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + end_key_doc_id='testString', + group=False, + group_level=1, + key='testString', + keys=['testString'], + reduce=True, + stable=False, + start_key='testString', + start_key_doc_id='testString', + update='true', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_view_queries(self): + + # Construct a dict representation of a ViewQuery model + view_query_model = { + 'att_encoding_info': False, + 'attachments': False, + 'conflicts': False, + 'descending': False, + 'include_docs': False, + 'inclusive_end': True, + 'limit': 0, + 'skip': 0, + 'update_seq': False, + 'end_key': 'testString', + 'end_key_doc_id': 'testString', + 'group': False, + 'group_level': 1, + 'key': 'testString', + 'keys': ['testString'], + 'reduce': True, + 'stable': False, + 'start_key': 'testString', + 'start_key_doc_id': 'testString', + 'update': 'true', + } + + response = self.cloudant_service.post_view_queries( + db='testString', + ddoc='testString', + view='testString', + queries=[view_query_model], + ) + + assert response.get_status_code() == 200 + view_queries_result = response.get_result() + assert view_queries_result is not None + + @needscredentials + def test_post_view_queries_as_stream(self): + + # Construct a dict representation of a ViewQuery model + view_query_model = { + 'att_encoding_info': False, + 'attachments': False, + 'conflicts': False, + 'descending': False, + 'include_docs': False, + 'inclusive_end': True, + 'limit': 0, + 'skip': 0, + 'update_seq': False, + 'end_key': 'testString', + 'end_key_doc_id': 'testString', + 'group': False, + 'group_level': 1, + 'key': 'testString', + 'keys': ['testString'], + 'reduce': True, + 'stable': False, + 'start_key': 'testString', + 'start_key_doc_id': 'testString', + 'update': 'true', + } + + response = self.cloudant_service.post_view_queries_as_stream( + db='testString', + ddoc='testString', + view='testString', + queries=[view_query_model], + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_get_partition_information(self): + + response = self.cloudant_service.get_partition_information( + db='testString', + partition_key='testString', + ) + + assert response.get_status_code() == 200 + partition_information = response.get_result() + assert partition_information is not None + + @needscredentials + def test_post_partition_all_docs(self): + + response = self.cloudant_service.post_partition_all_docs( + db='testString', + partition_key='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + key='testString', + keys=['testString'], + start_key='testString', + ) + + assert response.get_status_code() == 200 + all_docs_result = response.get_result() + assert all_docs_result is not None + + @needscredentials + def test_post_partition_all_docs_as_stream(self): + + response = self.cloudant_service.post_partition_all_docs_as_stream( + db='testString', + partition_key='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + key='testString', + keys=['testString'], + start_key='testString', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_partition_search(self): + + response = self.cloudant_service.post_partition_search( + db='testString', + partition_key='testString', + ddoc='testString', + index='testString', + query='testString', + bookmark='testString', + highlight_fields=['testString'], + highlight_number=1, + highlight_post_tag='
', + highlight_pre_tag='', + highlight_size=1, + include_docs=False, + include_fields=['testString'], + limit=0, + sort=['testString'], + stale='ok', + ) + + assert response.get_status_code() == 200 + search_result = response.get_result() + assert search_result is not None + + @needscredentials + def test_post_partition_search_as_stream(self): + + response = self.cloudant_service.post_partition_search_as_stream( + db='testString', + partition_key='testString', + ddoc='testString', + index='testString', + query='testString', + bookmark='testString', + highlight_fields=['testString'], + highlight_number=1, + highlight_post_tag='', + highlight_pre_tag='', + highlight_size=1, + include_docs=False, + include_fields=['testString'], + limit=0, + sort=['testString'], + stale='ok', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_partition_view(self): + + response = self.cloudant_service.post_partition_view( + db='testString', + partition_key='testString', + ddoc='testString', + view='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + end_key_doc_id='testString', + group=False, + group_level=1, + key='testString', + keys=['testString'], + reduce=True, + stable=False, + start_key='testString', + start_key_doc_id='testString', + update='true', + ) + + assert response.get_status_code() == 200 + view_result = response.get_result() + assert view_result is not None + + @needscredentials + def test_post_partition_view_as_stream(self): + + response = self.cloudant_service.post_partition_view_as_stream( + db='testString', + partition_key='testString', + ddoc='testString', + view='testString', + att_encoding_info=False, + attachments=False, + conflicts=False, + descending=False, + include_docs=False, + inclusive_end=True, + limit=0, + skip=0, + update_seq=False, + end_key='testString', + end_key_doc_id='testString', + group=False, + group_level=1, + key='testString', + keys=['testString'], + reduce=True, + stable=False, + start_key='testString', + start_key_doc_id='testString', + update='true', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_partition_find(self): + + response = self.cloudant_service.post_partition_find( + db='testString', + partition_key='testString', + selector={'foo': 'bar'}, + bookmark='testString', + conflicts=True, + execution_stats=True, + fields=['testString'], + limit=0, + skip=0, + sort=[{'key1': 'asc'}], + stable=True, + update='true', + use_index=['testString'], + ) + + assert response.get_status_code() == 200 + find_result = response.get_result() + assert find_result is not None + + @needscredentials + def test_post_partition_find_as_stream(self): + + response = self.cloudant_service.post_partition_find_as_stream( + db='testString', + partition_key='testString', + selector={'foo': 'bar'}, + bookmark='testString', + conflicts=True, + execution_stats=True, + fields=['testString'], + limit=0, + skip=0, + sort=[{'key1': 'asc'}], + stable=True, + update='true', + use_index=['testString'], + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_post_explain(self): + + response = self.cloudant_service.post_explain( + db='testString', + selector={'foo': 'bar'}, + bookmark='testString', + conflicts=True, + execution_stats=True, + fields=['testString'], + limit=0, + skip=0, + sort=[{'key1': 'asc'}], + stable=True, + update='true', + use_index=['testString'], + r=1, + ) + + assert response.get_status_code() == 200 + explain_result = response.get_result() + assert explain_result is not None + + @needscredentials + def test_post_find(self): + + response = self.cloudant_service.post_find( + db='testString', + selector={'foo': 'bar'}, + bookmark='testString', + conflicts=True, + execution_stats=True, + fields=['testString'], + limit=0, + skip=0, + sort=[{'key1': 'asc'}], + stable=True, + update='true', + use_index=['testString'], + r=1, + ) + + assert response.get_status_code() == 200 + find_result = response.get_result() + assert find_result is not None + + @needscredentials + def test_post_find_as_stream(self): + + response = self.cloudant_service.post_find_as_stream( + db='testString', + selector={'foo': 'bar'}, + bookmark='testString', + conflicts=True, + execution_stats=True, + fields=['testString'], + limit=0, + skip=0, + sort=[{'key1': 'asc'}], + stable=True, + update='true', + use_index=['testString'], + r=1, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_get_indexes_information(self): + + response = self.cloudant_service.get_indexes_information( + db='testString', + ) + + assert response.get_status_code() == 200 + indexes_information = response.get_result() + assert indexes_information is not None + + @needscredentials + def test_post_index(self): + + # Construct a dict representation of a Analyzer model + analyzer_model = { + 'name': 'classic', + 'stopwords': ['testString'], + } + + # Construct a dict representation of a IndexTextOperatorDefaultField model + index_text_operator_default_field_model = { + 'analyzer': analyzer_model, + 'enabled': True, + } + + # Construct a dict representation of a IndexField model + index_field_model = { + 'name': 'testString', + 'type': 'boolean', + 'foo': 'asc', + } + + # Construct a dict representation of a IndexDefinition model + index_definition_model = { + 'default_analyzer': analyzer_model, + 'default_field': index_text_operator_default_field_model, + 'fields': [index_field_model], + 'index_array_lengths': True, + 'partial_filter_selector': {'foo': 'bar'}, + } + + response = self.cloudant_service.post_index( + db='testString', + index=index_definition_model, + ddoc='testString', + def_=index_definition_model, + name='testString', + partitioned=True, + type='json', + ) + + assert response.get_status_code() == 200 + index_result = response.get_result() + assert index_result is not None + + @needscredentials + def test_post_search_analyze(self): + + response = self.cloudant_service.post_search_analyze( + analyzer='arabic', + text='testString', + ) + + assert response.get_status_code() == 200 + search_analyze_result = response.get_result() + assert search_analyze_result is not None + + @needscredentials + def test_post_search(self): + + response = self.cloudant_service.post_search( + db='testString', + ddoc='testString', + index='testString', + query='testString', + bookmark='testString', + highlight_fields=['testString'], + highlight_number=1, + highlight_post_tag='', + highlight_pre_tag='', + highlight_size=1, + include_docs=False, + include_fields=['testString'], + limit=0, + sort=['testString'], + stale='ok', + counts=['testString'], + drilldown=[['testString']], + group_field='testString', + group_limit=1, + group_sort=['testString'], + ranges={'key1': {'key1': {'key1': 'testString'}}}, + ) + + assert response.get_status_code() == 200 + search_result = response.get_result() + assert search_result is not None + + @needscredentials + def test_post_search_as_stream(self): + + response = self.cloudant_service.post_search_as_stream( + db='testString', + ddoc='testString', + index='testString', + query='testString', + bookmark='testString', + highlight_fields=['testString'], + highlight_number=1, + highlight_post_tag='', + highlight_pre_tag='', + highlight_size=1, + include_docs=False, + include_fields=['testString'], + limit=0, + sort=['testString'], + stale='ok', + counts=['testString'], + drilldown=[['testString']], + group_field='testString', + group_limit=1, + group_sort=['testString'], + ranges={'key1': {'key1': {'key1': 'testString'}}}, + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_get_search_info(self): + + response = self.cloudant_service.get_search_info( + db='testString', + ddoc='testString', + index='testString', + ) + + assert response.get_status_code() == 200 + search_info_result = response.get_result() + assert search_info_result is not None + + @needscredentials + def test_head_replication_document(self): + + response = self.cloudant_service.head_replication_document( + doc_id='testString', + if_none_match='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_head_scheduler_document(self): + + response = self.cloudant_service.head_scheduler_document( + doc_id='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_head_scheduler_job(self): + + response = self.cloudant_service.head_scheduler_job( + job_id='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_get_replication_document(self): + + response = self.cloudant_service.get_replication_document( + doc_id='testString', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + conflicts=False, + deleted_conflicts=False, + latest=False, + local_seq=False, + meta=False, + rev='testString', + revs=False, + revs_info=False, + ) + + assert response.get_status_code() == 200 + replication_document = response.get_result() + assert replication_document is not None + + @needscredentials + def test_put_replication_document(self): + + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + + # Construct a dict representation of a ReplicationCreateTargetParameters model + replication_create_target_parameters_model = { + 'n': 1, + 'partitioned': False, + 'q': 26, + } + + # Construct a dict representation of a ReplicationDatabaseAuthBasic model + replication_database_auth_basic_model = { + 'password': 'testString', + 'username': 'testString', + } + + # Construct a dict representation of a ReplicationDatabaseAuthIam model + replication_database_auth_iam_model = { + 'api_key': 'testString', + } + + # Construct a dict representation of a ReplicationDatabaseAuth model + replication_database_auth_model = { + 'basic': replication_database_auth_basic_model, + 'iam': replication_database_auth_iam_model, + } + + # Construct a dict representation of a ReplicationDatabase model + replication_database_model = { + 'auth': replication_database_auth_model, + 'headers': {'key1': 'testString'}, + 'url': 'testString', + } + + # Construct a dict representation of a UserContext model + user_context_model = { + 'db': 'testString', + 'name': 'testString', + 'roles': ['_reader'], + } + + # Construct a dict representation of a ReplicationDocument model + replication_document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'cancel': True, + 'checkpoint_interval': 0, + 'connection_timeout': 0, + 'continuous': False, + 'create_target': False, + 'create_target_params': replication_create_target_parameters_model, + 'doc_ids': ['testString'], + 'filter': 'testString', + 'http_connections': 1, + 'query_params': {'key1': 'testString'}, + 'retries_per_request': 0, + 'selector': {'foo': 'bar'}, + 'since_seq': 'testString', + 'socket_options': 'testString', + 'source': replication_database_model, + 'source_proxy': 'testString', + 'target': replication_database_model, + 'target_proxy': 'testString', + 'use_bulk_get': True, + 'use_checkpoints': True, + 'user_ctx': user_context_model, + 'winning_revs_only': False, + 'worker_batch_size': 1, + 'worker_processes': 1, + 'foo': 'testString', + } + + response = self.cloudant_service.put_replication_document( + doc_id='testString', + replication_document=replication_document_model, + if_match='testString', + batch='ok', + new_edits=False, + rev='testString', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_get_scheduler_docs(self): + + response = self.cloudant_service.get_scheduler_docs( + limit=0, + skip=0, + states=['initializing'], + ) + + assert response.get_status_code() == 200 + scheduler_docs_result = response.get_result() + assert scheduler_docs_result is not None + + @needscredentials + def test_get_scheduler_document(self): + + response = self.cloudant_service.get_scheduler_document( + doc_id='testString', + ) + + assert response.get_status_code() == 200 + scheduler_document = response.get_result() + assert scheduler_document is not None + + @needscredentials + def test_get_scheduler_jobs(self): + + response = self.cloudant_service.get_scheduler_jobs( + limit=0, + skip=0, + ) + + assert response.get_status_code() == 200 + scheduler_jobs_result = response.get_result() + assert scheduler_jobs_result is not None + + @needscredentials + def test_get_scheduler_job(self): + + response = self.cloudant_service.get_scheduler_job( + job_id='testString', + ) + + assert response.get_status_code() == 200 + scheduler_job = response.get_result() + assert scheduler_job is not None + + @needscredentials + def test_get_session_information(self): + + response = self.cloudant_service.get_session_information() + + assert response.get_status_code() == 200 + session_information = response.get_result() + assert session_information is not None + + @needscredentials + def test_get_security(self): + + response = self.cloudant_service.get_security( + db='testString', + ) + + assert response.get_status_code() == 200 + security = response.get_result() + assert security is not None + + @needscredentials + def test_put_security(self): + + # Construct a dict representation of a SecurityObject model + security_object_model = { + 'names': ['testString'], + 'roles': ['testString'], + } + + response = self.cloudant_service.put_security( + db='testString', + admins=security_object_model, + members=security_object_model, + cloudant={'key1': ['_reader']}, + couchdb_auth_only=True, + ) + + assert response.get_status_code() == 200 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_post_api_keys(self): + + response = self.cloudant_service.post_api_keys() + + assert response.get_status_code() == 201 + api_keys_result = response.get_result() + assert api_keys_result is not None + + @needscredentials + def test_put_cloudant_security_configuration(self): + + # Construct a dict representation of a SecurityObject model + security_object_model = { + 'names': ['testString'], + 'roles': ['testString'], + } + + response = self.cloudant_service.put_cloudant_security_configuration( + db='testString', + cloudant={'key1': ['_reader']}, + admins=security_object_model, + members=security_object_model, + couchdb_auth_only=True, + ) + + assert response.get_status_code() == 200 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_get_cors_information(self): + + response = self.cloudant_service.get_cors_information() + + assert response.get_status_code() == 200 + cors_information = response.get_result() + assert cors_information is not None + + @needscredentials + def test_put_cors_configuration(self): + + response = self.cloudant_service.put_cors_configuration( + origins=['testString'], + allow_credentials=True, + enable_cors=True, + ) + + assert response.get_status_code() == 200 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_head_attachment(self): + + response = self.cloudant_service.head_attachment( + db='testString', + doc_id='testString', + attachment_name='testString', + if_match='testString', + if_none_match='testString', + rev='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_get_attachment(self): + + response = self.cloudant_service.get_attachment( + db='testString', + doc_id='testString', + attachment_name='testString', + if_match='testString', + if_none_match='testString', + range='testString', + rev='testString', + ) + + assert response.get_status_code() == 200 + result = response.get_result() + assert result is not None + + @needscredentials + def test_put_attachment(self): + + response = self.cloudant_service.put_attachment( + db='testString', + doc_id='testString', + attachment_name='testString', + attachment=io.BytesIO(b'This is a mock file.').getvalue(), + content_type='application/octet-stream', + if_match='testString', + rev='testString', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_head_local_document(self): + + response = self.cloudant_service.head_local_document( + db='testString', + doc_id='testString', + if_none_match='testString', + ) + + assert response.get_status_code() == 200 + + @needscredentials + def test_get_local_document(self): + + response = self.cloudant_service.get_local_document( + db='testString', + doc_id='testString', + accept='application/json', + if_none_match='testString', + attachments=False, + att_encoding_info=False, + local_seq=False, + ) + + assert response.get_status_code() == 200 + document = response.get_result() + assert document is not None + + @needscredentials + def test_put_local_document(self): + + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + + # Construct a dict representation of a Document model + document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'foo': 'testString', + } + + response = self.cloudant_service.put_local_document( + db='testString', + doc_id='testString', + document=document_model, + content_type='application/json', + batch='ok', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_post_revs_diff(self): + + response = self.cloudant_service.post_revs_diff( + db='testString', + document_revisions={'key1': ['testString']}, + ) + + assert response.get_status_code() == 200 + dict = response.get_result() + assert dict is not None + + @needscredentials + def test_get_shards_information(self): + + response = self.cloudant_service.get_shards_information( + db='testString', + ) + + assert response.get_status_code() == 200 + shards_information = response.get_result() + assert shards_information is not None + + @needscredentials + def test_get_document_shards_info(self): + + response = self.cloudant_service.get_document_shards_info( + db='testString', + doc_id='testString', + ) + + assert response.get_status_code() == 200 + document_shard_info = response.get_result() + assert document_shard_info is not None + + @needscredentials + def test_head_up_information(self): + + response = self.cloudant_service.head_up_information() + + assert response.get_status_code() == 200 + + @needscredentials + def test_get_active_tasks(self): + + response = self.cloudant_service.get_active_tasks() + + assert response.get_status_code() == 200 + list_active_task = response.get_result() + assert list_active_task is not None + + @needscredentials + def test_get_up_information(self): + + response = self.cloudant_service.get_up_information() + + assert response.get_status_code() == 200 + up_information = response.get_result() + assert up_information is not None + + @needscredentials + def test_get_activity_tracker_events(self): + + response = self.cloudant_service.get_activity_tracker_events() + + assert response.get_status_code() == 200 + activity_tracker_events = response.get_result() + assert activity_tracker_events is not None + + @needscredentials + def test_post_activity_tracker_events(self): + + response = self.cloudant_service.post_activity_tracker_events( + types=['management'], + ) + + assert response.get_status_code() == 200 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_get_current_throughput_information(self): + + response = self.cloudant_service.get_current_throughput_information() + + assert response.get_status_code() == 200 + current_throughput_information = response.get_result() + assert current_throughput_information is not None + + @needscredentials + def test_delete_database(self): + + response = self.cloudant_service.delete_database( + db='testString', + ) + + assert response.get_status_code() == 200 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_delete_document(self): + + response = self.cloudant_service.delete_document( + db='testString', + doc_id='testString', + if_match='testString', + batch='ok', + rev='testString', + ) + + assert response.get_status_code() == 200 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_delete_design_document(self): + + response = self.cloudant_service.delete_design_document( + db='testString', + ddoc='testString', + if_match='testString', + batch='ok', + rev='testString', + ) + + assert response.get_status_code() == 200 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_delete_index(self): + + response = self.cloudant_service.delete_index( + db='testString', + ddoc='testString', + type='json', + index='testString', + ) + + assert response.get_status_code() == 200 + ok = response.get_result() + assert ok is not None + + @needscredentials + def test_delete_replication_document(self): + + response = self.cloudant_service.delete_replication_document( + doc_id='testString', + if_match='testString', + batch='ok', + rev='testString', + ) + + assert response.get_status_code() == 200 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_delete_attachment(self): + + response = self.cloudant_service.delete_attachment( + db='testString', + doc_id='testString', + attachment_name='testString', + if_match='testString', + rev='testString', + batch='ok', + ) + + assert response.get_status_code() == 200 + document_result = response.get_result() + assert document_result is not None + + @needscredentials + def test_delete_local_document(self): + + response = self.cloudant_service.delete_local_document( + db='testString', + doc_id='testString', + batch='ok', + ) + + assert response.get_status_code() == 200 + document_result = response.get_result() + assert document_result is not None From 9e1533447926f3aca9fd032cb4ce610ecebbf6fb Mon Sep 17 00:00:00 2001 From: Esteban Laver Date: Thu, 26 Jan 2023 12:25:01 -0500 Subject: [PATCH 090/669] ci: add Wiremock to GH action workflow, use one env file across all test files Signed-off-by: Esteban Laver --- .github/workflows/test.yml | 10 ++++++++++ test/integration/test_integration.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ab3e48b..45cb1529 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,8 @@ env: SERVER_URL: http://127.0.0.1:5984 SERVER_USERNAME: admin SERVER_PASSWORD: password + WIREMOCK_URL: http://127.0.0.1:8080 + WIREMOCK_PORT: 8080 jobs: test: strategy: @@ -24,6 +26,11 @@ jobs: options: --name couchdb ports: - 5984:5984 + wiremock: + image: wiremock/wiremock + options: --name wiremock + ports: + - 8080:8080 steps: - name: Checkout code uses: actions/checkout@v3 @@ -37,6 +44,9 @@ jobs: - name: Setup CouchDB shell: bash run: ${GITHUB_WORKSPACE}/scripts/setup_couch.sh + - name: Setup Wiremock + shell: bash + run: ${GITHUB_WORKSPACE}/scripts/setup_wiremock.sh - name: Install deps run: | python -m pip install --upgrade pip diff --git a/test/integration/test_integration.py b/test/integration/test_integration.py index 74205500..2e6eb891 100644 --- a/test/integration/test_integration.py +++ b/test/integration/test_integration.py @@ -3,7 +3,7 @@ import unittest # Read config file -configFile = 'cloudant.env' +configFile = 'cloudant_v1.env' configLoaded = None if os.path.exists(configFile): From a50b4ce51d96769f3b608e086600526c94997347 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 17:01:02 +0000 Subject: [PATCH 091/669] build(deps-dev): Bump tox from 4.4.2 to 4.4.3 Bumps [tox](https://github.com/tox-dev/tox) from 4.4.2 to 4.4.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.2...4.4.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3b64abad..9f8e4c97 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 pylint==2.15.10 -tox==4.4.2 +tox==4.4.3 pytest-rerunfailures==11.0 # code coverage From b465929ca5307192af02d06a58d181eb23f8e514 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 17:01:52 +0000 Subject: [PATCH 092/669] build(deps-dev): Bump pylint from 2.15.10 to 2.16.0 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.10 to 2.16.0. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.10...v2.16.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9f8e4c97..2b26ba48 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 -pylint==2.15.10 +pylint==2.16.0 tox==4.4.3 pytest-rerunfailures==11.0 From 7bc4de16cc7ae339aef731b0a2cf8a6f40d68364 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 17:32:46 +0000 Subject: [PATCH 093/669] build(deps-dev): Bump tox from 4.4.3 to 4.4.4 Bumps [tox](https://github.com/tox-dev/tox) from 4.4.3 to 4.4.4. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.3...4.4.4) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2b26ba48..54384ca3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 pylint==2.16.0 -tox==4.4.3 +tox==4.4.4 pytest-rerunfailures==11.0 # code coverage From 2d3e309ded28617178581bfa8a3cb6ff526c0e0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:01:03 +0000 Subject: [PATCH 094/669] build(deps-dev): Bump pylint from 2.16.0 to 2.16.1 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.16.0 to 2.16.1. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.16.0...v2.16.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 54384ca3..d4353cf8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 -pylint==2.16.0 +pylint==2.16.1 tox==4.4.4 pytest-rerunfailures==11.0 From 131bd73ea971eafd1f90d521fb8d4d22b29a5526 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 11:39:27 +0100 Subject: [PATCH 095/669] build(deps): Bump ibm-cloud-sdk-core from 3.16.1 to 3.16.2 (#427) Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.1 to 3.16.2. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.1...v3.16.2) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index afd6cf6f..4c8bd9b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_cloud_sdk_core==3.16.1 +ibm_cloud_sdk_core==3.16.2 # dependencies of ibm_cloud_sdk_core: requests>=2.20,<3.0 python_dateutil>=2.5.3,<3.0.0 From c9fca904aa02d8c461b5eb90d3dcb3b0ab4bb99f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 9 Feb 2023 17:02:12 +0000 Subject: [PATCH 096/669] Update version 0.3.2 -> 0.3.3 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 77e86c76..19aa3724 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.2 +current_version = 0.3.3 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index b2ce6341..b11064e2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.3.2 +# IBM Cloudant Python SDK Version 0.3.3 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.3.2" +pip install --upgrade "ibmcloudant>=0.3.3" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.3.2" +easy_install --upgrade "ibmcloudant>=0.3.3" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index dcd8ec48..c377f51f 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.3.2' +__version__ = '0.3.3' diff --git a/setup.py b/setup.py index 7875532c..fcedc93c 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.3.2' +__version__ = '0.3.3' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From bcd1ccaff62b9616d47060690d0a4d3cb1e9726f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:54:02 +0100 Subject: [PATCH 097/669] build(deps-dev): Bump tox from 4.4.4 to 4.4.5 (#426) Bumps [tox](https://github.com/tox-dev/tox) from 4.4.4 to 4.4.5. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.4...4.4.5) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d4353cf8..f1cd86da 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 pylint==2.16.1 -tox==4.4.4 +tox==4.4.5 pytest-rerunfailures==11.0 # code coverage From 2a6b88093be249582d5397221136989627e75de1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 15:14:59 +0100 Subject: [PATCH 098/669] build(deps-dev): Bump pytest-rerunfailures from 11.0 to 11.1 (#428) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.0 to 11.1. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.0...11.1) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f1cd86da..ac297bc6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ responses==0.22.0 python_dotenv==0.21.1 pylint==2.16.1 tox==4.4.5 -pytest-rerunfailures==11.0 +pytest-rerunfailures==11.1 # code coverage coverage==7.1.0 From 9d6c3e49ba3d574f520a95a0bb0ef6fc643940d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 09:44:11 +0000 Subject: [PATCH 099/669] build(deps-dev): Bump pylint from 2.16.1 to 2.16.2 (#429) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.16.1 to 2.16.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.16.1...v2.16.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ac297bc6..ccda5888 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 -pylint==2.16.1 +pylint==2.16.2 tox==4.4.5 pytest-rerunfailures==11.1 From 0041215f90c0180cf5d88e5789a6e1d8c923817c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:07:24 +0000 Subject: [PATCH 100/669] build(generated): Init SonarQube (#425) Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version 49ee3dd Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 13627623..5d7835c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,6 +65,20 @@ pipeline { } } } + stage('SonarQube analysis') { + environment { + scannerHome = tool 'SonarQubeScanner' + } + // Scanning runs only on non-dependabot branches + when { + not { + branch 'dependabot/*' + } + } + steps { + scanCode() + } + } stage('Publish[staging]') { environment { STAGE_ROOT = "${ARTIFACTORY_URL_UP}/api/" @@ -173,6 +187,7 @@ def publishArtifactoryBuildInfoScript def artifactUrl def moduleId def buildType +def scanCode void defaultInit() { // Default to using bump2version @@ -246,6 +261,12 @@ void defaultInit() { ) publishArtifactoryBuildInfoScript() } + + scanCode = { + withSonarQubeEnv(installationName: 'SonarQubeServer') { + sh "${scannerHome}/bin/sonar-scanner -X -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME}" + } + } } // Language specific implementations of the methods: From 1169312c8993e34a0a79d91eb00f10b269b2cddc Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 16 Feb 2023 14:24:46 +0000 Subject: [PATCH 101/669] refactor(generated): use shared globals var in common's jenkins parameters Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version 9255f28 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5d7835c9..f583b760 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { defaultValue: 'NONE', description: 'Tag to create after successful QA', failedValidationMessage: 'Tag name must be NONE or a semantic version release or pre-release (i.e. no build metadata)', - regex: /NONE|${SVRE_PRE_RELEASE}/) + regex: /NONE|${globals.SVRE_PRE_RELEASE}/) } environment { GH_CREDS = credentials('gh-sdks-automation') From 4bff4bc90c50638c9b74d641ed4f3f351b6571cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 09:53:17 +0100 Subject: [PATCH 102/669] build(deps-dev): Bump pytest-rerunfailures from 11.1 to 11.1.1 (#431) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1 to 11.1.1. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.1...11.1.1) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ccda5888..f02b9866 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ responses==0.22.0 python_dotenv==0.21.1 pylint==2.16.2 tox==4.4.5 -pytest-rerunfailures==11.1 +pytest-rerunfailures==11.1.1 # code coverage coverage==7.1.0 From 22dcb4930fb5321a144498ec0f4f3733db0fbe5d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 21 Feb 2023 18:23:01 +0000 Subject: [PATCH 103/669] build(generated): exclude examples dir from SQ scans (#432) Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version 20e6597 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f583b760..00a83f4f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -264,7 +264,7 @@ void defaultInit() { scanCode = { withSonarQubeEnv(installationName: 'SonarQubeServer') { - sh "${scannerHome}/bin/sonar-scanner -X -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME}" + sh "${scannerHome}/bin/sonar-scanner -X -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.exclusions=examples/**" } } } From 249172249b59a5e89827584cab72713d3f145aa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 09:02:05 +0000 Subject: [PATCH 104/669] build(deps-dev): Bump tox from 4.4.5 to 4.4.6 Bumps [tox](https://github.com/tox-dev/tox) from 4.4.5 to 4.4.6. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.5...4.4.6) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f02b9866..8c0d9a40 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 pylint==2.16.2 -tox==4.4.5 +tox==4.4.6 pytest-rerunfailures==11.1.1 # code coverage From df5a4cc84d880b3ae02c38ca10ec7cff8d491f6f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:56:34 +0000 Subject: [PATCH 105/669] build(generated): fail pipeline for SQ quality gate failures (#434) Generated SDK source code using: - Generator version 3.64.0 - Specification version 1.0.0-dev0.0.49 - Automation (cloudant-sdks) version d185674 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 00a83f4f..80b10c50 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -264,7 +264,7 @@ void defaultInit() { scanCode = { withSonarQubeEnv(installationName: 'SonarQubeServer') { - sh "${scannerHome}/bin/sonar-scanner -X -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.exclusions=examples/**" + sh "${scannerHome}/bin/sonar-scanner -X -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.exclusions=examples/**" } } } From fe9b1f8f3f557c142ed32904b7a564fb83abaccb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 13:39:58 +0000 Subject: [PATCH 106/669] build(deps-dev): Bump coverage from 7.1.0 to 7.2.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.1.0 to 7.2.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.1.0...7.2.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8c0d9a40..b63d07b5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.4.6 pytest-rerunfailures==11.1.1 # code coverage -coverage==7.1.0 +coverage==7.2.0 pytest-cov==4.0.0 # documentation From 6ce858f8cef8612f897bb9fe73f9bcb8904878b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 17:55:18 -0500 Subject: [PATCH 107/669] build(deps-dev): Bump coverage from 7.2.0 to 7.2.1 (#437) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.0 to 7.2.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.0...7.2.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b63d07b5..91ce9cd2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.4.6 pytest-rerunfailures==11.1.1 # code coverage -coverage==7.2.0 +coverage==7.2.1 pytest-cov==4.0.0 # documentation From 85dafb13fde475ae2b5a16c54312123ea472eedc Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 28 Feb 2023 21:07:36 +0000 Subject: [PATCH 108/669] build(generated): Update spec version to 0.0.50 (#683) (#438) Generated SDK source code using: - Generator version 3.67.0 - Specification version 1.0.0-dev0.0.50 - Automation (cloudant-sdks) version 2e38988 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 356 +++++++++++++++++++++++---- test/integration/test_cloudant_v1.py | 2 - test/unit/test_cloudant_v1.py | 39 ++- 3 files changed, 337 insertions(+), 60 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 4e861d5c..c256b0db 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -3944,7 +3944,6 @@ def post_partition_view(self, key: object = None, keys: List[object] = None, reduce: bool = None, - stable: bool = None, start_key: object = None, start_key_doc_id: str = None, update: str = None, @@ -4007,15 +4006,6 @@ def post_partition_view(self, :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - :param bool stable: (optional) Query parameter to specify whether use the - same replica of the index on each request. The default value `false` - contacts all replicas and returns the result from the first, fastest, - responder. Setting it to `true` when used in conjunction with - `update=false` may improve consistency at the expense of increased latency - and decreased throughput if the selected replica is not the fastest of the - available replicas. - **Note:** In general setting `true` is discouraged and is strictly not - recommended when using `update=true`. :param object start_key: (optional) Schema for any JSON type. :param str start_key_doc_id: (optional) Schema for a document ID. :param str update: (optional) Parameter to specify whether or not the view @@ -4060,7 +4050,6 @@ def post_partition_view(self, 'key': key, 'keys': keys, 'reduce': reduce, - 'stable': stable, 'start_key': start_key, 'start_key_doc_id': start_key_doc_id, 'update': update, @@ -4109,7 +4098,6 @@ def post_partition_view_as_stream(self, key: object = None, keys: List[object] = None, reduce: bool = None, - stable: bool = None, start_key: object = None, start_key_doc_id: str = None, update: str = None, @@ -4172,15 +4160,6 @@ def post_partition_view_as_stream(self, :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - :param bool stable: (optional) Query parameter to specify whether use the - same replica of the index on each request. The default value `false` - contacts all replicas and returns the result from the first, fastest, - responder. Setting it to `true` when used in conjunction with - `update=false` may improve consistency at the expense of increased latency - and decreased throughput if the selected replica is not the fastest of the - available replicas. - **Note:** In general setting `true` is discouraged and is strictly not - recommended when using `update=true`. :param object start_key: (optional) Schema for any JSON type. :param str start_key_doc_id: (optional) Schema for a document ID. :param str update: (optional) Parameter to specify whether or not the view @@ -4225,7 +4204,6 @@ def post_partition_view_as_stream(self, 'key': key, 'keys': keys, 'reduce': reduce, - 'stable': stable, 'start_key': start_key, 'start_key_doc_id': start_key_doc_id, 'update': update, @@ -7741,17 +7719,71 @@ class ActiveTask(): """ Schema for information about a running task. - :attr int changes_done: (optional) Processed changes. + :attr int bulk_get_attempts: (optional) The total count of attempted doc + revisions fetched with `_bulk_get`. Available for `replication` type tasks. + :attr int bulk_get_docs: (optional) The total count of successful docs fetched + with `_bulk_get`. Available for `replication` type tasks. + :attr int changes_done: (optional) Processed changes. Available for + `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type + tasks. + :attr int changes_pending: (optional) The count of changes not yet replicated. + Available for `replication` type tasks. + :attr int checkpoint_interval: (optional) Specifies the checkpoint interval in + ms. Available for `replication` type tasks. + :attr str checkpointed_source_seq: (optional) The source sequence id which was + last successfully replicated. Available for `replication` type tasks. + :attr bool continuous: (optional) The replication configured to be continuous. + Available for `replication` type tasks. :attr str database: Source database. + :attr str design_document: (optional) The design document that belongs to this + task. Available for `indexer`, `search_indexer`, `view_compaction` type tasks. + :attr str doc_id: (optional) Replication document ID. Available for + `replication` type tasks. + :attr int doc_write_failures: (optional) Number of document write failures. + Available for `replication` type tasks. + :attr int docs_read: (optional) Number of documents read. Available for + `replication` type tasks. + :attr int docs_written: (optional) Number of documents written to target. + Available for `replication` type tasks. + :attr str index: (optional) The search index that belongs to this task. + Available for `search_indexer` type tasks. + :attr str indexer_pid: (optional) Indexer process ID. Available for `indexer` + type tasks. + :attr int missing_revisions_found: (optional) The count of docs which have been + read from the source. Available for `replication` type tasks. :attr str node: Cluster node where the task is running. + :attr str phase: (optional) The phase the active task is in. `docid_sort`, + `docid_copy`, `document_copy` phases are available for `database_compaction`, + while `ids` and `view` phases are available for `view_compaction` type tasks. :attr str pid: Process ID. - :attr int progress: (optional) Current percentage progress. + :attr str process_status: (optional) Process status. + :attr int progress: (optional) Current percentage progress. Available for + `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type + tasks. + :attr str replication_id: (optional) Replication ID. Available for `replication` + type tasks. + :attr bool retry: (optional) Indicates whether a compaction retry is currently + running on the database. Available for `database_compaction` type tasks. + :attr int revisions_checked: (optional) The count of revisions which have been + checked since this replication began. Available for `replication` type tasks. + :attr str source: (optional) Replication source. Available for `replication` + type tasks. + :attr str source_seq: (optional) The last sequence number obtained from the + source database changes feed. Available for `replication` type tasks. :attr int started_on: Schema for a Unix epoch timestamp. - :attr str status: (optional) Task status message. - :attr str task: (optional) Task name. - :attr int total_changes: (optional) Total changes to process. + :attr str target: (optional) Replication target. Available for `replication` + type tasks. + :attr str through_seq: (optional) The last sequence number processed by the + replicator. Available for `replication` type tasks. + :attr int total_changes: (optional) Total changes to process. Available for + `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type + tasks. :attr str type: Operation type. :attr int updated_on: Schema for a Unix epoch timestamp. + :attr str user: (optional) Name of user running replication or owning the + indexer. Available for `indexer`, `replication` type tasks. + :attr int view: (optional) Number of view indexes. Available for + `view_compaction` type tasks. """ def __init__(self, @@ -7762,11 +7794,34 @@ def __init__(self, type: str, updated_on: int, *, + bulk_get_attempts: int = None, + bulk_get_docs: int = None, changes_done: int = None, + changes_pending: int = None, + checkpoint_interval: int = None, + checkpointed_source_seq: str = None, + continuous: bool = None, + design_document: str = None, + doc_id: str = None, + doc_write_failures: int = None, + docs_read: int = None, + docs_written: int = None, + index: str = None, + indexer_pid: str = None, + missing_revisions_found: int = None, + phase: str = None, + process_status: str = None, progress: int = None, - status: str = None, - task: str = None, - total_changes: int = None) -> None: + replication_id: str = None, + retry: bool = None, + revisions_checked: int = None, + source: str = None, + source_seq: str = None, + target: str = None, + through_seq: str = None, + total_changes: int = None, + user: str = None, + view: int = None) -> None: """ Initialize a ActiveTask object. @@ -7776,52 +7831,175 @@ def __init__(self, :param int started_on: Schema for a Unix epoch timestamp. :param str type: Operation type. :param int updated_on: Schema for a Unix epoch timestamp. - :param int changes_done: (optional) Processed changes. - :param int progress: (optional) Current percentage progress. - :param str status: (optional) Task status message. - :param str task: (optional) Task name. - :param int total_changes: (optional) Total changes to process. - """ + :param int bulk_get_attempts: (optional) The total count of attempted doc + revisions fetched with `_bulk_get`. Available for `replication` type tasks. + :param int bulk_get_docs: (optional) The total count of successful docs + fetched with `_bulk_get`. Available for `replication` type tasks. + :param int changes_done: (optional) Processed changes. Available for + `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type + tasks. + :param int changes_pending: (optional) The count of changes not yet + replicated. Available for `replication` type tasks. + :param int checkpoint_interval: (optional) Specifies the checkpoint + interval in ms. Available for `replication` type tasks. + :param str checkpointed_source_seq: (optional) The source sequence id which + was last successfully replicated. Available for `replication` type tasks. + :param bool continuous: (optional) The replication configured to be + continuous. Available for `replication` type tasks. + :param str design_document: (optional) The design document that belongs to + this task. Available for `indexer`, `search_indexer`, `view_compaction` + type tasks. + :param str doc_id: (optional) Replication document ID. Available for + `replication` type tasks. + :param int doc_write_failures: (optional) Number of document write + failures. Available for `replication` type tasks. + :param int docs_read: (optional) Number of documents read. Available for + `replication` type tasks. + :param int docs_written: (optional) Number of documents written to target. + Available for `replication` type tasks. + :param str index: (optional) The search index that belongs to this task. + Available for `search_indexer` type tasks. + :param str indexer_pid: (optional) Indexer process ID. Available for + `indexer` type tasks. + :param int missing_revisions_found: (optional) The count of docs which have + been read from the source. Available for `replication` type tasks. + :param str phase: (optional) The phase the active task is in. `docid_sort`, + `docid_copy`, `document_copy` phases are available for + `database_compaction`, while `ids` and `view` phases are available for + `view_compaction` type tasks. + :param str process_status: (optional) Process status. + :param int progress: (optional) Current percentage progress. Available for + `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type + tasks. + :param str replication_id: (optional) Replication ID. Available for + `replication` type tasks. + :param bool retry: (optional) Indicates whether a compaction retry is + currently running on the database. Available for `database_compaction` type + tasks. + :param int revisions_checked: (optional) The count of revisions which have + been checked since this replication began. Available for `replication` type + tasks. + :param str source: (optional) Replication source. Available for + `replication` type tasks. + :param str source_seq: (optional) The last sequence number obtained from + the source database changes feed. Available for `replication` type tasks. + :param str target: (optional) Replication target. Available for + `replication` type tasks. + :param str through_seq: (optional) The last sequence number processed by + the replicator. Available for `replication` type tasks. + :param int total_changes: (optional) Total changes to process. Available + for `database_compaction`, `indexer`, `search_indexer`, `view_compaction` + type tasks. + :param str user: (optional) Name of user running replication or owning the + indexer. Available for `indexer`, `replication` type tasks. + :param int view: (optional) Number of view indexes. Available for + `view_compaction` type tasks. + """ + self.bulk_get_attempts = bulk_get_attempts + self.bulk_get_docs = bulk_get_docs self.changes_done = changes_done + self.changes_pending = changes_pending + self.checkpoint_interval = checkpoint_interval + self.checkpointed_source_seq = checkpointed_source_seq + self.continuous = continuous self.database = database + self.design_document = design_document + self.doc_id = doc_id + self.doc_write_failures = doc_write_failures + self.docs_read = docs_read + self.docs_written = docs_written + self.index = index + self.indexer_pid = indexer_pid + self.missing_revisions_found = missing_revisions_found self.node = node + self.phase = phase self.pid = pid + self.process_status = process_status self.progress = progress + self.replication_id = replication_id + self.retry = retry + self.revisions_checked = revisions_checked + self.source = source + self.source_seq = source_seq self.started_on = started_on - self.status = status - self.task = task + self.target = target + self.through_seq = through_seq self.total_changes = total_changes self.type = type self.updated_on = updated_on + self.user = user + self.view = view @classmethod def from_dict(cls, _dict: Dict) -> 'ActiveTask': """Initialize a ActiveTask object from a json dictionary.""" args = {} + if 'bulk_get_attempts' in _dict: + args['bulk_get_attempts'] = _dict.get('bulk_get_attempts') + if 'bulk_get_docs' in _dict: + args['bulk_get_docs'] = _dict.get('bulk_get_docs') if 'changes_done' in _dict: args['changes_done'] = _dict.get('changes_done') + if 'changes_pending' in _dict: + args['changes_pending'] = _dict.get('changes_pending') + if 'checkpoint_interval' in _dict: + args['checkpoint_interval'] = _dict.get('checkpoint_interval') + if 'checkpointed_source_seq' in _dict: + args['checkpointed_source_seq'] = _dict.get('checkpointed_source_seq') + if 'continuous' in _dict: + args['continuous'] = _dict.get('continuous') if 'database' in _dict: args['database'] = _dict.get('database') else: raise ValueError('Required property \'database\' not present in ActiveTask JSON') + if 'design_document' in _dict: + args['design_document'] = _dict.get('design_document') + if 'doc_id' in _dict: + args['doc_id'] = _dict.get('doc_id') + if 'doc_write_failures' in _dict: + args['doc_write_failures'] = _dict.get('doc_write_failures') + if 'docs_read' in _dict: + args['docs_read'] = _dict.get('docs_read') + if 'docs_written' in _dict: + args['docs_written'] = _dict.get('docs_written') + if 'index' in _dict: + args['index'] = _dict.get('index') + if 'indexer_pid' in _dict: + args['indexer_pid'] = _dict.get('indexer_pid') + if 'missing_revisions_found' in _dict: + args['missing_revisions_found'] = _dict.get('missing_revisions_found') if 'node' in _dict: args['node'] = _dict.get('node') else: raise ValueError('Required property \'node\' not present in ActiveTask JSON') + if 'phase' in _dict: + args['phase'] = _dict.get('phase') if 'pid' in _dict: args['pid'] = _dict.get('pid') else: raise ValueError('Required property \'pid\' not present in ActiveTask JSON') + if 'process_status' in _dict: + args['process_status'] = _dict.get('process_status') if 'progress' in _dict: args['progress'] = _dict.get('progress') + if 'replication_id' in _dict: + args['replication_id'] = _dict.get('replication_id') + if 'retry' in _dict: + args['retry'] = _dict.get('retry') + if 'revisions_checked' in _dict: + args['revisions_checked'] = _dict.get('revisions_checked') + if 'source' in _dict: + args['source'] = _dict.get('source') + if 'source_seq' in _dict: + args['source_seq'] = _dict.get('source_seq') if 'started_on' in _dict: args['started_on'] = _dict.get('started_on') else: raise ValueError('Required property \'started_on\' not present in ActiveTask JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - if 'task' in _dict: - args['task'] = _dict.get('task') + if 'target' in _dict: + args['target'] = _dict.get('target') + if 'through_seq' in _dict: + args['through_seq'] = _dict.get('through_seq') if 'total_changes' in _dict: args['total_changes'] = _dict.get('total_changes') if 'type' in _dict: @@ -7832,6 +8010,10 @@ def from_dict(cls, _dict: Dict) -> 'ActiveTask': args['updated_on'] = _dict.get('updated_on') else: raise ValueError('Required property \'updated_on\' not present in ActiveTask JSON') + if 'user' in _dict: + args['user'] = _dict.get('user') + if 'view' in _dict: + args['view'] = _dict.get('view') return cls(**args) @classmethod @@ -7842,28 +8024,74 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'bulk_get_attempts') and self.bulk_get_attempts is not None: + _dict['bulk_get_attempts'] = self.bulk_get_attempts + if hasattr(self, 'bulk_get_docs') and self.bulk_get_docs is not None: + _dict['bulk_get_docs'] = self.bulk_get_docs if hasattr(self, 'changes_done') and self.changes_done is not None: _dict['changes_done'] = self.changes_done + if hasattr(self, 'changes_pending') and self.changes_pending is not None: + _dict['changes_pending'] = self.changes_pending + if hasattr(self, 'checkpoint_interval') and self.checkpoint_interval is not None: + _dict['checkpoint_interval'] = self.checkpoint_interval + if hasattr(self, 'checkpointed_source_seq') and self.checkpointed_source_seq is not None: + _dict['checkpointed_source_seq'] = self.checkpointed_source_seq + if hasattr(self, 'continuous') and self.continuous is not None: + _dict['continuous'] = self.continuous if hasattr(self, 'database') and self.database is not None: _dict['database'] = self.database + if hasattr(self, 'design_document') and self.design_document is not None: + _dict['design_document'] = self.design_document + if hasattr(self, 'doc_id') and self.doc_id is not None: + _dict['doc_id'] = self.doc_id + if hasattr(self, 'doc_write_failures') and self.doc_write_failures is not None: + _dict['doc_write_failures'] = self.doc_write_failures + if hasattr(self, 'docs_read') and self.docs_read is not None: + _dict['docs_read'] = self.docs_read + if hasattr(self, 'docs_written') and self.docs_written is not None: + _dict['docs_written'] = self.docs_written + if hasattr(self, 'index') and self.index is not None: + _dict['index'] = self.index + if hasattr(self, 'indexer_pid') and self.indexer_pid is not None: + _dict['indexer_pid'] = self.indexer_pid + if hasattr(self, 'missing_revisions_found') and self.missing_revisions_found is not None: + _dict['missing_revisions_found'] = self.missing_revisions_found if hasattr(self, 'node') and self.node is not None: _dict['node'] = self.node + if hasattr(self, 'phase') and self.phase is not None: + _dict['phase'] = self.phase if hasattr(self, 'pid') and self.pid is not None: _dict['pid'] = self.pid + if hasattr(self, 'process_status') and self.process_status is not None: + _dict['process_status'] = self.process_status if hasattr(self, 'progress') and self.progress is not None: _dict['progress'] = self.progress + if hasattr(self, 'replication_id') and self.replication_id is not None: + _dict['replication_id'] = self.replication_id + if hasattr(self, 'retry') and self.retry is not None: + _dict['retry'] = self.retry + if hasattr(self, 'revisions_checked') and self.revisions_checked is not None: + _dict['revisions_checked'] = self.revisions_checked + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'source_seq') and self.source_seq is not None: + _dict['source_seq'] = self.source_seq if hasattr(self, 'started_on') and self.started_on is not None: _dict['started_on'] = self.started_on - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'task') and self.task is not None: - _dict['task'] = self.task + if hasattr(self, 'target') and self.target is not None: + _dict['target'] = self.target + if hasattr(self, 'through_seq') and self.through_seq is not None: + _dict['through_seq'] = self.through_seq if hasattr(self, 'total_changes') and self.total_changes is not None: _dict['total_changes'] = self.total_changes if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'updated_on') and self.updated_on is not None: _dict['updated_on'] = self.updated_on + if hasattr(self, 'user') and self.user is not None: + _dict['user'] = self.user + if hasattr(self, 'view') and self.view is not None: + _dict['view'] = self.view return _dict def _to_dict(self): @@ -7884,6 +8112,42 @@ def __ne__(self, other: 'ActiveTask') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class PhaseEnum(str, Enum): + """ + The phase the active task is in. `docid_sort`, `docid_copy`, `document_copy` + phases are available for `database_compaction`, while `ids` and `view` phases are + available for `view_compaction` type tasks. + """ + DOCID_SORT = 'docid_sort' + DOCID_COPY = 'docid_copy' + DOCUMENT_COPY = 'document_copy' + IDS = 'ids' + VIEW = 'view' + + + class ProcessStatusEnum(str, Enum): + """ + Process status. + """ + EXITING = 'exiting' + GARBAGE_COLLECTING = 'garbage_collecting' + RUNNABLE = 'runnable' + RUNNING = 'running' + SUSPENDED = 'suspended' + WAITING = 'waiting' + + + class TypeEnum(str, Enum): + """ + Operation type. + """ + DATABASE_COMPACTION = 'database_compaction' + INDEXER = 'indexer' + REPLICATION = 'replication' + SEARCH_INDEXER = 'search_indexer' + VIEW_COMPACTION = 'view_compaction' + + class ActivityTrackerEvents(): """ Schema for Activity Tracker events. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index a64dc47d..340c0396 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1176,7 +1176,6 @@ def test_post_partition_view(self): key='testString', keys=['testString'], reduce=True, - stable=False, start_key='testString', start_key_doc_id='testString', update='true', @@ -1210,7 +1209,6 @@ def test_post_partition_view_as_stream(self): key='testString', keys=['testString'], reduce=True, - stable=False, start_key='testString', start_key_doc_id='testString', update='true', diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 88f22e70..8f300cd1 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -6828,7 +6828,6 @@ def test_post_partition_view_all_params(self): key = 'testString' keys = ['testString'] reduce = True - stable = False start_key = 'testString' start_key_doc_id = 'testString' update = 'true' @@ -6855,7 +6854,6 @@ def test_post_partition_view_all_params(self): key=key, keys=keys, reduce=reduce, - stable=stable, start_key=start_key, start_key_doc_id=start_key_doc_id, update=update, @@ -6886,7 +6884,6 @@ def test_post_partition_view_all_params(self): assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] assert req_body['reduce'] == True - assert req_body['stable'] == False assert req_body['start_key'] == 'testString' assert req_body['start_key_doc_id'] == 'testString' assert req_body['update'] == 'true' @@ -6935,7 +6932,6 @@ def test_post_partition_view_value_error(self): key = 'testString' keys = ['testString'] reduce = True - stable = False start_key = 'testString' start_key_doc_id = 'testString' update = 'true' @@ -7001,7 +6997,6 @@ def test_post_partition_view_as_stream_all_params(self): key = 'testString' keys = ['testString'] reduce = True - stable = False start_key = 'testString' start_key_doc_id = 'testString' update = 'true' @@ -7028,7 +7023,6 @@ def test_post_partition_view_as_stream_all_params(self): key=key, keys=keys, reduce=reduce, - stable=stable, start_key=start_key, start_key_doc_id=start_key_doc_id, update=update, @@ -7059,7 +7053,6 @@ def test_post_partition_view_as_stream_all_params(self): assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] assert req_body['reduce'] == True - assert req_body['stable'] == False assert req_body['start_key'] == 'testString' assert req_body['start_key_doc_id'] == 'testString' assert req_body['update'] == 'true' @@ -7114,7 +7107,6 @@ def test_post_partition_view_as_stream_value_error(self): key = 'testString' keys = ['testString'] reduce = True - stable = False start_key = 'testString' start_key_doc_id = 'testString' update = 'true' @@ -12174,7 +12166,7 @@ def test_get_active_tasks_all_params(self): """ # Set up mock url = preprocess_url('/_active_tasks') - mock_response = '[{"changes_done": 0, "database": "database", "node": "node", "pid": "pid", "progress": 0, "started_on": 0, "status": "status", "task": "task", "total_changes": 0, "type": "type", "updated_on": 0}]' + mock_response = '[{"bulk_get_attempts": 0, "bulk_get_docs": 0, "changes_done": 0, "changes_pending": 0, "checkpoint_interval": 0, "checkpointed_source_seq": "checkpointed_source_seq", "continuous": false, "database": "database", "design_document": "design_document", "doc_id": "doc_id", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "index": "index", "indexer_pid": "indexer_pid", "missing_revisions_found": 0, "node": "node", "phase": "docid_sort", "pid": "pid", "process_status": "exiting", "progress": 0, "replication_id": "replication_id", "retry": false, "revisions_checked": 0, "source": "source", "source_seq": "source_seq", "started_on": 0, "target": "target", "through_seq": "through_seq", "total_changes": 0, "type": "database_compaction", "updated_on": 0, "user": "user", "view": 0}]' responses.add(responses.GET, url, body=mock_response, @@ -12410,17 +12402,40 @@ def test_active_task_serialization(self): # Construct a json representation of a ActiveTask model active_task_model_json = {} + active_task_model_json['bulk_get_attempts'] = 0 + active_task_model_json['bulk_get_docs'] = 0 active_task_model_json['changes_done'] = 0 + active_task_model_json['changes_pending'] = 0 + active_task_model_json['checkpoint_interval'] = 0 + active_task_model_json['checkpointed_source_seq'] = 'testString' + active_task_model_json['continuous'] = False active_task_model_json['database'] = 'testString' + active_task_model_json['design_document'] = 'testString' + active_task_model_json['doc_id'] = 'testString' + active_task_model_json['doc_write_failures'] = 0 + active_task_model_json['docs_read'] = 0 + active_task_model_json['docs_written'] = 0 + active_task_model_json['index'] = 'testString' + active_task_model_json['indexer_pid'] = 'testString' + active_task_model_json['missing_revisions_found'] = 0 active_task_model_json['node'] = 'testString' + active_task_model_json['phase'] = 'docid_sort' active_task_model_json['pid'] = 'testString' + active_task_model_json['process_status'] = 'exiting' active_task_model_json['progress'] = 0 + active_task_model_json['replication_id'] = 'testString' + active_task_model_json['retry'] = True + active_task_model_json['revisions_checked'] = 0 + active_task_model_json['source'] = 'testString' + active_task_model_json['source_seq'] = 'testString' active_task_model_json['started_on'] = 0 - active_task_model_json['status'] = 'testString' - active_task_model_json['task'] = 'testString' + active_task_model_json['target'] = 'testString' + active_task_model_json['through_seq'] = 'testString' active_task_model_json['total_changes'] = 0 - active_task_model_json['type'] = 'testString' + active_task_model_json['type'] = 'database_compaction' active_task_model_json['updated_on'] = 0 + active_task_model_json['user'] = 'testString' + active_task_model_json['view'] = 0 # Construct a model instance of ActiveTask by calling from_dict on the json representation active_task_model = ActiveTask.from_dict(active_task_model_json) From f1a511738434787ef9e26230e51ded168e29b1cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:48:09 -0500 Subject: [PATCH 109/669] build(deps-dev): Bump pylint from 2.16.2 to 2.16.3 (#439) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.16.2 to 2.16.3. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.16.2...v2.16.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 91ce9cd2..80501b05 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.1 responses==0.22.0 python_dotenv==0.21.1 -pylint==2.16.2 +pylint==2.16.3 tox==4.4.6 pytest-rerunfailures==11.1.1 From fee17d19f2ba9346cede37d7df8da85ff12f4e84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:58:47 +0000 Subject: [PATCH 110/669] build(deps-dev): Bump pytest from 7.2.1 to 7.2.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.1 to 7.2.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.2.1...7.2.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 80501b05..28f2b512 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.2.1 +pytest==7.2.2 responses==0.22.0 python_dotenv==0.21.1 pylint==2.16.3 From 33f88382686c2a90c9d6a13bf6d3770290d59cf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 18:22:31 +0000 Subject: [PATCH 111/669] build(deps-dev): Bump pylint from 2.16.3 to 2.16.4 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.16.3 to 2.16.4. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.16.3...v2.16.4) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 28f2b512..0f6f4b83 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.2 responses==0.22.0 python_dotenv==0.21.1 -pylint==2.16.3 +pylint==2.16.4 tox==4.4.6 pytest-rerunfailures==11.1.1 From 9338a5528f8b1e4c6e00414469cd6f07c3a0cea5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 17:57:01 +0000 Subject: [PATCH 112/669] build(deps-dev): Bump pylint from 2.16.4 to 2.17.0 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.16.4 to 2.17.0. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.16.4...v2.17.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0f6f4b83..d2b6a853 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.2 responses==0.22.0 python_dotenv==0.21.1 -pylint==2.16.4 +pylint==2.17.0 tox==4.4.6 pytest-rerunfailures==11.1.1 From 3e6b0fd4aea02a92480649d7b44061ee399c6cfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:10:11 +0000 Subject: [PATCH 113/669] build(deps-dev): Bump pytest-rerunfailures from 11.1.1 to 11.1.2 Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1.1 to 11.1.2. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.1.1...11.1.2) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d2b6a853..4a1bba4e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ responses==0.22.0 python_dotenv==0.21.1 pylint==2.17.0 tox==4.4.6 -pytest-rerunfailures==11.1.1 +pytest-rerunfailures==11.1.2 # code coverage coverage==7.2.1 From 7f5cde59a3184aed6561b05f7011f3fb937efd12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 12:06:56 +0100 Subject: [PATCH 114/669] build(deps-dev): Bump responses from 0.22.0 to 0.23.1 (#445) Bumps [responses](https://github.com/getsentry/responses) from 0.22.0 to 0.23.1. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.22.0...0.23.1) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4a1bba4e..53853418 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ # test dependencies pytest==7.2.2 -responses==0.22.0 +responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.0 tox==4.4.6 From 2039df682099139f25fd6cabd95b19d0a878da4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 10:12:07 +0100 Subject: [PATCH 115/669] build(deps-dev): Bump tox from 4.4.6 to 4.4.7 (#446) Bumps [tox](https://github.com/tox-dev/tox) from 4.4.6 to 4.4.7. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.6...4.4.7) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 53853418..c7762412 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.0 -tox==4.4.6 +tox==4.4.7 pytest-rerunfailures==11.1.2 # code coverage From e774686e211098a72acbb6ca96e9105cf705f1c3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 16 Mar 2023 17:40:16 +0000 Subject: [PATCH 116/669] chore(generated): use new build image in common jenkinsfile (#447) Generated SDK source code using: - Generator version 3.67.0 - Specification version 1.0.0-dev0.0.50 - Automation (cloudant-sdks) version 40a395c Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 11 ++++------- scripts/setup_couch.sh | 2 +- scripts/setup_wiremock.sh | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 80b10c50..4b9d893c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,9 @@ pipeline { agent { - label 'sdks-executor' + kubernetes { + yaml kubePodTemplate(name: 'gauge.yaml') + } } parameters { validatingString( name: 'TARGET_VERSION', @@ -47,10 +49,8 @@ pipeline { passwordVariable: 'SERVER_PASSWORD') ]) { script { - docker.withRegistry(env.ARTIFACTORY_DOCKER_REGISTRY,'artifactory') { sh './scripts/setup_couch.sh' sh './scripts/setup_wiremock.sh' - } } runTests() } @@ -294,8 +294,7 @@ void applyCustomizations() { void runTests() { sh ''' export PIP_INDEX_URL=https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL_DOWN##'https://'}/api/pypi/cloudant-sdks-pypi-virtual/simple - . /home/jenkins/pythonvenv/bin/activate - python3 -m tox -e py310 + python3 -m tox -e py311 ''' } @@ -316,7 +315,6 @@ void publishTwine() { deleteDir() } sh ''' - . /home/jenkins/pythonvenv/bin/activate python3 --version python3 setup.py sdist python3 -m twine upload dist/* @@ -325,7 +323,6 @@ void publishTwine() { void publishDocs() { sh ''' - . /home/jenkins/pythonvenv/bin/activate ./scripts/pydoc/publish-doc.sh ''' } diff --git a/scripts/setup_couch.sh b/scripts/setup_couch.sh index 8bf32ec7..188682f2 100755 --- a/scripts/setup_couch.sh +++ b/scripts/setup_couch.sh @@ -5,7 +5,7 @@ set -ev printenv | grep "^SERVER_" >> cloudant_v1.env # if you change the image version please regenerate example output captures # use image at ARTIFACTORY_DOCKER_REPO_VIRTUAL registry if set, otherwise use default registry -docker start couchdb || docker run --name couchdb --rm -e COUCHDB_USER="$SERVER_USERNAME" -e COUCHDB_PASSWORD="$SERVER_PASSWORD" -p 5984:5984 -d ${ARTIFACTORY_DOCKER_REPO_VIRTUAL:+${ARTIFACTORY_DOCKER_REPO_VIRTUAL}/}apache/couchdb:3 + # shellcheck disable=SC2016 timeout 120 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${SERVER_URL}/_up)" != "200" ]]; do sleep 5; done' || false curl -XPUT -u "$SERVER_USERNAME":"$SERVER_PASSWORD" "$SERVER_URL"/_users diff --git a/scripts/setup_wiremock.sh b/scripts/setup_wiremock.sh index ea3b5bad..b46974e7 100755 --- a/scripts/setup_wiremock.sh +++ b/scripts/setup_wiremock.sh @@ -7,7 +7,6 @@ printenv | grep "^WIREMOCK_" > wiremock.env echo -e "CLOUDANT_AUTH_TYPE=noauth\nCLOUDANT_URL=$WIREMOCK_URL" >> cloudant_v1.env # use image at ARTIFACTORY_DOCKER_REPO_VIRTUAL registry if set, otherwise use default registry -docker start wiremock || docker run --name wiremock --rm -d -p "$WIREMOCK_PORT":8080 ${ARTIFACTORY_DOCKER_REPO_VIRTUAL:+${ARTIFACTORY_DOCKER_REPO_VIRTUAL}/}wiremock/wiremock:latest timeout 120 bash -c 'while [[ "$(curl -s --location -o /dev/null -w ''%{http_code}'' ${WIREMOCK_URL}/__admin)" != "200" ]]; do sleep 2; done' || false curl "$WIREMOCK_URL"/__admin/mappings/import -X POST -d @stubs/mappings.json curl "$WIREMOCK_URL"/__admin/mappings/import -X POST -d @stubs/gen-its-mappings.json From b8f57f90e9626814a7337cc3f46a0c8da264df95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 08:44:01 +0000 Subject: [PATCH 117/669] build(deps-dev): Bump coverage from 7.2.1 to 7.2.2 (#448) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.1 to 7.2.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.1...7.2.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c7762412..eef81c80 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.4.7 pytest-rerunfailures==11.1.2 # code coverage -coverage==7.2.1 +coverage==7.2.2 pytest-cov==4.0.0 # documentation From 5064186ffae7739f29350fb104b2a479689feb09 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 17 Mar 2023 15:03:08 +0000 Subject: [PATCH 118/669] docs(generated): remove transaction engine section from known issues (#449) Generated SDK source code using: - Generator version 3.67.0 - Specification version 1.0.0-dev0.0.50 - Automation (cloudant-sdks) version be554c1 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- KNOWN_ISSUES.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 5d9552fd..392b0dde 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -102,13 +102,6 @@ The workaround is to [disable request body compression](#disabling-request-body- The `basic` property of `ReplicationDatabaseAuth` is not available in CouchDB < 3.2.0 and Cloudant <= 8914. For those versions use the `headers` property to add a header with a key of `Authorization` and a value of `Basic `. -### Cloudant on Transaction Engine - -Whilst most SDK methods will work with _Cloudant on Transaction Engine_ there are some limitations. -It should be noted that not all existing API options are applicable to _Cloudant on Transaction Engine_ -and new API options added in _Cloudant on Transaction Engine_ are not yet available in the SDKs. Please -consult the Cloudant documentation for further information. - ### Compression * Manually setting an `Accept-Encoding` header on requests will disable the transparent gzip decompression of response bodies from the server. From 4452ace3c76f0305c90523ccf01433acf289f58e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 22 Mar 2023 11:03:51 +0000 Subject: [PATCH 119/669] ci(generated): change dependabot branch separator config Generated SDK source code using: - Generator version 3.68.2 - Specification version 1.0.0-dev0.0.50 - Automation (cloudant-sdks) version 5365fad Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .github/dependabot.yml | 2 ++ Jenkinsfile | 2 +- scripts/publish_buildinfo.sh | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 09d2400e..cdf4a779 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,4 +5,6 @@ updates: open-pull-requests-limit: 10 schedule: interval: "daily" + pull-request-branch-name: + separator: "-" # Custom settings diff --git a/Jenkinsfile b/Jenkinsfile index 4b9d893c..7cba78ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,7 +72,7 @@ pipeline { // Scanning runs only on non-dependabot branches when { not { - branch 'dependabot/*' + branch 'dependabot*' } } steps { diff --git a/scripts/publish_buildinfo.sh b/scripts/publish_buildinfo.sh index cb305903..273c7c29 100755 --- a/scripts/publish_buildinfo.sh +++ b/scripts/publish_buildinfo.sh @@ -5,7 +5,7 @@ file="/tmp/build.json" tmpfile="/tmp/build.json.tmp" printf "Current values set:\n Module ID: $MODULE_ID\nBuild name: $BUILD_NAME\nBuild URL: $BUILD_URL\nBuild timestamp: $BUILD_TIMESTAMP\nBuild number: $BUILD_NUMBER\n" printf "Artifactory URL: $ARTIFACT_URL\n" -ARTIFACTS=$(curl -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$ARTIFACT_URL") +ARTIFACTS=$(curl -f -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$ARTIFACT_URL") HAS_CHILDREN_RESULT=$(echo $ARTIFACTS | jq 'has("children")') # if 'children' array exists then grab all aritfact uris, else grab parent uri if [[ "$HAS_CHILDREN_RESULT" == "false" ]]; then @@ -22,14 +22,14 @@ fi # create new (or write over existing) build.json file echo -n "" > $file # get current published build -CURRENT_BUILD=$(curl -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$STAGE_ROOT"build/"$BUILD_NAME"/"$BUILD_NUMBER") +CURRENT_BUILD=$(curl -f -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$STAGE_ROOT"build/"$BUILD_NAME"/"$BUILD_NUMBER") echo $CURRENT_BUILD CURRENT_BUILD_INFO=$(echo "$CURRENT_BUILD" | jq -r '.buildInfo') echo $CURRENT_BUILD_INFO | tee $file # put build name, number, and url on published artifacts URL_WITH_PROPS="$ARTIFACT_URL?properties=build.name=$BUILD_NAME;build.number=$BUILD_NUMBER;build.url=$BUILD_URL" -curl -i -X PUT -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$URL_WITH_PROPS" +curl --fail-with-body -i -X PUT -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" "$URL_WITH_PROPS" # add artifact type and module id to build info file jq --arg type "$TYPE" '.type = $type' $file > $tmpfile && mv $tmpfile $file @@ -43,7 +43,7 @@ for artifact in $ARTIFACTS_URI; do else ARTIFACT_INFO_URL="$ARTIFACT_URL$artifact" fi - GET_ARTIFACT=$(curl -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" $ARTIFACT_INFO_URL | jq -r .checksums) + GET_ARTIFACT=$(curl -f -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" $ARTIFACT_INFO_URL | jq -r .checksums) MD5=$(echo $GET_ARTIFACT | jq -r .md5) SHA1=$(echo $GET_ARTIFACT | jq -r .sha1) NAME="${artifact#*/}" @@ -57,4 +57,4 @@ else exit 1 fi -curl -i -X PUT -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" -H "Content-Type: application/json" "$STAGE_ROOT"build --upload-file $file +curl --fail-with-body -i -X PUT -H "Authorization: Bearer $ARTIFACTORY_CREDS_PSW" -H "Content-Type: application/json" "$STAGE_ROOT"build --upload-file $file From 2e572fc4f3d5b7c56cb315da1d8ce6c14a1c985a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:53:53 -0400 Subject: [PATCH 120/669] build(deps): Bump ibm-cloud-sdk-core from 3.16.2 to 3.16.3 (#452) Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.2 to 3.16.3. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.2...v3.16.3) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4c8bd9b3..d04041ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_cloud_sdk_core==3.16.2 +ibm_cloud_sdk_core==3.16.3 # dependencies of ibm_cloud_sdk_core: requests>=2.20,<3.0 python_dateutil>=2.5.3,<3.0.0 From 230314b94bd2908afae3d9c4fc76fc1899c4b60a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:08:36 +0100 Subject: [PATCH 121/669] build(deps-dev): Bump pylint from 2.17.0 to 2.17.1 (#451) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.17.0 to 2.17.1. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.17.0...v2.17.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index eef81c80..106e89c6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.2 responses==0.23.1 python_dotenv==0.21.1 -pylint==2.17.0 +pylint==2.17.1 tox==4.4.7 pytest-rerunfailures==11.1.2 From f6bf88b51e6b92edf80142059c07f4ada3bb9455 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:57:01 +0000 Subject: [PATCH 122/669] build(deps): Bump ibm-cloud-sdk-core from 3.16.3 to 3.16.5 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.3 to 3.16.5. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.3...v3.16.5) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d04041ae..1cb4d659 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_cloud_sdk_core==3.16.3 +ibm_cloud_sdk_core==3.16.5 # dependencies of ibm_cloud_sdk_core: requests>=2.20,<3.0 python_dateutil>=2.5.3,<3.0.0 From e34676c5aef0187cb0eb01ee81455f9fda1b7ca2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:00:20 +0000 Subject: [PATCH 123/669] build(deps-dev): Bump tox from 4.4.7 to 4.4.8 Bumps [tox](https://github.com/tox-dev/tox) from 4.4.7 to 4.4.8. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.7...4.4.8) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 106e89c6..de978c3e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.1 -tox==4.4.7 +tox==4.4.8 pytest-rerunfailures==11.1.2 # code coverage From 6fd9ceb3f7624b29d30677a324289a48da383904 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:29:00 +0000 Subject: [PATCH 124/669] Update version 0.3.3 -> 0.4.0 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 19aa3724..ea3564ad 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.3 +current_version = 0.4.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index b11064e2..e2d4f34e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.3.3 +# IBM Cloudant Python SDK Version 0.4.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.3.3" +pip install --upgrade "ibmcloudant>=0.4.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.3.3" +easy_install --upgrade "ibmcloudant>=0.4.0" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index c377f51f..a6b3a5b6 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.3.3' +__version__ = '0.4.0' diff --git a/setup.py b/setup.py index fcedc93c..c8d78fa2 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.3.3' +__version__ = '0.4.0' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From 2c4a1894cc898034d7886c8a80cc2251d60ad104 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 27 Mar 2023 15:50:54 +0100 Subject: [PATCH 125/669] chore: update secrets baseline --- .secrets.baseline | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 5ea1313a..045ca711 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "stubs/.+\\.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2022-10-26T09:53:42Z", + "generated_at": "2023-03-27T14:50:33Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -138,7 +138,7 @@ } ] }, - "version": "0.13.1+ibm.55.dss", + "version": "0.13.1+ibm.57.dss", "word_list": { "file": null, "hash": null From 12391cefdcfc292522e064727082f81be0f004d0 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 27 Mar 2023 15:51:06 +0100 Subject: [PATCH 126/669] docs: update python version for docs publish --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 37ca3351..ebc40720 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,6 @@ exclude = .venv,.git,.tox,docs [testenv:docs] description = invoke sphinx-build to build the HTML docs deps = {[testenv]deps} -basepython = python3.10 +basepython = python3.11 commands = sphinx-apidoc -o {toxinidir}/source ibmcloudant "**/common.py" "**/version.py" "**/cloudant_base_service.py" "**/couchdb_session_get_authenticator_patch.py" sphinx-build -d "{toxinidir}/docs_doctree" {toxinidir}/source "{toxinidir}/apidocs" --color -bhtml From 46036fb2056bdaa406e6101df8ec25f23b17b463 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 14:44:11 -0400 Subject: [PATCH 127/669] build(deps-dev): Bump pylint from 2.17.1 to 2.17.2 (#457) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.17.1 to 2.17.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.17.1...v2.17.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index de978c3e..48fca030 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.2.2 responses==0.23.1 python_dotenv==0.21.1 -pylint==2.17.1 +pylint==2.17.2 tox==4.4.8 pytest-rerunfailures==11.1.2 From 39be6bd3356068c4c893008f67fa5fe43bdf8be5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:41:24 -0400 Subject: [PATCH 128/669] build(deps-dev): Bump tox from 4.4.8 to 4.4.10 (#459) Bumps [tox](https://github.com/tox-dev/tox) from 4.4.8 to 4.4.10. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.8...4.4.10) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 48fca030..b16e26b3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.2 -tox==4.4.8 +tox==4.4.10 pytest-rerunfailures==11.1.2 # code coverage From 1e09a08a9f640a7e48f473247ff94da419224266 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 13:45:00 -0400 Subject: [PATCH 129/669] build(deps-dev): Bump coverage from 7.2.2 to 7.2.3 (#460) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.2 to 7.2.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.2...7.2.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b16e26b3..1005d735 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.4.10 pytest-rerunfailures==11.1.2 # code coverage -coverage==7.2.2 +coverage==7.2.3 pytest-cov==4.0.0 # documentation From 4b7dc47fe6d853dc80733391fcbf411bd44882a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:17:51 -0400 Subject: [PATCH 130/669] build(deps-dev): Bump tox from 4.4.10 to 4.4.11 (#461) Bumps [tox](https://github.com/tox-dev/tox) from 4.4.10 to 4.4.11. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.10...4.4.11) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1005d735..4d343697 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.2.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.2 -tox==4.4.10 +tox==4.4.11 pytest-rerunfailures==11.1.2 # code coverage From 294dbe8b79e6786357381da37e8a719e01bc6a2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 17:57:14 +0000 Subject: [PATCH 131/669] build(deps-dev): Bump pytest from 7.2.2 to 7.3.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.2 to 7.3.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.2.2...7.3.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4d343697..7a794c98 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.2.2 +pytest==7.3.0 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.2 From a879ff2b65e26516523d5d8936921b21aba1ba20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:15:40 -0300 Subject: [PATCH 132/669] build(deps-dev): Bump tox from 4.4.11 to 4.4.12 (#463) Bumps [tox](https://github.com/tox-dev/tox) from 4.4.11 to 4.4.12. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.11...4.4.12) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7a794c98..103e03a9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.0 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.2 -tox==4.4.11 +tox==4.4.12 pytest-rerunfailures==11.1.2 # code coverage From 626fe880c0551fcabaa92896e81a61ad9e15dc05 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:49:34 +0100 Subject: [PATCH 133/669] chore(generated): update generator to 3.69.0 (#466) Generated SDK source code using: - Generator version 3.69.0 - Specification version 1.0.0-dev0.0.50 - Automation (cloudant-sdks) version b4eefb1 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 3919 +++++++++++++++----------- test/integration/test_cloudant_v1.py | 134 +- test/unit/test_cloudant_v1.py | 3897 ++++++++++++++----------- 3 files changed, 4574 insertions(+), 3376 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index c256b0db..7e1c39af 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -37,6 +37,7 @@ # Service ############################################################################## + class CloudantV1(BaseService): """The Cloudant V1 service.""" @@ -44,9 +45,10 @@ class CloudantV1(BaseService): DEFAULT_SERVICE_NAME = 'cloudant' @classmethod - def new_instance(cls, - service_name: str = DEFAULT_SERVICE_NAME, - ) -> 'CloudantV1': + def new_instance( + cls, + service_name: str = DEFAULT_SERVICE_NAME, + ) -> 'CloudantV1': """ Return a new client for the Cloudant service using the specified parameters and external configuration. @@ -58,9 +60,10 @@ def new_instance(cls, service.configure_service(service_name) return service - def __init__(self, - authenticator: Authenticator = None, - ) -> None: + def __init__( + self, + authenticator: Authenticator = None, + ) -> None: """ Construct a new client for the Cloudant service. @@ -68,20 +71,17 @@ def __init__(self, Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ - BaseService.__init__(self, - service_url=self.DEFAULT_SERVICE_URL, - authenticator=authenticator) + BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) # enable gzip compression of request bodies self.set_enable_gzip_compression(True) - ######################### # Server ######################### - - def get_server_information(self, - **kwargs + def get_server_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve server instance information. @@ -98,9 +98,11 @@ def get_server_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_server_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_server_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -109,16 +111,18 @@ def get_server_information(self, headers['Accept'] = 'application/json' url = '/' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_membership_information(self, - **kwargs + def get_membership_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve cluster membership information. @@ -133,9 +137,11 @@ def get_membership_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_membership_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_membership_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -144,18 +150,20 @@ def get_membership_information(self, headers['Accept'] = 'application/json' url = '/_membership' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_uuids(self, + def get_uuids( + self, *, count: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve one or more UUIDs. @@ -172,9 +180,11 @@ def get_uuids(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_uuids') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_uuids', + ) headers.update(sdk_headers) params = { @@ -187,17 +197,19 @@ def get_uuids(self, headers['Accept'] = 'application/json' url = '/_uuids' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_capacity_throughput_information(self, - **kwargs + def get_capacity_throughput_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve provisioned throughput capacity information. @@ -211,9 +223,11 @@ def get_capacity_throughput_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_capacity_throughput_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_capacity_throughput_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -222,17 +236,19 @@ def get_capacity_throughput_information(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/capacity/throughput' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def put_capacity_throughput_configuration(self, + def put_capacity_throughput_configuration( + self, blocks: int, - **kwargs + **kwargs, ) -> DetailedResponse: """ Update the target provisioned throughput capacity. @@ -252,9 +268,11 @@ def put_capacity_throughput_configuration(self, if blocks is None: raise ValueError('blocks must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_capacity_throughput_configuration') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_capacity_throughput_configuration', + ) headers.update(sdk_headers) data = { @@ -270,10 +288,12 @@ def put_capacity_throughput_configuration(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/capacity/throughput' - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response @@ -282,14 +302,14 @@ def put_capacity_throughput_configuration(self, # Databases ######################### - - def get_db_updates(self, + def get_db_updates( + self, *, feed: str = None, heartbeat: int = None, timeout: int = None, since: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve change events for all databases. @@ -324,9 +344,11 @@ def get_db_updates(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_db_updates') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_db_updates', + ) headers.update(sdk_headers) params = { @@ -342,16 +364,18 @@ def get_db_updates(self, headers['Accept'] = 'application/json' url = '/_db_updates' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def post_changes(self, + def post_changes( + self, db: str, *, doc_ids: List[str] = None, @@ -372,7 +396,7 @@ def post_changes(self, style: str = None, timeout: int = None, view: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query the database document changes feed. @@ -491,9 +515,11 @@ def post_changes(self, headers = { 'Last-Event-ID': last_event_id, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_changes') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_changes', + ) headers.update(sdk_headers) params = { @@ -531,17 +557,19 @@ def post_changes(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_changes'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_changes_as_stream(self, + def post_changes_as_stream( + self, db: str, *, doc_ids: List[str] = None, @@ -562,7 +590,7 @@ def post_changes_as_stream(self, style: str = None, timeout: int = None, view: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query the database document changes feed as stream. @@ -681,9 +709,11 @@ def post_changes_as_stream(self, headers = { 'Last-Event-ID': last_event_id, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_changes_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_changes_as_stream', + ) headers.update(sdk_headers) params = { @@ -721,11 +751,13 @@ def post_changes_as_stream(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_changes'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response @@ -734,10 +766,10 @@ def post_changes_as_stream(self, # Databases ######################### - - def head_database(self, + def head_database( + self, db: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve the HTTP headers for a database. @@ -755,9 +787,11 @@ def head_database(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_database') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_database', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -768,22 +802,24 @@ def head_database(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_all_dbs(self, + def get_all_dbs( + self, *, descending: bool = None, end_key: str = None, limit: int = None, skip: int = None, start_key: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a list of all database names in the instance. @@ -806,9 +842,11 @@ def get_all_dbs(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_all_dbs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_all_dbs', + ) headers.update(sdk_headers) params = { @@ -825,18 +863,20 @@ def get_all_dbs(self, headers['Accept'] = 'application/json' url = '/_all_dbs' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def post_dbs_info(self, + def post_dbs_info( + self, keys: List[str], - **kwargs + **kwargs, ) -> DetailedResponse: """ Query information about multiple databases. @@ -855,9 +895,11 @@ def post_dbs_info(self, if keys is None: raise ValueError('keys must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_dbs_info') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_dbs_info', + ) headers.update(sdk_headers) data = { @@ -873,18 +915,20 @@ def post_dbs_info(self, headers['Accept'] = 'application/json' url = '/_dbs_info' - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def delete_database(self, + def delete_database( + self, db: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete a database. @@ -903,9 +947,11 @@ def delete_database(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_database') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_database', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -917,17 +963,19 @@ def delete_database(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_database_information(self, + def get_database_information( + self, db: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve information about a database. @@ -941,9 +989,11 @@ def get_database_information(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_database_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_database_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -955,20 +1005,22 @@ def get_database_information(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def put_database(self, + def put_database( + self, db: str, *, partitioned: bool = None, q: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create a database. @@ -988,9 +1040,11 @@ def put_database(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_database') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_database', + ) headers.update(sdk_headers) params = { @@ -1007,10 +1061,12 @@ def put_database(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response @@ -1019,15 +1075,15 @@ def put_database(self, # Documents ######################### - - def head_document(self, + def head_document( + self, db: str, doc_id: str, *, if_none_match: str = None, latest: bool = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve the HTTP headers for the document. @@ -1058,9 +1114,11 @@ def head_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_document', + ) headers.update(sdk_headers) params = { @@ -1076,22 +1134,24 @@ def head_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def post_document(self, + def post_document( + self, db: str, document: Union['Document', BinaryIO], *, content_type: str = None, batch: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create or modify a document in a database. @@ -1127,9 +1187,11 @@ def post_document(self, headers = { 'Content-Type': content_type, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_document', + ) headers.update(sdk_headers) params = { @@ -1152,17 +1214,19 @@ def post_document(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_all_docs(self, + def post_all_docs( + self, db: str, *, att_encoding_info: bool = None, @@ -1178,7 +1242,7 @@ def post_all_docs(self, key: str = None, keys: List[str] = None, start_key: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a list of all documents in a database. @@ -1224,9 +1288,11 @@ def post_all_docs(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_all_docs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_all_docs', + ) headers.update(sdk_headers) data = { @@ -1257,16 +1323,18 @@ def post_all_docs(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_all_docs'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_all_docs_as_stream(self, + def post_all_docs_as_stream( + self, db: str, *, att_encoding_info: bool = None, @@ -1282,7 +1350,7 @@ def post_all_docs_as_stream(self, key: str = None, keys: List[str] = None, start_key: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a list of all documents in a database as stream. @@ -1328,9 +1396,11 @@ def post_all_docs_as_stream(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_all_docs_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_all_docs_as_stream', + ) headers.update(sdk_headers) data = { @@ -1361,19 +1431,21 @@ def post_all_docs_as_stream(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_all_docs'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def post_all_docs_queries(self, + def post_all_docs_queries( + self, db: str, queries: List['AllDocsQuery'], - **kwargs + **kwargs, ) -> DetailedResponse: """ Multi-query the list of all documents in a database. @@ -1400,9 +1472,11 @@ def post_all_docs_queries(self, raise ValueError('queries must be provided') queries = [convert_model(x) for x in queries] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_all_docs_queries') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_all_docs_queries', + ) headers.update(sdk_headers) data = { @@ -1421,19 +1495,21 @@ def post_all_docs_queries(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_all_docs/queries'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_all_docs_queries_as_stream(self, + def post_all_docs_queries_as_stream( + self, db: str, queries: List['AllDocsQuery'], - **kwargs + **kwargs, ) -> DetailedResponse: """ Multi-query the list of all documents in a database as stream. @@ -1460,9 +1536,11 @@ def post_all_docs_queries_as_stream(self, raise ValueError('queries must be provided') queries = [convert_model(x) for x in queries] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_all_docs_queries_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_all_docs_queries_as_stream', + ) headers.update(sdk_headers) data = { @@ -1481,19 +1559,21 @@ def post_all_docs_queries_as_stream(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_all_docs/queries'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def post_bulk_docs(self, + def post_bulk_docs( + self, db: str, bulk_docs: Union['BulkDocs', BinaryIO], - **kwargs + **kwargs, ) -> DetailedResponse: """ Bulk modify multiple documents in a database. @@ -1517,9 +1597,11 @@ def post_bulk_docs(self, if isinstance(bulk_docs, BulkDocs): bulk_docs = convert_model(bulk_docs) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_bulk_docs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_bulk_docs', + ) headers.update(sdk_headers) if isinstance(bulk_docs, dict): @@ -1537,16 +1619,18 @@ def post_bulk_docs(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_bulk_docs'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_bulk_get(self, + def post_bulk_get( + self, db: str, docs: List['BulkGetQueryDocument'], *, @@ -1554,7 +1638,7 @@ def post_bulk_get(self, att_encoding_info: bool = None, latest: bool = None, revs: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Bulk query revision information for multiple documents. @@ -1585,9 +1669,11 @@ def post_bulk_get(self, raise ValueError('docs must be provided') docs = [convert_model(x) for x in docs] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_bulk_get') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_bulk_get', + ) headers.update(sdk_headers) params = { @@ -1613,17 +1699,19 @@ def post_bulk_get(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_bulk_get'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_bulk_get_as_mixed(self, + def post_bulk_get_as_mixed( + self, db: str, docs: List['BulkGetQueryDocument'], *, @@ -1631,7 +1719,7 @@ def post_bulk_get_as_mixed(self, att_encoding_info: bool = None, latest: bool = None, revs: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Bulk query revision information for multiple documents as mixed. @@ -1662,9 +1750,11 @@ def post_bulk_get_as_mixed(self, raise ValueError('docs must be provided') docs = [convert_model(x) for x in docs] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_bulk_get_as_mixed') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_bulk_get_as_mixed', + ) headers.update(sdk_headers) params = { @@ -1690,17 +1780,19 @@ def post_bulk_get_as_mixed(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_bulk_get'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_bulk_get_as_related(self, + def post_bulk_get_as_related( + self, db: str, docs: List['BulkGetQueryDocument'], *, @@ -1708,7 +1800,7 @@ def post_bulk_get_as_related(self, att_encoding_info: bool = None, latest: bool = None, revs: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Bulk query revision information for multiple documents as related. @@ -1739,9 +1831,11 @@ def post_bulk_get_as_related(self, raise ValueError('docs must be provided') docs = [convert_model(x) for x in docs] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_bulk_get_as_related') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_bulk_get_as_related', + ) headers.update(sdk_headers) params = { @@ -1767,17 +1861,19 @@ def post_bulk_get_as_related(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_bulk_get'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_bulk_get_as_stream(self, + def post_bulk_get_as_stream( + self, db: str, docs: List['BulkGetQueryDocument'], *, @@ -1785,7 +1881,7 @@ def post_bulk_get_as_stream(self, att_encoding_info: bool = None, latest: bool = None, revs: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Bulk query revision information for multiple documents as stream. @@ -1816,9 +1912,11 @@ def post_bulk_get_as_stream(self, raise ValueError('docs must be provided') docs = [convert_model(x) for x in docs] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_bulk_get_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_bulk_get_as_stream', + ) headers.update(sdk_headers) params = { @@ -1844,24 +1942,26 @@ def post_bulk_get_as_stream(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_bulk_get'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def delete_document(self, + def delete_document( + self, db: str, doc_id: str, *, if_match: str = None, batch: str = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete a document. @@ -1892,9 +1992,11 @@ def delete_document(self, headers = { 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_document', + ) headers.update(sdk_headers) params = { @@ -1911,16 +2013,18 @@ def delete_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_document(self, + def get_document( + self, db: str, doc_id: str, *, @@ -1935,7 +2039,7 @@ def get_document(self, rev: str = None, revs: bool = None, revs_info: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a document. @@ -1983,9 +2087,11 @@ def get_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_document', + ) headers.update(sdk_headers) params = { @@ -2010,16 +2116,18 @@ def get_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_document_as_mixed(self, + def get_document_as_mixed( + self, db: str, doc_id: str, *, @@ -2034,7 +2142,7 @@ def get_document_as_mixed(self, rev: str = None, revs: bool = None, revs_info: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a document as mixed. @@ -2082,9 +2190,11 @@ def get_document_as_mixed(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_document_as_mixed') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_document_as_mixed', + ) headers.update(sdk_headers) params = { @@ -2109,16 +2219,18 @@ def get_document_as_mixed(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_document_as_related(self, + def get_document_as_related( + self, db: str, doc_id: str, *, @@ -2133,7 +2245,7 @@ def get_document_as_related(self, rev: str = None, revs: bool = None, revs_info: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a document as related. @@ -2181,9 +2293,11 @@ def get_document_as_related(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_document_as_related') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_document_as_related', + ) headers.update(sdk_headers) params = { @@ -2208,16 +2322,18 @@ def get_document_as_related(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_document_as_stream(self, + def get_document_as_stream( + self, db: str, doc_id: str, *, @@ -2232,7 +2348,7 @@ def get_document_as_stream(self, rev: str = None, revs: bool = None, revs_info: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a document as stream. @@ -2280,9 +2396,11 @@ def get_document_as_stream(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_document_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_document_as_stream', + ) headers.update(sdk_headers) params = { @@ -2307,16 +2425,18 @@ def get_document_as_stream(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, stream=True, **kwargs) return response - - def put_document(self, + def put_document( + self, db: str, doc_id: str, document: Union['Document', BinaryIO], @@ -2326,7 +2446,7 @@ def put_document(self, batch: str = None, new_edits: bool = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create or modify a document. @@ -2369,9 +2489,11 @@ def put_document(self, 'Content-Type': content_type, 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_document', + ) headers.update(sdk_headers) params = { @@ -2396,11 +2518,13 @@ def put_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -2409,13 +2533,13 @@ def put_document(self, # Design Documents ######################### - - def head_design_document(self, + def head_design_document( + self, db: str, ddoc: str, *, if_none_match: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve the HTTP headers for a design document. @@ -2446,9 +2570,11 @@ def head_design_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_design_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_design_document', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -2459,22 +2585,24 @@ def head_design_document(self, path_param_values = self.encode_path_vars(db, ddoc) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def delete_design_document(self, + def delete_design_document( + self, db: str, ddoc: str, *, if_match: str = None, batch: str = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete a design document. @@ -2507,9 +2635,11 @@ def delete_design_document(self, headers = { 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_design_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_design_document', + ) headers.update(sdk_headers) params = { @@ -2526,16 +2656,18 @@ def delete_design_document(self, path_param_values = self.encode_path_vars(db, ddoc) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_design_document(self, + def get_design_document( + self, db: str, ddoc: str, *, @@ -2550,7 +2682,7 @@ def get_design_document(self, rev: str = None, revs: bool = None, revs_info: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a design document. @@ -2600,9 +2732,11 @@ def get_design_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_design_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_design_document', + ) headers.update(sdk_headers) params = { @@ -2627,16 +2761,18 @@ def get_design_document(self, path_param_values = self.encode_path_vars(db, ddoc) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def put_design_document(self, + def put_design_document( + self, db: str, ddoc: str, design_document: 'DesignDocument', @@ -2645,7 +2781,7 @@ def put_design_document(self, batch: str = None, new_edits: bool = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create or modify a design document. @@ -2686,9 +2822,11 @@ def put_design_document(self, headers = { 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_design_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_design_document', + ) headers.update(sdk_headers) params = { @@ -2709,20 +2847,22 @@ def put_design_document(self, path_param_values = self.encode_path_vars(db, ddoc) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def get_design_document_information(self, + def get_design_document_information( + self, db: str, ddoc: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve information about a design document. @@ -2745,9 +2885,11 @@ def get_design_document_information(self, if not ddoc: raise ValueError('ddoc must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_design_document_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_design_document_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -2759,15 +2901,17 @@ def get_design_document_information(self, path_param_values = self.encode_path_vars(db, ddoc) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_info'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def post_design_docs(self, + def post_design_docs( + self, db: str, *, att_encoding_info: bool = None, @@ -2784,7 +2928,7 @@ def post_design_docs(self, keys: List[str] = None, start_key: str = None, accept: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a list of all design documents in a database. @@ -2834,9 +2978,11 @@ def post_design_docs(self, headers = { 'Accept': accept, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_design_docs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_design_docs', + ) headers.update(sdk_headers) data = { @@ -2866,21 +3012,23 @@ def post_design_docs(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design_docs'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_design_docs_queries(self, + def post_design_docs_queries( + self, db: str, queries: List['AllDocsQuery'], *, accept: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Multi-query the list of all design documents. @@ -2909,9 +3057,11 @@ def post_design_docs_queries(self, headers = { 'Accept': accept, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_design_docs_queries') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_design_docs_queries', + ) headers.update(sdk_headers) data = { @@ -2929,10 +3079,12 @@ def post_design_docs_queries(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design_docs/queries'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response @@ -2941,8 +3093,8 @@ def post_design_docs_queries(self, # Views ######################### - - def post_view(self, + def post_view( + self, db: str, ddoc: str, view: str, @@ -2967,7 +3119,7 @@ def post_view(self, start_key: object = None, start_key_doc_id: str = None, update: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a MapReduce view. @@ -3054,9 +3206,11 @@ def post_view(self, if not view: raise ValueError('view must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_view') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_view', + ) headers.update(sdk_headers) data = { @@ -3094,16 +3248,18 @@ def post_view(self, path_param_values = self.encode_path_vars(db, ddoc, view) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_view/{view}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_view_as_stream(self, + def post_view_as_stream( + self, db: str, ddoc: str, view: str, @@ -3128,7 +3284,7 @@ def post_view_as_stream(self, start_key: object = None, start_key_doc_id: str = None, update: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a MapReduce view as stream. @@ -3215,9 +3371,11 @@ def post_view_as_stream(self, if not view: raise ValueError('view must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_view_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_view_as_stream', + ) headers.update(sdk_headers) data = { @@ -3255,21 +3413,23 @@ def post_view_as_stream(self, path_param_values = self.encode_path_vars(db, ddoc, view) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_view/{view}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def post_view_queries(self, + def post_view_queries( + self, db: str, ddoc: str, view: str, queries: List['ViewQuery'], - **kwargs + **kwargs, ) -> DetailedResponse: """ Multi-query a MapReduce view. @@ -3302,9 +3462,11 @@ def post_view_queries(self, raise ValueError('queries must be provided') queries = [convert_model(x) for x in queries] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_view_queries') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_view_queries', + ) headers.update(sdk_headers) data = { @@ -3323,21 +3485,23 @@ def post_view_queries(self, path_param_values = self.encode_path_vars(db, ddoc, view) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_view/{view}/queries'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_view_queries_as_stream(self, + def post_view_queries_as_stream( + self, db: str, ddoc: str, view: str, queries: List['ViewQuery'], - **kwargs + **kwargs, ) -> DetailedResponse: """ Multi-query a MapReduce view as stream. @@ -3370,9 +3534,11 @@ def post_view_queries_as_stream(self, raise ValueError('queries must be provided') queries = [convert_model(x) for x in queries] headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_view_queries_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_view_queries_as_stream', + ) headers.update(sdk_headers) data = { @@ -3391,10 +3557,12 @@ def post_view_queries_as_stream(self, path_param_values = self.encode_path_vars(db, ddoc, view) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_view/{view}/queries'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response @@ -3403,11 +3571,11 @@ def post_view_queries_as_stream(self, # Queries ######################### - - def get_partition_information(self, + def get_partition_information( + self, db: str, partition_key: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve information about a database partition. @@ -3428,9 +3596,11 @@ def get_partition_information(self, if not partition_key: raise ValueError('partition_key must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_partition_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_partition_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -3442,15 +3612,17 @@ def get_partition_information(self, path_param_values = self.encode_path_vars(db, partition_key) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def post_partition_all_docs(self, + def post_partition_all_docs( + self, db: str, partition_key: str, *, @@ -3467,7 +3639,7 @@ def post_partition_all_docs(self, key: str = None, keys: List[str] = None, start_key: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a list of all documents in a database partition. @@ -3517,9 +3689,11 @@ def post_partition_all_docs(self, if not partition_key: raise ValueError('partition_key must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_all_docs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_all_docs', + ) headers.update(sdk_headers) data = { @@ -3550,16 +3724,18 @@ def post_partition_all_docs(self, path_param_values = self.encode_path_vars(db, partition_key) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_all_docs'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_partition_all_docs_as_stream(self, + def post_partition_all_docs_as_stream( + self, db: str, partition_key: str, *, @@ -3576,7 +3752,7 @@ def post_partition_all_docs_as_stream(self, key: str = None, keys: List[str] = None, start_key: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a list of all documents in a database partition as stream. @@ -3626,9 +3802,11 @@ def post_partition_all_docs_as_stream(self, if not partition_key: raise ValueError('partition_key must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_all_docs_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_all_docs_as_stream', + ) headers.update(sdk_headers) data = { @@ -3659,16 +3837,18 @@ def post_partition_all_docs_as_stream(self, path_param_values = self.encode_path_vars(db, partition_key) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_all_docs'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def post_partition_search(self, + def post_partition_search( + self, db: str, partition_key: str, ddoc: str, @@ -3686,7 +3866,7 @@ def post_partition_search(self, limit: int = None, sort: List[str] = None, stale: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a database partition search index. @@ -3754,9 +3934,11 @@ def post_partition_search(self, if query is None: raise ValueError('query must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_search') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_search', + ) headers.update(sdk_headers) data = { @@ -3786,16 +3968,18 @@ def post_partition_search(self, path_param_values = self.encode_path_vars(db, partition_key, ddoc, index) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_partition_search_as_stream(self, + def post_partition_search_as_stream( + self, db: str, partition_key: str, ddoc: str, @@ -3813,7 +3997,7 @@ def post_partition_search_as_stream(self, limit: int = None, sort: List[str] = None, stale: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a database partition search index as stream. @@ -3881,9 +4065,11 @@ def post_partition_search_as_stream(self, if query is None: raise ValueError('query must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_search_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_search_as_stream', + ) headers.update(sdk_headers) data = { @@ -3913,16 +4099,18 @@ def post_partition_search_as_stream(self, path_param_values = self.encode_path_vars(db, partition_key, ddoc, index) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def post_partition_view(self, + def post_partition_view( + self, db: str, partition_key: str, ddoc: str, @@ -3947,7 +4135,7 @@ def post_partition_view(self, start_key: object = None, start_key_doc_id: str = None, update: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a database partition MapReduce view function. @@ -4028,9 +4216,11 @@ def post_partition_view(self, if not view: raise ValueError('view must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_view') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_view', + ) headers.update(sdk_headers) data = { @@ -4067,16 +4257,18 @@ def post_partition_view(self, path_param_values = self.encode_path_vars(db, partition_key, ddoc, view) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_partition_view_as_stream(self, + def post_partition_view_as_stream( + self, db: str, partition_key: str, ddoc: str, @@ -4101,7 +4293,7 @@ def post_partition_view_as_stream(self, start_key: object = None, start_key_doc_id: str = None, update: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a database partition MapReduce view function as stream. @@ -4182,9 +4374,11 @@ def post_partition_view_as_stream(self, if not view: raise ValueError('view must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_view_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_view_as_stream', + ) headers.update(sdk_headers) data = { @@ -4221,16 +4415,18 @@ def post_partition_view_as_stream(self, path_param_values = self.encode_path_vars(db, partition_key, ddoc, view) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def post_partition_find(self, + def post_partition_find( + self, db: str, partition_key: str, selector: dict, @@ -4245,7 +4441,7 @@ def post_partition_find(self, stable: bool = None, update: str = None, use_index: List[str] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a database partition index by using selector syntax. @@ -4338,9 +4534,11 @@ def post_partition_find(self, if selector is None: raise ValueError('selector must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_find') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_find', + ) headers.update(sdk_headers) data = { @@ -4369,16 +4567,18 @@ def post_partition_find(self, path_param_values = self.encode_path_vars(db, partition_key) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_find'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_partition_find_as_stream(self, + def post_partition_find_as_stream( + self, db: str, partition_key: str, selector: dict, @@ -4393,7 +4593,7 @@ def post_partition_find_as_stream(self, stable: bool = None, update: str = None, use_index: List[str] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a database partition index by using selector syntax as stream. @@ -4486,9 +4686,11 @@ def post_partition_find_as_stream(self, if selector is None: raise ValueError('selector must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_partition_find_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_find_as_stream', + ) headers.update(sdk_headers) data = { @@ -4517,10 +4719,12 @@ def post_partition_find_as_stream(self, path_param_values = self.encode_path_vars(db, partition_key) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_partition/{partition_key}/_find'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response @@ -4529,8 +4733,8 @@ def post_partition_find_as_stream(self, # Queries ######################### - - def post_explain(self, + def post_explain( + self, db: str, selector: dict, *, @@ -4545,7 +4749,7 @@ def post_explain(self, update: str = None, use_index: List[str] = None, r: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve information about which index is used for a query. @@ -4635,9 +4839,11 @@ def post_explain(self, if selector is None: raise ValueError('selector must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_explain') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_explain', + ) headers.update(sdk_headers) data = { @@ -4667,16 +4873,18 @@ def post_explain(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_explain'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_find(self, + def post_find( + self, db: str, selector: dict, *, @@ -4691,7 +4899,7 @@ def post_find(self, update: str = None, use_index: List[str] = None, r: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query an index by using selector syntax. @@ -4787,9 +4995,11 @@ def post_find(self, if selector is None: raise ValueError('selector must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_find') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_find', + ) headers.update(sdk_headers) data = { @@ -4819,16 +5029,18 @@ def post_find(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_find'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_find_as_stream(self, + def post_find_as_stream( + self, db: str, selector: dict, *, @@ -4843,7 +5055,7 @@ def post_find_as_stream(self, update: str = None, use_index: List[str] = None, r: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query an index by using selector syntax as stream. @@ -4939,9 +5151,11 @@ def post_find_as_stream(self, if selector is None: raise ValueError('selector must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_find_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_find_as_stream', + ) headers.update(sdk_headers) data = { @@ -4971,18 +5185,20 @@ def post_find_as_stream(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_find'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def get_indexes_information(self, + def get_indexes_information( + self, db: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve information about all indexes. @@ -5001,9 +5217,11 @@ def get_indexes_information(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_indexes_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_indexes_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -5015,15 +5233,17 @@ def get_indexes_information(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_index'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def post_index(self, + def post_index( + self, db: str, index: 'IndexDefinition', *, @@ -5032,7 +5252,7 @@ def post_index(self, name: str = None, partitioned: bool = None, type: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create a new index on a database. @@ -5073,9 +5293,11 @@ def post_index(self, if def_ is not None: def_ = convert_model(def_) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_index') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_index', + ) headers.update(sdk_headers) data = { @@ -5099,21 +5321,23 @@ def post_index(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_index'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def delete_index(self, + def delete_index( + self, db: str, ddoc: str, type: str, index: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete an index. @@ -5138,9 +5362,11 @@ def delete_index(self, if not index: raise ValueError('index must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_index') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_index', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -5152,9 +5378,11 @@ def delete_index(self, path_param_values = self.encode_path_vars(db, ddoc, type, index) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_index/_design/{ddoc}/{type}/{index}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response @@ -5163,11 +5391,11 @@ def delete_index(self, # Searches ######################### - - def post_search_analyze(self, + def post_search_analyze( + self, analyzer: str, text: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query tokenization of sample text. @@ -5188,9 +5416,11 @@ def post_search_analyze(self, if text is None: raise ValueError('text must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_search_analyze') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_search_analyze', + ) headers.update(sdk_headers) data = { @@ -5207,16 +5437,18 @@ def post_search_analyze(self, headers['Accept'] = 'application/json' url = '/_search_analyze' - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_search(self, + def post_search( + self, db: str, ddoc: str, index: str, @@ -5239,7 +5471,7 @@ def post_search(self, group_limit: int = None, group_sort: List[str] = None, ranges: dict = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a search index. @@ -5335,9 +5567,11 @@ def post_search(self, if query is None: raise ValueError('query must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_search') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_search', + ) headers.update(sdk_headers) data = { @@ -5373,16 +5607,18 @@ def post_search(self, path_param_values = self.encode_path_vars(db, ddoc, index) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_search/{index}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_search_as_stream(self, + def post_search_as_stream( + self, db: str, ddoc: str, index: str, @@ -5405,7 +5641,7 @@ def post_search_as_stream(self, group_limit: int = None, group_sort: List[str] = None, ranges: dict = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query a search index as stream. @@ -5501,9 +5737,11 @@ def post_search_as_stream(self, if query is None: raise ValueError('query must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_search_as_stream') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_search_as_stream', + ) headers.update(sdk_headers) data = { @@ -5539,20 +5777,22 @@ def post_search_as_stream(self, path_param_values = self.encode_path_vars(db, ddoc, index) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_search/{index}'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, stream=True, **kwargs) return response - - def get_search_info(self, + def get_search_info( + self, db: str, ddoc: str, index: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve information about a search index. @@ -5576,9 +5816,11 @@ def get_search_info(self, if not index: raise ValueError('index must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_search_info') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_search_info', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -5590,9 +5832,11 @@ def get_search_info(self, path_param_values = self.encode_path_vars(db, ddoc, index) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_design/{ddoc}/_search_info/{index}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response @@ -5601,12 +5845,12 @@ def get_search_info(self, # Replication ######################### - - def head_replication_document(self, + def head_replication_document( + self, doc_id: str, *, if_none_match: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve the HTTP headers for a replication document. @@ -5629,9 +5873,11 @@ def head_replication_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_replication_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_replication_document', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -5642,17 +5888,19 @@ def head_replication_document(self, path_param_values = self.encode_path_vars(doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_replicator/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def head_scheduler_document(self, + def head_scheduler_document( + self, doc_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve HTTP headers for a replication scheduler document. @@ -5671,9 +5919,11 @@ def head_scheduler_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_scheduler_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_scheduler_document', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -5684,17 +5934,19 @@ def head_scheduler_document(self, path_param_values = self.encode_path_vars(doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_scheduler/docs/_replicator/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def head_scheduler_job(self, + def head_scheduler_job( + self, job_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve the HTTP headers for a replication scheduler job. @@ -5711,9 +5963,11 @@ def head_scheduler_job(self, if not job_id: raise ValueError('job_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_scheduler_job') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_scheduler_job', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -5724,21 +5978,23 @@ def head_scheduler_job(self, path_param_values = self.encode_path_vars(job_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_scheduler/jobs/{job_id}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def delete_replication_document(self, + def delete_replication_document( + self, doc_id: str, *, if_match: str = None, batch: str = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Cancel a replication. @@ -5763,9 +6019,11 @@ def delete_replication_document(self, headers = { 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_replication_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_replication_document', + ) headers.update(sdk_headers) params = { @@ -5782,16 +6040,18 @@ def delete_replication_document(self, path_param_values = self.encode_path_vars(doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_replicator/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_replication_document(self, + def get_replication_document( + self, doc_id: str, *, if_none_match: str = None, @@ -5805,7 +6065,7 @@ def get_replication_document(self, rev: str = None, revs: bool = None, revs_info: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a replication document. @@ -5850,9 +6110,11 @@ def get_replication_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_replication_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_replication_document', + ) headers.update(sdk_headers) params = { @@ -5877,16 +6139,18 @@ def get_replication_document(self, path_param_values = self.encode_path_vars(doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_replicator/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def put_replication_document(self, + def put_replication_document( + self, doc_id: str, replication_document: 'ReplicationDocument', *, @@ -5894,7 +6158,7 @@ def put_replication_document(self, batch: str = None, new_edits: bool = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create or modify a replication using a replication document. @@ -5930,9 +6194,11 @@ def put_replication_document(self, headers = { 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_replication_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_replication_document', + ) headers.update(sdk_headers) params = { @@ -5953,22 +6219,24 @@ def put_replication_document(self, path_param_values = self.encode_path_vars(doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_replicator/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response - - def get_scheduler_docs(self, + def get_scheduler_docs( + self, *, limit: int = None, skip: int = None, states: List[str] = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve replication scheduler documents. @@ -5990,9 +6258,11 @@ def get_scheduler_docs(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_scheduler_docs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_scheduler_docs', + ) headers.update(sdk_headers) params = { @@ -6007,18 +6277,20 @@ def get_scheduler_docs(self, headers['Accept'] = 'application/json' url = '/_scheduler/docs' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_scheduler_document(self, + def get_scheduler_document( + self, doc_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a replication scheduler document. @@ -6036,9 +6308,11 @@ def get_scheduler_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_scheduler_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_scheduler_document', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6050,19 +6324,21 @@ def get_scheduler_document(self, path_param_values = self.encode_path_vars(doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_scheduler/docs/_replicator/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_scheduler_jobs(self, + def get_scheduler_jobs( + self, *, limit: int = None, skip: int = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve replication scheduler jobs. @@ -6083,9 +6359,11 @@ def get_scheduler_jobs(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_scheduler_jobs') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_scheduler_jobs', + ) headers.update(sdk_headers) params = { @@ -6099,18 +6377,20 @@ def get_scheduler_jobs(self, headers['Accept'] = 'application/json' url = '/_scheduler/jobs' - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_scheduler_job(self, + def get_scheduler_job( + self, job_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a replication scheduler job. @@ -6126,9 +6406,11 @@ def get_scheduler_job(self, if not job_id: raise ValueError('job_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_scheduler_job') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_scheduler_job', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6140,9 +6422,11 @@ def get_scheduler_job(self, path_param_values = self.encode_path_vars(job_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_scheduler/jobs/{job_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response @@ -6151,9 +6435,9 @@ def get_scheduler_job(self, # Authentication ######################### - - def get_session_information(self, - **kwargs + def get_session_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve current session cookie information. @@ -6166,9 +6450,11 @@ def get_session_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_session_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_session_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6177,9 +6463,11 @@ def get_session_information(self, headers['Accept'] = 'application/json' url = '/_session' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response @@ -6188,10 +6476,10 @@ def get_session_information(self, # Authorization ######################### - - def get_security(self, + def get_security( + self, db: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve database permissions information. @@ -6211,9 +6499,11 @@ def get_security(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_security') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_security', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6225,22 +6515,24 @@ def get_security(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_security'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def put_security(self, + def put_security( + self, db: str, *, admins: 'SecurityObject' = None, members: 'SecurityObject' = None, cloudant: dict = None, couchdb_auth_only: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Modify database permissions. @@ -6277,9 +6569,11 @@ def put_security(self, if members is not None: members = convert_model(members) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_security') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_security', + ) headers.update(sdk_headers) data = { @@ -6301,17 +6595,19 @@ def put_security(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_security'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def post_api_keys(self, - **kwargs + def post_api_keys( + self, + **kwargs, ) -> DetailedResponse: """ Generates API keys for apps or persons to enable database access. @@ -6327,9 +6623,11 @@ def post_api_keys(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_api_keys') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_api_keys', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6338,22 +6636,24 @@ def post_api_keys(self, headers['Accept'] = 'application/json' url = '/_api/v2/api_keys' - request = self.prepare_request(method='POST', - url=url, - headers=headers) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def put_cloudant_security_configuration(self, + def put_cloudant_security_configuration( + self, db: str, cloudant: dict, *, admins: 'SecurityObject' = None, members: 'SecurityObject' = None, couchdb_auth_only: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Modify only Cloudant related database permissions. @@ -6390,9 +6690,11 @@ def put_cloudant_security_configuration(self, if members is not None: members = convert_model(members) headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_cloudant_security_configuration') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_cloudant_security_configuration', + ) headers.update(sdk_headers) data = { @@ -6414,10 +6716,12 @@ def put_cloudant_security_configuration(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/_api/v2/db/{db}/_security'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response @@ -6426,9 +6730,9 @@ def put_cloudant_security_configuration(self, # CORS ######################### - - def get_cors_information(self, - **kwargs + def get_cors_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve CORS configuration information. @@ -6443,9 +6747,11 @@ def get_cors_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_cors_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_cors_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6454,20 +6760,22 @@ def get_cors_information(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/config/cors' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def put_cors_configuration(self, + def put_cors_configuration( + self, origins: List[str], *, allow_credentials: bool = None, enable_cors: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Modify CORS configuration. @@ -6491,9 +6799,11 @@ def put_cors_configuration(self, if origins is None: raise ValueError('origins must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_cors_configuration') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_cors_configuration', + ) headers.update(sdk_headers) data = { @@ -6511,10 +6821,12 @@ def put_cors_configuration(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/config/cors' - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response @@ -6523,8 +6835,8 @@ def put_cors_configuration(self, # Attachments ######################### - - def head_attachment(self, + def head_attachment( + self, db: str, doc_id: str, attachment_name: str, @@ -6532,7 +6844,7 @@ def head_attachment(self, if_match: str = None, if_none_match: str = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve the HTTP headers for an attachment. @@ -6565,9 +6877,11 @@ def head_attachment(self, 'If-Match': if_match, 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_attachment') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_attachment', + ) headers.update(sdk_headers) params = { @@ -6582,16 +6896,18 @@ def head_attachment(self, path_param_values = self.encode_path_vars(db, doc_id, attachment_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}/{attachment_name}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def delete_attachment(self, + def delete_attachment( + self, db: str, doc_id: str, attachment_name: str, @@ -6599,7 +6915,7 @@ def delete_attachment(self, if_match: str = None, rev: str = None, batch: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete an attachment. @@ -6631,9 +6947,11 @@ def delete_attachment(self, headers = { 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_attachment') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_attachment', + ) headers.update(sdk_headers) params = { @@ -6650,16 +6968,18 @@ def delete_attachment(self, path_param_values = self.encode_path_vars(db, doc_id, attachment_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}/{attachment_name}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_attachment(self, + def get_attachment( + self, db: str, doc_id: str, attachment_name: str, @@ -6668,7 +6988,7 @@ def get_attachment(self, if_none_match: str = None, range: str = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve an attachment. @@ -6705,9 +7025,11 @@ def get_attachment(self, 'If-None-Match': if_none_match, 'Range': range, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_attachment') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_attachment', + ) headers.update(sdk_headers) params = { @@ -6723,16 +7045,18 @@ def get_attachment(self, path_param_values = self.encode_path_vars(db, doc_id, attachment_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}/{attachment_name}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def put_attachment(self, + def put_attachment( + self, db: str, doc_id: str, attachment_name: str, @@ -6741,7 +7065,7 @@ def put_attachment(self, *, if_match: str = None, rev: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create or modify an attachment. @@ -6783,9 +7107,11 @@ def put_attachment(self, 'Content-Type': content_type, 'If-Match': if_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_attachment') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_attachment', + ) headers.update(sdk_headers) params = { @@ -6803,11 +7129,13 @@ def put_attachment(self, path_param_values = self.encode_path_vars(db, doc_id, attachment_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/{doc_id}/{attachment_name}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -6816,13 +7144,13 @@ def put_attachment(self, # Local Documents ######################### - - def head_local_document(self, + def head_local_document( + self, db: str, doc_id: str, *, if_none_match: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve HTTP headers for a local document. @@ -6847,9 +7175,11 @@ def head_local_document(self, headers = { 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_local_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_local_document', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -6860,20 +7190,22 @@ def head_local_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_local/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def delete_local_document(self, + def delete_local_document( + self, db: str, doc_id: str, *, batch: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Delete a local document. @@ -6897,9 +7229,11 @@ def delete_local_document(self, if not doc_id: raise ValueError('doc_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_local_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_local_document', + ) headers.update(sdk_headers) params = { @@ -6915,16 +7249,18 @@ def delete_local_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_local/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='DELETE', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def get_local_document(self, + def get_local_document( + self, db: str, doc_id: str, *, @@ -6933,7 +7269,7 @@ def get_local_document(self, attachments: bool = None, att_encoding_info: bool = None, local_seq: bool = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve a local document. @@ -6968,9 +7304,11 @@ def get_local_document(self, 'Accept': accept, 'If-None-Match': if_none_match, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_local_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_local_document', + ) headers.update(sdk_headers) params = { @@ -6987,23 +7325,25 @@ def get_local_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_local/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) response = self.send(request, **kwargs) return response - - def put_local_document(self, + def put_local_document( + self, db: str, doc_id: str, document: Union['Document', BinaryIO], *, content_type: str = None, batch: str = None, - **kwargs + **kwargs, ) -> DetailedResponse: """ Create or modify a local document. @@ -7036,9 +7376,11 @@ def put_local_document(self, headers = { 'Content-Type': content_type, } - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='put_local_document') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='put_local_document', + ) headers.update(sdk_headers) params = { @@ -7061,11 +7403,13 @@ def put_local_document(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_local/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params, - data=data) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) response = self.send(request, **kwargs) return response @@ -7074,11 +7418,11 @@ def put_local_document(self, # Database Details ######################### - - def post_revs_diff(self, + def post_revs_diff( + self, db: str, document_revisions: dict, - **kwargs + **kwargs, ) -> DetailedResponse: """ Query the document revisions and possible ancestors missing from the database. @@ -7101,9 +7445,11 @@ def post_revs_diff(self, if document_revisions is None: raise ValueError('document_revisions must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_revs_diff') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_revs_diff', + ) headers.update(sdk_headers) data = json.dumps(document_revisions) @@ -7118,18 +7464,20 @@ def post_revs_diff(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_revs_diff'.format(**path_param_dict) - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def get_shards_information(self, + def get_shards_information( + self, db: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve shard information. @@ -7145,9 +7493,11 @@ def get_shards_information(self, if not db: raise ValueError('db must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_shards_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_shards_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7159,18 +7509,20 @@ def get_shards_information(self, path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_shards'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_document_shards_info(self, + def get_document_shards_info( + self, db: str, doc_id: str, - **kwargs + **kwargs, ) -> DetailedResponse: """ Retrieve shard information for a specific document. @@ -7190,9 +7542,11 @@ def get_document_shards_info(self, if not doc_id: raise ValueError('doc_id must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_document_shards_info') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_document_shards_info', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7204,9 +7558,11 @@ def get_document_shards_info(self, path_param_values = self.encode_path_vars(db, doc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/{db}/_shards/{doc_id}'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response @@ -7215,9 +7571,9 @@ def get_document_shards_info(self, # Monitoring ######################### - - def head_up_information(self, - **kwargs + def head_up_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve HTTP headers about whether the server is up. @@ -7230,9 +7586,11 @@ def head_up_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='head_up_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='head_up_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7240,16 +7598,18 @@ def head_up_information(self, del kwargs['headers'] url = '/_up' - request = self.prepare_request(method='HEAD', - url=url, - headers=headers) + request = self.prepare_request( + method='HEAD', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_active_tasks(self, - **kwargs + def get_active_tasks( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve list of running tasks. @@ -7265,9 +7625,11 @@ def get_active_tasks(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_active_tasks') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_active_tasks', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7276,16 +7638,18 @@ def get_active_tasks(self, headers['Accept'] = 'application/json' url = '/_active_tasks' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_up_information(self, - **kwargs + def get_up_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve information about whether the server is up. @@ -7300,9 +7664,11 @@ def get_up_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_up_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_up_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7311,16 +7677,18 @@ def get_up_information(self, headers['Accept'] = 'application/json' url = '/_up' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def get_activity_tracker_events(self, - **kwargs + def get_activity_tracker_events( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve Activity Tracker events information. @@ -7334,9 +7702,11 @@ def get_activity_tracker_events(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_activity_tracker_events') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_activity_tracker_events', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7345,17 +7715,19 @@ def get_activity_tracker_events(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/activity_tracker/events' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response - - def post_activity_tracker_events(self, + def post_activity_tracker_events( + self, types: List[str], - **kwargs + **kwargs, ) -> DetailedResponse: """ Modify Activity Tracker events configuration. @@ -7374,9 +7746,11 @@ def post_activity_tracker_events(self, if types is None: raise ValueError('types must be provided') headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='post_activity_tracker_events') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_activity_tracker_events', + ) headers.update(sdk_headers) data = { @@ -7392,17 +7766,19 @@ def post_activity_tracker_events(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/activity_tracker/events' - request = self.prepare_request(method='POST', - url=url, - headers=headers, - data=data) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) response = self.send(request, **kwargs) return response - - def get_current_throughput_information(self, - **kwargs + def get_current_throughput_information( + self, + **kwargs, ) -> DetailedResponse: """ Retrieve the current provisioned throughput capacity consumption. @@ -7417,9 +7793,11 @@ def get_current_throughput_information(self, """ headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_current_throughput_information') + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_current_throughput_information', + ) headers.update(sdk_headers) if 'headers' in kwargs: @@ -7428,9 +7806,11 @@ def get_current_throughput_information(self, headers['Accept'] = 'application/json' url = '/_api/v2/user/current/throughput' - request = self.prepare_request(method='GET', - url=url, - headers=headers) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) response = self.send(request, **kwargs) return response @@ -7445,6 +7825,7 @@ class Feed(str, Enum): """ Query parameter to specify the changes feed type. """ + CONTINUOUS = 'continuous' EVENTSOURCE = 'eventsource' LONGPOLL = 'longpoll' @@ -7460,6 +7841,7 @@ class Feed(str, Enum): """ Query parameter to specify the changes feed type. """ + CONTINUOUS = 'continuous' EVENTSOURCE = 'eventsource' LONGPOLL = 'longpoll' @@ -7475,6 +7857,7 @@ class Feed(str, Enum): """ Query parameter to specify the changes feed type. """ + CONTINUOUS = 'continuous' EVENTSOURCE = 'eventsource' LONGPOLL = 'longpoll' @@ -7490,6 +7873,7 @@ class ContentType(str, Enum): """ The type of the input. """ + APPLICATION_JSON = 'application/json' MULTIPART_MIXED = 'multipart/mixed' MULTIPART_RELATED = 'multipart/related' @@ -7499,6 +7883,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7512,6 +7897,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7524,6 +7910,7 @@ class ContentType(str, Enum): """ The type of the input. """ + APPLICATION_JSON = 'application/json' MULTIPART_MIXED = 'multipart/mixed' MULTIPART_RELATED = 'multipart/related' @@ -7533,6 +7920,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7546,6 +7934,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7559,6 +7948,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7571,6 +7961,7 @@ class Accept(str, Enum): """ The type of the response: application/json or application/octet-stream. """ + APPLICATION_JSON = 'application/json' APPLICATION_OCTET_STREAM = 'application/octet-stream' @@ -7584,6 +7975,7 @@ class Accept(str, Enum): """ The type of the response: application/json or application/octet-stream. """ + APPLICATION_JSON = 'application/json' APPLICATION_OCTET_STREAM = 'application/octet-stream' @@ -7597,6 +7989,7 @@ class Type(str, Enum): """ Path parameter to specify the index type. """ + JSON = 'json' SPECIAL = 'special' TEXT = 'text' @@ -7612,6 +8005,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7625,6 +8019,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7638,6 +8033,7 @@ class States(str, Enum): Query parameter to include only replication documents in the specified states. String must be a comma-delimited string. """ + INITIALIZING = 'initializing' ERROR = 'error' PENDING = 'pending' @@ -7657,6 +8053,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7670,6 +8067,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7683,6 +8081,7 @@ class Accept(str, Enum): The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream. """ + APPLICATION_JSON = 'application/json' MULTIPART_MIXED = 'multipart/mixed' MULTIPART_RELATED = 'multipart/related' @@ -7698,6 +8097,7 @@ class ContentType(str, Enum): """ The type of the input. """ + APPLICATION_JSON = 'application/json' MULTIPART_MIXED = 'multipart/mixed' MULTIPART_RELATED = 'multipart/related' @@ -7707,6 +8107,7 @@ class Batch(str, Enum): Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. """ + OK = 'ok' @@ -7715,7 +8116,7 @@ class Batch(str, Enum): ############################################################################## -class ActiveTask(): +class ActiveTask: """ Schema for information about a running task. @@ -7786,42 +8187,44 @@ class ActiveTask(): `view_compaction` type tasks. """ - def __init__(self, - database: str, - node: str, - pid: str, - started_on: int, - type: str, - updated_on: int, - *, - bulk_get_attempts: int = None, - bulk_get_docs: int = None, - changes_done: int = None, - changes_pending: int = None, - checkpoint_interval: int = None, - checkpointed_source_seq: str = None, - continuous: bool = None, - design_document: str = None, - doc_id: str = None, - doc_write_failures: int = None, - docs_read: int = None, - docs_written: int = None, - index: str = None, - indexer_pid: str = None, - missing_revisions_found: int = None, - phase: str = None, - process_status: str = None, - progress: int = None, - replication_id: str = None, - retry: bool = None, - revisions_checked: int = None, - source: str = None, - source_seq: str = None, - target: str = None, - through_seq: str = None, - total_changes: int = None, - user: str = None, - view: int = None) -> None: + def __init__( + self, + database: str, + node: str, + pid: str, + started_on: int, + type: str, + updated_on: int, + *, + bulk_get_attempts: int = None, + bulk_get_docs: int = None, + changes_done: int = None, + changes_pending: int = None, + checkpoint_interval: int = None, + checkpointed_source_seq: str = None, + continuous: bool = None, + design_document: str = None, + doc_id: str = None, + doc_write_failures: int = None, + docs_read: int = None, + docs_written: int = None, + index: str = None, + indexer_pid: str = None, + missing_revisions_found: int = None, + phase: str = None, + process_status: str = None, + progress: int = None, + replication_id: str = None, + retry: bool = None, + revisions_checked: int = None, + source: str = None, + source_seq: str = None, + target: str = None, + through_seq: str = None, + total_changes: int = None, + user: str = None, + view: int = None, + ) -> None: """ Initialize a ActiveTask object. @@ -8118,6 +8521,7 @@ class PhaseEnum(str, Enum): phases are available for `database_compaction`, while `ids` and `view` phases are available for `view_compaction` type tasks. """ + DOCID_SORT = 'docid_sort' DOCID_COPY = 'docid_copy' DOCUMENT_COPY = 'document_copy' @@ -8129,6 +8533,7 @@ class ProcessStatusEnum(str, Enum): """ Process status. """ + EXITING = 'exiting' GARBAGE_COLLECTING = 'garbage_collecting' RUNNABLE = 'runnable' @@ -8141,6 +8546,7 @@ class TypeEnum(str, Enum): """ Operation type. """ + DATABASE_COMPACTION = 'database_compaction' INDEXER = 'indexer' REPLICATION = 'replication' @@ -8148,7 +8554,8 @@ class TypeEnum(str, Enum): VIEW_COMPACTION = 'view_compaction' -class ActivityTrackerEvents(): + +class ActivityTrackerEvents: """ Schema for Activity Tracker events. @@ -8157,8 +8564,10 @@ class ActivityTrackerEvents(): element of this array. """ - def __init__(self, - types: List[str]) -> None: + def __init__( + self, + types: List[str], + ) -> None: """ Initialize a ActivityTrackerEvents object. @@ -8212,11 +8621,13 @@ class TypesEnum(str, Enum): """ types. """ + MANAGEMENT = 'management' DATA = 'data' -class AllDocsQueriesResult(): + +class AllDocsQueriesResult: """ Schema for the result of an all documents queries operation. @@ -8225,8 +8636,10 @@ class AllDocsQueriesResult(): `/_all_docs` request. """ - def __init__(self, - results: List['AllDocsResult']) -> None: + def __init__( + self, + results: List['AllDocsResult'], + ) -> None: """ Initialize a AllDocsQueriesResult object. @@ -8282,7 +8695,8 @@ def __ne__(self, other: 'AllDocsQueriesResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AllDocsQuery(): + +class AllDocsQuery: """ Schema for an all documents query operation. @@ -8313,21 +8727,23 @@ class AllDocsQuery(): :attr str start_key: (optional) Schema for a document ID. """ - def __init__(self, - *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None) -> None: + def __init__( + self, + *, + att_encoding_info: bool = None, + attachments: bool = None, + conflicts: bool = None, + descending: bool = None, + include_docs: bool = None, + inclusive_end: bool = None, + limit: int = None, + skip: int = None, + update_seq: bool = None, + end_key: str = None, + key: str = None, + keys: List[str] = None, + start_key: str = None, + ) -> None: """ Initialize a AllDocsQuery object. @@ -8457,7 +8873,8 @@ def __ne__(self, other: 'AllDocsQuery') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AllDocsResult(): + +class AllDocsResult: """ Schema for the result of an all documents operation. @@ -8466,11 +8883,13 @@ class AllDocsResult(): :attr str update_seq: (optional) Current update sequence for the database. """ - def __init__(self, - total_rows: int, - rows: List['DocsResultRow'], - *, - update_seq: str = None) -> None: + def __init__( + self, + total_rows: int, + rows: List['DocsResultRow'], + *, + update_seq: str = None, + ) -> None: """ Initialize a AllDocsResult object. @@ -8538,7 +8957,8 @@ def __ne__(self, other: 'AllDocsResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Analyzer(): + +class Analyzer: """ Schema for a full text search analyzer. @@ -8551,10 +8971,12 @@ class Analyzer(): analyzer. """ - def __init__(self, - *, - name: str = None, - stopwords: List[str] = None) -> None: + def __init__( + self, + *, + name: str = None, + stopwords: List[str] = None, + ) -> None: """ Initialize a Analyzer object. @@ -8620,6 +9042,7 @@ class NameEnum(str, Enum): default is `keyword` * For a query text index default_field the default is `standard`. """ + CLASSIC = 'classic' EMAIL = 'email' KEYWORD = 'keyword' @@ -8663,7 +9086,8 @@ class NameEnum(str, Enum): PERFIELD = 'perfield' -class AnalyzerConfiguration(): + +class AnalyzerConfiguration: """ Schema for a search analyzer configuration. @@ -8678,11 +9102,13 @@ class AnalyzerConfiguration(): analyzer. """ - def __init__(self, - *, - name: str = None, - stopwords: List[str] = None, - fields: dict = None) -> None: + def __init__( + self, + *, + name: str = None, + stopwords: List[str] = None, + fields: dict = None, + ) -> None: """ Initialize a AnalyzerConfiguration object. @@ -8710,7 +9136,7 @@ def from_dict(cls, _dict: Dict) -> 'AnalyzerConfiguration': if 'stopwords' in _dict: args['stopwords'] = _dict.get('stopwords') if 'fields' in _dict: - args['fields'] = {k : Analyzer.from_dict(v) for k, v in _dict.get('fields').items()} + args['fields'] = {k: Analyzer.from_dict(v) for k, v in _dict.get('fields').items()} return cls(**args) @classmethod @@ -8761,6 +9187,7 @@ class NameEnum(str, Enum): default is `keyword` * For a query text index default_field the default is `standard`. """ + CLASSIC = 'classic' EMAIL = 'email' KEYWORD = 'keyword' @@ -8804,7 +9231,8 @@ class NameEnum(str, Enum): PERFIELD = 'perfield' -class ApiKeysResult(): + +class ApiKeysResult: """ Schema for api keys. @@ -8813,10 +9241,12 @@ class ApiKeysResult(): :attr str password: The password associated with the api key. """ - def __init__(self, - ok: bool, - key: str, - password: str) -> None: + def __init__( + self, + ok: bool, + key: str, + password: str, + ) -> None: """ Initialize a ApiKeysResult object. @@ -8880,7 +9310,8 @@ def __ne__(self, other: 'ApiKeysResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Attachment(): + +class Attachment: """ Schema for an attachment. @@ -8908,17 +9339,19 @@ class Attachment(): content. Otherwise omitted in response. """ - def __init__(self, - *, - content_type: str = None, - data: bytes = None, - digest: str = None, - encoded_length: int = None, - encoding: str = None, - follows: bool = None, - length: int = None, - revpos: int = None, - stub: bool = None) -> None: + def __init__( + self, + *, + content_type: str = None, + data: bytes = None, + digest: str = None, + encoded_length: int = None, + encoding: str = None, + follows: bool = None, + length: int = None, + revpos: int = None, + stub: bool = None, + ) -> None: """ Initialize a Attachment object. @@ -9028,7 +9461,8 @@ def __ne__(self, other: 'Attachment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BulkDocs(): + +class BulkDocs: """ Schema for submitting documents for bulk modifications. @@ -9037,10 +9471,12 @@ class BulkDocs(): assigning them new revision IDs. Default is `true`. """ - def __init__(self, - docs: List['Document'], - *, - new_edits: bool = None) -> None: + def __init__( + self, + docs: List['Document'], + *, + new_edits: bool = None, + ) -> None: """ Initialize a BulkDocs object. @@ -9101,7 +9537,8 @@ def __ne__(self, other: 'BulkDocs') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BulkGetQueryDocument(): + +class BulkGetQueryDocument: """ Schema for a document item in a bulk get query. @@ -9111,11 +9548,13 @@ class BulkGetQueryDocument(): :attr str rev: (optional) Schema for a document revision identifier. """ - def __init__(self, - id: str, - *, - atts_since: List[str] = None, - rev: str = None) -> None: + def __init__( + self, + id: str, + *, + atts_since: List[str] = None, + rev: str = None, + ) -> None: """ Initialize a BulkGetQueryDocument object. @@ -9176,15 +9615,18 @@ def __ne__(self, other: 'BulkGetQueryDocument') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BulkGetResult(): + +class BulkGetResult: """ Schema for the results object of a bulk get operation. :attr List[BulkGetResultItem] results: Results. """ - def __init__(self, - results: List['BulkGetResultItem']) -> None: + def __init__( + self, + results: List['BulkGetResultItem'], + ) -> None: """ Initialize a BulkGetResult object. @@ -9238,7 +9680,8 @@ def __ne__(self, other: 'BulkGetResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BulkGetResultDocument(): + +class BulkGetResultDocument: """ Schema for BulkGetResult object containing a successfully retrieved document or error information. @@ -9248,10 +9691,12 @@ class BulkGetResultDocument(): :attr Document ok: (optional) Schema for a document. """ - def __init__(self, - *, - error: 'DocumentResult' = None, - ok: 'Document' = None) -> None: + def __init__( + self, + *, + error: 'DocumentResult' = None, + ok: 'Document' = None, + ) -> None: """ Initialize a BulkGetResultDocument object. @@ -9310,7 +9755,8 @@ def __ne__(self, other: 'BulkGetResultDocument') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BulkGetResultItem(): + +class BulkGetResultItem: """ Schema for the document revisions information from a bulk get operation. @@ -9319,9 +9765,11 @@ class BulkGetResultItem(): :attr str id: Schema for a document ID. """ - def __init__(self, - docs: List['BulkGetResultDocument'], - id: str) -> None: + def __init__( + self, + docs: List['BulkGetResultDocument'], + id: str, + ) -> None: """ Initialize a BulkGetResultItem object. @@ -9384,7 +9832,8 @@ def __ne__(self, other: 'BulkGetResultItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CapacityThroughputInformation(): + +class CapacityThroughputInformation: """ Schema for information about the currently provisioned and target throughput capacity. @@ -9394,10 +9843,12 @@ class CapacityThroughputInformation(): information about target throughput capacity. """ - def __init__(self, - current: 'CapacityThroughputInformationCurrent', - *, - target: 'CapacityThroughputInformationTarget' = None) -> None: + def __init__( + self, + current: 'CapacityThroughputInformationCurrent', + *, + target: 'CapacityThroughputInformationTarget' = None, + ) -> None: """ Initialize a CapacityThroughputInformation object. @@ -9459,7 +9910,8 @@ def __ne__(self, other: 'CapacityThroughputInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CapacityThroughputInformationCurrent(): + +class CapacityThroughputInformationCurrent: """ Detailed information about provisioned throughput capacity. @@ -9467,8 +9919,10 @@ class CapacityThroughputInformationCurrent(): throughput capacity with breakdown by specific throughput requests classes. """ - def __init__(self, - throughput: 'ThroughputInformation') -> None: + def __init__( + self, + throughput: 'ThroughputInformation', + ) -> None: """ Initialize a CapacityThroughputInformationCurrent object. @@ -9521,7 +9975,8 @@ def __ne__(self, other: 'CapacityThroughputInformationCurrent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CapacityThroughputInformationTarget(): + +class CapacityThroughputInformationTarget: """ Detailed information about target throughput capacity. @@ -9529,8 +9984,10 @@ class CapacityThroughputInformationTarget(): throughput capacity with breakdown by specific throughput requests classes. """ - def __init__(self, - throughput: 'ThroughputInformation') -> None: + def __init__( + self, + throughput: 'ThroughputInformation', + ) -> None: """ Initialize a CapacityThroughputInformationTarget object. @@ -9583,15 +10040,18 @@ def __ne__(self, other: 'CapacityThroughputInformationTarget') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Change(): + +class Change: """ Schema for a document leaf with single field rev. :attr str rev: Schema for a document revision identifier. """ - def __init__(self, - rev: str) -> None: + def __init__( + self, + rev: str, + ) -> None: """ Initialize a Change object. @@ -9639,7 +10099,8 @@ def __ne__(self, other: 'Change') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ChangesResult(): + +class ChangesResult: """ Schema for normal changes feed result. @@ -9648,10 +10109,12 @@ class ChangesResult(): :attr List[ChangesResultItem] results: results. """ - def __init__(self, - last_seq: str, - pending: int, - results: List['ChangesResultItem']) -> None: + def __init__( + self, + last_seq: str, + pending: int, + results: List['ChangesResultItem'], + ) -> None: """ Initialize a ChangesResult object. @@ -9721,7 +10184,8 @@ def __ne__(self, other: 'ChangesResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ChangesResultItem(): + +class ChangesResultItem: """ Schema for an item in the changes results array. @@ -9732,13 +10196,15 @@ class ChangesResultItem(): :attr str seq: Update sequence. """ - def __init__(self, - changes: List['Change'], - id: str, - seq: str, - *, - deleted: bool = None, - doc: 'Document' = None) -> None: + def __init__( + self, + changes: List['Change'], + id: str, + seq: str, + *, + deleted: bool = None, + doc: 'Document' = None, + ) -> None: """ Initialize a ChangesResultItem object. @@ -9824,7 +10290,8 @@ def __ne__(self, other: 'ChangesResultItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ContentInformationSizes(): + +class ContentInformationSizes: """ Schema for size information of content. @@ -9833,10 +10300,12 @@ class ContentInformationSizes(): :attr int file: The total size of the content as stored on disk, in bytes. """ - def __init__(self, - active: int, - external: int, - file: int) -> None: + def __init__( + self, + active: int, + external: int, + file: int, + ) -> None: """ Initialize a ContentInformationSizes object. @@ -9900,7 +10369,8 @@ def __ne__(self, other: 'ContentInformationSizes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CorsInformation(): + +class CorsInformation: """ Schema for information about the CORS configuration. @@ -9913,10 +10383,12 @@ class CorsInformation(): domains, so you have to specify all subdomains used. """ - def __init__(self, - allow_credentials: bool, - enable_cors: bool, - origins: List[str]) -> None: + def __init__( + self, + allow_credentials: bool, + enable_cors: bool, + origins: List[str], + ) -> None: """ Initialize a CorsInformation object. @@ -9985,7 +10457,8 @@ def __ne__(self, other: 'CorsInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CurrentThroughputInformation(): + +class CurrentThroughputInformation: """ Schema for information about current consumption of a provisioned throughput capacity. @@ -9993,8 +10466,10 @@ class CurrentThroughputInformation(): about current consumption. """ - def __init__(self, - throughput: 'CurrentThroughputInformationThroughput') -> None: + def __init__( + self, + throughput: 'CurrentThroughputInformationThroughput', + ) -> None: """ Initialize a CurrentThroughputInformation object. @@ -10046,7 +10521,8 @@ def __ne__(self, other: 'CurrentThroughputInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CurrentThroughputInformationThroughput(): + +class CurrentThroughputInformationThroughput: """ Detailed information about current consumption. @@ -10058,10 +10534,12 @@ class CurrentThroughputInformationThroughput(): second. """ - def __init__(self, - query: int, - read: int, - write: int) -> None: + def __init__( + self, + query: int, + read: int, + write: int, + ) -> None: """ Initialize a CurrentThroughputInformationThroughput object. @@ -10128,7 +10606,8 @@ def __ne__(self, other: 'CurrentThroughputInformationThroughput') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DatabaseInformation(): + +class DatabaseInformation: """ Schema for information about a database. @@ -10153,21 +10632,23 @@ class DatabaseInformation(): :attr str uuid: (optional) The UUID of the database. """ - def __init__(self, - cluster: 'DatabaseInformationCluster', - compact_running: bool, - db_name: str, - disk_format_version: int, - doc_count: int, - doc_del_count: int, - props: 'DatabaseInformationProps', - sizes: 'ContentInformationSizes', - update_seq: str, - *, - committed_update_seq: str = None, - compacted_seq: str = None, - engine: str = None, - uuid: str = None) -> None: + def __init__( + self, + cluster: 'DatabaseInformationCluster', + compact_running: bool, + db_name: str, + disk_format_version: int, + doc_count: int, + doc_del_count: int, + props: 'DatabaseInformationProps', + sizes: 'ContentInformationSizes', + update_seq: str, + *, + committed_update_seq: str = None, + compacted_seq: str = None, + engine: str = None, + uuid: str = None, + ) -> None: """ Initialize a DatabaseInformation object. @@ -10319,7 +10800,8 @@ def __ne__(self, other: 'DatabaseInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DatabaseInformationCluster(): + +class DatabaseInformationCluster: """ Schema for database cluster information. @@ -10332,11 +10814,13 @@ class DatabaseInformationCluster(): written before a successful reply. """ - def __init__(self, - n: int, - q: int, - r: int, - w: int) -> None: + def __init__( + self, + n: int, + q: int, + r: int, + w: int, + ) -> None: """ Initialize a DatabaseInformationCluster object. @@ -10411,7 +10895,8 @@ def __ne__(self, other: 'DatabaseInformationCluster') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DatabaseInformationProps(): + +class DatabaseInformationProps: """ Schema for database properties. @@ -10419,9 +10904,11 @@ class DatabaseInformationProps(): database. """ - def __init__(self, - *, - partitioned: bool = None) -> None: + def __init__( + self, + *, + partitioned: bool = None, + ) -> None: """ Initialize a DatabaseInformationProps object. @@ -10468,7 +10955,8 @@ def __ne__(self, other: 'DatabaseInformationProps') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DbEvent(): + +class DbEvent: """ Schema for a database change event. @@ -10477,10 +10965,12 @@ class DbEvent(): :attr str type: A database event. """ - def __init__(self, - db_name: str, - seq: str, - type: str) -> None: + def __init__( + self, + db_name: str, + seq: str, + type: str, + ) -> None: """ Initialize a DbEvent object. @@ -10548,12 +11038,14 @@ class TypeEnum(str, Enum): """ A database event. """ + CREATED = 'created' DELETED = 'deleted' UPDATED = 'updated' -class DbUpdates(): + +class DbUpdates: """ Schema for database updates. @@ -10561,9 +11053,11 @@ class DbUpdates(): :attr List[DbEvent] results: results. """ - def __init__(self, - last_seq: str, - results: List['DbEvent']) -> None: + def __init__( + self, + last_seq: str, + results: List['DbEvent'], + ) -> None: """ Initialize a DbUpdates object. @@ -10625,7 +11119,8 @@ def __ne__(self, other: 'DbUpdates') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DbsInfoResult(): + +class DbsInfoResult: """ Schema for database information keyed by database name. @@ -10635,11 +11130,13 @@ class DbsInfoResult(): :attr str key: Database name. """ - def __init__(self, - key: str, - *, - error: str = None, - info: 'DatabaseInformation' = None) -> None: + def __init__( + self, + key: str, + *, + error: str = None, + info: 'DatabaseInformation' = None, + ) -> None: """ Initialize a DbsInfoResult object. @@ -10703,7 +11200,8 @@ def __ne__(self, other: 'DbsInfoResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DesignDocument(): + +class DesignDocument: """ Schema for a design document. @@ -10796,25 +11294,27 @@ class DesignDocument(): # The set of defined properties for the class _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'autoupdate', 'filters', 'indexes', 'language', 'options', 'validate_doc_update', 'views']) - def __init__(self, - *, - attachments: dict = None, - conflicts: List[str] = None, - deleted: bool = None, - deleted_conflicts: List[str] = None, - id: str = None, - local_seq: str = None, - rev: str = None, - revisions: 'Revisions' = None, - revs_info: List['DocumentRevisionStatus'] = None, - autoupdate: bool = None, - filters: dict = None, - indexes: dict = None, - language: str = None, - options: 'DesignDocumentOptions' = None, - validate_doc_update: str = None, - views: dict = None, - **kwargs) -> None: + def __init__( + self, + *, + attachments: dict = None, + conflicts: List[str] = None, + deleted: bool = None, + deleted_conflicts: List[str] = None, + id: str = None, + local_seq: str = None, + rev: str = None, + revisions: 'Revisions' = None, + revs_info: List['DocumentRevisionStatus'] = None, + autoupdate: bool = None, + filters: dict = None, + indexes: dict = None, + language: str = None, + options: 'DesignDocumentOptions' = None, + validate_doc_update: str = None, + views: dict = None, + **kwargs, + ) -> None: """ Initialize a DesignDocument object. @@ -10931,7 +11431,7 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': """Initialize a DesignDocument object from a json dictionary.""" args = {} if '_attachments' in _dict: - args['attachments'] = {k : Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} + args['attachments'] = {k: Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} if '_conflicts' in _dict: args['conflicts'] = _dict.get('_conflicts') if '_deleted' in _dict: @@ -10953,7 +11453,7 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': if 'filters' in _dict: args['filters'] = _dict.get('filters') if 'indexes' in _dict: - args['indexes'] = {k : SearchIndexDefinition.from_dict(v) for k, v in _dict.get('indexes').items()} + args['indexes'] = {k: SearchIndexDefinition.from_dict(v) for k, v in _dict.get('indexes').items()} if 'language' in _dict: args['language'] = _dict.get('language') if 'options' in _dict: @@ -10961,8 +11461,8 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': if 'validate_doc_update' in _dict: args['validate_doc_update'] = _dict.get('validate_doc_update') if 'views' in _dict: - args['views'] = {k : DesignDocumentViewsMapReduce.from_dict(v) for k, v in _dict.get('views').items()} - args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) + args['views'] = {k: DesignDocumentViewsMapReduce.from_dict(v) for k, v in _dict.get('views').items()} + args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @classmethod @@ -11074,7 +11574,8 @@ def __ne__(self, other: 'DesignDocument') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DesignDocumentInformation(): + +class DesignDocumentInformation: """ Schema for information about a design document. @@ -11082,9 +11583,11 @@ class DesignDocumentInformation(): :attr DesignDocumentViewIndex view_index: View index information. """ - def __init__(self, - name: str, - view_index: 'DesignDocumentViewIndex') -> None: + def __init__( + self, + name: str, + view_index: 'DesignDocumentViewIndex', + ) -> None: """ Initialize a DesignDocumentInformation object. @@ -11143,7 +11646,8 @@ def __ne__(self, other: 'DesignDocumentInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DesignDocumentOptions(): + +class DesignDocumentOptions: """ Schema for design document options. @@ -11151,9 +11655,11 @@ class DesignDocumentOptions(): partitioned or global indexes. """ - def __init__(self, - *, - partitioned: bool = None) -> None: + def __init__( + self, + *, + partitioned: bool = None, + ) -> None: """ Initialize a DesignDocumentOptions object. @@ -11200,7 +11706,8 @@ def __ne__(self, other: 'DesignDocumentOptions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DesignDocumentViewIndex(): + +class DesignDocumentViewIndex: """ View index information. @@ -11219,15 +11726,17 @@ class DesignDocumentViewIndex(): underlying database that need to processed. """ - def __init__(self, - collator_versions: List[str], - compact_running: bool, - language: str, - signature: str, - sizes: 'ContentInformationSizes', - updater_running: bool, - waiting_clients: int, - waiting_commit: bool) -> None: + def __init__( + self, + collator_versions: List[str], + compact_running: bool, + language: str, + signature: str, + sizes: 'ContentInformationSizes', + updater_running: bool, + waiting_clients: int, + waiting_commit: bool, + ) -> None: """ Initialize a DesignDocumentViewIndex object. @@ -11341,7 +11850,8 @@ def __ne__(self, other: 'DesignDocumentViewIndex') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DesignDocumentViewsMapReduce(): + +class DesignDocumentViewsMapReduce: """ Schema for view functions definition. @@ -11349,10 +11859,12 @@ class DesignDocumentViewsMapReduce(): :attr str reduce: (optional) JavaScript reduce function as a string. """ - def __init__(self, - map: str, - *, - reduce: str = None) -> None: + def __init__( + self, + map: str, + *, + reduce: str = None, + ) -> None: """ Initialize a DesignDocumentViewsMapReduce object. @@ -11406,7 +11918,8 @@ def __ne__(self, other: 'DesignDocumentViewsMapReduce') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DocsResultRow(): + +class DocsResultRow: """ Schema for a row of document information in a DocsResult. @@ -11420,15 +11933,17 @@ class DocsResultRow(): view. """ - def __init__(self, - key: str, - *, - caused_by: str = None, - error: str = None, - reason: str = None, - doc: 'Document' = None, - id: str = None, - value: 'DocsResultRowValue' = None) -> None: + def __init__( + self, + key: str, + *, + caused_by: str = None, + error: str = None, + reason: str = None, + doc: 'Document' = None, + id: str = None, + value: 'DocsResultRowValue' = None, + ) -> None: """ Initialize a DocsResultRow object. @@ -11519,7 +12034,8 @@ def __ne__(self, other: 'DocsResultRow') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DocsResultRowValue(): + +class DocsResultRowValue: """ Value of built-in `/_all_docs` style view. @@ -11528,10 +12044,12 @@ class DocsResultRowValue(): :attr str rev: Schema for a document revision identifier. """ - def __init__(self, - rev: str, - *, - deleted: bool = None) -> None: + def __init__( + self, + rev: str, + *, + deleted: bool = None, + ) -> None: """ Initialize a DocsResultRowValue object. @@ -11586,7 +12104,8 @@ def __ne__(self, other: 'DocsResultRowValue') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Document(): + +class Document: """ Schema for a document. @@ -11609,18 +12128,20 @@ class Document(): # The set of defined properties for the class _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info']) - def __init__(self, - *, - attachments: dict = None, - conflicts: List[str] = None, - deleted: bool = None, - deleted_conflicts: List[str] = None, - id: str = None, - local_seq: str = None, - rev: str = None, - revisions: 'Revisions' = None, - revs_info: List['DocumentRevisionStatus'] = None, - **kwargs) -> None: + def __init__( + self, + *, + attachments: dict = None, + conflicts: List[str] = None, + deleted: bool = None, + deleted_conflicts: List[str] = None, + id: str = None, + local_seq: str = None, + rev: str = None, + revisions: 'Revisions' = None, + revs_info: List['DocumentRevisionStatus'] = None, + **kwargs, + ) -> None: """ Initialize a Document object. @@ -11659,7 +12180,7 @@ def from_dict(cls, _dict: Dict) -> 'Document': """Initialize a Document object from a json dictionary.""" args = {} if '_attachments' in _dict: - args['attachments'] = {k : Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} + args['attachments'] = {k: Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} if '_conflicts' in _dict: args['conflicts'] = _dict.get('_conflicts') if '_deleted' in _dict: @@ -11676,7 +12197,7 @@ def from_dict(cls, _dict: Dict) -> 'Document': args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) if '_revs_info' in _dict: args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] - args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) + args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @classmethod @@ -11759,7 +12280,8 @@ def __ne__(self, other: 'Document') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DocumentResult(): + +class DocumentResult: """ Schema for the result of a document modification. @@ -11771,14 +12293,16 @@ class DocumentResult(): :attr str reason: (optional) The reason the error occurred (if available). """ - def __init__(self, - id: str, - *, - rev: str = None, - ok: bool = None, - caused_by: str = None, - error: str = None, - reason: str = None) -> None: + def __init__( + self, + id: str, + *, + rev: str = None, + ok: bool = None, + caused_by: str = None, + error: str = None, + reason: str = None, + ) -> None: """ Initialize a DocumentResult object. @@ -11856,7 +12380,8 @@ def __ne__(self, other: 'DocumentResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DocumentRevisionStatus(): + +class DocumentRevisionStatus: """ Schema for information about revisions and their status. @@ -11866,9 +12391,11 @@ class DocumentRevisionStatus(): not available - `deleted`: Revision belongs to deleted document. """ - def __init__(self, - rev: str, - status: str) -> None: + def __init__( + self, + rev: str, + status: str, + ) -> None: """ Initialize a DocumentRevisionStatus object. @@ -11933,12 +12460,14 @@ class StatusEnum(str, Enum): retrieving with rev query parameter - `missing`: Revision is not available - `deleted`: Revision belongs to deleted document. """ + AVAILABLE = 'available' MISSING = 'missing' DELETED = 'deleted' -class DocumentShardInfo(): + +class DocumentShardInfo: """ Schema for document shard information. @@ -11946,9 +12475,11 @@ class DocumentShardInfo(): :attr str range: The shard range in which the document is stored. """ - def __init__(self, - nodes: List[str], - range: str) -> None: + def __init__( + self, + nodes: List[str], + range: str, + ) -> None: """ Initialize a DocumentShardInfo object. @@ -12004,7 +12535,8 @@ def __ne__(self, other: 'DocumentShardInfo') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ExecutionStats(): + +class ExecutionStats: """ Schema for find query execution statistics. @@ -12016,12 +12548,14 @@ class ExecutionStats(): primary index with the specified read quorum. """ - def __init__(self, - execution_time_ms: float, - results_returned: int, - total_docs_examined: int, - total_keys_examined: int, - total_quorum_docs_examined: int) -> None: + def __init__( + self, + execution_time_ms: float, + results_returned: int, + total_docs_examined: int, + total_keys_examined: int, + total_quorum_docs_examined: int, + ) -> None: """ Initialize a ExecutionStats object. @@ -12102,7 +12636,8 @@ def __ne__(self, other: 'ExecutionStats') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ExplainResult(): + +class ExplainResult: """ Schema for information about the index used for a find query. @@ -12144,16 +12679,18 @@ class ExplainResult(): :attr int skip: skip. """ - def __init__(self, - dbname: str, - fields: List[str], - index: 'IndexInformation', - limit: int, - opts: dict, - selector: dict, - skip: int, - *, - range: 'ExplainResultRange' = None) -> None: + def __init__( + self, + dbname: str, + fields: List[str], + index: 'IndexInformation', + limit: int, + opts: dict, + selector: dict, + skip: int, + *, + range: 'ExplainResultRange' = None, + ) -> None: """ Initialize a ExplainResult object. @@ -12291,7 +12828,8 @@ def __ne__(self, other: 'ExplainResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ExplainResultRange(): + +class ExplainResultRange: """ range. @@ -12299,10 +12837,12 @@ class ExplainResultRange(): :attr List[object] start_key: (optional) start_key. """ - def __init__(self, - *, - end_key: List[object] = None, - start_key: List[object] = None) -> None: + def __init__( + self, + *, + end_key: List[object] = None, + start_key: List[object] = None, + ) -> None: """ Initialize a ExplainResultRange object. @@ -12354,7 +12894,8 @@ def __ne__(self, other: 'ExplainResultRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FindResult(): + +class FindResult: """ Schema for the result of a query find operation. @@ -12365,12 +12906,14 @@ class FindResult(): :attr str warning: (optional) warning. """ - def __init__(self, - bookmark: str, - docs: List['Document'], - *, - execution_stats: 'ExecutionStats' = None, - warning: str = None) -> None: + def __init__( + self, + bookmark: str, + docs: List['Document'], + *, + execution_stats: 'ExecutionStats' = None, + warning: str = None, + ) -> None: """ Initialize a FindResult object. @@ -12448,7 +12991,8 @@ def __ne__(self, other: 'FindResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IndexDefinition(): + +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: @@ -12504,13 +13048,15 @@ class IndexDefinition(): syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). """ - def __init__(self, - *, - default_analyzer: 'Analyzer' = None, - default_field: 'IndexTextOperatorDefaultField' = None, - fields: List['IndexField'] = None, - index_array_lengths: bool = None, - partial_filter_selector: dict = None) -> None: + def __init__( + self, + *, + default_analyzer: 'Analyzer' = None, + default_field: 'IndexTextOperatorDefaultField' = None, + fields: List['IndexField'] = None, + index_array_lengths: bool = None, + partial_filter_selector: dict = None, + ) -> None: """ Initialize a IndexDefinition object. @@ -12639,7 +13185,8 @@ def __ne__(self, other: 'IndexDefinition') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IndexField(): + +class IndexField: """ Schema for indexed fields for use with declarative JSON query. @@ -12650,11 +13197,13 @@ class IndexField(): # The set of defined properties for the class _properties = frozenset(['name', 'type']) - def __init__(self, - *, - name: str = None, - type: str = None, - **kwargs) -> None: + def __init__( + self, + *, + name: str = None, + type: str = None, + **kwargs, + ) -> None: """ Initialize a IndexField object. @@ -12675,7 +13224,7 @@ def from_dict(cls, _dict: Dict) -> 'IndexField': args['name'] = _dict.get('name') if 'type' in _dict: args['type'] = _dict.get('type') - args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) + args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @classmethod @@ -12733,12 +13282,14 @@ class TypeEnum(str, Enum): """ The type of the named field. """ + BOOLEAN = 'boolean' NUMBER = 'number' STRING = 'string' -class IndexInformation(): + +class IndexInformation: """ Schema for information about an index. @@ -12753,11 +13304,13 @@ class IndexInformation(): :attr str type: Schema for the type of an index. """ - def __init__(self, - ddoc: str, - def_: 'IndexDefinition', - name: str, - type: str) -> None: + def __init__( + self, + ddoc: str, + def_: 'IndexDefinition', + name: str, + type: str, + ) -> None: """ Initialize a IndexInformation object. @@ -12841,12 +13394,14 @@ class TypeEnum(str, Enum): """ Schema for the type of an index. """ + JSON = 'json' SPECIAL = 'special' TEXT = 'text' -class IndexResult(): + +class IndexResult: """ Schema for the result of creating an index. @@ -12856,10 +13411,12 @@ class IndexResult(): exists. """ - def __init__(self, - id: str, - name: str, - result: str) -> None: + def __init__( + self, + id: str, + name: str, + result: str, + ) -> None: """ Initialize a IndexResult object. @@ -12928,11 +13485,13 @@ class ResultEnum(str, Enum): """ Flag to show whether the index was created or one already exists. """ + CREATED = 'created' EXISTS = 'exists' -class IndexTextOperatorDefaultField(): + +class IndexTextOperatorDefaultField: """ Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator. @@ -12941,10 +13500,12 @@ class IndexTextOperatorDefaultField(): :attr bool enabled: (optional) Whether or not the default_field is enabled. """ - def __init__(self, - *, - analyzer: 'Analyzer' = None, - enabled: bool = None) -> None: + def __init__( + self, + *, + analyzer: 'Analyzer' = None, + enabled: bool = None, + ) -> None: """ Initialize a IndexTextOperatorDefaultField object. @@ -13001,7 +13562,8 @@ def __ne__(self, other: 'IndexTextOperatorDefaultField') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IndexesInformation(): + +class IndexesInformation: """ Schema for information about the indexes in a database. @@ -13009,9 +13571,11 @@ class IndexesInformation(): :attr List[IndexInformation] indexes: Indexes. """ - def __init__(self, - total_rows: int, - indexes: List['IndexInformation']) -> None: + def __init__( + self, + total_rows: int, + indexes: List['IndexInformation'], + ) -> None: """ Initialize a IndexesInformation object. @@ -13073,7 +13637,8 @@ def __ne__(self, other: 'IndexesInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class MembershipInformation(): + +class MembershipInformation: """ Schema for information about known nodes and cluster membership. @@ -13082,9 +13647,11 @@ class MembershipInformation(): :attr List[str] cluster_nodes: All cluster nodes. """ - def __init__(self, - all_nodes: List[str], - cluster_nodes: List[str]) -> None: + def __init__( + self, + all_nodes: List[str], + cluster_nodes: List[str], + ) -> None: """ Initialize a MembershipInformation object. @@ -13141,16 +13708,19 @@ def __ne__(self, other: 'MembershipInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Ok(): + +class Ok: """ Schema for an OK result. :attr bool ok: (optional) ok. """ - def __init__(self, - *, - ok: bool = None) -> None: + def __init__( + self, + *, + ok: bool = None, + ) -> None: """ Initialize a Ok object. @@ -13196,7 +13766,8 @@ def __ne__(self, other: 'Ok') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PartitionInformation(): + +class PartitionInformation: """ Schema for information about a database partition. @@ -13211,14 +13782,16 @@ class PartitionInformation(): bytes. """ - def __init__(self, - db_name: str, - doc_count: int, - doc_del_count: int, - partition: str, - sizes: 'PartitionInformationSizes', - *, - partitioned_indexes: 'PartitionInformationIndexes' = None) -> None: + def __init__( + self, + db_name: str, + doc_count: int, + doc_del_count: int, + partition: str, + sizes: 'PartitionInformationSizes', + *, + partitioned_indexes: 'PartitionInformationIndexes' = None, + ) -> None: """ Initialize a PartitionInformation object. @@ -13313,7 +13886,8 @@ def __ne__(self, other: 'PartitionInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PartitionInformationIndexes(): + +class PartitionInformationIndexes: """ Schema for information about the partition index count and limit in a database. @@ -13323,11 +13897,13 @@ class PartitionInformationIndexes(): :attr int limit: (optional) The partitioned index limit. """ - def __init__(self, - *, - count: int = None, - indexes: 'PartitionInformationIndexesIndexes' = None, - limit: int = None) -> None: + def __init__( + self, + *, + count: int = None, + indexes: 'PartitionInformationIndexesIndexes' = None, + limit: int = None, + ) -> None: """ Initialize a PartitionInformationIndexes object. @@ -13389,7 +13965,8 @@ def __ne__(self, other: 'PartitionInformationIndexes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PartitionInformationIndexesIndexes(): + +class PartitionInformationIndexesIndexes: """ The count breakdown of partitioned indexes. @@ -13397,10 +13974,12 @@ class PartitionInformationIndexesIndexes(): :attr int view: (optional) Number of partitioned view indexes. """ - def __init__(self, - *, - search: int = None, - view: int = None) -> None: + def __init__( + self, + *, + search: int = None, + view: int = None, + ) -> None: """ Initialize a PartitionInformationIndexesIndexes object. @@ -13452,7 +14031,8 @@ def __ne__(self, other: 'PartitionInformationIndexesIndexes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PartitionInformationSizes(): + +class PartitionInformationSizes: """ The size of active and external data, in bytes. @@ -13462,10 +14042,12 @@ class PartitionInformationSizes(): bytes. """ - def __init__(self, - *, - active: int = None, - external: int = None) -> None: + def __init__( + self, + *, + active: int = None, + external: int = None, + ) -> None: """ Initialize a PartitionInformationSizes object. @@ -13519,7 +14101,8 @@ def __ne__(self, other: 'PartitionInformationSizes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReplicationCreateTargetParameters(): + +class ReplicationCreateTargetParameters: """ Request parameters to use during target database creation. @@ -13531,11 +14114,13 @@ class ReplicationCreateTargetParameters(): shard is a partition of the hash value range. """ - def __init__(self, - *, - n: int = None, - partitioned: bool = None, - q: int = None) -> None: + def __init__( + self, + *, + n: int = None, + partitioned: bool = None, + q: int = None, + ) -> None: """ Initialize a ReplicationCreateTargetParameters object. @@ -13596,7 +14181,8 @@ def __ne__(self, other: 'ReplicationCreateTargetParameters') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReplicationDatabase(): + +class ReplicationDatabase: """ Schema for a replication source or target database. @@ -13606,11 +14192,13 @@ class ReplicationDatabase(): :attr str url: Replication database URL. """ - def __init__(self, - url: str, - *, - auth: 'ReplicationDatabaseAuth' = None, - headers_: dict = None) -> None: + def __init__( + self, + url: str, + *, + auth: 'ReplicationDatabaseAuth' = None, + headers_: dict = None, + ) -> None: """ Initialize a ReplicationDatabase object. @@ -13674,7 +14262,8 @@ def __ne__(self, other: 'ReplicationDatabase') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReplicationDatabaseAuth(): + +class ReplicationDatabaseAuth: """ Schema for replication source or target database authentication. @@ -13684,10 +14273,12 @@ class ReplicationDatabaseAuth(): replication database authentication. """ - def __init__(self, - *, - basic: 'ReplicationDatabaseAuthBasic' = None, - iam: 'ReplicationDatabaseAuthIam' = None) -> None: + def __init__( + self, + *, + basic: 'ReplicationDatabaseAuthBasic' = None, + iam: 'ReplicationDatabaseAuthIam' = None, + ) -> None: """ Initialize a ReplicationDatabaseAuth object. @@ -13747,7 +14338,8 @@ def __ne__(self, other: 'ReplicationDatabaseAuth') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReplicationDatabaseAuthBasic(): + +class ReplicationDatabaseAuthBasic: """ Schema for basic authentication of replication source or target database. @@ -13755,9 +14347,11 @@ class ReplicationDatabaseAuthBasic(): :attr str username: The username. """ - def __init__(self, - password: str, - username: str) -> None: + def __init__( + self, + password: str, + username: str, + ) -> None: """ Initialize a ReplicationDatabaseAuthBasic object. @@ -13813,15 +14407,18 @@ def __ne__(self, other: 'ReplicationDatabaseAuthBasic') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReplicationDatabaseAuthIam(): + +class ReplicationDatabaseAuthIam: """ Schema for an IAM API key for replication database authentication. :attr str api_key: IAM API key. """ - def __init__(self, - api_key: str) -> None: + def __init__( + self, + api_key: str, + ) -> None: """ Initialize a ReplicationDatabaseAuthIam object. @@ -13869,7 +14466,8 @@ def __ne__(self, other: 'ReplicationDatabaseAuthIam') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReplicationDocument(): + +class ReplicationDocument: """ Schema for a replication document. Note that `selector`, `doc_ids`, and `filter` are incompatible with each other. @@ -13975,42 +14573,44 @@ class ReplicationDocument(): # The set of defined properties for the class _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_bulk_get', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) - def __init__(self, - source: 'ReplicationDatabase', - target: 'ReplicationDatabase', - *, - attachments: dict = None, - conflicts: List[str] = None, - deleted: bool = None, - deleted_conflicts: List[str] = None, - id: str = None, - local_seq: str = None, - rev: str = None, - revisions: 'Revisions' = None, - revs_info: List['DocumentRevisionStatus'] = None, - cancel: bool = None, - checkpoint_interval: int = None, - connection_timeout: int = None, - continuous: bool = None, - create_target: bool = None, - create_target_params: 'ReplicationCreateTargetParameters' = None, - doc_ids: List[str] = None, - filter: str = None, - http_connections: int = None, - query_params: dict = None, - retries_per_request: int = None, - selector: dict = None, - since_seq: str = None, - socket_options: str = None, - source_proxy: str = None, - target_proxy: str = None, - use_bulk_get: bool = None, - use_checkpoints: bool = None, - user_ctx: 'UserContext' = None, - winning_revs_only: bool = None, - worker_batch_size: int = None, - worker_processes: int = None, - **kwargs) -> None: + def __init__( + self, + source: 'ReplicationDatabase', + target: 'ReplicationDatabase', + *, + attachments: dict = None, + conflicts: List[str] = None, + deleted: bool = None, + deleted_conflicts: List[str] = None, + id: str = None, + local_seq: str = None, + rev: str = None, + revisions: 'Revisions' = None, + revs_info: List['DocumentRevisionStatus'] = None, + cancel: bool = None, + checkpoint_interval: int = None, + connection_timeout: int = None, + continuous: bool = None, + create_target: bool = None, + create_target_params: 'ReplicationCreateTargetParameters' = None, + doc_ids: List[str] = None, + filter: str = None, + http_connections: int = None, + query_params: dict = None, + retries_per_request: int = None, + selector: dict = None, + since_seq: str = None, + socket_options: str = None, + source_proxy: str = None, + target_proxy: str = None, + use_bulk_get: bool = None, + use_checkpoints: bool = None, + user_ctx: 'UserContext' = None, + winning_revs_only: bool = None, + worker_batch_size: int = None, + worker_processes: int = None, + **kwargs, + ) -> None: """ Initialize a ReplicationDocument object. @@ -14162,7 +14762,7 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': """Initialize a ReplicationDocument object from a json dictionary.""" args = {} if '_attachments' in _dict: - args['attachments'] = {k : Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} + args['attachments'] = {k: Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} if '_conflicts' in _dict: args['conflicts'] = _dict.get('_conflicts') if '_deleted' in _dict: @@ -14231,7 +14831,7 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': args['worker_batch_size'] = _dict.get('worker_batch_size') if 'worker_processes' in _dict: args['worker_processes'] = _dict.get('worker_processes') - args.update({k:v for (k, v) in _dict.items() if k not in cls._properties}) + args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @classmethod @@ -14374,7 +14974,8 @@ def __ne__(self, other: 'ReplicationDocument') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Revisions(): + +class Revisions: """ Schema for list of revision information. @@ -14383,9 +14984,11 @@ class Revisions(): :attr int start: Prefix number for the latest revision. """ - def __init__(self, - ids: List[str], - start: int) -> None: + def __init__( + self, + ids: List[str], + start: int, + ) -> None: """ Initialize a Revisions object. @@ -14442,7 +15045,8 @@ def __ne__(self, other: 'Revisions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RevsDiff(): + +class RevsDiff: """ Schema for information about missing revs and possible ancestors. @@ -14451,10 +15055,12 @@ class RevsDiff(): revisions. """ - def __init__(self, - *, - missing: List[str] = None, - possible_ancestors: List[str] = None) -> None: + def __init__( + self, + *, + missing: List[str] = None, + possible_ancestors: List[str] = None, + ) -> None: """ Initialize a RevsDiff object. @@ -14507,7 +15113,8 @@ def __ne__(self, other: 'RevsDiff') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SchedulerDocsResult(): + +class SchedulerDocsResult: """ Schema for a listing of replication scheduler documents. @@ -14515,9 +15122,11 @@ class SchedulerDocsResult(): :attr List[SchedulerDocument] docs: Array of replication scheduler doc objects. """ - def __init__(self, - total_rows: int, - docs: List['SchedulerDocument']) -> None: + def __init__( + self, + total_rows: int, + docs: List['SchedulerDocument'], + ) -> None: """ Initialize a SchedulerDocsResult object. @@ -14580,7 +15189,8 @@ def __ne__(self, other: 'SchedulerDocsResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SchedulerDocument(): + +class SchedulerDocument: """ Schema for a replication scheduler document. @@ -14607,21 +15217,23 @@ class SchedulerDocument(): proxy server through which replication with the target database occurs. """ - def __init__(self, - database: str, - doc_id: str, - error_count: int, - id: str, - info: 'SchedulerInfo', - last_updated: datetime, - start_time: datetime, - state: str, - *, - node: str = None, - source: str = None, - source_proxy: str = None, - target: str = None, - target_proxy: str = None) -> None: + def __init__( + self, + database: str, + doc_id: str, + error_count: int, + id: str, + info: 'SchedulerInfo', + last_updated: datetime, + start_time: datetime, + state: str, + *, + node: str = None, + source: str = None, + source_proxy: str = None, + target: str = None, + target_proxy: str = None, + ) -> None: """ Initialize a SchedulerDocument object. @@ -14772,6 +15384,7 @@ class StateEnum(str, Enum): """ Schema for replication state. """ + INITIALIZING = 'initializing' ERROR = 'error' PENDING = 'pending' @@ -14781,7 +15394,8 @@ class StateEnum(str, Enum): FAILED = 'failed' -class SchedulerInfo(): + +class SchedulerInfo: """ Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and @@ -14807,18 +15421,20 @@ class SchedulerInfo(): replicator. """ - def __init__(self, - *, - changes_pending: int = None, - checkpointed_source_seq: str = None, - doc_write_failures: int = None, - docs_read: int = None, - docs_written: int = None, - error: str = None, - missing_revisions_found: int = None, - revisions_checked: int = None, - source_seq: str = None, - through_seq: str = None) -> None: + def __init__( + self, + *, + changes_pending: int = None, + checkpointed_source_seq: str = None, + doc_write_failures: int = None, + docs_read: int = None, + docs_written: int = None, + error: str = None, + missing_revisions_found: int = None, + revisions_checked: int = None, + source_seq: str = None, + through_seq: str = None, + ) -> None: """ Initialize a SchedulerInfo object. @@ -14927,7 +15543,8 @@ def __ne__(self, other: 'SchedulerInfo') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SchedulerJob(): + +class SchedulerJob: """ Schema for a replication scheduler job. @@ -14947,18 +15564,20 @@ class SchedulerJob(): :attr str user: Name of user running replication. """ - def __init__(self, - database: str, - doc_id: str, - history: List['SchedulerJobEvent'], - id: str, - info: 'SchedulerInfo', - node: str, - pid: str, - source: str, - start_time: datetime, - target: str, - user: str) -> None: + def __init__( + self, + database: str, + doc_id: str, + history: List['SchedulerJobEvent'], + id: str, + info: 'SchedulerInfo', + node: str, + pid: str, + source: str, + start_time: datetime, + target: str, + user: str, + ) -> None: """ Initialize a SchedulerJob object. @@ -15098,7 +15717,8 @@ def __ne__(self, other: 'SchedulerJob') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SchedulerJobEvent(): + +class SchedulerJobEvent: """ Schema for a replication scheduler job event. @@ -15107,11 +15727,13 @@ class SchedulerJobEvent(): :attr str type: Type of the event. """ - def __init__(self, - timestamp: datetime, - type: str, - *, - reason: str = None) -> None: + def __init__( + self, + timestamp: datetime, + type: str, + *, + reason: str = None, + ) -> None: """ Initialize a SchedulerJobEvent object. @@ -15173,7 +15795,8 @@ def __ne__(self, other: 'SchedulerJobEvent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SchedulerJobsResult(): + +class SchedulerJobsResult: """ Schema for a listing of replication scheduler jobs. @@ -15181,9 +15804,11 @@ class SchedulerJobsResult(): :attr List[SchedulerJob] jobs: Array of replication job objects. """ - def __init__(self, - total_rows: int, - jobs: List['SchedulerJob']) -> None: + def __init__( + self, + total_rows: int, + jobs: List['SchedulerJob'], + ) -> None: """ Initialize a SchedulerJobsResult object. @@ -15245,15 +15870,18 @@ def __ne__(self, other: 'SchedulerJobsResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchAnalyzeResult(): + +class SearchAnalyzeResult: """ Schema for the output of testing search analyzer tokenization. :attr List[str] tokens: tokens. """ - def __init__(self, - tokens: List[str]) -> None: + def __init__( + self, + tokens: List[str], + ) -> None: """ Initialize a SearchAnalyzeResult object. @@ -15301,7 +15929,8 @@ def __ne__(self, other: 'SearchAnalyzeResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchIndexDefinition(): + +class SearchIndexDefinition: """ Schema for a search index definition. @@ -15327,10 +15956,12 @@ class SearchIndexDefinition(): in the search result; otherwise, the value is not returned. """ - def __init__(self, - index: str, - *, - analyzer: 'AnalyzerConfiguration' = None) -> None: + def __init__( + self, + index: str, + *, + analyzer: 'AnalyzerConfiguration' = None, + ) -> None: """ Initialize a SearchIndexDefinition object. @@ -15406,7 +16037,8 @@ def __ne__(self, other: 'SearchIndexDefinition') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchIndexInfo(): + +class SearchIndexInfo: """ Schema for metadata information about a search index. @@ -15418,13 +16050,15 @@ class SearchIndexInfo(): :attr str signature: Unique signature of the search index. """ - def __init__(self, - committed_seq: int, - disk_size: int, - doc_count: int, - doc_del_count: int, - pending_seq: int, - signature: str) -> None: + def __init__( + self, + committed_seq: int, + disk_size: int, + doc_count: int, + doc_del_count: int, + pending_seq: int, + signature: str, + ) -> None: """ Initialize a SearchIndexInfo object. @@ -15512,7 +16146,8 @@ def __ne__(self, other: 'SearchIndexInfo') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchInfoResult(): + +class SearchInfoResult: """ Schema for search index information. @@ -15522,9 +16157,11 @@ class SearchInfoResult(): search index. """ - def __init__(self, - name: str, - search_index: 'SearchIndexInfo') -> None: + def __init__( + self, + name: str, + search_index: 'SearchIndexInfo', + ) -> None: """ Initialize a SearchInfoResult object. @@ -15585,7 +16222,8 @@ def __ne__(self, other: 'SearchInfoResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResult(): + +class SearchResult: """ Schema for the result of a query search operation. @@ -15603,15 +16241,17 @@ class SearchResult(): matches. """ - def __init__(self, - total_rows: int, - *, - bookmark: str = None, - by: str = None, - counts: dict = None, - ranges: dict = None, - rows: List['SearchResultRow'] = None, - groups: List['SearchResultProperties'] = None) -> None: + def __init__( + self, + total_rows: int, + *, + bookmark: str = None, + by: str = None, + counts: dict = None, + ranges: dict = None, + rows: List['SearchResultRow'] = None, + groups: List['SearchResultProperties'] = None, + ) -> None: """ Initialize a SearchResult object. @@ -15712,7 +16352,8 @@ def __ne__(self, other: 'SearchResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultProperties(): + +class SearchResultProperties: """ Schema for the result of a query search operation. @@ -15728,14 +16369,16 @@ class SearchResultProperties(): :attr List[SearchResultRow] rows: (optional) Array of row objects. """ - def __init__(self, - total_rows: int, - *, - bookmark: str = None, - by: str = None, - counts: dict = None, - ranges: dict = None, - rows: List['SearchResultRow'] = None) -> None: + def __init__( + self, + total_rows: int, + *, + bookmark: str = None, + by: str = None, + counts: dict = None, + ranges: dict = None, + rows: List['SearchResultRow'] = None, + ) -> None: """ Initialize a SearchResultProperties object. @@ -15823,7 +16466,8 @@ def __ne__(self, other: 'SearchResultProperties') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SearchResultRow(): + +class SearchResultRow: """ Schema for a row of the result of a query search operation. @@ -15835,12 +16479,14 @@ class SearchResultRow(): :attr str id: Schema for a document ID. """ - def __init__(self, - fields: dict, - id: str, - *, - doc: 'Document' = None, - highlights: dict = None) -> None: + def __init__( + self, + fields: dict, + id: str, + *, + doc: 'Document' = None, + highlights: dict = None, + ) -> None: """ Initialize a SearchResultRow object. @@ -15914,7 +16560,8 @@ def __ne__(self, other: 'SearchResultRow') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Security(): + +class Security: """ Schema for a security document. @@ -15928,12 +16575,14 @@ class Security(): database only. """ - def __init__(self, - *, - admins: 'SecurityObject' = None, - members: 'SecurityObject' = None, - cloudant: dict = None, - couchdb_auth_only: bool = None) -> None: + def __init__( + self, + *, + admins: 'SecurityObject' = None, + members: 'SecurityObject' = None, + cloudant: dict = None, + couchdb_auth_only: bool = None, + ) -> None: """ Initialize a Security object. @@ -16011,6 +16660,7 @@ class CloudantEnum(str, Enum): """ Database permissions for Cloudant users and/or API keys. """ + READER = '_reader' WRITER = '_writer' ADMIN = '_admin' @@ -16021,7 +16671,8 @@ class CloudantEnum(str, Enum): SECURITY = '_security' -class SecurityObject(): + +class SecurityObject: """ Schema for names and roles to map to a database permission. @@ -16029,10 +16680,12 @@ class SecurityObject(): :attr List[str] roles: (optional) List of roles. """ - def __init__(self, - *, - names: List[str] = None, - roles: List[str] = None) -> None: + def __init__( + self, + *, + names: List[str] = None, + roles: List[str] = None, + ) -> None: """ Initialize a SecurityObject object. @@ -16084,7 +16737,8 @@ def __ne__(self, other: 'SecurityObject') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServerInformation(): + +class ServerInformation: """ Schema for information about the server instance. @@ -16095,12 +16749,14 @@ class ServerInformation(): :attr List[str] features_flags: List of feature flags. """ - def __init__(self, - couchdb: str, - features: List[str], - vendor: 'ServerVendor', - version: str, - features_flags: List[str]) -> None: + def __init__( + self, + couchdb: str, + features: List[str], + vendor: 'ServerVendor', + version: str, + features_flags: List[str], + ) -> None: """ Initialize a ServerInformation object. @@ -16183,7 +16839,8 @@ def __ne__(self, other: 'ServerInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ServerVendor(): + +class ServerVendor: """ Schema for server vendor information. @@ -16192,11 +16849,13 @@ class ServerVendor(): :attr str version: (optional) Vendor version. """ - def __init__(self, - name: str, - *, - variant: str = None, - version: str = None) -> None: + def __init__( + self, + name: str, + *, + variant: str = None, + version: str = None, + ) -> None: """ Initialize a ServerVendor object. @@ -16256,7 +16915,8 @@ def __ne__(self, other: 'ServerVendor') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SessionAuthentication(): + +class SessionAuthentication: """ Schema for session authentication information. @@ -16265,11 +16925,13 @@ class SessionAuthentication(): :attr List[str] authentication_handlers: authentication_handlers. """ - def __init__(self, - authentication_handlers: List[str], - *, - authenticated: str = None, - authentication_db: str = None) -> None: + def __init__( + self, + authentication_handlers: List[str], + *, + authenticated: str = None, + authentication_db: str = None, + ) -> None: """ Initialize a SessionAuthentication object. @@ -16329,7 +16991,8 @@ def __ne__(self, other: 'SessionAuthentication') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SessionInformation(): + +class SessionInformation: """ Schema for information about a session. @@ -16338,10 +17001,12 @@ class SessionInformation(): :attr UserContext user_ctx: Schema for the user context of a session. """ - def __init__(self, - ok: bool, - info: 'SessionAuthentication', - user_ctx: 'UserContext') -> None: + def __init__( + self, + ok: bool, + info: 'SessionAuthentication', + user_ctx: 'UserContext', + ) -> None: """ Initialize a SessionInformation object. @@ -16412,7 +17077,8 @@ def __ne__(self, other: 'SessionInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ShardsInformation(): + +class ShardsInformation: """ Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard. @@ -16420,8 +17086,10 @@ class ShardsInformation(): :attr dict shards: Mapping of shard hash value range to a list of nodes. """ - def __init__(self, - shards: dict) -> None: + def __init__( + self, + shards: dict, + ) -> None: """ Initialize a ShardsInformation object. @@ -16469,7 +17137,8 @@ def __ne__(self, other: 'ShardsInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ThroughputInformation(): + +class ThroughputInformation: """ Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes. @@ -16482,11 +17151,13 @@ class ThroughputInformation(): :attr int write: Provisioned writes capacity in operations per second. """ - def __init__(self, - blocks: int, - query: int, - read: int, - write: int) -> None: + def __init__( + self, + blocks: int, + query: int, + read: int, + write: int, + ) -> None: """ Initialize a ThroughputInformation object. @@ -16561,7 +17232,8 @@ def __ne__(self, other: 'ThroughputInformation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class UpInformation(): + +class UpInformation: """ Schema for information about the up state of the server. @@ -16569,9 +17241,11 @@ class UpInformation(): :attr str status: status. """ - def __init__(self, - seeds: dict, - status: str) -> None: + def __init__( + self, + seeds: dict, + status: str, + ) -> None: """ Initialize a UpInformation object. @@ -16631,12 +17305,14 @@ class StatusEnum(str, Enum): """ status. """ + MAINTENANCE_MODE = 'maintenance_mode' NOLB = 'nolb' OK = 'ok' -class UserContext(): + +class UserContext: """ Schema for the user context of a session. @@ -16645,11 +17321,13 @@ class UserContext(): :attr List[str] roles: List of user roles. """ - def __init__(self, - name: str, - roles: List[str], - *, - db: str = None) -> None: + def __init__( + self, + name: str, + roles: List[str], + *, + db: str = None, + ) -> None: """ Initialize a UserContext object. @@ -16716,6 +17394,7 @@ class RolesEnum(str, Enum): """ Schema for a security role. """ + READER = '_reader' WRITER = '_writer' ADMIN = '_admin' @@ -16726,15 +17405,18 @@ class RolesEnum(str, Enum): SECURITY = '_security' -class UuidsResult(): + +class UuidsResult: """ Schema for a set of uuids generated by the server. :attr List[str] uuids: uuids. """ - def __init__(self, - uuids: List[str]) -> None: + def __init__( + self, + uuids: List[str], + ) -> None: """ Initialize a UuidsResult object. @@ -16782,7 +17464,8 @@ def __ne__(self, other: 'UuidsResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ViewQueriesResult(): + +class ViewQueriesResult: """ Schema for the results of a queries view operation. @@ -16791,8 +17474,10 @@ class ViewQueriesResult(): request. """ - def __init__(self, - results: List['ViewResult']) -> None: + def __init__( + self, + results: List['ViewResult'], + ) -> None: """ Initialize a ViewQueriesResult object. @@ -16848,7 +17533,8 @@ def __ne__(self, other: 'ViewQueriesResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ViewQuery(): + +class ViewQuery: """ Schema for a query view operation. @@ -16909,28 +17595,30 @@ class ViewQuery(): them immediately after the request. """ - def __init__(self, - *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: object = None, - end_key_doc_id: str = None, - group: bool = None, - group_level: int = None, - key: object = None, - keys: List[object] = None, - reduce: bool = None, - stable: bool = None, - start_key: object = None, - start_key_doc_id: str = None, - update: str = None) -> None: + def __init__( + self, + *, + att_encoding_info: bool = None, + attachments: bool = None, + conflicts: bool = None, + descending: bool = None, + include_docs: bool = None, + inclusive_end: bool = None, + limit: int = None, + skip: int = None, + update_seq: bool = None, + end_key: object = None, + end_key_doc_id: str = None, + group: bool = None, + group_level: int = None, + key: object = None, + keys: List[object] = None, + reduce: bool = None, + stable: bool = None, + start_key: object = None, + start_key_doc_id: str = None, + update: str = None, + ) -> None: """ Initialize a ViewQuery object. @@ -17136,12 +17824,14 @@ class UpdateEnum(str, Enum): * `lazy` - Return the view results without waiting for an update, but update them immediately after the request. """ + TRUE = 'true' FALSE = 'false' LAZY = 'lazy' -class ViewResult(): + +class ViewResult: """ Schema for the result of a query view operation. @@ -17150,11 +17840,13 @@ class ViewResult(): :attr List[ViewResultRow] rows: rows. """ - def __init__(self, - rows: List['ViewResultRow'], - *, - total_rows: int = None, - update_seq: str = None) -> None: + def __init__( + self, + rows: List['ViewResultRow'], + *, + total_rows: int = None, + update_seq: str = None, + ) -> None: """ Initialize a ViewResult object. @@ -17220,7 +17912,8 @@ def __ne__(self, other: 'ViewResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ViewResultRow(): + +class ViewResultRow: """ Schema for a row of a view result. @@ -17233,15 +17926,17 @@ class ViewResultRow(): :attr object value: Schema for any JSON type. """ - def __init__(self, - key: object, - value: object, - *, - caused_by: str = None, - error: str = None, - reason: str = None, - doc: 'Document' = None, - id: str = None) -> None: + def __init__( + self, + key: object, + value: object, + *, + caused_by: str = None, + error: str = None, + reason: str = None, + doc: 'Document' = None, + id: str = None, + ) -> None: """ Initialize a ViewResultRow object. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 340c0396..4f5a987e 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -26,7 +26,8 @@ # Config file name config_file = 'cloudant_v1.env' -class TestCloudantV1(): + +class TestCloudantV1: """ Integration Test Class for CloudantV1 """ @@ -40,8 +41,7 @@ def setup_class(cls): ) assert cls.cloudant_service is not None - cls.config = read_external_sources( - CloudantV1.DEFAULT_SERVICE_NAME) + cls.config = read_external_sources(CloudantV1.DEFAULT_SERVICE_NAME) assert cls.config is not None cls.cloudant_service.enable_retries() @@ -54,7 +54,6 @@ def setup_class(cls): @needscredentials def test_get_server_information(self): - response = self.cloudant_service.get_server_information() assert response.get_status_code() == 200 @@ -63,7 +62,6 @@ def test_get_server_information(self): @needscredentials def test_get_membership_information(self): - response = self.cloudant_service.get_membership_information() assert response.get_status_code() == 200 @@ -72,7 +70,6 @@ def test_get_membership_information(self): @needscredentials def test_get_uuids(self): - response = self.cloudant_service.get_uuids( count=1, ) @@ -83,7 +80,6 @@ def test_get_uuids(self): @needscredentials def test_get_capacity_throughput_information(self): - response = self.cloudant_service.get_capacity_throughput_information() assert response.get_status_code() == 200 @@ -92,7 +88,6 @@ def test_get_capacity_throughput_information(self): @needscredentials def test_put_capacity_throughput_configuration(self): - response = self.cloudant_service.put_capacity_throughput_configuration( blocks=0, ) @@ -103,7 +98,6 @@ def test_put_capacity_throughput_configuration(self): @needscredentials def test_get_db_updates(self): - response = self.cloudant_service.get_db_updates( feed='normal', heartbeat=0, @@ -117,7 +111,6 @@ def test_get_db_updates(self): @needscredentials def test_post_changes(self): - response = self.cloudant_service.post_changes( db='testString', doc_ids=['testString'], @@ -146,7 +139,6 @@ def test_post_changes(self): @needscredentials def test_post_changes_as_stream(self): - response = self.cloudant_service.post_changes_as_stream( db='testString', doc_ids=['testString'], @@ -175,7 +167,6 @@ def test_post_changes_as_stream(self): @needscredentials def test_head_database(self): - response = self.cloudant_service.head_database( db='testString', ) @@ -184,7 +175,6 @@ def test_head_database(self): @needscredentials def test_get_all_dbs(self): - response = self.cloudant_service.get_all_dbs( descending=False, end_key='testString', @@ -199,7 +189,6 @@ def test_get_all_dbs(self): @needscredentials def test_post_dbs_info(self): - response = self.cloudant_service.post_dbs_info( keys=['testString'], ) @@ -210,7 +199,6 @@ def test_post_dbs_info(self): @needscredentials def test_get_database_information(self): - response = self.cloudant_service.get_database_information( db='testString', ) @@ -221,7 +209,6 @@ def test_get_database_information(self): @needscredentials def test_put_database(self): - response = self.cloudant_service.put_database( db='testString', partitioned=False, @@ -234,7 +221,6 @@ def test_put_database(self): @needscredentials def test_head_document(self): - response = self.cloudant_service.head_document( db='testString', doc_id='testString', @@ -247,7 +233,6 @@ def test_head_document(self): @needscredentials def test_post_document(self): - # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', @@ -260,19 +245,16 @@ def test_post_document(self): 'revpos': 1, 'stub': True, } - # Construct a dict representation of a Revisions model revisions_model = { 'ids': ['testString'], 'start': 1, } - # Construct a dict representation of a DocumentRevisionStatus model document_revision_status_model = { 'rev': 'testString', 'status': 'available', } - # Construct a dict representation of a Document model document_model = { '_attachments': {'key1': attachment_model}, @@ -300,7 +282,6 @@ def test_post_document(self): @needscredentials def test_post_all_docs(self): - response = self.cloudant_service.post_all_docs( db='testString', att_encoding_info=False, @@ -324,7 +305,6 @@ def test_post_all_docs(self): @needscredentials def test_post_all_docs_as_stream(self): - response = self.cloudant_service.post_all_docs_as_stream( db='testString', att_encoding_info=False, @@ -348,7 +328,6 @@ def test_post_all_docs_as_stream(self): @needscredentials def test_post_all_docs_queries(self): - # Construct a dict representation of a AllDocsQuery model all_docs_query_model = { 'att_encoding_info': False, @@ -377,7 +356,6 @@ def test_post_all_docs_queries(self): @needscredentials def test_post_all_docs_queries_as_stream(self): - # Construct a dict representation of a AllDocsQuery model all_docs_query_model = { 'att_encoding_info': False, @@ -406,7 +384,6 @@ def test_post_all_docs_queries_as_stream(self): @needscredentials def test_post_bulk_docs(self): - # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', @@ -419,19 +396,16 @@ def test_post_bulk_docs(self): 'revpos': 1, 'stub': True, } - # Construct a dict representation of a Revisions model revisions_model = { 'ids': ['testString'], 'start': 1, } - # Construct a dict representation of a DocumentRevisionStatus model document_revision_status_model = { 'rev': 'testString', 'status': 'available', } - # Construct a dict representation of a Document model document_model = { '_attachments': {'key1': attachment_model}, @@ -445,7 +419,6 @@ def test_post_bulk_docs(self): '_revs_info': [document_revision_status_model], 'foo': 'testString', } - # Construct a dict representation of a BulkDocs model bulk_docs_model = { 'docs': [document_model], @@ -463,7 +436,6 @@ def test_post_bulk_docs(self): @needscredentials def test_post_bulk_get(self): - # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], @@ -486,7 +458,6 @@ def test_post_bulk_get(self): @needscredentials def test_post_bulk_get_as_mixed(self): - # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], @@ -509,7 +480,6 @@ def test_post_bulk_get_as_mixed(self): @needscredentials def test_post_bulk_get_as_related(self): - # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], @@ -532,7 +502,6 @@ def test_post_bulk_get_as_related(self): @needscredentials def test_post_bulk_get_as_stream(self): - # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], @@ -555,7 +524,6 @@ def test_post_bulk_get_as_stream(self): @needscredentials def test_get_document(self): - response = self.cloudant_service.get_document( db='testString', doc_id='testString', @@ -578,7 +546,6 @@ def test_get_document(self): @needscredentials def test_get_document_as_mixed(self): - response = self.cloudant_service.get_document_as_mixed( db='testString', doc_id='testString', @@ -601,7 +568,6 @@ def test_get_document_as_mixed(self): @needscredentials def test_get_document_as_related(self): - response = self.cloudant_service.get_document_as_related( db='testString', doc_id='testString', @@ -624,7 +590,6 @@ def test_get_document_as_related(self): @needscredentials def test_get_document_as_stream(self): - response = self.cloudant_service.get_document_as_stream( db='testString', doc_id='testString', @@ -647,7 +612,6 @@ def test_get_document_as_stream(self): @needscredentials def test_put_document(self): - # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', @@ -660,19 +624,16 @@ def test_put_document(self): 'revpos': 1, 'stub': True, } - # Construct a dict representation of a Revisions model revisions_model = { 'ids': ['testString'], 'start': 1, } - # Construct a dict representation of a DocumentRevisionStatus model document_revision_status_model = { 'rev': 'testString', 'status': 'available', } - # Construct a dict representation of a Document model document_model = { '_attachments': {'key1': attachment_model}, @@ -704,7 +665,6 @@ def test_put_document(self): @needscredentials def test_head_design_document(self): - response = self.cloudant_service.head_design_document( db='testString', ddoc='testString', @@ -715,7 +675,6 @@ def test_head_design_document(self): @needscredentials def test_get_design_document(self): - response = self.cloudant_service.get_design_document( db='testString', ddoc='testString', @@ -738,7 +697,6 @@ def test_get_design_document(self): @needscredentials def test_put_design_document(self): - # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', @@ -751,49 +709,41 @@ def test_put_design_document(self): 'revpos': 1, 'stub': True, } - # Construct a dict representation of a Revisions model revisions_model = { 'ids': ['testString'], 'start': 1, } - # Construct a dict representation of a DocumentRevisionStatus model document_revision_status_model = { 'rev': 'testString', 'status': 'available', } - # Construct a dict representation of a Analyzer model analyzer_model = { 'name': 'classic', 'stopwords': ['testString'], } - # Construct a dict representation of a AnalyzerConfiguration model analyzer_configuration_model = { 'name': 'classic', 'stopwords': ['testString'], 'fields': {'key1': analyzer_model}, } - # Construct a dict representation of a SearchIndexDefinition model search_index_definition_model = { 'analyzer': analyzer_configuration_model, 'index': 'testString', } - # Construct a dict representation of a DesignDocumentOptions model design_document_options_model = { 'partitioned': True, } - # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = { 'map': 'testString', 'reduce': 'testString', } - # Construct a dict representation of a DesignDocument model design_document_model = { '_attachments': {'key1': attachment_model}, @@ -831,7 +781,6 @@ def test_put_design_document(self): @needscredentials def test_get_design_document_information(self): - response = self.cloudant_service.get_design_document_information( db='testString', ddoc='testString', @@ -843,7 +792,6 @@ def test_get_design_document_information(self): @needscredentials def test_post_design_docs(self): - response = self.cloudant_service.post_design_docs( db='testString', att_encoding_info=False, @@ -868,7 +816,6 @@ def test_post_design_docs(self): @needscredentials def test_post_design_docs_queries(self): - # Construct a dict representation of a AllDocsQuery model all_docs_query_model = { 'att_encoding_info': False, @@ -898,7 +845,6 @@ def test_post_design_docs_queries(self): @needscredentials def test_post_view(self): - response = self.cloudant_service.post_view( db='testString', ddoc='testString', @@ -931,7 +877,6 @@ def test_post_view(self): @needscredentials def test_post_view_as_stream(self): - response = self.cloudant_service.post_view_as_stream( db='testString', ddoc='testString', @@ -964,7 +909,6 @@ def test_post_view_as_stream(self): @needscredentials def test_post_view_queries(self): - # Construct a dict representation of a ViewQuery model view_query_model = { 'att_encoding_info': False, @@ -1002,7 +946,6 @@ def test_post_view_queries(self): @needscredentials def test_post_view_queries_as_stream(self): - # Construct a dict representation of a ViewQuery model view_query_model = { 'att_encoding_info': False, @@ -1040,7 +983,6 @@ def test_post_view_queries_as_stream(self): @needscredentials def test_get_partition_information(self): - response = self.cloudant_service.get_partition_information( db='testString', partition_key='testString', @@ -1052,7 +994,6 @@ def test_get_partition_information(self): @needscredentials def test_post_partition_all_docs(self): - response = self.cloudant_service.post_partition_all_docs( db='testString', partition_key='testString', @@ -1077,7 +1018,6 @@ def test_post_partition_all_docs(self): @needscredentials def test_post_partition_all_docs_as_stream(self): - response = self.cloudant_service.post_partition_all_docs_as_stream( db='testString', partition_key='testString', @@ -1102,7 +1042,6 @@ def test_post_partition_all_docs_as_stream(self): @needscredentials def test_post_partition_search(self): - response = self.cloudant_service.post_partition_search( db='testString', partition_key='testString', @@ -1128,7 +1067,6 @@ def test_post_partition_search(self): @needscredentials def test_post_partition_search_as_stream(self): - response = self.cloudant_service.post_partition_search_as_stream( db='testString', partition_key='testString', @@ -1154,7 +1092,6 @@ def test_post_partition_search_as_stream(self): @needscredentials def test_post_partition_view(self): - response = self.cloudant_service.post_partition_view( db='testString', partition_key='testString', @@ -1187,7 +1124,6 @@ def test_post_partition_view(self): @needscredentials def test_post_partition_view_as_stream(self): - response = self.cloudant_service.post_partition_view_as_stream( db='testString', partition_key='testString', @@ -1220,7 +1156,6 @@ def test_post_partition_view_as_stream(self): @needscredentials def test_post_partition_find(self): - response = self.cloudant_service.post_partition_find( db='testString', partition_key='testString', @@ -1243,7 +1178,6 @@ def test_post_partition_find(self): @needscredentials def test_post_partition_find_as_stream(self): - response = self.cloudant_service.post_partition_find_as_stream( db='testString', partition_key='testString', @@ -1266,7 +1200,6 @@ def test_post_partition_find_as_stream(self): @needscredentials def test_post_explain(self): - response = self.cloudant_service.post_explain( db='testString', selector={'foo': 'bar'}, @@ -1289,7 +1222,6 @@ def test_post_explain(self): @needscredentials def test_post_find(self): - response = self.cloudant_service.post_find( db='testString', selector={'foo': 'bar'}, @@ -1312,7 +1244,6 @@ def test_post_find(self): @needscredentials def test_post_find_as_stream(self): - response = self.cloudant_service.post_find_as_stream( db='testString', selector={'foo': 'bar'}, @@ -1335,7 +1266,6 @@ def test_post_find_as_stream(self): @needscredentials def test_get_indexes_information(self): - response = self.cloudant_service.get_indexes_information( db='testString', ) @@ -1346,26 +1276,22 @@ def test_get_indexes_information(self): @needscredentials def test_post_index(self): - # Construct a dict representation of a Analyzer model analyzer_model = { 'name': 'classic', 'stopwords': ['testString'], } - # Construct a dict representation of a IndexTextOperatorDefaultField model index_text_operator_default_field_model = { 'analyzer': analyzer_model, 'enabled': True, } - # Construct a dict representation of a IndexField model index_field_model = { 'name': 'testString', 'type': 'boolean', 'foo': 'asc', } - # Construct a dict representation of a IndexDefinition model index_definition_model = { 'default_analyzer': analyzer_model, @@ -1391,7 +1317,6 @@ def test_post_index(self): @needscredentials def test_post_search_analyze(self): - response = self.cloudant_service.post_search_analyze( analyzer='arabic', text='testString', @@ -1403,7 +1328,6 @@ def test_post_search_analyze(self): @needscredentials def test_post_search(self): - response = self.cloudant_service.post_search( db='testString', ddoc='testString', @@ -1434,7 +1358,6 @@ def test_post_search(self): @needscredentials def test_post_search_as_stream(self): - response = self.cloudant_service.post_search_as_stream( db='testString', ddoc='testString', @@ -1465,7 +1388,6 @@ def test_post_search_as_stream(self): @needscredentials def test_get_search_info(self): - response = self.cloudant_service.get_search_info( db='testString', ddoc='testString', @@ -1478,7 +1400,6 @@ def test_get_search_info(self): @needscredentials def test_head_replication_document(self): - response = self.cloudant_service.head_replication_document( doc_id='testString', if_none_match='testString', @@ -1488,7 +1409,6 @@ def test_head_replication_document(self): @needscredentials def test_head_scheduler_document(self): - response = self.cloudant_service.head_scheduler_document( doc_id='testString', ) @@ -1497,7 +1417,6 @@ def test_head_scheduler_document(self): @needscredentials def test_head_scheduler_job(self): - response = self.cloudant_service.head_scheduler_job( job_id='testString', ) @@ -1506,7 +1425,6 @@ def test_head_scheduler_job(self): @needscredentials def test_get_replication_document(self): - response = self.cloudant_service.get_replication_document( doc_id='testString', if_none_match='testString', @@ -1528,7 +1446,6 @@ def test_get_replication_document(self): @needscredentials def test_put_replication_document(self): - # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', @@ -1541,57 +1458,48 @@ def test_put_replication_document(self): 'revpos': 1, 'stub': True, } - # Construct a dict representation of a Revisions model revisions_model = { 'ids': ['testString'], 'start': 1, } - # Construct a dict representation of a DocumentRevisionStatus model document_revision_status_model = { 'rev': 'testString', 'status': 'available', } - # Construct a dict representation of a ReplicationCreateTargetParameters model replication_create_target_parameters_model = { 'n': 1, 'partitioned': False, 'q': 26, } - # Construct a dict representation of a ReplicationDatabaseAuthBasic model replication_database_auth_basic_model = { 'password': 'testString', 'username': 'testString', } - # Construct a dict representation of a ReplicationDatabaseAuthIam model replication_database_auth_iam_model = { 'api_key': 'testString', } - # Construct a dict representation of a ReplicationDatabaseAuth model replication_database_auth_model = { 'basic': replication_database_auth_basic_model, 'iam': replication_database_auth_iam_model, } - # Construct a dict representation of a ReplicationDatabase model replication_database_model = { 'auth': replication_database_auth_model, 'headers': {'key1': 'testString'}, 'url': 'testString', } - # Construct a dict representation of a UserContext model user_context_model = { 'db': 'testString', 'name': 'testString', 'roles': ['_reader'], } - # Construct a dict representation of a ReplicationDocument model replication_document_model = { '_attachments': {'key1': attachment_model}, @@ -1645,7 +1553,6 @@ def test_put_replication_document(self): @needscredentials def test_get_scheduler_docs(self): - response = self.cloudant_service.get_scheduler_docs( limit=0, skip=0, @@ -1658,7 +1565,6 @@ def test_get_scheduler_docs(self): @needscredentials def test_get_scheduler_document(self): - response = self.cloudant_service.get_scheduler_document( doc_id='testString', ) @@ -1669,7 +1575,6 @@ def test_get_scheduler_document(self): @needscredentials def test_get_scheduler_jobs(self): - response = self.cloudant_service.get_scheduler_jobs( limit=0, skip=0, @@ -1681,7 +1586,6 @@ def test_get_scheduler_jobs(self): @needscredentials def test_get_scheduler_job(self): - response = self.cloudant_service.get_scheduler_job( job_id='testString', ) @@ -1692,7 +1596,6 @@ def test_get_scheduler_job(self): @needscredentials def test_get_session_information(self): - response = self.cloudant_service.get_session_information() assert response.get_status_code() == 200 @@ -1701,7 +1604,6 @@ def test_get_session_information(self): @needscredentials def test_get_security(self): - response = self.cloudant_service.get_security( db='testString', ) @@ -1712,7 +1614,6 @@ def test_get_security(self): @needscredentials def test_put_security(self): - # Construct a dict representation of a SecurityObject model security_object_model = { 'names': ['testString'], @@ -1733,7 +1634,6 @@ def test_put_security(self): @needscredentials def test_post_api_keys(self): - response = self.cloudant_service.post_api_keys() assert response.get_status_code() == 201 @@ -1742,7 +1642,6 @@ def test_post_api_keys(self): @needscredentials def test_put_cloudant_security_configuration(self): - # Construct a dict representation of a SecurityObject model security_object_model = { 'names': ['testString'], @@ -1763,7 +1662,6 @@ def test_put_cloudant_security_configuration(self): @needscredentials def test_get_cors_information(self): - response = self.cloudant_service.get_cors_information() assert response.get_status_code() == 200 @@ -1772,7 +1670,6 @@ def test_get_cors_information(self): @needscredentials def test_put_cors_configuration(self): - response = self.cloudant_service.put_cors_configuration( origins=['testString'], allow_credentials=True, @@ -1785,7 +1682,6 @@ def test_put_cors_configuration(self): @needscredentials def test_head_attachment(self): - response = self.cloudant_service.head_attachment( db='testString', doc_id='testString', @@ -1799,7 +1695,6 @@ def test_head_attachment(self): @needscredentials def test_get_attachment(self): - response = self.cloudant_service.get_attachment( db='testString', doc_id='testString', @@ -1816,7 +1711,6 @@ def test_get_attachment(self): @needscredentials def test_put_attachment(self): - response = self.cloudant_service.put_attachment( db='testString', doc_id='testString', @@ -1833,7 +1727,6 @@ def test_put_attachment(self): @needscredentials def test_head_local_document(self): - response = self.cloudant_service.head_local_document( db='testString', doc_id='testString', @@ -1844,7 +1737,6 @@ def test_head_local_document(self): @needscredentials def test_get_local_document(self): - response = self.cloudant_service.get_local_document( db='testString', doc_id='testString', @@ -1861,7 +1753,6 @@ def test_get_local_document(self): @needscredentials def test_put_local_document(self): - # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', @@ -1874,19 +1765,16 @@ def test_put_local_document(self): 'revpos': 1, 'stub': True, } - # Construct a dict representation of a Revisions model revisions_model = { 'ids': ['testString'], 'start': 1, } - # Construct a dict representation of a DocumentRevisionStatus model document_revision_status_model = { 'rev': 'testString', 'status': 'available', } - # Construct a dict representation of a Document model document_model = { '_attachments': {'key1': attachment_model}, @@ -1915,7 +1803,6 @@ def test_put_local_document(self): @needscredentials def test_post_revs_diff(self): - response = self.cloudant_service.post_revs_diff( db='testString', document_revisions={'key1': ['testString']}, @@ -1927,7 +1814,6 @@ def test_post_revs_diff(self): @needscredentials def test_get_shards_information(self): - response = self.cloudant_service.get_shards_information( db='testString', ) @@ -1938,7 +1824,6 @@ def test_get_shards_information(self): @needscredentials def test_get_document_shards_info(self): - response = self.cloudant_service.get_document_shards_info( db='testString', doc_id='testString', @@ -1950,14 +1835,12 @@ def test_get_document_shards_info(self): @needscredentials def test_head_up_information(self): - response = self.cloudant_service.head_up_information() assert response.get_status_code() == 200 @needscredentials def test_get_active_tasks(self): - response = self.cloudant_service.get_active_tasks() assert response.get_status_code() == 200 @@ -1966,7 +1849,6 @@ def test_get_active_tasks(self): @needscredentials def test_get_up_information(self): - response = self.cloudant_service.get_up_information() assert response.get_status_code() == 200 @@ -1975,7 +1857,6 @@ def test_get_up_information(self): @needscredentials def test_get_activity_tracker_events(self): - response = self.cloudant_service.get_activity_tracker_events() assert response.get_status_code() == 200 @@ -1984,7 +1865,6 @@ def test_get_activity_tracker_events(self): @needscredentials def test_post_activity_tracker_events(self): - response = self.cloudant_service.post_activity_tracker_events( types=['management'], ) @@ -1995,7 +1875,6 @@ def test_post_activity_tracker_events(self): @needscredentials def test_get_current_throughput_information(self): - response = self.cloudant_service.get_current_throughput_information() assert response.get_status_code() == 200 @@ -2004,7 +1883,6 @@ def test_get_current_throughput_information(self): @needscredentials def test_delete_database(self): - response = self.cloudant_service.delete_database( db='testString', ) @@ -2015,7 +1893,6 @@ def test_delete_database(self): @needscredentials def test_delete_document(self): - response = self.cloudant_service.delete_document( db='testString', doc_id='testString', @@ -2030,7 +1907,6 @@ def test_delete_document(self): @needscredentials def test_delete_design_document(self): - response = self.cloudant_service.delete_design_document( db='testString', ddoc='testString', @@ -2045,7 +1921,6 @@ def test_delete_design_document(self): @needscredentials def test_delete_index(self): - response = self.cloudant_service.delete_index( db='testString', ddoc='testString', @@ -2059,7 +1934,6 @@ def test_delete_index(self): @needscredentials def test_delete_replication_document(self): - response = self.cloudant_service.delete_replication_document( doc_id='testString', if_match='testString', @@ -2073,7 +1947,6 @@ def test_delete_replication_document(self): @needscredentials def test_delete_attachment(self): - response = self.cloudant_service.delete_attachment( db='testString', doc_id='testString', @@ -2089,7 +1962,6 @@ def test_delete_attachment(self): @needscredentials def test_delete_local_document(self): - response = self.cloudant_service.delete_local_document( db='testString', doc_id='testString', diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 8f300cd1..ffa3d676 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -75,7 +75,8 @@ def preprocess_url(operation_path: str): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -102,7 +103,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestGetServerInformation(): + +class TestGetServerInformation: """ Test Class for get_server_information """ @@ -115,16 +117,17 @@ def test_get_server_information_all_params(self): # Set up mock url = preprocess_url('/') mock_response = '{"couchdb": "couchdb", "features": ["features"], "vendor": {"name": "name", "variant": "variant", "version": "version"}, "version": "version", "features_flags": ["features_flags"]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_server_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -138,7 +141,8 @@ def test_get_server_information_all_params_with_retries(self): _service.disable_retries() self.test_get_server_information_all_params() -class TestGetMembershipInformation(): + +class TestGetMembershipInformation: """ Test Class for get_membership_information """ @@ -151,16 +155,17 @@ def test_get_membership_information_all_params(self): # Set up mock url = preprocess_url('/_membership') mock_response = '{"all_nodes": ["all_nodes"], "cluster_nodes": ["cluster_nodes"]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_membership_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -174,7 +179,8 @@ def test_get_membership_information_all_params_with_retries(self): _service.disable_retries() self.test_get_membership_information_all_params() -class TestGetUuids(): + +class TestGetUuids: """ Test Class for get_uuids """ @@ -187,11 +193,13 @@ def test_get_uuids_all_params(self): # Set up mock url = preprocess_url('/_uuids') mock_response = '{"uuids": ["uuids"]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values count = 1 @@ -199,14 +207,14 @@ def test_get_uuids_all_params(self): # Invoke method response = _service.get_uuids( count=count, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'count={}'.format(count) in query_string @@ -227,16 +235,17 @@ def test_get_uuids_required_params(self): # Set up mock url = preprocess_url('/_uuids') mock_response = '{"uuids": ["uuids"]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_uuids() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -250,7 +259,8 @@ def test_get_uuids_required_params_with_retries(self): _service.disable_retries() self.test_get_uuids_required_params() -class TestGetCapacityThroughputInformation(): + +class TestGetCapacityThroughputInformation: """ Test Class for get_capacity_throughput_information """ @@ -263,16 +273,17 @@ def test_get_capacity_throughput_information_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/capacity/throughput') mock_response = '{"current": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_capacity_throughput_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -286,7 +297,8 @@ def test_get_capacity_throughput_information_all_params_with_retries(self): _service.disable_retries() self.test_get_capacity_throughput_information_all_params() -class TestPutCapacityThroughputConfiguration(): + +class TestPutCapacityThroughputConfiguration: """ Test Class for put_capacity_throughput_configuration """ @@ -299,11 +311,13 @@ def test_put_capacity_throughput_configuration_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/capacity/throughput') mock_response = '{"current": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values blocks = 0 @@ -311,7 +325,7 @@ def test_put_capacity_throughput_configuration_all_params(self): # Invoke method response = _service.put_capacity_throughput_configuration( blocks, - headers={} + headers={}, ) # Check for correct operation @@ -341,11 +355,13 @@ def test_put_capacity_throughput_configuration_value_error(self): # Set up mock url = preprocess_url('/_api/v2/user/capacity/throughput') mock_response = '{"current": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values blocks = 0 @@ -355,7 +371,7 @@ def test_put_capacity_throughput_configuration_value_error(self): "blocks": blocks, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_capacity_throughput_configuration(**req_copy) @@ -368,6 +384,7 @@ def test_put_capacity_throughput_configuration_value_error_with_retries(self): _service.disable_retries() self.test_put_capacity_throughput_configuration_value_error() + # endregion ############################################################################## # End of Service: Server @@ -378,7 +395,8 @@ def test_put_capacity_throughput_configuration_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -405,7 +423,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestGetDbUpdates(): + +class TestGetDbUpdates: """ Test Class for get_db_updates """ @@ -418,11 +437,13 @@ def test_get_db_updates_all_params(self): # Set up mock url = preprocess_url('/_db_updates') mock_response = '{"last_seq": "last_seq", "results": [{"db_name": "db_name", "seq": "seq", "type": "created"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values feed = 'normal' @@ -436,14 +457,14 @@ def test_get_db_updates_all_params(self): heartbeat=heartbeat, timeout=timeout, since=since, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'feed={}'.format(feed) in query_string assert 'heartbeat={}'.format(heartbeat) in query_string @@ -467,16 +488,17 @@ def test_get_db_updates_required_params(self): # Set up mock url = preprocess_url('/_db_updates') mock_response = '{"last_seq": "last_seq", "results": [{"db_name": "db_name", "seq": "seq", "type": "created"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_db_updates() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -490,7 +512,8 @@ def test_get_db_updates_required_params_with_retries(self): _service.disable_retries() self.test_get_db_updates_required_params() -class TestPostChanges(): + +class TestPostChanges: """ Test Class for post_changes """ @@ -503,11 +526,13 @@ def test_post_changes_all_params(self): # Set up mock url = preprocess_url('/testString/_changes') mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -551,14 +576,14 @@ def test_post_changes_all_params(self): style=style, timeout=timeout, view=view, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string assert 'attachments={}'.format('true' if attachments else 'false') in query_string @@ -600,11 +625,13 @@ def test_post_changes_required_params(self): # Set up mock url = preprocess_url('/testString/_changes') mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -618,7 +645,7 @@ def test_post_changes_required_params(self): doc_ids=doc_ids, fields=fields, selector=selector, - headers={} + headers={}, ) # Check for correct operation @@ -650,11 +677,13 @@ def test_post_changes_value_error(self): # Set up mock url = preprocess_url('/testString/_changes') mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -667,7 +696,7 @@ def test_post_changes_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_changes(**req_copy) @@ -680,7 +709,8 @@ def test_post_changes_value_error_with_retries(self): _service.disable_retries() self.test_post_changes_value_error() -class TestPostChangesAsStream(): + +class TestPostChangesAsStream: """ Test Class for post_changes_as_stream """ @@ -693,11 +723,13 @@ def test_post_changes_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_changes') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -741,14 +773,14 @@ def test_post_changes_as_stream_all_params(self): style=style, timeout=timeout, view=view, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string assert 'attachments={}'.format('true' if attachments else 'false') in query_string @@ -796,11 +828,13 @@ def test_post_changes_as_stream_required_params(self): # Set up mock url = preprocess_url('/testString/_changes') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -814,7 +848,7 @@ def test_post_changes_as_stream_required_params(self): doc_ids=doc_ids, fields=fields, selector=selector, - headers={} + headers={}, ) # Check for correct operation @@ -852,11 +886,13 @@ def test_post_changes_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_changes') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -869,7 +905,7 @@ def test_post_changes_as_stream_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_changes_as_stream(**req_copy) @@ -882,6 +918,7 @@ def test_post_changes_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_changes_as_stream_value_error() + # endregion ############################################################################## # End of Service: Changes @@ -892,7 +929,8 @@ def test_post_changes_as_stream_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -919,7 +957,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadDatabase(): + +class TestHeadDatabase: """ Test Class for head_database """ @@ -931,9 +970,11 @@ def test_head_database_all_params(self): """ # Set up mock url = preprocess_url('/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -941,7 +982,7 @@ def test_head_database_all_params(self): # Invoke method response = _service.head_database( db, - headers={} + headers={}, ) # Check for correct operation @@ -964,9 +1005,11 @@ def test_head_database_value_error(self): """ # Set up mock url = preprocess_url('/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -976,7 +1019,7 @@ def test_head_database_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_database(**req_copy) @@ -989,7 +1032,8 @@ def test_head_database_value_error_with_retries(self): _service.disable_retries() self.test_head_database_value_error() -class TestGetAllDbs(): + +class TestGetAllDbs: """ Test Class for get_all_dbs """ @@ -1002,11 +1046,13 @@ def test_get_all_dbs_all_params(self): # Set up mock url = preprocess_url('/_all_dbs') mock_response = '["operation_response"]' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values descending = False @@ -1022,14 +1068,14 @@ def test_get_all_dbs_all_params(self): limit=limit, skip=skip, start_key=start_key, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'descending={}'.format('true' if descending else 'false') in query_string assert 'end_key={}'.format(end_key) in query_string @@ -1054,16 +1100,17 @@ def test_get_all_dbs_required_params(self): # Set up mock url = preprocess_url('/_all_dbs') mock_response = '["operation_response"]' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_all_dbs() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -1077,7 +1124,8 @@ def test_get_all_dbs_required_params_with_retries(self): _service.disable_retries() self.test_get_all_dbs_required_params() -class TestPostDbsInfo(): + +class TestPostDbsInfo: """ Test Class for post_dbs_info """ @@ -1090,11 +1138,13 @@ def test_post_dbs_info_all_params(self): # Set up mock url = preprocess_url('/_dbs_info') mock_response = '[{"error": "error", "info": {"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values keys = ['testString'] @@ -1102,7 +1152,7 @@ def test_post_dbs_info_all_params(self): # Invoke method response = _service.post_dbs_info( keys, - headers={} + headers={}, ) # Check for correct operation @@ -1132,11 +1182,13 @@ def test_post_dbs_info_value_error(self): # Set up mock url = preprocess_url('/_dbs_info') mock_response = '[{"error": "error", "info": {"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values keys = ['testString'] @@ -1146,7 +1198,7 @@ def test_post_dbs_info_value_error(self): "keys": keys, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_dbs_info(**req_copy) @@ -1159,7 +1211,8 @@ def test_post_dbs_info_value_error_with_retries(self): _service.disable_retries() self.test_post_dbs_info_value_error() -class TestDeleteDatabase(): + +class TestDeleteDatabase: """ Test Class for delete_database """ @@ -1172,11 +1225,13 @@ def test_delete_database_all_params(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"ok": true}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -1184,7 +1239,7 @@ def test_delete_database_all_params(self): # Invoke method response = _service.delete_database( db, - headers={} + headers={}, ) # Check for correct operation @@ -1208,11 +1263,13 @@ def test_delete_database_value_error(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"ok": true}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -1222,7 +1279,7 @@ def test_delete_database_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_database(**req_copy) @@ -1235,7 +1292,8 @@ def test_delete_database_value_error_with_retries(self): _service.disable_retries() self.test_delete_database_value_error() -class TestGetDatabaseInformation(): + +class TestGetDatabaseInformation: """ Test Class for get_database_information """ @@ -1248,11 +1306,13 @@ def test_get_database_information_all_params(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -1260,7 +1320,7 @@ def test_get_database_information_all_params(self): # Invoke method response = _service.get_database_information( db, - headers={} + headers={}, ) # Check for correct operation @@ -1284,11 +1344,13 @@ def test_get_database_information_value_error(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -1298,7 +1360,7 @@ def test_get_database_information_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_database_information(**req_copy) @@ -1311,7 +1373,8 @@ def test_get_database_information_value_error_with_retries(self): _service.disable_retries() self.test_get_database_information_value_error() -class TestPutDatabase(): + +class TestPutDatabase: """ Test Class for put_database """ @@ -1324,11 +1387,13 @@ def test_put_database_all_params(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values db = 'testString' @@ -1340,14 +1405,14 @@ def test_put_database_all_params(self): db, partitioned=partitioned, q=q, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'partitioned={}'.format('true' if partitioned else 'false') in query_string assert 'q={}'.format(q) in query_string @@ -1369,11 +1434,13 @@ def test_put_database_required_params(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values db = 'testString' @@ -1381,7 +1448,7 @@ def test_put_database_required_params(self): # Invoke method response = _service.put_database( db, - headers={} + headers={}, ) # Check for correct operation @@ -1405,11 +1472,13 @@ def test_put_database_value_error(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values db = 'testString' @@ -1419,7 +1488,7 @@ def test_put_database_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_database(**req_copy) @@ -1432,6 +1501,7 @@ def test_put_database_value_error_with_retries(self): _service.disable_retries() self.test_put_database_value_error() + # endregion ############################################################################## # End of Service: Databases @@ -1442,7 +1512,8 @@ def test_put_database_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -1469,7 +1540,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadDocument(): + +class TestHeadDocument: """ Test Class for head_document """ @@ -1481,9 +1553,11 @@ def test_head_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -1499,14 +1573,14 @@ def test_head_document_all_params(self): if_none_match=if_none_match, latest=latest, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'latest={}'.format('true' if latest else 'false') in query_string assert 'rev={}'.format(rev) in query_string @@ -1527,9 +1601,11 @@ def test_head_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -1539,7 +1615,7 @@ def test_head_document_required_params(self): response = _service.head_document( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -1562,9 +1638,11 @@ def test_head_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -1576,7 +1654,7 @@ def test_head_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_document(**req_copy) @@ -1589,7 +1667,8 @@ def test_head_document_value_error_with_retries(self): _service.disable_retries() self.test_head_document_value_error() -class TestPostDocument(): + +class TestPostDocument: """ Test Class for post_document """ @@ -1602,11 +1681,13 @@ def test_post_document_all_params(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -1655,14 +1736,14 @@ def test_post_document_all_params(self): document, content_type=content_type, batch=batch, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string # decompress gzip compressed request body @@ -1687,11 +1768,13 @@ def test_post_document_required_params(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -1736,7 +1819,7 @@ def test_post_document_required_params(self): response = _service.post_document( db, document, - headers={} + headers={}, ) # Check for correct operation @@ -1764,11 +1847,13 @@ def test_post_document_value_error(self): # Set up mock url = preprocess_url('/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -1815,7 +1900,7 @@ def test_post_document_value_error(self): "document": document, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_document(**req_copy) @@ -1828,7 +1913,8 @@ def test_post_document_value_error_with_retries(self): _service.disable_retries() self.test_post_document_value_error() -class TestPostAllDocs(): + +class TestPostAllDocs: """ Test Class for post_all_docs """ @@ -1841,11 +1927,13 @@ def test_post_all_docs_all_params(self): # Set up mock url = preprocess_url('/testString/_all_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -1879,7 +1967,7 @@ def test_post_all_docs_all_params(self): key=key, keys=keys, start_key=start_key, - headers={} + headers={}, ) # Check for correct operation @@ -1921,11 +2009,13 @@ def test_post_all_docs_value_error(self): # Set up mock url = preprocess_url('/testString/_all_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -1948,7 +2038,7 @@ def test_post_all_docs_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_all_docs(**req_copy) @@ -1961,7 +2051,8 @@ def test_post_all_docs_value_error_with_retries(self): _service.disable_retries() self.test_post_all_docs_value_error() -class TestPostAllDocsAsStream(): + +class TestPostAllDocsAsStream: """ Test Class for post_all_docs_as_stream """ @@ -1974,11 +2065,13 @@ def test_post_all_docs_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_all_docs') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -2012,7 +2105,7 @@ def test_post_all_docs_as_stream_all_params(self): key=key, keys=keys, start_key=start_key, - headers={} + headers={}, ) # Check for correct operation @@ -2060,11 +2153,13 @@ def test_post_all_docs_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_all_docs') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -2087,7 +2182,7 @@ def test_post_all_docs_as_stream_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_all_docs_as_stream(**req_copy) @@ -2100,7 +2195,8 @@ def test_post_all_docs_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_all_docs_as_stream_value_error() -class TestPostAllDocsQueries(): + +class TestPostAllDocsQueries: """ Test Class for post_all_docs_queries """ @@ -2113,11 +2209,13 @@ def test_post_all_docs_queries_all_params(self): # Set up mock url = preprocess_url('/testString/_all_docs/queries') mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -2143,7 +2241,7 @@ def test_post_all_docs_queries_all_params(self): response = _service.post_all_docs_queries( db, queries, - headers={} + headers={}, ) # Check for correct operation @@ -2173,11 +2271,13 @@ def test_post_all_docs_queries_value_error(self): # Set up mock url = preprocess_url('/testString/_all_docs/queries') mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -2205,7 +2305,7 @@ def test_post_all_docs_queries_value_error(self): "queries": queries, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_all_docs_queries(**req_copy) @@ -2218,7 +2318,8 @@ def test_post_all_docs_queries_value_error_with_retries(self): _service.disable_retries() self.test_post_all_docs_queries_value_error() -class TestPostAllDocsQueriesAsStream(): + +class TestPostAllDocsQueriesAsStream: """ Test Class for post_all_docs_queries_as_stream """ @@ -2231,11 +2332,13 @@ def test_post_all_docs_queries_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_all_docs/queries') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -2261,7 +2364,7 @@ def test_post_all_docs_queries_as_stream_all_params(self): response = _service.post_all_docs_queries_as_stream( db, queries, - headers={} + headers={}, ) # Check for correct operation @@ -2297,11 +2400,13 @@ def test_post_all_docs_queries_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_all_docs/queries') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -2329,7 +2434,7 @@ def test_post_all_docs_queries_as_stream_value_error(self): "queries": queries, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_all_docs_queries_as_stream(**req_copy) @@ -2342,7 +2447,8 @@ def test_post_all_docs_queries_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_all_docs_queries_as_stream_value_error() -class TestPostBulkDocs(): + +class TestPostBulkDocs: """ Test Class for post_bulk_docs """ @@ -2355,11 +2461,13 @@ def test_post_bulk_docs_all_params(self): # Set up mock url = preprocess_url('/testString/_bulk_docs') mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}]' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -2409,7 +2517,7 @@ def test_post_bulk_docs_all_params(self): response = _service.post_bulk_docs( db, bulk_docs, - headers={} + headers={}, ) # Check for correct operation @@ -2439,11 +2547,13 @@ def test_post_bulk_docs_value_error(self): # Set up mock url = preprocess_url('/testString/_bulk_docs') mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}]' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -2495,7 +2605,7 @@ def test_post_bulk_docs_value_error(self): "bulk_docs": bulk_docs, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_bulk_docs(**req_copy) @@ -2508,7 +2618,8 @@ def test_post_bulk_docs_value_error_with_retries(self): _service.disable_retries() self.test_post_bulk_docs_value_error() -class TestPostBulkGet(): + +class TestPostBulkGet: """ Test Class for post_bulk_get """ @@ -2521,11 +2632,13 @@ def test_post_bulk_get_all_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2549,14 +2662,14 @@ def test_post_bulk_get_all_params(self): att_encoding_info=att_encoding_info, latest=latest, revs=revs, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -2586,11 +2699,13 @@ def test_post_bulk_get_required_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2606,7 +2721,7 @@ def test_post_bulk_get_required_params(self): response = _service.post_bulk_get( db, docs, - headers={} + headers={}, ) # Check for correct operation @@ -2636,11 +2751,13 @@ def test_post_bulk_get_value_error(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2658,7 +2775,7 @@ def test_post_bulk_get_value_error(self): "docs": docs, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_bulk_get(**req_copy) @@ -2671,7 +2788,8 @@ def test_post_bulk_get_value_error_with_retries(self): _service.disable_retries() self.test_post_bulk_get_value_error() -class TestPostBulkGetAsMixed(): + +class TestPostBulkGetAsMixed: """ Test Class for post_bulk_get_as_mixed """ @@ -2684,11 +2802,13 @@ def test_post_bulk_get_as_mixed_all_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = 'This is a mock binary response.' - responses.add(responses.POST, - url, - body=mock_response, - content_type='multipart/mixed', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='multipart/mixed', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2712,14 +2832,14 @@ def test_post_bulk_get_as_mixed_all_params(self): att_encoding_info=att_encoding_info, latest=latest, revs=revs, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -2749,11 +2869,13 @@ def test_post_bulk_get_as_mixed_required_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = 'This is a mock binary response.' - responses.add(responses.POST, - url, - body=mock_response, - content_type='multipart/mixed', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='multipart/mixed', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2769,7 +2891,7 @@ def test_post_bulk_get_as_mixed_required_params(self): response = _service.post_bulk_get_as_mixed( db, docs, - headers={} + headers={}, ) # Check for correct operation @@ -2799,11 +2921,13 @@ def test_post_bulk_get_as_mixed_value_error(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = 'This is a mock binary response.' - responses.add(responses.POST, - url, - body=mock_response, - content_type='multipart/mixed', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='multipart/mixed', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2821,7 +2945,7 @@ def test_post_bulk_get_as_mixed_value_error(self): "docs": docs, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_bulk_get_as_mixed(**req_copy) @@ -2834,7 +2958,8 @@ def test_post_bulk_get_as_mixed_value_error_with_retries(self): _service.disable_retries() self.test_post_bulk_get_as_mixed_value_error() -class TestPostBulkGetAsRelated(): + +class TestPostBulkGetAsRelated: """ Test Class for post_bulk_get_as_related """ @@ -2847,11 +2972,13 @@ def test_post_bulk_get_as_related_all_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = 'This is a mock binary response.' - responses.add(responses.POST, - url, - body=mock_response, - content_type='multipart/related', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='multipart/related', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2875,14 +3002,14 @@ def test_post_bulk_get_as_related_all_params(self): att_encoding_info=att_encoding_info, latest=latest, revs=revs, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -2912,11 +3039,13 @@ def test_post_bulk_get_as_related_required_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = 'This is a mock binary response.' - responses.add(responses.POST, - url, - body=mock_response, - content_type='multipart/related', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='multipart/related', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2932,7 +3061,7 @@ def test_post_bulk_get_as_related_required_params(self): response = _service.post_bulk_get_as_related( db, docs, - headers={} + headers={}, ) # Check for correct operation @@ -2962,11 +3091,13 @@ def test_post_bulk_get_as_related_value_error(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = 'This is a mock binary response.' - responses.add(responses.POST, - url, - body=mock_response, - content_type='multipart/related', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='multipart/related', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -2984,7 +3115,7 @@ def test_post_bulk_get_as_related_value_error(self): "docs": docs, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_bulk_get_as_related(**req_copy) @@ -2997,7 +3128,8 @@ def test_post_bulk_get_as_related_value_error_with_retries(self): _service.disable_retries() self.test_post_bulk_get_as_related_value_error() -class TestPostBulkGetAsStream(): + +class TestPostBulkGetAsStream: """ Test Class for post_bulk_get_as_stream """ @@ -3010,11 +3142,13 @@ def test_post_bulk_get_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -3038,14 +3172,14 @@ def test_post_bulk_get_as_stream_all_params(self): att_encoding_info=att_encoding_info, latest=latest, revs=revs, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -3081,11 +3215,13 @@ def test_post_bulk_get_as_stream_required_params(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -3101,7 +3237,7 @@ def test_post_bulk_get_as_stream_required_params(self): response = _service.post_bulk_get_as_stream( db, docs, - headers={} + headers={}, ) # Check for correct operation @@ -3137,11 +3273,13 @@ def test_post_bulk_get_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_bulk_get') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} @@ -3159,7 +3297,7 @@ def test_post_bulk_get_as_stream_value_error(self): "docs": docs, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_bulk_get_as_stream(**req_copy) @@ -3172,7 +3310,8 @@ def test_post_bulk_get_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_bulk_get_as_stream_value_error() -class TestDeleteDocument(): + +class TestDeleteDocument: """ Test Class for delete_document """ @@ -3185,11 +3324,13 @@ def test_delete_document_all_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3205,14 +3346,14 @@ def test_delete_document_all_params(self): if_match=if_match, batch=batch, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string assert 'rev={}'.format(rev) in query_string @@ -3234,11 +3375,13 @@ def test_delete_document_required_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3248,7 +3391,7 @@ def test_delete_document_required_params(self): response = _service.delete_document( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -3272,11 +3415,13 @@ def test_delete_document_value_error(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3288,7 +3433,7 @@ def test_delete_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_document(**req_copy) @@ -3301,7 +3446,8 @@ def test_delete_document_value_error_with_retries(self): _service.disable_retries() self.test_delete_document_value_error() -class TestGetDocument(): + +class TestGetDocument: """ Test Class for get_document """ @@ -3314,11 +3460,13 @@ def test_get_document_all_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3350,14 +3498,14 @@ def test_get_document_all_params(self): rev=rev, revs=revs, revs_info=revs_info, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -3387,11 +3535,13 @@ def test_get_document_required_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3401,7 +3551,7 @@ def test_get_document_required_params(self): response = _service.get_document( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -3425,11 +3575,13 @@ def test_get_document_value_error(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3441,7 +3593,7 @@ def test_get_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_document(**req_copy) @@ -3454,7 +3606,8 @@ def test_get_document_value_error_with_retries(self): _service.disable_retries() self.test_get_document_value_error() -class TestGetDocumentAsMixed(): + +class TestGetDocumentAsMixed: """ Test Class for get_document_as_mixed """ @@ -3467,11 +3620,13 @@ def test_get_document_as_mixed_all_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='multipart/mixed', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='multipart/mixed', + status=200, + ) # Set up parameter values db = 'testString' @@ -3503,14 +3658,14 @@ def test_get_document_as_mixed_all_params(self): rev=rev, revs=revs, revs_info=revs_info, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -3540,11 +3695,13 @@ def test_get_document_as_mixed_required_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='multipart/mixed', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='multipart/mixed', + status=200, + ) # Set up parameter values db = 'testString' @@ -3554,7 +3711,7 @@ def test_get_document_as_mixed_required_params(self): response = _service.get_document_as_mixed( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -3578,11 +3735,13 @@ def test_get_document_as_mixed_value_error(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='multipart/mixed', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='multipart/mixed', + status=200, + ) # Set up parameter values db = 'testString' @@ -3594,7 +3753,7 @@ def test_get_document_as_mixed_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_document_as_mixed(**req_copy) @@ -3607,7 +3766,8 @@ def test_get_document_as_mixed_value_error_with_retries(self): _service.disable_retries() self.test_get_document_as_mixed_value_error() -class TestGetDocumentAsRelated(): + +class TestGetDocumentAsRelated: """ Test Class for get_document_as_related """ @@ -3620,11 +3780,13 @@ def test_get_document_as_related_all_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='multipart/related', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='multipart/related', + status=200, + ) # Set up parameter values db = 'testString' @@ -3656,14 +3818,14 @@ def test_get_document_as_related_all_params(self): rev=rev, revs=revs, revs_info=revs_info, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -3693,11 +3855,13 @@ def test_get_document_as_related_required_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='multipart/related', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='multipart/related', + status=200, + ) # Set up parameter values db = 'testString' @@ -3707,7 +3871,7 @@ def test_get_document_as_related_required_params(self): response = _service.get_document_as_related( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -3731,11 +3895,13 @@ def test_get_document_as_related_value_error(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='multipart/related', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='multipart/related', + status=200, + ) # Set up parameter values db = 'testString' @@ -3747,7 +3913,7 @@ def test_get_document_as_related_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_document_as_related(**req_copy) @@ -3760,7 +3926,8 @@ def test_get_document_as_related_value_error_with_retries(self): _service.disable_retries() self.test_get_document_as_related_value_error() -class TestGetDocumentAsStream(): + +class TestGetDocumentAsStream: """ Test Class for get_document_as_stream """ @@ -3773,11 +3940,13 @@ def test_get_document_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3809,14 +3978,14 @@ def test_get_document_as_stream_all_params(self): rev=rev, revs=revs, revs_info=revs_info, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -3852,11 +4021,13 @@ def test_get_document_as_stream_required_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3866,7 +4037,7 @@ def test_get_document_as_stream_required_params(self): response = _service.get_document_as_stream( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -3896,11 +4067,13 @@ def test_get_document_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -3912,7 +4085,7 @@ def test_get_document_as_stream_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_document_as_stream(**req_copy) @@ -3925,7 +4098,8 @@ def test_get_document_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_get_document_as_stream_value_error() -class TestPutDocument(): + +class TestPutDocument: """ Test Class for put_document """ @@ -3938,11 +4112,13 @@ def test_put_document_all_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -3999,14 +4175,14 @@ def test_put_document_all_params(self): batch=batch, new_edits=new_edits, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string assert 'new_edits={}'.format('true' if new_edits else 'false') in query_string @@ -4033,11 +4209,13 @@ def test_put_document_required_params(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -4084,7 +4262,7 @@ def test_put_document_required_params(self): db, doc_id, document, - headers={} + headers={}, ) # Check for correct operation @@ -4112,11 +4290,13 @@ def test_put_document_value_error(self): # Set up mock url = preprocess_url('/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -4165,7 +4345,7 @@ def test_put_document_value_error(self): "document": document, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_document(**req_copy) @@ -4178,6 +4358,7 @@ def test_put_document_value_error_with_retries(self): _service.disable_retries() self.test_put_document_value_error() + # endregion ############################################################################## # End of Service: Documents @@ -4188,7 +4369,8 @@ def test_put_document_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -4215,7 +4397,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadDesignDocument(): + +class TestHeadDesignDocument: """ Test Class for head_design_document """ @@ -4227,9 +4410,11 @@ def test_head_design_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -4241,7 +4426,7 @@ def test_head_design_document_all_params(self): db, ddoc, if_none_match=if_none_match, - headers={} + headers={}, ) # Check for correct operation @@ -4264,9 +4449,11 @@ def test_head_design_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -4276,7 +4463,7 @@ def test_head_design_document_required_params(self): response = _service.head_design_document( db, ddoc, - headers={} + headers={}, ) # Check for correct operation @@ -4299,9 +4486,11 @@ def test_head_design_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -4313,7 +4502,7 @@ def test_head_design_document_value_error(self): "ddoc": ddoc, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_design_document(**req_copy) @@ -4326,7 +4515,8 @@ def test_head_design_document_value_error_with_retries(self): _service.disable_retries() self.test_head_design_document_value_error() -class TestDeleteDesignDocument(): + +class TestDeleteDesignDocument: """ Test Class for delete_design_document """ @@ -4339,11 +4529,13 @@ def test_delete_design_document_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4359,14 +4551,14 @@ def test_delete_design_document_all_params(self): if_match=if_match, batch=batch, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string assert 'rev={}'.format(rev) in query_string @@ -4388,11 +4580,13 @@ def test_delete_design_document_required_params(self): # Set up mock url = preprocess_url('/testString/_design/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4402,7 +4596,7 @@ def test_delete_design_document_required_params(self): response = _service.delete_design_document( db, ddoc, - headers={} + headers={}, ) # Check for correct operation @@ -4426,11 +4620,13 @@ def test_delete_design_document_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4442,7 +4638,7 @@ def test_delete_design_document_value_error(self): "ddoc": ddoc, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_design_document(**req_copy) @@ -4455,7 +4651,8 @@ def test_delete_design_document_value_error_with_retries(self): _service.disable_retries() self.test_delete_design_document_value_error() -class TestGetDesignDocument(): + +class TestGetDesignDocument: """ Test Class for get_design_document """ @@ -4468,11 +4665,13 @@ 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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4504,14 +4703,14 @@ def test_get_design_document_all_params(self): rev=rev, revs=revs, revs_info=revs_info, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -4541,11 +4740,13 @@ 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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4555,7 +4756,7 @@ def test_get_design_document_required_params(self): response = _service.get_design_document( db, ddoc, - headers={} + headers={}, ) # Check for correct operation @@ -4579,11 +4780,13 @@ 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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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"}}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4595,7 +4798,7 @@ def test_get_design_document_value_error(self): "ddoc": ddoc, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_design_document(**req_copy) @@ -4608,7 +4811,8 @@ def test_get_design_document_value_error_with_retries(self): _service.disable_retries() self.test_get_design_document_value_error() -class TestPutDesignDocument(): + +class TestPutDesignDocument: """ Test Class for put_design_document """ @@ -4621,11 +4825,13 @@ def test_put_design_document_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -4712,14 +4918,14 @@ def test_put_design_document_all_params(self): batch=batch, new_edits=new_edits, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string assert 'new_edits={}'.format('true' if new_edits else 'false') in query_string @@ -4748,11 +4954,13 @@ def test_put_design_document_required_params(self): # Set up mock url = preprocess_url('/testString/_design/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -4831,7 +5039,7 @@ def test_put_design_document_required_params(self): db, ddoc, design_document, - headers={} + headers={}, ) # Check for correct operation @@ -4861,11 +5069,13 @@ def test_put_design_document_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -4946,7 +5156,7 @@ def test_put_design_document_value_error(self): "design_document": design_document, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_design_document(**req_copy) @@ -4959,7 +5169,8 @@ def test_put_design_document_value_error_with_retries(self): _service.disable_retries() self.test_put_design_document_value_error() -class TestGetDesignDocumentInformation(): + +class TestGetDesignDocumentInformation: """ Test Class for get_design_document_information """ @@ -4972,11 +5183,13 @@ def test_get_design_document_information_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_info') mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "waiting_clients": 0, "waiting_commit": true}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -4986,7 +5199,7 @@ def test_get_design_document_information_all_params(self): response = _service.get_design_document_information( db, ddoc, - headers={} + headers={}, ) # Check for correct operation @@ -5010,11 +5223,13 @@ def test_get_design_document_information_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_info') mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "waiting_clients": 0, "waiting_commit": true}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5026,7 +5241,7 @@ def test_get_design_document_information_value_error(self): "ddoc": ddoc, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_design_document_information(**req_copy) @@ -5039,7 +5254,8 @@ def test_get_design_document_information_value_error_with_retries(self): _service.disable_retries() self.test_get_design_document_information_value_error() -class TestPostDesignDocs(): + +class TestPostDesignDocs: """ Test Class for post_design_docs """ @@ -5052,11 +5268,13 @@ def test_post_design_docs_all_params(self): # Set up mock url = preprocess_url('/testString/_design_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5092,7 +5310,7 @@ def test_post_design_docs_all_params(self): keys=keys, start_key=start_key, accept=accept, - headers={} + headers={}, ) # Check for correct operation @@ -5134,11 +5352,13 @@ def test_post_design_docs_required_params(self): # Set up mock url = preprocess_url('/testString/_design_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5172,7 +5392,7 @@ def test_post_design_docs_required_params(self): key=key, keys=keys, start_key=start_key, - headers={} + headers={}, ) # Check for correct operation @@ -5214,11 +5434,13 @@ def test_post_design_docs_value_error(self): # Set up mock url = preprocess_url('/testString/_design_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5241,7 +5463,7 @@ def test_post_design_docs_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_design_docs(**req_copy) @@ -5254,7 +5476,8 @@ def test_post_design_docs_value_error_with_retries(self): _service.disable_retries() self.test_post_design_docs_value_error() -class TestPostDesignDocsQueries(): + +class TestPostDesignDocsQueries: """ Test Class for post_design_docs_queries """ @@ -5267,11 +5490,13 @@ def test_post_design_docs_queries_all_params(self): # Set up mock url = preprocess_url('/testString/_design_docs/queries') mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -5299,7 +5524,7 @@ def test_post_design_docs_queries_all_params(self): db, queries, accept=accept, - headers={} + headers={}, ) # Check for correct operation @@ -5329,11 +5554,13 @@ def test_post_design_docs_queries_required_params(self): # Set up mock url = preprocess_url('/testString/_design_docs/queries') mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -5359,7 +5586,7 @@ def test_post_design_docs_queries_required_params(self): response = _service.post_design_docs_queries( db, queries, - headers={} + headers={}, ) # Check for correct operation @@ -5389,11 +5616,13 @@ def test_post_design_docs_queries_value_error(self): # Set up mock url = preprocess_url('/testString/_design_docs/queries') mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a AllDocsQuery model all_docs_query_model = {} @@ -5421,7 +5650,7 @@ def test_post_design_docs_queries_value_error(self): "queries": queries, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_design_docs_queries(**req_copy) @@ -5434,6 +5663,7 @@ def test_post_design_docs_queries_value_error_with_retries(self): _service.disable_retries() self.test_post_design_docs_queries_value_error() + # endregion ############################################################################## # End of Service: DesignDocuments @@ -5444,7 +5674,8 @@ def test_post_design_docs_queries_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -5471,7 +5702,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestPostView(): + +class TestPostView: """ Test Class for post_view """ @@ -5484,11 +5716,13 @@ def test_post_view_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5540,7 +5774,7 @@ def test_post_view_all_params(self): start_key=start_key, start_key_doc_id=start_key_doc_id, update=update, - headers={} + headers={}, ) # Check for correct operation @@ -5589,11 +5823,13 @@ def test_post_view_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5627,7 +5863,7 @@ def test_post_view_value_error(self): "view": view, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_view(**req_copy) @@ -5640,7 +5876,8 @@ def test_post_view_value_error_with_retries(self): _service.disable_retries() self.test_post_view_value_error() -class TestPostViewAsStream(): + +class TestPostViewAsStream: """ Test Class for post_view_as_stream """ @@ -5653,11 +5890,13 @@ def test_post_view_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5709,7 +5948,7 @@ def test_post_view_as_stream_all_params(self): start_key=start_key, start_key_doc_id=start_key_doc_id, update=update, - headers={} + headers={}, ) # Check for correct operation @@ -5764,11 +6003,13 @@ def test_post_view_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -5802,7 +6043,7 @@ def test_post_view_as_stream_value_error(self): "view": view, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_view_as_stream(**req_copy) @@ -5815,7 +6056,8 @@ def test_post_view_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_view_as_stream_value_error() -class TestPostViewQueries(): + +class TestPostViewQueries: """ Test Class for post_view_queries """ @@ -5828,11 +6070,13 @@ def test_post_view_queries_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a ViewQuery model view_query_model = {} @@ -5869,7 +6113,7 @@ def test_post_view_queries_all_params(self): ddoc, view, queries, - headers={} + headers={}, ) # Check for correct operation @@ -5899,11 +6143,13 @@ def test_post_view_queries_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a ViewQuery model view_query_model = {} @@ -5942,7 +6188,7 @@ def test_post_view_queries_value_error(self): "queries": queries, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_view_queries(**req_copy) @@ -5955,7 +6201,8 @@ def test_post_view_queries_value_error_with_retries(self): _service.disable_retries() self.test_post_view_queries_value_error() -class TestPostViewQueriesAsStream(): + +class TestPostViewQueriesAsStream: """ Test Class for post_view_queries_as_stream """ @@ -5968,11 +6215,13 @@ def test_post_view_queries_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a ViewQuery model view_query_model = {} @@ -6009,7 +6258,7 @@ def test_post_view_queries_as_stream_all_params(self): ddoc, view, queries, - headers={} + headers={}, ) # Check for correct operation @@ -6045,11 +6294,13 @@ def test_post_view_queries_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a ViewQuery model view_query_model = {} @@ -6088,7 +6339,7 @@ def test_post_view_queries_as_stream_value_error(self): "queries": queries, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_view_queries_as_stream(**req_copy) @@ -6101,6 +6352,7 @@ def test_post_view_queries_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_view_queries_as_stream_value_error() + # endregion ############################################################################## # End of Service: Views @@ -6111,7 +6363,8 @@ def test_post_view_queries_as_stream_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -6138,7 +6391,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestGetPartitionInformation(): + +class TestGetPartitionInformation: """ Test Class for get_partition_information """ @@ -6151,11 +6405,13 @@ def test_get_partition_information_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString') mock_response = '{"db_name": "db_name", "doc_count": 0, "doc_del_count": 0, "partition": "partition", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 0}, "sizes": {"active": 0, "external": 0}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6165,7 +6421,7 @@ def test_get_partition_information_all_params(self): response = _service.get_partition_information( db, partition_key, - headers={} + headers={}, ) # Check for correct operation @@ -6189,11 +6445,13 @@ def test_get_partition_information_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString') mock_response = '{"db_name": "db_name", "doc_count": 0, "doc_del_count": 0, "partition": "partition", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 0}, "sizes": {"active": 0, "external": 0}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6205,7 +6463,7 @@ def test_get_partition_information_value_error(self): "partition_key": partition_key, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_partition_information(**req_copy) @@ -6218,7 +6476,8 @@ def test_get_partition_information_value_error_with_retries(self): _service.disable_retries() self.test_get_partition_information_value_error() -class TestPostPartitionAllDocs(): + +class TestPostPartitionAllDocs: """ Test Class for post_partition_all_docs """ @@ -6231,11 +6490,13 @@ def test_post_partition_all_docs_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6271,7 +6532,7 @@ def test_post_partition_all_docs_all_params(self): key=key, keys=keys, start_key=start_key, - headers={} + headers={}, ) # Check for correct operation @@ -6313,11 +6574,13 @@ def test_post_partition_all_docs_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6342,7 +6605,7 @@ def test_post_partition_all_docs_value_error(self): "partition_key": partition_key, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_all_docs(**req_copy) @@ -6355,7 +6618,8 @@ def test_post_partition_all_docs_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_all_docs_value_error() -class TestPostPartitionAllDocsAsStream(): + +class TestPostPartitionAllDocsAsStream: """ Test Class for post_partition_all_docs_as_stream """ @@ -6368,11 +6632,13 @@ def test_post_partition_all_docs_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6408,7 +6674,7 @@ def test_post_partition_all_docs_as_stream_all_params(self): key=key, keys=keys, start_key=start_key, - headers={} + headers={}, ) # Check for correct operation @@ -6456,11 +6722,13 @@ def test_post_partition_all_docs_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6485,7 +6753,7 @@ def test_post_partition_all_docs_as_stream_value_error(self): "partition_key": partition_key, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_all_docs_as_stream(**req_copy) @@ -6498,7 +6766,8 @@ def test_post_partition_all_docs_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_all_docs_as_stream_value_error() -class TestPostPartitionSearch(): + +class TestPostPartitionSearch: """ Test Class for post_partition_search """ @@ -6511,11 +6780,13 @@ def test_post_partition_search_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6553,7 +6824,7 @@ def test_post_partition_search_all_params(self): limit=limit, sort=sort, stale=stale, - headers={} + headers={}, ) # Check for correct operation @@ -6594,11 +6865,13 @@ def test_post_partition_search_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6627,7 +6900,7 @@ def test_post_partition_search_value_error(self): "query": query, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_search(**req_copy) @@ -6640,7 +6913,8 @@ def test_post_partition_search_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_search_value_error() -class TestPostPartitionSearchAsStream(): + +class TestPostPartitionSearchAsStream: """ Test Class for post_partition_search_as_stream """ @@ -6653,11 +6927,13 @@ def test_post_partition_search_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6695,7 +6971,7 @@ def test_post_partition_search_as_stream_all_params(self): limit=limit, sort=sort, stale=stale, - headers={} + headers={}, ) # Check for correct operation @@ -6742,11 +7018,13 @@ def test_post_partition_search_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6775,7 +7053,7 @@ def test_post_partition_search_as_stream_value_error(self): "query": query, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_search_as_stream(**req_copy) @@ -6788,7 +7066,8 @@ def test_post_partition_search_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_search_as_stream_value_error() -class TestPostPartitionView(): + +class TestPostPartitionView: """ Test Class for post_partition_view """ @@ -6801,11 +7080,13 @@ def test_post_partition_view_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6857,7 +7138,7 @@ def test_post_partition_view_all_params(self): start_key=start_key, start_key_doc_id=start_key_doc_id, update=update, - headers={} + headers={}, ) # Check for correct operation @@ -6905,11 +7186,13 @@ def test_post_partition_view_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -6944,7 +7227,7 @@ def test_post_partition_view_value_error(self): "view": view, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_view(**req_copy) @@ -6957,7 +7240,8 @@ def test_post_partition_view_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_view_value_error() -class TestPostPartitionViewAsStream(): + +class TestPostPartitionViewAsStream: """ Test Class for post_partition_view_as_stream """ @@ -6970,11 +7254,13 @@ def test_post_partition_view_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7026,7 +7312,7 @@ def test_post_partition_view_as_stream_all_params(self): start_key=start_key, start_key_doc_id=start_key_doc_id, update=update, - headers={} + headers={}, ) # Check for correct operation @@ -7080,11 +7366,13 @@ def test_post_partition_view_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7119,7 +7407,7 @@ def test_post_partition_view_as_stream_value_error(self): "view": view, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_view_as_stream(**req_copy) @@ -7132,7 +7420,8 @@ def test_post_partition_view_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_view_as_stream_value_error() -class TestPostPartitionFind(): + +class TestPostPartitionFind: """ Test Class for post_partition_find """ @@ -7145,11 +7434,13 @@ def test_post_partition_find_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_find') mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7181,7 +7472,7 @@ def test_post_partition_find_all_params(self): stable=stable, update=update, use_index=use_index, - headers={} + headers={}, ) # Check for correct operation @@ -7221,11 +7512,13 @@ def test_post_partition_find_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_find') mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7249,7 +7542,7 @@ def test_post_partition_find_value_error(self): "selector": selector, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_find(**req_copy) @@ -7262,7 +7555,8 @@ def test_post_partition_find_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_find_value_error() -class TestPostPartitionFindAsStream(): + +class TestPostPartitionFindAsStream: """ Test Class for post_partition_find_as_stream """ @@ -7275,11 +7569,13 @@ def test_post_partition_find_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_find') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7311,7 +7607,7 @@ def test_post_partition_find_as_stream_all_params(self): stable=stable, update=update, use_index=use_index, - headers={} + headers={}, ) # Check for correct operation @@ -7357,11 +7653,13 @@ def test_post_partition_find_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_partition/testString/_find') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7385,7 +7683,7 @@ def test_post_partition_find_as_stream_value_error(self): "selector": selector, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_partition_find_as_stream(**req_copy) @@ -7398,6 +7696,7 @@ def test_post_partition_find_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_partition_find_as_stream_value_error() + # endregion ############################################################################## # End of Service: PartitionedDatabases @@ -7408,7 +7707,8 @@ def test_post_partition_find_as_stream_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -7435,7 +7735,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestPostExplain(): + +class TestPostExplain: """ Test Class for post_explain """ @@ -7448,11 +7749,13 @@ def test_post_explain_all_params(self): # Set up mock url = preprocess_url('/testString/_explain') mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7484,7 +7787,7 @@ def test_post_explain_all_params(self): update=update, use_index=use_index, r=r, - headers={} + headers={}, ) # Check for correct operation @@ -7525,11 +7828,13 @@ def test_post_explain_value_error(self): # Set up mock url = preprocess_url('/testString/_explain') mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7552,7 +7857,7 @@ def test_post_explain_value_error(self): "selector": selector, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_explain(**req_copy) @@ -7565,7 +7870,8 @@ def test_post_explain_value_error_with_retries(self): _service.disable_retries() self.test_post_explain_value_error() -class TestPostFind(): + +class TestPostFind: """ Test Class for post_find """ @@ -7578,11 +7884,13 @@ def test_post_find_all_params(self): # Set up mock url = preprocess_url('/testString/_find') mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7614,7 +7922,7 @@ def test_post_find_all_params(self): update=update, use_index=use_index, r=r, - headers={} + headers={}, ) # Check for correct operation @@ -7655,11 +7963,13 @@ def test_post_find_value_error(self): # Set up mock url = preprocess_url('/testString/_find') mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7682,7 +7992,7 @@ def test_post_find_value_error(self): "selector": selector, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_find(**req_copy) @@ -7695,7 +8005,8 @@ def test_post_find_value_error_with_retries(self): _service.disable_retries() self.test_post_find_value_error() -class TestPostFindAsStream(): + +class TestPostFindAsStream: """ Test Class for post_find_as_stream """ @@ -7708,11 +8019,13 @@ def test_post_find_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_find') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7744,7 +8057,7 @@ def test_post_find_as_stream_all_params(self): update=update, use_index=use_index, r=r, - headers={} + headers={}, ) # Check for correct operation @@ -7791,11 +8104,13 @@ def test_post_find_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_find') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7818,7 +8133,7 @@ def test_post_find_as_stream_value_error(self): "selector": selector, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_find_as_stream(**req_copy) @@ -7831,7 +8146,8 @@ def test_post_find_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_find_as_stream_value_error() -class TestGetIndexesInformation(): + +class TestGetIndexesInformation: """ Test Class for get_indexes_information """ @@ -7844,11 +8160,13 @@ def test_get_indexes_information_all_params(self): # Set up mock url = preprocess_url('/testString/_index') mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7856,7 +8174,7 @@ def test_get_indexes_information_all_params(self): # Invoke method response = _service.get_indexes_information( db, - headers={} + headers={}, ) # Check for correct operation @@ -7880,11 +8198,13 @@ def test_get_indexes_information_value_error(self): # Set up mock url = preprocess_url('/testString/_index') mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -7894,7 +8214,7 @@ def test_get_indexes_information_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_indexes_information(**req_copy) @@ -7907,7 +8227,8 @@ def test_get_indexes_information_value_error_with_retries(self): _service.disable_retries() self.test_get_indexes_information_value_error() -class TestPostIndex(): + +class TestPostIndex: """ Test Class for post_index """ @@ -7920,11 +8241,13 @@ def test_post_index_all_params(self): # Set up mock url = preprocess_url('/testString/_index') mock_response = '{"id": "id", "name": "name", "result": "created"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a Analyzer model analyzer_model = {} @@ -7968,7 +8291,7 @@ def test_post_index_all_params(self): name=name, partitioned=partitioned, type=type, - headers={} + headers={}, ) # Check for correct operation @@ -8003,11 +8326,13 @@ def test_post_index_value_error(self): # Set up mock url = preprocess_url('/testString/_index') mock_response = '{"id": "id", "name": "name", "result": "created"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a Analyzer model analyzer_model = {} @@ -8048,7 +8373,7 @@ def test_post_index_value_error(self): "index": index, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_index(**req_copy) @@ -8061,7 +8386,8 @@ def test_post_index_value_error_with_retries(self): _service.disable_retries() self.test_post_index_value_error() -class TestDeleteIndex(): + +class TestDeleteIndex: """ Test Class for delete_index """ @@ -8074,11 +8400,13 @@ def test_delete_index_all_params(self): # Set up mock url = preprocess_url('/testString/_index/_design/testString/json/testString') mock_response = '{"ok": true}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8092,7 +8420,7 @@ def test_delete_index_all_params(self): ddoc, type, index, - headers={} + headers={}, ) # Check for correct operation @@ -8116,11 +8444,13 @@ def test_delete_index_value_error(self): # Set up mock url = preprocess_url('/testString/_index/_design/testString/json/testString') mock_response = '{"ok": true}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8136,7 +8466,7 @@ def test_delete_index_value_error(self): "index": index, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_index(**req_copy) @@ -8149,6 +8479,7 @@ def test_delete_index_value_error_with_retries(self): _service.disable_retries() self.test_delete_index_value_error() + # endregion ############################################################################## # End of Service: Queries @@ -8159,7 +8490,8 @@ def test_delete_index_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -8186,7 +8518,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestPostSearchAnalyze(): + +class TestPostSearchAnalyze: """ Test Class for post_search_analyze """ @@ -8199,11 +8532,13 @@ def test_post_search_analyze_all_params(self): # Set up mock url = preprocess_url('/_search_analyze') mock_response = '{"tokens": ["tokens"]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values analyzer = 'arabic' @@ -8213,7 +8548,7 @@ def test_post_search_analyze_all_params(self): response = _service.post_search_analyze( analyzer, text, - headers={} + headers={}, ) # Check for correct operation @@ -8244,11 +8579,13 @@ def test_post_search_analyze_value_error(self): # Set up mock url = preprocess_url('/_search_analyze') mock_response = '{"tokens": ["tokens"]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values analyzer = 'arabic' @@ -8260,7 +8597,7 @@ def test_post_search_analyze_value_error(self): "text": text, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_search_analyze(**req_copy) @@ -8273,7 +8610,8 @@ def test_post_search_analyze_value_error_with_retries(self): _service.disable_retries() self.test_post_search_analyze_value_error() -class TestPostSearch(): + +class TestPostSearch: """ Test Class for post_search """ @@ -8286,11 +8624,13 @@ def test_post_search_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8338,7 +8678,7 @@ def test_post_search_all_params(self): group_limit=group_limit, group_sort=group_sort, ranges=ranges, - headers={} + headers={}, ) # Check for correct operation @@ -8385,11 +8725,13 @@ def test_post_search_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8422,7 +8764,7 @@ def test_post_search_value_error(self): "query": query, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_search(**req_copy) @@ -8435,7 +8777,8 @@ def test_post_search_value_error_with_retries(self): _service.disable_retries() self.test_post_search_value_error() -class TestPostSearchAsStream(): + +class TestPostSearchAsStream: """ Test Class for post_search_as_stream """ @@ -8448,11 +8791,13 @@ def test_post_search_as_stream_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8500,7 +8845,7 @@ def test_post_search_as_stream_all_params(self): group_limit=group_limit, group_sort=group_sort, ranges=ranges, - headers={} + headers={}, ) # Check for correct operation @@ -8553,11 +8898,13 @@ def test_post_search_as_stream_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') mock_response = '{"foo": "this is a mock response for JSON streaming"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8590,7 +8937,7 @@ def test_post_search_as_stream_value_error(self): "query": query, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_search_as_stream(**req_copy) @@ -8603,7 +8950,8 @@ def test_post_search_as_stream_value_error_with_retries(self): _service.disable_retries() self.test_post_search_as_stream_value_error() -class TestGetSearchInfo(): + +class TestGetSearchInfo: """ Test Class for get_search_info """ @@ -8616,11 +8964,13 @@ def test_get_search_info_all_params(self): # Set up mock url = preprocess_url('/testString/_design/testString/_search_info/testString') mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8632,7 +8982,7 @@ def test_get_search_info_all_params(self): db, ddoc, index, - headers={} + headers={}, ) # Check for correct operation @@ -8656,11 +9006,13 @@ def test_get_search_info_value_error(self): # Set up mock url = preprocess_url('/testString/_design/testString/_search_info/testString') mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -8674,7 +9026,7 @@ def test_get_search_info_value_error(self): "index": index, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_search_info(**req_copy) @@ -8687,6 +9039,7 @@ def test_get_search_info_value_error_with_retries(self): _service.disable_retries() self.test_get_search_info_value_error() + # endregion ############################################################################## # End of Service: Searches @@ -8697,7 +9050,8 @@ def test_get_search_info_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -8724,7 +9078,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadReplicationDocument(): + +class TestHeadReplicationDocument: """ Test Class for head_replication_document """ @@ -8736,9 +9091,11 @@ def test_head_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -8748,7 +9105,7 @@ def test_head_replication_document_all_params(self): response = _service.head_replication_document( doc_id, if_none_match=if_none_match, - headers={} + headers={}, ) # Check for correct operation @@ -8771,9 +9128,11 @@ def test_head_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -8781,7 +9140,7 @@ def test_head_replication_document_required_params(self): # Invoke method response = _service.head_replication_document( doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -8804,9 +9163,11 @@ def test_head_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -8816,7 +9177,7 @@ def test_head_replication_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_replication_document(**req_copy) @@ -8829,7 +9190,8 @@ def test_head_replication_document_value_error_with_retries(self): _service.disable_retries() self.test_head_replication_document_value_error() -class TestHeadSchedulerDocument(): + +class TestHeadSchedulerDocument: """ Test Class for head_scheduler_document """ @@ -8841,9 +9203,11 @@ def test_head_scheduler_document_all_params(self): """ # Set up mock url = preprocess_url('/_scheduler/docs/_replicator/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -8851,7 +9215,7 @@ def test_head_scheduler_document_all_params(self): # Invoke method response = _service.head_scheduler_document( doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -8874,9 +9238,11 @@ def test_head_scheduler_document_value_error(self): """ # Set up mock url = preprocess_url('/_scheduler/docs/_replicator/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -8886,7 +9252,7 @@ def test_head_scheduler_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_scheduler_document(**req_copy) @@ -8899,7 +9265,8 @@ def test_head_scheduler_document_value_error_with_retries(self): _service.disable_retries() self.test_head_scheduler_document_value_error() -class TestHeadSchedulerJob(): + +class TestHeadSchedulerJob: """ Test Class for head_scheduler_job """ @@ -8911,9 +9278,11 @@ def test_head_scheduler_job_all_params(self): """ # Set up mock url = preprocess_url('/_scheduler/jobs/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values job_id = 'testString' @@ -8921,7 +9290,7 @@ def test_head_scheduler_job_all_params(self): # Invoke method response = _service.head_scheduler_job( job_id, - headers={} + headers={}, ) # Check for correct operation @@ -8944,9 +9313,11 @@ def test_head_scheduler_job_value_error(self): """ # Set up mock url = preprocess_url('/_scheduler/jobs/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values job_id = 'testString' @@ -8956,7 +9327,7 @@ def test_head_scheduler_job_value_error(self): "job_id": job_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_scheduler_job(**req_copy) @@ -8969,7 +9340,8 @@ def test_head_scheduler_job_value_error_with_retries(self): _service.disable_retries() self.test_head_scheduler_job_value_error() -class TestDeleteReplicationDocument(): + +class TestDeleteReplicationDocument: """ Test Class for delete_replication_document """ @@ -8982,11 +9354,13 @@ def test_delete_replication_document_all_params(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9000,14 +9374,14 @@ def test_delete_replication_document_all_params(self): if_match=if_match, batch=batch, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string assert 'rev={}'.format(rev) in query_string @@ -9029,11 +9403,13 @@ def test_delete_replication_document_required_params(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9041,7 +9417,7 @@ def test_delete_replication_document_required_params(self): # Invoke method response = _service.delete_replication_document( doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -9065,11 +9441,13 @@ def test_delete_replication_document_value_error(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9079,7 +9457,7 @@ def test_delete_replication_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_replication_document(**req_copy) @@ -9092,7 +9470,8 @@ def test_delete_replication_document_value_error_with_retries(self): _service.disable_retries() self.test_delete_replication_document_value_error() -class TestGetReplicationDocument(): + +class TestGetReplicationDocument: """ Test Class for get_replication_document """ @@ -9105,11 +9484,13 @@ def test_get_replication_document_all_params(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9139,14 +9520,14 @@ def test_get_replication_document_all_params(self): rev=rev, revs=revs, revs_info=revs_info, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -9176,11 +9557,13 @@ def test_get_replication_document_required_params(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9188,7 +9571,7 @@ def test_get_replication_document_required_params(self): # Invoke method response = _service.get_replication_document( doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -9212,11 +9595,13 @@ def test_get_replication_document_value_error(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9226,7 +9611,7 @@ def test_get_replication_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_replication_document(**req_copy) @@ -9239,7 +9624,8 @@ def test_get_replication_document_value_error_with_retries(self): _service.disable_retries() self.test_get_replication_document_value_error() -class TestPutReplicationDocument(): + +class TestPutReplicationDocument: """ Test Class for put_replication_document """ @@ -9252,11 +9638,13 @@ def test_put_replication_document_all_params(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -9365,14 +9753,14 @@ def test_put_replication_document_all_params(self): batch=batch, new_edits=new_edits, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string assert 'new_edits={}'.format('true' if new_edits else 'false') in query_string @@ -9401,11 +9789,13 @@ def test_put_replication_document_required_params(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -9506,7 +9896,7 @@ def test_put_replication_document_required_params(self): response = _service.put_replication_document( doc_id, replication_document, - headers={} + headers={}, ) # Check for correct operation @@ -9536,11 +9926,13 @@ def test_put_replication_document_value_error(self): # Set up mock url = preprocess_url('/_replicator/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -9643,7 +10035,7 @@ def test_put_replication_document_value_error(self): "replication_document": replication_document, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_replication_document(**req_copy) @@ -9656,7 +10048,8 @@ def test_put_replication_document_value_error_with_retries(self): _service.disable_retries() self.test_put_replication_document_value_error() -class TestGetSchedulerDocs(): + +class TestGetSchedulerDocs: """ Test Class for get_scheduler_docs """ @@ -9669,11 +10062,13 @@ def test_get_scheduler_docs_all_params(self): # Set up mock url = preprocess_url('/_scheduler/docs') mock_response = '{"total_rows": 0, "docs": [{"database": "database", "doc_id": "doc_id", "error_count": 0, "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "last_updated": "2019-01-01T12:00:00.000Z", "node": "node", "source": "source", "source_proxy": "source_proxy", "start_time": "2019-01-01T12:00:00.000Z", "state": "initializing", "target": "target", "target_proxy": "target_proxy"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values limit = 0 @@ -9685,14 +10080,14 @@ def test_get_scheduler_docs_all_params(self): limit=limit, skip=skip, states=states, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'limit={}'.format(limit) in query_string assert 'skip={}'.format(skip) in query_string @@ -9715,16 +10110,17 @@ def test_get_scheduler_docs_required_params(self): # Set up mock url = preprocess_url('/_scheduler/docs') mock_response = '{"total_rows": 0, "docs": [{"database": "database", "doc_id": "doc_id", "error_count": 0, "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "last_updated": "2019-01-01T12:00:00.000Z", "node": "node", "source": "source", "source_proxy": "source_proxy", "start_time": "2019-01-01T12:00:00.000Z", "state": "initializing", "target": "target", "target_proxy": "target_proxy"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_scheduler_docs() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -9738,7 +10134,8 @@ def test_get_scheduler_docs_required_params_with_retries(self): _service.disable_retries() self.test_get_scheduler_docs_required_params() -class TestGetSchedulerDocument(): + +class TestGetSchedulerDocument: """ Test Class for get_scheduler_document """ @@ -9751,11 +10148,13 @@ def test_get_scheduler_document_all_params(self): # Set up mock url = preprocess_url('/_scheduler/docs/_replicator/testString') mock_response = '{"database": "database", "doc_id": "doc_id", "error_count": 0, "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "last_updated": "2019-01-01T12:00:00.000Z", "node": "node", "source": "source", "source_proxy": "source_proxy", "start_time": "2019-01-01T12:00:00.000Z", "state": "initializing", "target": "target", "target_proxy": "target_proxy"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9763,7 +10162,7 @@ def test_get_scheduler_document_all_params(self): # Invoke method response = _service.get_scheduler_document( doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -9787,11 +10186,13 @@ def test_get_scheduler_document_value_error(self): # Set up mock url = preprocess_url('/_scheduler/docs/_replicator/testString') mock_response = '{"database": "database", "doc_id": "doc_id", "error_count": 0, "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "last_updated": "2019-01-01T12:00:00.000Z", "node": "node", "source": "source", "source_proxy": "source_proxy", "start_time": "2019-01-01T12:00:00.000Z", "state": "initializing", "target": "target", "target_proxy": "target_proxy"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values doc_id = 'testString' @@ -9801,7 +10202,7 @@ def test_get_scheduler_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_scheduler_document(**req_copy) @@ -9814,7 +10215,8 @@ def test_get_scheduler_document_value_error_with_retries(self): _service.disable_retries() self.test_get_scheduler_document_value_error() -class TestGetSchedulerJobs(): + +class TestGetSchedulerJobs: """ Test Class for get_scheduler_jobs """ @@ -9827,11 +10229,13 @@ def test_get_scheduler_jobs_all_params(self): # Set up mock url = preprocess_url('/_scheduler/jobs') mock_response = '{"total_rows": 0, "jobs": [{"database": "database", "doc_id": "doc_id", "history": [{"reason": "reason", "timestamp": "2019-01-01T12:00:00.000Z", "type": "type"}], "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "node": "node", "pid": "pid", "source": "source", "start_time": "2019-01-01T12:00:00.000Z", "target": "target", "user": "user"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values limit = 0 @@ -9841,14 +10245,14 @@ def test_get_scheduler_jobs_all_params(self): response = _service.get_scheduler_jobs( limit=limit, skip=skip, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'limit={}'.format(limit) in query_string assert 'skip={}'.format(skip) in query_string @@ -9870,16 +10274,17 @@ def test_get_scheduler_jobs_required_params(self): # Set up mock url = preprocess_url('/_scheduler/jobs') mock_response = '{"total_rows": 0, "jobs": [{"database": "database", "doc_id": "doc_id", "history": [{"reason": "reason", "timestamp": "2019-01-01T12:00:00.000Z", "type": "type"}], "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "node": "node", "pid": "pid", "source": "source", "start_time": "2019-01-01T12:00:00.000Z", "target": "target", "user": "user"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_scheduler_jobs() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -9893,7 +10298,8 @@ def test_get_scheduler_jobs_required_params_with_retries(self): _service.disable_retries() self.test_get_scheduler_jobs_required_params() -class TestGetSchedulerJob(): + +class TestGetSchedulerJob: """ Test Class for get_scheduler_job """ @@ -9906,11 +10312,13 @@ def test_get_scheduler_job_all_params(self): # Set up mock url = preprocess_url('/_scheduler/jobs/testString') mock_response = '{"database": "database", "doc_id": "doc_id", "history": [{"reason": "reason", "timestamp": "2019-01-01T12:00:00.000Z", "type": "type"}], "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "node": "node", "pid": "pid", "source": "source", "start_time": "2019-01-01T12:00:00.000Z", "target": "target", "user": "user"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values job_id = 'testString' @@ -9918,7 +10326,7 @@ def test_get_scheduler_job_all_params(self): # Invoke method response = _service.get_scheduler_job( job_id, - headers={} + headers={}, ) # Check for correct operation @@ -9942,11 +10350,13 @@ def test_get_scheduler_job_value_error(self): # Set up mock url = preprocess_url('/_scheduler/jobs/testString') mock_response = '{"database": "database", "doc_id": "doc_id", "history": [{"reason": "reason", "timestamp": "2019-01-01T12:00:00.000Z", "type": "type"}], "id": "id", "info": {"changes_pending": 0, "checkpointed_source_seq": "checkpointed_source_seq", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "error": "error", "missing_revisions_found": 0, "revisions_checked": 0, "source_seq": "source_seq", "through_seq": "through_seq"}, "node": "node", "pid": "pid", "source": "source", "start_time": "2019-01-01T12:00:00.000Z", "target": "target", "user": "user"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values job_id = 'testString' @@ -9956,7 +10366,7 @@ def test_get_scheduler_job_value_error(self): "job_id": job_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_scheduler_job(**req_copy) @@ -9969,6 +10379,7 @@ def test_get_scheduler_job_value_error_with_retries(self): _service.disable_retries() self.test_get_scheduler_job_value_error() + # endregion ############################################################################## # End of Service: Replication @@ -9979,7 +10390,8 @@ def test_get_scheduler_job_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -10006,7 +10418,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestGetSessionInformation(): + +class TestGetSessionInformation: """ Test Class for get_session_information """ @@ -10019,16 +10432,17 @@ def test_get_session_information_all_params(self): # Set up mock url = preprocess_url('/_session') mock_response = '{"ok": true, "info": {"authenticated": "authenticated", "authentication_db": "authentication_db", "authentication_handlers": ["authentication_handlers"]}, "userCtx": {"db": "db", "name": "name", "roles": ["_reader"]}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_session_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -10042,6 +10456,7 @@ def test_get_session_information_all_params_with_retries(self): _service.disable_retries() self.test_get_session_information_all_params() + # endregion ############################################################################## # End of Service: Authentication @@ -10052,7 +10467,8 @@ def test_get_session_information_all_params_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -10079,7 +10495,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestGetSecurity(): + +class TestGetSecurity: """ Test Class for get_security """ @@ -10092,11 +10509,13 @@ def test_get_security_all_params(self): # Set up mock url = preprocess_url('/testString/_security') mock_response = '{"admins": {"names": ["names"], "roles": ["roles"]}, "members": {"names": ["names"], "roles": ["roles"]}, "cloudant": {"mapKey": ["_reader"]}, "couchdb_auth_only": false}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -10104,7 +10523,7 @@ def test_get_security_all_params(self): # Invoke method response = _service.get_security( db, - headers={} + headers={}, ) # Check for correct operation @@ -10128,11 +10547,13 @@ def test_get_security_value_error(self): # Set up mock url = preprocess_url('/testString/_security') mock_response = '{"admins": {"names": ["names"], "roles": ["roles"]}, "members": {"names": ["names"], "roles": ["roles"]}, "cloudant": {"mapKey": ["_reader"]}, "couchdb_auth_only": false}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -10142,7 +10563,7 @@ def test_get_security_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_security(**req_copy) @@ -10155,7 +10576,8 @@ def test_get_security_value_error_with_retries(self): _service.disable_retries() self.test_get_security_value_error() -class TestPutSecurity(): + +class TestPutSecurity: """ Test Class for put_security """ @@ -10168,11 +10590,13 @@ def test_put_security_all_params(self): # Set up mock url = preprocess_url('/testString/_security') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a SecurityObject model security_object_model = {} @@ -10193,7 +10617,7 @@ def test_put_security_all_params(self): members=members, cloudant=cloudant, couchdb_auth_only=couchdb_auth_only, - headers={} + headers={}, ) # Check for correct operation @@ -10226,11 +10650,13 @@ def test_put_security_value_error(self): # Set up mock url = preprocess_url('/testString/_security') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a SecurityObject model security_object_model = {} @@ -10249,7 +10675,7 @@ def test_put_security_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_security(**req_copy) @@ -10262,7 +10688,8 @@ def test_put_security_value_error_with_retries(self): _service.disable_retries() self.test_put_security_value_error() -class TestPostApiKeys(): + +class TestPostApiKeys: """ Test Class for post_api_keys """ @@ -10275,16 +10702,17 @@ def test_post_api_keys_all_params(self): # Set up mock url = preprocess_url('/_api/v2/api_keys') mock_response = '{"ok": true, "key": "key", "password": "password"}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Invoke method response = _service.post_api_keys() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 @@ -10298,7 +10726,8 @@ def test_post_api_keys_all_params_with_retries(self): _service.disable_retries() self.test_post_api_keys_all_params() -class TestPutCloudantSecurityConfiguration(): + +class TestPutCloudantSecurityConfiguration: """ Test Class for put_cloudant_security_configuration """ @@ -10311,11 +10740,13 @@ def test_put_cloudant_security_configuration_all_params(self): # Set up mock url = preprocess_url('/_api/v2/db/testString/_security') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a SecurityObject model security_object_model = {} @@ -10336,7 +10767,7 @@ def test_put_cloudant_security_configuration_all_params(self): admins=admins, members=members, couchdb_auth_only=couchdb_auth_only, - headers={} + headers={}, ) # Check for correct operation @@ -10369,11 +10800,13 @@ def test_put_cloudant_security_configuration_value_error(self): # Set up mock url = preprocess_url('/_api/v2/db/testString/_security') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Construct a dict representation of a SecurityObject model security_object_model = {} @@ -10393,7 +10826,7 @@ def test_put_cloudant_security_configuration_value_error(self): "cloudant": cloudant, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_cloudant_security_configuration(**req_copy) @@ -10406,6 +10839,7 @@ def test_put_cloudant_security_configuration_value_error_with_retries(self): _service.disable_retries() self.test_put_cloudant_security_configuration_value_error() + # endregion ############################################################################## # End of Service: Authorization @@ -10416,7 +10850,8 @@ def test_put_cloudant_security_configuration_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -10443,7 +10878,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestGetCorsInformation(): + +class TestGetCorsInformation: """ Test Class for get_cors_information """ @@ -10456,16 +10892,17 @@ def test_get_cors_information_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/config/cors') mock_response = '{"allow_credentials": true, "enable_cors": true, "origins": ["origins"]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_cors_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -10479,7 +10916,8 @@ def test_get_cors_information_all_params_with_retries(self): _service.disable_retries() self.test_get_cors_information_all_params() -class TestPutCorsConfiguration(): + +class TestPutCorsConfiguration: """ Test Class for put_cors_configuration """ @@ -10492,11 +10930,13 @@ def test_put_cors_configuration_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/config/cors') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values origins = ['testString'] @@ -10508,7 +10948,7 @@ def test_put_cors_configuration_all_params(self): origins, allow_credentials=allow_credentials, enable_cors=enable_cors, - headers={} + headers={}, ) # Check for correct operation @@ -10540,11 +10980,13 @@ def test_put_cors_configuration_value_error(self): # Set up mock url = preprocess_url('/_api/v2/user/config/cors') mock_response = '{"ok": true}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values origins = ['testString'] @@ -10556,7 +10998,7 @@ def test_put_cors_configuration_value_error(self): "origins": origins, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_cors_configuration(**req_copy) @@ -10569,6 +11011,7 @@ def test_put_cors_configuration_value_error_with_retries(self): _service.disable_retries() self.test_put_cors_configuration_value_error() + # endregion ############################################################################## # End of Service: CORS @@ -10579,7 +11022,8 @@ def test_put_cors_configuration_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -10606,7 +11050,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadAttachment(): + +class TestHeadAttachment: """ Test Class for head_attachment """ @@ -10618,9 +11063,11 @@ def test_head_attachment_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -10638,14 +11085,14 @@ def test_head_attachment_all_params(self): if_match=if_match, if_none_match=if_none_match, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'rev={}'.format(rev) in query_string @@ -10665,9 +11112,11 @@ def test_head_attachment_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -10679,7 +11128,7 @@ def test_head_attachment_required_params(self): db, doc_id, attachment_name, - headers={} + headers={}, ) # Check for correct operation @@ -10702,9 +11151,11 @@ def test_head_attachment_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -10718,7 +11169,7 @@ def test_head_attachment_value_error(self): "attachment_name": attachment_name, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_attachment(**req_copy) @@ -10731,7 +11182,8 @@ def test_head_attachment_value_error_with_retries(self): _service.disable_retries() self.test_head_attachment_value_error() -class TestDeleteAttachment(): + +class TestDeleteAttachment: """ Test Class for delete_attachment """ @@ -10744,11 +11196,13 @@ def test_delete_attachment_all_params(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -10766,14 +11220,14 @@ def test_delete_attachment_all_params(self): if_match=if_match, rev=rev, batch=batch, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'rev={}'.format(rev) in query_string assert 'batch={}'.format(batch) in query_string @@ -10795,11 +11249,13 @@ def test_delete_attachment_required_params(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -10811,7 +11267,7 @@ def test_delete_attachment_required_params(self): db, doc_id, attachment_name, - headers={} + headers={}, ) # Check for correct operation @@ -10835,11 +11291,13 @@ def test_delete_attachment_value_error(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -10853,7 +11311,7 @@ def test_delete_attachment_value_error(self): "attachment_name": attachment_name, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_attachment(**req_copy) @@ -10866,7 +11324,8 @@ def test_delete_attachment_value_error_with_retries(self): _service.disable_retries() self.test_delete_attachment_value_error() -class TestGetAttachment(): + +class TestGetAttachment: """ Test Class for get_attachment """ @@ -10879,11 +11338,13 @@ def test_get_attachment_all_params(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='*/*', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='*/*', + status=200, + ) # Set up parameter values db = 'testString' @@ -10903,14 +11364,14 @@ def test_get_attachment_all_params(self): if_none_match=if_none_match, range=range, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'rev={}'.format(rev) in query_string @@ -10931,11 +11392,13 @@ def test_get_attachment_required_params(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='*/*', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='*/*', + status=200, + ) # Set up parameter values db = 'testString' @@ -10947,7 +11410,7 @@ def test_get_attachment_required_params(self): db, doc_id, attachment_name, - headers={} + headers={}, ) # Check for correct operation @@ -10971,11 +11434,13 @@ def test_get_attachment_value_error(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = 'This is a mock binary response.' - responses.add(responses.GET, - url, - body=mock_response, - content_type='*/*', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='*/*', + status=200, + ) # Set up parameter values db = 'testString' @@ -10989,7 +11454,7 @@ def test_get_attachment_value_error(self): "attachment_name": attachment_name, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_attachment(**req_copy) @@ -11002,7 +11467,8 @@ def test_get_attachment_value_error_with_retries(self): _service.disable_retries() self.test_get_attachment_value_error() -class TestPutAttachment(): + +class TestPutAttachment: """ Test Class for put_attachment """ @@ -11015,11 +11481,13 @@ def test_put_attachment_all_params(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values db = 'testString' @@ -11039,14 +11507,14 @@ def test_put_attachment_all_params(self): content_type, if_match=if_match, rev=rev, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'rev={}'.format(rev) in query_string # decompress gzip compressed request body @@ -11071,11 +11539,13 @@ def test_put_attachment_required_params(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values db = 'testString' @@ -11091,7 +11561,7 @@ def test_put_attachment_required_params(self): attachment_name, attachment, content_type, - headers={} + headers={}, ) # Check for correct operation @@ -11119,11 +11589,13 @@ def test_put_attachment_value_error(self): # Set up mock url = preprocess_url('/testString/testString/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Set up parameter values db = 'testString' @@ -11141,7 +11613,7 @@ def test_put_attachment_value_error(self): "content_type": content_type, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_attachment(**req_copy) @@ -11154,6 +11626,7 @@ def test_put_attachment_value_error_with_retries(self): _service.disable_retries() self.test_put_attachment_value_error() + # endregion ############################################################################## # End of Service: Attachments @@ -11164,7 +11637,8 @@ def test_put_attachment_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -11191,7 +11665,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadLocalDocument(): + +class TestHeadLocalDocument: """ Test Class for head_local_document """ @@ -11203,9 +11678,11 @@ def test_head_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -11217,7 +11694,7 @@ def test_head_local_document_all_params(self): db, doc_id, if_none_match=if_none_match, - headers={} + headers={}, ) # Check for correct operation @@ -11240,9 +11717,11 @@ def test_head_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -11252,7 +11731,7 @@ def test_head_local_document_required_params(self): response = _service.head_local_document( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -11275,9 +11754,11 @@ def test_head_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Set up parameter values db = 'testString' @@ -11289,7 +11770,7 @@ def test_head_local_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.head_local_document(**req_copy) @@ -11302,7 +11783,8 @@ def test_head_local_document_value_error_with_retries(self): _service.disable_retries() self.test_head_local_document_value_error() -class TestDeleteLocalDocument(): + +class TestDeleteLocalDocument: """ Test Class for delete_local_document """ @@ -11315,11 +11797,13 @@ def test_delete_local_document_all_params(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11331,14 +11815,14 @@ def test_delete_local_document_all_params(self): db, doc_id, batch=batch, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string @@ -11359,11 +11843,13 @@ def test_delete_local_document_required_params(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11373,7 +11859,7 @@ def test_delete_local_document_required_params(self): response = _service.delete_local_document( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -11397,11 +11883,13 @@ def test_delete_local_document_value_error(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11413,7 +11901,7 @@ def test_delete_local_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.delete_local_document(**req_copy) @@ -11426,7 +11914,8 @@ def test_delete_local_document_value_error_with_retries(self): _service.disable_retries() self.test_delete_local_document_value_error() -class TestGetLocalDocument(): + +class TestGetLocalDocument: """ Test Class for get_local_document """ @@ -11439,11 +11928,13 @@ def test_get_local_document_all_params(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11463,14 +11954,14 @@ def test_get_local_document_all_params(self): attachments=attachments, att_encoding_info=att_encoding_info, local_seq=local_seq, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'attachments={}'.format('true' if attachments else 'false') in query_string assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string @@ -11493,11 +11984,13 @@ def test_get_local_document_required_params(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11507,7 +12000,7 @@ def test_get_local_document_required_params(self): response = _service.get_local_document( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -11531,11 +12024,13 @@ def test_get_local_document_value_error(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11547,7 +12042,7 @@ def test_get_local_document_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_local_document(**req_copy) @@ -11560,7 +12055,8 @@ def test_get_local_document_value_error_with_retries(self): _service.disable_retries() self.test_get_local_document_value_error() -class TestPutLocalDocument(): + +class TestPutLocalDocument: """ Test Class for put_local_document """ @@ -11573,11 +12069,13 @@ def test_put_local_document_all_params(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -11628,14 +12126,14 @@ def test_put_local_document_all_params(self): document, content_type=content_type, batch=batch, - headers={} + headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 # Validate query params - query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string # decompress gzip compressed request body @@ -11660,11 +12158,13 @@ def test_put_local_document_required_params(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -11711,7 +12211,7 @@ def test_put_local_document_required_params(self): db, doc_id, document, - headers={} + headers={}, ) # Check for correct operation @@ -11739,11 +12239,13 @@ def test_put_local_document_value_error(self): # Set up mock url = preprocess_url('/testString/_local/testString') mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) + responses.add( + responses.PUT, + url, + body=mock_response, + content_type='application/json', + status=201, + ) # Construct a dict representation of a Attachment model attachment_model = {} @@ -11792,7 +12294,7 @@ def test_put_local_document_value_error(self): "document": document, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.put_local_document(**req_copy) @@ -11805,6 +12307,7 @@ def test_put_local_document_value_error_with_retries(self): _service.disable_retries() self.test_put_local_document_value_error() + # endregion ############################################################################## # End of Service: LocalDocuments @@ -11815,7 +12318,8 @@ def test_put_local_document_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -11842,7 +12346,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestPostRevsDiff(): + +class TestPostRevsDiff: """ Test Class for post_revs_diff """ @@ -11855,11 +12360,13 @@ def test_post_revs_diff_all_params(self): # Set up mock url = preprocess_url('/testString/_revs_diff') mock_response = '{"mapKey": {"missing": ["missing"], "possible_ancestors": ["possible_ancestors"]}}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11869,7 +12376,7 @@ def test_post_revs_diff_all_params(self): response = _service.post_revs_diff( db, document_revisions, - headers={} + headers={}, ) # Check for correct operation @@ -11899,11 +12406,13 @@ def test_post_revs_diff_value_error(self): # Set up mock url = preprocess_url('/testString/_revs_diff') mock_response = '{"mapKey": {"missing": ["missing"], "possible_ancestors": ["possible_ancestors"]}}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11915,7 +12424,7 @@ def test_post_revs_diff_value_error(self): "document_revisions": document_revisions, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_revs_diff(**req_copy) @@ -11928,7 +12437,8 @@ def test_post_revs_diff_value_error_with_retries(self): _service.disable_retries() self.test_post_revs_diff_value_error() -class TestGetShardsInformation(): + +class TestGetShardsInformation: """ Test Class for get_shards_information """ @@ -11941,11 +12451,13 @@ def test_get_shards_information_all_params(self): # Set up mock url = preprocess_url('/testString/_shards') mock_response = '{"shards": {"mapKey": ["inner"]}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11953,7 +12465,7 @@ def test_get_shards_information_all_params(self): # Invoke method response = _service.get_shards_information( db, - headers={} + headers={}, ) # Check for correct operation @@ -11977,11 +12489,13 @@ def test_get_shards_information_value_error(self): # Set up mock url = preprocess_url('/testString/_shards') mock_response = '{"shards": {"mapKey": ["inner"]}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -11991,7 +12505,7 @@ def test_get_shards_information_value_error(self): "db": db, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_shards_information(**req_copy) @@ -12004,7 +12518,8 @@ def test_get_shards_information_value_error_with_retries(self): _service.disable_retries() self.test_get_shards_information_value_error() -class TestGetDocumentShardsInfo(): + +class TestGetDocumentShardsInfo: """ Test Class for get_document_shards_info """ @@ -12017,11 +12532,13 @@ def test_get_document_shards_info_all_params(self): # Set up mock url = preprocess_url('/testString/_shards/testString') mock_response = '{"nodes": ["nodes"], "range": "range"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -12031,7 +12548,7 @@ def test_get_document_shards_info_all_params(self): response = _service.get_document_shards_info( db, doc_id, - headers={} + headers={}, ) # Check for correct operation @@ -12055,11 +12572,13 @@ def test_get_document_shards_info_value_error(self): # Set up mock url = preprocess_url('/testString/_shards/testString') mock_response = '{"nodes": ["nodes"], "range": "range"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values db = 'testString' @@ -12071,7 +12590,7 @@ def test_get_document_shards_info_value_error(self): "doc_id": doc_id, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.get_document_shards_info(**req_copy) @@ -12084,6 +12603,7 @@ def test_get_document_shards_info_value_error_with_retries(self): _service.disable_retries() self.test_get_document_shards_info_value_error() + # endregion ############################################################################## # End of Service: DatabaseDetails @@ -12094,7 +12614,8 @@ def test_get_document_shards_info_value_error_with_retries(self): ############################################################################## # region -class TestNewInstance(): + +class TestNewInstance: """ Test Class for new_instance """ @@ -12121,7 +12642,8 @@ def test_new_instance_without_authenticator(self): service_name='TEST_SERVICE_NOT_FOUND', ) -class TestHeadUpInformation(): + +class TestHeadUpInformation: """ Test Class for head_up_information """ @@ -12133,14 +12655,15 @@ def test_head_up_information_all_params(self): """ # Set up mock url = preprocess_url('/_up') - responses.add(responses.HEAD, - url, - status=200) + responses.add( + responses.HEAD, + url, + status=200, + ) # Invoke method response = _service.head_up_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -12154,7 +12677,8 @@ def test_head_up_information_all_params_with_retries(self): _service.disable_retries() self.test_head_up_information_all_params() -class TestGetActiveTasks(): + +class TestGetActiveTasks: """ Test Class for get_active_tasks """ @@ -12167,16 +12691,17 @@ def test_get_active_tasks_all_params(self): # Set up mock url = preprocess_url('/_active_tasks') mock_response = '[{"bulk_get_attempts": 0, "bulk_get_docs": 0, "changes_done": 0, "changes_pending": 0, "checkpoint_interval": 0, "checkpointed_source_seq": "checkpointed_source_seq", "continuous": false, "database": "database", "design_document": "design_document", "doc_id": "doc_id", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "index": "index", "indexer_pid": "indexer_pid", "missing_revisions_found": 0, "node": "node", "phase": "docid_sort", "pid": "pid", "process_status": "exiting", "progress": 0, "replication_id": "replication_id", "retry": false, "revisions_checked": 0, "source": "source", "source_seq": "source_seq", "started_on": 0, "target": "target", "through_seq": "through_seq", "total_changes": 0, "type": "database_compaction", "updated_on": 0, "user": "user", "view": 0}]' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_active_tasks() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -12190,7 +12715,8 @@ def test_get_active_tasks_all_params_with_retries(self): _service.disable_retries() self.test_get_active_tasks_all_params() -class TestGetUpInformation(): + +class TestGetUpInformation: """ Test Class for get_up_information """ @@ -12203,16 +12729,17 @@ def test_get_up_information_all_params(self): # Set up mock url = preprocess_url('/_up') mock_response = '{"seeds": {"anyKey": "anyValue"}, "status": "maintenance_mode"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_up_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -12226,7 +12753,8 @@ def test_get_up_information_all_params_with_retries(self): _service.disable_retries() self.test_get_up_information_all_params() -class TestGetActivityTrackerEvents(): + +class TestGetActivityTrackerEvents: """ Test Class for get_activity_tracker_events """ @@ -12239,16 +12767,17 @@ def test_get_activity_tracker_events_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/activity_tracker/events') mock_response = '{"types": ["management"]}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_activity_tracker_events() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -12262,7 +12791,8 @@ def test_get_activity_tracker_events_all_params_with_retries(self): _service.disable_retries() self.test_get_activity_tracker_events_all_params() -class TestPostActivityTrackerEvents(): + +class TestPostActivityTrackerEvents: """ Test Class for post_activity_tracker_events """ @@ -12275,11 +12805,13 @@ def test_post_activity_tracker_events_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/activity_tracker/events') mock_response = '{"ok": true}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values types = ['management'] @@ -12287,7 +12819,7 @@ def test_post_activity_tracker_events_all_params(self): # Invoke method response = _service.post_activity_tracker_events( types, - headers={} + headers={}, ) # Check for correct operation @@ -12317,11 +12849,13 @@ def test_post_activity_tracker_events_value_error(self): # Set up mock url = preprocess_url('/_api/v2/user/activity_tracker/events') mock_response = '{"ok": true}' - responses.add(responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Set up parameter values types = ['management'] @@ -12331,7 +12865,7 @@ def test_post_activity_tracker_events_value_error(self): "types": types, } for param in req_param_dict.keys(): - req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): _service.post_activity_tracker_events(**req_copy) @@ -12344,7 +12878,8 @@ def test_post_activity_tracker_events_value_error_with_retries(self): _service.disable_retries() self.test_post_activity_tracker_events_value_error() -class TestGetCurrentThroughputInformation(): + +class TestGetCurrentThroughputInformation: """ Test Class for get_current_throughput_information """ @@ -12357,16 +12892,17 @@ def test_get_current_throughput_information_all_params(self): # Set up mock url = preprocess_url('/_api/v2/user/current/throughput') mock_response = '{"throughput": {"query": 0, "read": 0, "write": 0}}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) # Invoke method response = _service.get_current_throughput_information() - # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 @@ -12380,6 +12916,7 @@ def test_get_current_throughput_information_all_params_with_retries(self): _service.disable_retries() self.test_get_current_throughput_information_all_params() + # endregion ############################################################################## # End of Service: Monitoring @@ -12390,7 +12927,9 @@ def test_get_current_throughput_information_all_params_with_retries(self): # Start of Model Tests ############################################################################## # region -class TestModel_ActiveTask(): + + +class TestModel_ActiveTask: """ Test Class for ActiveTask """ @@ -12452,7 +12991,8 @@ def test_active_task_serialization(self): active_task_model_json2 = active_task_model.to_dict() assert active_task_model_json2 == active_task_model_json -class TestModel_ActivityTrackerEvents(): + +class TestModel_ActivityTrackerEvents: """ Test Class for ActivityTrackerEvents """ @@ -12481,7 +13021,8 @@ def test_activity_tracker_events_serialization(self): activity_tracker_events_model_json2 = activity_tracker_events_model.to_dict() assert activity_tracker_events_model_json2 == activity_tracker_events_model_json -class TestModel_AllDocsQueriesResult(): + +class TestModel_AllDocsQueriesResult: """ Test Class for AllDocsQueriesResult """ @@ -12493,7 +13034,7 @@ def test_all_docs_queries_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -12504,15 +13045,15 @@ def test_all_docs_queries_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -12524,11 +13065,11 @@ def test_all_docs_queries_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - docs_result_row_value_model = {} # DocsResultRowValue + docs_result_row_value_model = {} # DocsResultRowValue docs_result_row_value_model['deleted'] = True docs_result_row_value_model['rev'] = 'testString' - docs_result_row_model = {} # DocsResultRow + docs_result_row_model = {} # DocsResultRow docs_result_row_model['caused_by'] = 'testString' docs_result_row_model['error'] = 'testString' docs_result_row_model['reason'] = 'testString' @@ -12537,7 +13078,7 @@ def test_all_docs_queries_result_serialization(self): docs_result_row_model['key'] = 'testString' docs_result_row_model['value'] = docs_result_row_value_model - all_docs_result_model = {} # AllDocsResult + all_docs_result_model = {} # AllDocsResult all_docs_result_model['total_rows'] = 0 all_docs_result_model['rows'] = [docs_result_row_model] all_docs_result_model['update_seq'] = 'testString' @@ -12561,7 +13102,8 @@ def test_all_docs_queries_result_serialization(self): all_docs_queries_result_model_json2 = all_docs_queries_result_model.to_dict() assert all_docs_queries_result_model_json2 == all_docs_queries_result_model_json -class TestModel_AllDocsQuery(): + +class TestModel_AllDocsQuery: """ Test Class for AllDocsQuery """ @@ -12602,7 +13144,8 @@ def test_all_docs_query_serialization(self): all_docs_query_model_json2 = all_docs_query_model.to_dict() assert all_docs_query_model_json2 == all_docs_query_model_json -class TestModel_AllDocsResult(): + +class TestModel_AllDocsResult: """ Test Class for AllDocsResult """ @@ -12614,7 +13157,7 @@ def test_all_docs_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -12625,15 +13168,15 @@ def test_all_docs_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -12645,11 +13188,11 @@ def test_all_docs_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - docs_result_row_value_model = {} # DocsResultRowValue + docs_result_row_value_model = {} # DocsResultRowValue docs_result_row_value_model['deleted'] = True docs_result_row_value_model['rev'] = 'testString' - docs_result_row_model = {} # DocsResultRow + docs_result_row_model = {} # DocsResultRow docs_result_row_model['caused_by'] = 'testString' docs_result_row_model['error'] = 'testString' docs_result_row_model['reason'] = 'testString' @@ -12679,7 +13222,8 @@ def test_all_docs_result_serialization(self): all_docs_result_model_json2 = all_docs_result_model.to_dict() assert all_docs_result_model_json2 == all_docs_result_model_json -class TestModel_Analyzer(): + +class TestModel_Analyzer: """ Test Class for Analyzer """ @@ -12709,7 +13253,8 @@ def test_analyzer_serialization(self): analyzer_model_json2 = analyzer_model.to_dict() assert analyzer_model_json2 == analyzer_model_json -class TestModel_AnalyzerConfiguration(): + +class TestModel_AnalyzerConfiguration: """ Test Class for AnalyzerConfiguration """ @@ -12721,7 +13266,7 @@ def test_analyzer_configuration_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] @@ -12746,7 +13291,8 @@ def test_analyzer_configuration_serialization(self): analyzer_configuration_model_json2 = analyzer_configuration_model.to_dict() assert analyzer_configuration_model_json2 == analyzer_configuration_model_json -class TestModel_ApiKeysResult(): + +class TestModel_ApiKeysResult: """ Test Class for ApiKeysResult """ @@ -12777,7 +13323,8 @@ def test_api_keys_result_serialization(self): api_keys_result_model_json2 = api_keys_result_model.to_dict() assert api_keys_result_model_json2 == api_keys_result_model_json -class TestModel_Attachment(): + +class TestModel_Attachment: """ Test Class for Attachment """ @@ -12814,7 +13361,8 @@ def test_attachment_serialization(self): attachment_model_json2 = attachment_model.to_dict() assert attachment_model_json2 == attachment_model_json -class TestModel_BulkDocs(): + +class TestModel_BulkDocs: """ Test Class for BulkDocs """ @@ -12826,7 +13374,7 @@ def test_bulk_docs_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -12837,15 +13385,15 @@ def test_bulk_docs_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -12877,7 +13425,8 @@ def test_bulk_docs_serialization(self): bulk_docs_model_json2 = bulk_docs_model.to_dict() assert bulk_docs_model_json2 == bulk_docs_model_json -class TestModel_BulkGetQueryDocument(): + +class TestModel_BulkGetQueryDocument: """ Test Class for BulkGetQueryDocument """ @@ -12908,7 +13457,8 @@ def test_bulk_get_query_document_serialization(self): bulk_get_query_document_model_json2 = bulk_get_query_document_model.to_dict() assert bulk_get_query_document_model_json2 == bulk_get_query_document_model_json -class TestModel_BulkGetResult(): + +class TestModel_BulkGetResult: """ Test Class for BulkGetResult """ @@ -12920,7 +13470,7 @@ def test_bulk_get_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - document_result_model = {} # DocumentResult + document_result_model = {} # DocumentResult document_result_model['id'] = 'testString' document_result_model['rev'] = 'testString' document_result_model['ok'] = True @@ -12928,7 +13478,7 @@ def test_bulk_get_result_serialization(self): document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -12939,15 +13489,15 @@ def test_bulk_get_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -12959,11 +13509,11 @@ def test_bulk_get_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - bulk_get_result_document_model = {} # BulkGetResultDocument + bulk_get_result_document_model = {} # BulkGetResultDocument bulk_get_result_document_model['error'] = document_result_model bulk_get_result_document_model['ok'] = document_model - bulk_get_result_item_model = {} # BulkGetResultItem + bulk_get_result_item_model = {} # BulkGetResultItem bulk_get_result_item_model['docs'] = [bulk_get_result_document_model] bulk_get_result_item_model['id'] = 'testString' @@ -12986,7 +13536,8 @@ def test_bulk_get_result_serialization(self): bulk_get_result_model_json2 = bulk_get_result_model.to_dict() assert bulk_get_result_model_json2 == bulk_get_result_model_json -class TestModel_BulkGetResultDocument(): + +class TestModel_BulkGetResultDocument: """ Test Class for BulkGetResultDocument """ @@ -12998,7 +13549,7 @@ def test_bulk_get_result_document_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - document_result_model = {} # DocumentResult + document_result_model = {} # DocumentResult document_result_model['id'] = 'testString' document_result_model['rev'] = 'testString' document_result_model['ok'] = True @@ -13006,7 +13557,7 @@ def test_bulk_get_result_document_serialization(self): document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -13017,15 +13568,15 @@ def test_bulk_get_result_document_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -13057,7 +13608,8 @@ def test_bulk_get_result_document_serialization(self): bulk_get_result_document_model_json2 = bulk_get_result_document_model.to_dict() assert bulk_get_result_document_model_json2 == bulk_get_result_document_model_json -class TestModel_BulkGetResultItem(): + +class TestModel_BulkGetResultItem: """ Test Class for BulkGetResultItem """ @@ -13069,7 +13621,7 @@ def test_bulk_get_result_item_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - document_result_model = {} # DocumentResult + document_result_model = {} # DocumentResult document_result_model['id'] = 'testString' document_result_model['rev'] = 'testString' document_result_model['ok'] = True @@ -13077,7 +13629,7 @@ def test_bulk_get_result_item_serialization(self): document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -13088,15 +13640,15 @@ def test_bulk_get_result_item_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -13108,7 +13660,7 @@ def test_bulk_get_result_item_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - bulk_get_result_document_model = {} # BulkGetResultDocument + bulk_get_result_document_model = {} # BulkGetResultDocument bulk_get_result_document_model['error'] = document_result_model bulk_get_result_document_model['ok'] = document_model @@ -13132,7 +13684,8 @@ def test_bulk_get_result_item_serialization(self): bulk_get_result_item_model_json2 = bulk_get_result_item_model.to_dict() assert bulk_get_result_item_model_json2 == bulk_get_result_item_model_json -class TestModel_CapacityThroughputInformation(): + +class TestModel_CapacityThroughputInformation: """ Test Class for CapacityThroughputInformation """ @@ -13144,16 +13697,16 @@ def test_capacity_throughput_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - throughput_information_model = {} # ThroughputInformation + throughput_information_model = {} # ThroughputInformation throughput_information_model['blocks'] = 0 throughput_information_model['query'] = 0 throughput_information_model['read'] = 0 throughput_information_model['write'] = 0 - capacity_throughput_information_current_model = {} # CapacityThroughputInformationCurrent + capacity_throughput_information_current_model = {} # CapacityThroughputInformationCurrent capacity_throughput_information_current_model['throughput'] = throughput_information_model - capacity_throughput_information_target_model = {} # CapacityThroughputInformationTarget + capacity_throughput_information_target_model = {} # CapacityThroughputInformationTarget capacity_throughput_information_target_model['throughput'] = throughput_information_model # Construct a json representation of a CapacityThroughputInformation model @@ -13176,7 +13729,8 @@ def test_capacity_throughput_information_serialization(self): capacity_throughput_information_model_json2 = capacity_throughput_information_model.to_dict() assert capacity_throughput_information_model_json2 == capacity_throughput_information_model_json -class TestModel_CapacityThroughputInformationCurrent(): + +class TestModel_CapacityThroughputInformationCurrent: """ Test Class for CapacityThroughputInformationCurrent """ @@ -13188,7 +13742,7 @@ def test_capacity_throughput_information_current_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - throughput_information_model = {} # ThroughputInformation + throughput_information_model = {} # ThroughputInformation throughput_information_model['blocks'] = 0 throughput_information_model['query'] = 0 throughput_information_model['read'] = 0 @@ -13213,7 +13767,8 @@ def test_capacity_throughput_information_current_serialization(self): capacity_throughput_information_current_model_json2 = capacity_throughput_information_current_model.to_dict() assert capacity_throughput_information_current_model_json2 == capacity_throughput_information_current_model_json -class TestModel_CapacityThroughputInformationTarget(): + +class TestModel_CapacityThroughputInformationTarget: """ Test Class for CapacityThroughputInformationTarget """ @@ -13225,7 +13780,7 @@ def test_capacity_throughput_information_target_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - throughput_information_model = {} # ThroughputInformation + throughput_information_model = {} # ThroughputInformation throughput_information_model['blocks'] = 0 throughput_information_model['query'] = 0 throughput_information_model['read'] = 0 @@ -13250,7 +13805,8 @@ def test_capacity_throughput_information_target_serialization(self): capacity_throughput_information_target_model_json2 = capacity_throughput_information_target_model.to_dict() assert capacity_throughput_information_target_model_json2 == capacity_throughput_information_target_model_json -class TestModel_Change(): + +class TestModel_Change: """ Test Class for Change """ @@ -13279,7 +13835,8 @@ def test_change_serialization(self): change_model_json2 = change_model.to_dict() assert change_model_json2 == change_model_json -class TestModel_ChangesResult(): + +class TestModel_ChangesResult: """ Test Class for ChangesResult """ @@ -13291,10 +13848,10 @@ def test_changes_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - change_model = {} # Change + change_model = {} # Change change_model['rev'] = 'testString' - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -13305,15 +13862,15 @@ def test_changes_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -13325,7 +13882,7 @@ def test_changes_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - changes_result_item_model = {} # ChangesResultItem + changes_result_item_model = {} # ChangesResultItem changes_result_item_model['changes'] = [change_model] changes_result_item_model['deleted'] = True changes_result_item_model['doc'] = document_model @@ -13353,7 +13910,8 @@ def test_changes_result_serialization(self): changes_result_model_json2 = changes_result_model.to_dict() assert changes_result_model_json2 == changes_result_model_json -class TestModel_ChangesResultItem(): + +class TestModel_ChangesResultItem: """ Test Class for ChangesResultItem """ @@ -13365,10 +13923,10 @@ def test_changes_result_item_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - change_model = {} # Change + change_model = {} # Change change_model['rev'] = 'testString' - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -13379,15 +13937,15 @@ def test_changes_result_item_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -13422,7 +13980,8 @@ def test_changes_result_item_serialization(self): changes_result_item_model_json2 = changes_result_item_model.to_dict() assert changes_result_item_model_json2 == changes_result_item_model_json -class TestModel_ContentInformationSizes(): + +class TestModel_ContentInformationSizes: """ Test Class for ContentInformationSizes """ @@ -13453,7 +14012,8 @@ def test_content_information_sizes_serialization(self): content_information_sizes_model_json2 = content_information_sizes_model.to_dict() assert content_information_sizes_model_json2 == content_information_sizes_model_json -class TestModel_CorsInformation(): + +class TestModel_CorsInformation: """ Test Class for CorsInformation """ @@ -13484,7 +14044,8 @@ def test_cors_information_serialization(self): cors_information_model_json2 = cors_information_model.to_dict() assert cors_information_model_json2 == cors_information_model_json -class TestModel_CurrentThroughputInformation(): + +class TestModel_CurrentThroughputInformation: """ Test Class for CurrentThroughputInformation """ @@ -13496,7 +14057,7 @@ def test_current_throughput_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - current_throughput_information_throughput_model = {} # CurrentThroughputInformationThroughput + current_throughput_information_throughput_model = {} # CurrentThroughputInformationThroughput current_throughput_information_throughput_model['query'] = 0 current_throughput_information_throughput_model['read'] = 0 current_throughput_information_throughput_model['write'] = 0 @@ -13520,7 +14081,8 @@ def test_current_throughput_information_serialization(self): current_throughput_information_model_json2 = current_throughput_information_model.to_dict() assert current_throughput_information_model_json2 == current_throughput_information_model_json -class TestModel_CurrentThroughputInformationThroughput(): + +class TestModel_CurrentThroughputInformationThroughput: """ Test Class for CurrentThroughputInformationThroughput """ @@ -13551,7 +14113,8 @@ def test_current_throughput_information_throughput_serialization(self): current_throughput_information_throughput_model_json2 = current_throughput_information_throughput_model.to_dict() assert current_throughput_information_throughput_model_json2 == current_throughput_information_throughput_model_json -class TestModel_DatabaseInformation(): + +class TestModel_DatabaseInformation: """ Test Class for DatabaseInformation """ @@ -13563,16 +14126,16 @@ def test_database_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - database_information_cluster_model = {} # DatabaseInformationCluster + database_information_cluster_model = {} # DatabaseInformationCluster database_information_cluster_model['n'] = 1 database_information_cluster_model['q'] = 26 database_information_cluster_model['r'] = 1 database_information_cluster_model['w'] = 1 - database_information_props_model = {} # DatabaseInformationProps + database_information_props_model = {} # DatabaseInformationProps database_information_props_model['partitioned'] = True - content_information_sizes_model = {} # ContentInformationSizes + content_information_sizes_model = {} # ContentInformationSizes content_information_sizes_model['active'] = 26 content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 @@ -13608,7 +14171,8 @@ def test_database_information_serialization(self): database_information_model_json2 = database_information_model.to_dict() assert database_information_model_json2 == database_information_model_json -class TestModel_DatabaseInformationCluster(): + +class TestModel_DatabaseInformationCluster: """ Test Class for DatabaseInformationCluster """ @@ -13640,7 +14204,8 @@ def test_database_information_cluster_serialization(self): database_information_cluster_model_json2 = database_information_cluster_model.to_dict() assert database_information_cluster_model_json2 == database_information_cluster_model_json -class TestModel_DatabaseInformationProps(): + +class TestModel_DatabaseInformationProps: """ Test Class for DatabaseInformationProps """ @@ -13669,7 +14234,8 @@ def test_database_information_props_serialization(self): database_information_props_model_json2 = database_information_props_model.to_dict() assert database_information_props_model_json2 == database_information_props_model_json -class TestModel_DbEvent(): + +class TestModel_DbEvent: """ Test Class for DbEvent """ @@ -13700,7 +14266,8 @@ def test_db_event_serialization(self): db_event_model_json2 = db_event_model.to_dict() assert db_event_model_json2 == db_event_model_json -class TestModel_DbUpdates(): + +class TestModel_DbUpdates: """ Test Class for DbUpdates """ @@ -13712,7 +14279,7 @@ def test_db_updates_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - db_event_model = {} # DbEvent + db_event_model = {} # DbEvent db_event_model['db_name'] = 'testString' db_event_model['seq'] = 'testString' db_event_model['type'] = 'created' @@ -13737,7 +14304,8 @@ def test_db_updates_serialization(self): db_updates_model_json2 = db_updates_model.to_dict() assert db_updates_model_json2 == db_updates_model_json -class TestModel_DbsInfoResult(): + +class TestModel_DbsInfoResult: """ Test Class for DbsInfoResult """ @@ -13749,21 +14317,21 @@ def test_dbs_info_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - database_information_cluster_model = {} # DatabaseInformationCluster + database_information_cluster_model = {} # DatabaseInformationCluster database_information_cluster_model['n'] = 1 database_information_cluster_model['q'] = 26 database_information_cluster_model['r'] = 1 database_information_cluster_model['w'] = 1 - database_information_props_model = {} # DatabaseInformationProps + database_information_props_model = {} # DatabaseInformationProps database_information_props_model['partitioned'] = True - content_information_sizes_model = {} # ContentInformationSizes + content_information_sizes_model = {} # ContentInformationSizes content_information_sizes_model['active'] = 26 content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 - database_information_model = {} # DatabaseInformation + database_information_model = {} # DatabaseInformation database_information_model['cluster'] = database_information_cluster_model database_information_model['committed_update_seq'] = 'testString' database_information_model['compact_running'] = True @@ -13799,7 +14367,8 @@ def test_dbs_info_result_serialization(self): dbs_info_result_model_json2 = dbs_info_result_model.to_dict() assert dbs_info_result_model_json2 == dbs_info_result_model_json -class TestModel_DesignDocument(): + +class TestModel_DesignDocument: """ Test Class for DesignDocument """ @@ -13811,7 +14380,7 @@ def test_design_document_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -13822,31 +14391,31 @@ def test_design_document_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] - analyzer_configuration_model = {} # AnalyzerConfiguration + analyzer_configuration_model = {} # AnalyzerConfiguration analyzer_configuration_model['name'] = 'classic' analyzer_configuration_model['stopwords'] = ['testString'] analyzer_configuration_model['fields'] = {'key1': analyzer_model} - search_index_definition_model = {} # SearchIndexDefinition + search_index_definition_model = {} # SearchIndexDefinition search_index_definition_model['analyzer'] = analyzer_configuration_model search_index_definition_model['index'] = 'testString' - design_document_options_model = {} # DesignDocumentOptions + design_document_options_model = {} # DesignDocumentOptions design_document_options_model['partitioned'] = True - design_document_views_map_reduce_model = {} # DesignDocumentViewsMapReduce + design_document_views_map_reduce_model = {} # DesignDocumentViewsMapReduce design_document_views_map_reduce_model['map'] = 'testString' design_document_views_map_reduce_model['reduce'] = 'testString' @@ -13895,7 +14464,8 @@ def test_design_document_serialization(self): actual_dict = design_document_model.get_properties() assert actual_dict == expected_dict -class TestModel_DesignDocumentInformation(): + +class TestModel_DesignDocumentInformation: """ Test Class for DesignDocumentInformation """ @@ -13907,12 +14477,12 @@ def test_design_document_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - content_information_sizes_model = {} # ContentInformationSizes + content_information_sizes_model = {} # ContentInformationSizes content_information_sizes_model['active'] = 26 content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 - design_document_view_index_model = {} # DesignDocumentViewIndex + design_document_view_index_model = {} # DesignDocumentViewIndex design_document_view_index_model['collator_versions'] = ['testString'] design_document_view_index_model['compact_running'] = True design_document_view_index_model['language'] = 'testString' @@ -13942,7 +14512,8 @@ def test_design_document_information_serialization(self): design_document_information_model_json2 = design_document_information_model.to_dict() assert design_document_information_model_json2 == design_document_information_model_json -class TestModel_DesignDocumentOptions(): + +class TestModel_DesignDocumentOptions: """ Test Class for DesignDocumentOptions """ @@ -13971,7 +14542,8 @@ def test_design_document_options_serialization(self): design_document_options_model_json2 = design_document_options_model.to_dict() assert design_document_options_model_json2 == design_document_options_model_json -class TestModel_DesignDocumentViewIndex(): + +class TestModel_DesignDocumentViewIndex: """ Test Class for DesignDocumentViewIndex """ @@ -13983,7 +14555,7 @@ def test_design_document_view_index_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - content_information_sizes_model = {} # ContentInformationSizes + content_information_sizes_model = {} # ContentInformationSizes content_information_sizes_model['active'] = 26 content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 @@ -14014,7 +14586,8 @@ def test_design_document_view_index_serialization(self): design_document_view_index_model_json2 = design_document_view_index_model.to_dict() assert design_document_view_index_model_json2 == design_document_view_index_model_json -class TestModel_DesignDocumentViewsMapReduce(): + +class TestModel_DesignDocumentViewsMapReduce: """ Test Class for DesignDocumentViewsMapReduce """ @@ -14044,7 +14617,8 @@ def test_design_document_views_map_reduce_serialization(self): design_document_views_map_reduce_model_json2 = design_document_views_map_reduce_model.to_dict() assert design_document_views_map_reduce_model_json2 == design_document_views_map_reduce_model_json -class TestModel_DocsResultRow(): + +class TestModel_DocsResultRow: """ Test Class for DocsResultRow """ @@ -14056,7 +14630,7 @@ def test_docs_result_row_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -14067,15 +14641,15 @@ def test_docs_result_row_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -14087,7 +14661,7 @@ def test_docs_result_row_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - docs_result_row_value_model = {} # DocsResultRowValue + docs_result_row_value_model = {} # DocsResultRowValue docs_result_row_value_model['deleted'] = True docs_result_row_value_model['rev'] = 'testString' @@ -14116,7 +14690,8 @@ def test_docs_result_row_serialization(self): docs_result_row_model_json2 = docs_result_row_model.to_dict() assert docs_result_row_model_json2 == docs_result_row_model_json -class TestModel_DocsResultRowValue(): + +class TestModel_DocsResultRowValue: """ Test Class for DocsResultRowValue """ @@ -14146,7 +14721,8 @@ def test_docs_result_row_value_serialization(self): docs_result_row_value_model_json2 = docs_result_row_value_model.to_dict() assert docs_result_row_value_model_json2 == docs_result_row_value_model_json -class TestModel_Document(): + +class TestModel_Document: """ Test Class for Document """ @@ -14158,7 +14734,7 @@ def test_document_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -14169,11 +14745,11 @@ def test_document_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' @@ -14215,7 +14791,8 @@ def test_document_serialization(self): actual_dict = document_model.get_properties() assert actual_dict == expected_dict -class TestModel_DocumentResult(): + +class TestModel_DocumentResult: """ Test Class for DocumentResult """ @@ -14249,7 +14826,8 @@ def test_document_result_serialization(self): document_result_model_json2 = document_result_model.to_dict() assert document_result_model_json2 == document_result_model_json -class TestModel_DocumentRevisionStatus(): + +class TestModel_DocumentRevisionStatus: """ Test Class for DocumentRevisionStatus """ @@ -14279,7 +14857,8 @@ def test_document_revision_status_serialization(self): document_revision_status_model_json2 = document_revision_status_model.to_dict() assert document_revision_status_model_json2 == document_revision_status_model_json -class TestModel_DocumentShardInfo(): + +class TestModel_DocumentShardInfo: """ Test Class for DocumentShardInfo """ @@ -14309,7 +14888,8 @@ def test_document_shard_info_serialization(self): document_shard_info_model_json2 = document_shard_info_model.to_dict() assert document_shard_info_model_json2 == document_shard_info_model_json -class TestModel_ExecutionStats(): + +class TestModel_ExecutionStats: """ Test Class for ExecutionStats """ @@ -14342,7 +14922,8 @@ def test_execution_stats_serialization(self): execution_stats_model_json2 = execution_stats_model.to_dict() assert execution_stats_model_json2 == execution_stats_model_json -class TestModel_ExplainResult(): + +class TestModel_ExplainResult: """ Test Class for ExplainResult """ @@ -14354,33 +14935,33 @@ def test_explain_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] - index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField + index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField index_text_operator_default_field_model['analyzer'] = analyzer_model index_text_operator_default_field_model['enabled'] = True - index_field_model = {} # IndexField + index_field_model = {} # IndexField index_field_model['name'] = 'testString' index_field_model['type'] = 'boolean' index_field_model['foo'] = 'asc' - index_definition_model = {} # IndexDefinition + index_definition_model = {} # IndexDefinition index_definition_model['default_analyzer'] = analyzer_model index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True index_definition_model['partial_filter_selector'] = {'foo': 'bar'} - index_information_model = {} # IndexInformation + index_information_model = {} # IndexInformation index_information_model['ddoc'] = 'testString' index_information_model['def'] = index_definition_model index_information_model['name'] = 'testString' index_information_model['type'] = 'json' - explain_result_range_model = {} # ExplainResultRange + explain_result_range_model = {} # ExplainResultRange explain_result_range_model['end_key'] = ['testString'] explain_result_range_model['start_key'] = ['testString'] @@ -14410,7 +14991,8 @@ def test_explain_result_serialization(self): explain_result_model_json2 = explain_result_model.to_dict() assert explain_result_model_json2 == explain_result_model_json -class TestModel_ExplainResultRange(): + +class TestModel_ExplainResultRange: """ Test Class for ExplainResultRange """ @@ -14440,7 +15022,8 @@ def test_explain_result_range_serialization(self): explain_result_range_model_json2 = explain_result_range_model.to_dict() assert explain_result_range_model_json2 == explain_result_range_model_json -class TestModel_FindResult(): + +class TestModel_FindResult: """ Test Class for FindResult """ @@ -14452,7 +15035,7 @@ def test_find_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -14463,15 +15046,15 @@ def test_find_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -14483,7 +15066,7 @@ def test_find_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - execution_stats_model = {} # ExecutionStats + execution_stats_model = {} # ExecutionStats execution_stats_model['execution_time_ms'] = 72.5 execution_stats_model['results_returned'] = 0 execution_stats_model['total_docs_examined'] = 0 @@ -14512,7 +15095,8 @@ def test_find_result_serialization(self): find_result_model_json2 = find_result_model.to_dict() assert find_result_model_json2 == find_result_model_json -class TestModel_IndexDefinition(): + +class TestModel_IndexDefinition: """ Test Class for IndexDefinition """ @@ -14524,15 +15108,15 @@ def test_index_definition_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] - index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField + index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField index_text_operator_default_field_model['analyzer'] = analyzer_model index_text_operator_default_field_model['enabled'] = True - index_field_model = {} # IndexField + index_field_model = {} # IndexField index_field_model['name'] = 'testString' index_field_model['type'] = 'boolean' index_field_model['foo'] = 'asc' @@ -14560,7 +15144,8 @@ def test_index_definition_serialization(self): index_definition_model_json2 = index_definition_model.to_dict() assert index_definition_model_json2 == index_definition_model_json -class TestModel_IndexField(): + +class TestModel_IndexField: """ Test Class for IndexField """ @@ -14601,7 +15186,8 @@ def test_index_field_serialization(self): actual_dict = index_field_model.get_properties() assert actual_dict == expected_dict -class TestModel_IndexInformation(): + +class TestModel_IndexInformation: """ Test Class for IndexInformation """ @@ -14613,20 +15199,20 @@ def test_index_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] - index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField + index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField index_text_operator_default_field_model['analyzer'] = analyzer_model index_text_operator_default_field_model['enabled'] = True - index_field_model = {} # IndexField + index_field_model = {} # IndexField index_field_model['name'] = 'testString' index_field_model['type'] = 'boolean' index_field_model['foo'] = 'asc' - index_definition_model = {} # IndexDefinition + index_definition_model = {} # IndexDefinition index_definition_model['default_analyzer'] = analyzer_model index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] @@ -14655,7 +15241,8 @@ def test_index_information_serialization(self): index_information_model_json2 = index_information_model.to_dict() assert index_information_model_json2 == index_information_model_json -class TestModel_IndexResult(): + +class TestModel_IndexResult: """ Test Class for IndexResult """ @@ -14686,7 +15273,8 @@ def test_index_result_serialization(self): index_result_model_json2 = index_result_model.to_dict() assert index_result_model_json2 == index_result_model_json -class TestModel_IndexTextOperatorDefaultField(): + +class TestModel_IndexTextOperatorDefaultField: """ Test Class for IndexTextOperatorDefaultField """ @@ -14698,7 +15286,7 @@ def test_index_text_operator_default_field_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] @@ -14722,7 +15310,8 @@ def test_index_text_operator_default_field_serialization(self): index_text_operator_default_field_model_json2 = index_text_operator_default_field_model.to_dict() assert index_text_operator_default_field_model_json2 == index_text_operator_default_field_model_json -class TestModel_IndexesInformation(): + +class TestModel_IndexesInformation: """ Test Class for IndexesInformation """ @@ -14734,27 +15323,27 @@ def test_indexes_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] - index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField + index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField index_text_operator_default_field_model['analyzer'] = analyzer_model index_text_operator_default_field_model['enabled'] = True - index_field_model = {} # IndexField + index_field_model = {} # IndexField index_field_model['name'] = 'testString' index_field_model['type'] = 'boolean' index_field_model['foo'] = 'asc' - index_definition_model = {} # IndexDefinition + index_definition_model = {} # IndexDefinition index_definition_model['default_analyzer'] = analyzer_model index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True index_definition_model['partial_filter_selector'] = {'foo': 'bar'} - index_information_model = {} # IndexInformation + index_information_model = {} # IndexInformation index_information_model['ddoc'] = 'testString' index_information_model['def'] = index_definition_model index_information_model['name'] = 'testString' @@ -14780,7 +15369,8 @@ def test_indexes_information_serialization(self): indexes_information_model_json2 = indexes_information_model.to_dict() assert indexes_information_model_json2 == indexes_information_model_json -class TestModel_MembershipInformation(): + +class TestModel_MembershipInformation: """ Test Class for MembershipInformation """ @@ -14810,7 +15400,8 @@ def test_membership_information_serialization(self): membership_information_model_json2 = membership_information_model.to_dict() assert membership_information_model_json2 == membership_information_model_json -class TestModel_Ok(): + +class TestModel_Ok: """ Test Class for Ok """ @@ -14839,7 +15430,8 @@ def test_ok_serialization(self): ok_model_json2 = ok_model.to_dict() assert ok_model_json2 == ok_model_json -class TestModel_PartitionInformation(): + +class TestModel_PartitionInformation: """ Test Class for PartitionInformation """ @@ -14851,16 +15443,16 @@ def test_partition_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - partition_information_indexes_indexes_model = {} # PartitionInformationIndexesIndexes + partition_information_indexes_indexes_model = {} # PartitionInformationIndexesIndexes partition_information_indexes_indexes_model['search'] = 0 partition_information_indexes_indexes_model['view'] = 0 - partition_information_indexes_model = {} # PartitionInformationIndexes + partition_information_indexes_model = {} # PartitionInformationIndexes partition_information_indexes_model['count'] = 0 partition_information_indexes_model['indexes'] = partition_information_indexes_indexes_model partition_information_indexes_model['limit'] = 0 - partition_information_sizes_model = {} # PartitionInformationSizes + partition_information_sizes_model = {} # PartitionInformationSizes partition_information_sizes_model['active'] = 0 partition_information_sizes_model['external'] = 0 @@ -14888,7 +15480,8 @@ def test_partition_information_serialization(self): partition_information_model_json2 = partition_information_model.to_dict() assert partition_information_model_json2 == partition_information_model_json -class TestModel_PartitionInformationIndexes(): + +class TestModel_PartitionInformationIndexes: """ Test Class for PartitionInformationIndexes """ @@ -14900,7 +15493,7 @@ def test_partition_information_indexes_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - partition_information_indexes_indexes_model = {} # PartitionInformationIndexesIndexes + partition_information_indexes_indexes_model = {} # PartitionInformationIndexesIndexes partition_information_indexes_indexes_model['search'] = 0 partition_information_indexes_indexes_model['view'] = 0 @@ -14925,7 +15518,8 @@ def test_partition_information_indexes_serialization(self): partition_information_indexes_model_json2 = partition_information_indexes_model.to_dict() assert partition_information_indexes_model_json2 == partition_information_indexes_model_json -class TestModel_PartitionInformationIndexesIndexes(): + +class TestModel_PartitionInformationIndexesIndexes: """ Test Class for PartitionInformationIndexesIndexes """ @@ -14955,7 +15549,8 @@ def test_partition_information_indexes_indexes_serialization(self): partition_information_indexes_indexes_model_json2 = partition_information_indexes_indexes_model.to_dict() assert partition_information_indexes_indexes_model_json2 == partition_information_indexes_indexes_model_json -class TestModel_PartitionInformationSizes(): + +class TestModel_PartitionInformationSizes: """ Test Class for PartitionInformationSizes """ @@ -14985,7 +15580,8 @@ def test_partition_information_sizes_serialization(self): partition_information_sizes_model_json2 = partition_information_sizes_model.to_dict() assert partition_information_sizes_model_json2 == partition_information_sizes_model_json -class TestModel_ReplicationCreateTargetParameters(): + +class TestModel_ReplicationCreateTargetParameters: """ Test Class for ReplicationCreateTargetParameters """ @@ -15016,7 +15612,8 @@ def test_replication_create_target_parameters_serialization(self): replication_create_target_parameters_model_json2 = replication_create_target_parameters_model.to_dict() assert replication_create_target_parameters_model_json2 == replication_create_target_parameters_model_json -class TestModel_ReplicationDatabase(): + +class TestModel_ReplicationDatabase: """ Test Class for ReplicationDatabase """ @@ -15028,14 +15625,14 @@ def test_replication_database_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic + replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic replication_database_auth_basic_model['password'] = 'testString' replication_database_auth_basic_model['username'] = 'testString' - replication_database_auth_iam_model = {} # ReplicationDatabaseAuthIam + replication_database_auth_iam_model = {} # ReplicationDatabaseAuthIam replication_database_auth_iam_model['api_key'] = 'testString' - replication_database_auth_model = {} # ReplicationDatabaseAuth + replication_database_auth_model = {} # ReplicationDatabaseAuth replication_database_auth_model['basic'] = replication_database_auth_basic_model replication_database_auth_model['iam'] = replication_database_auth_iam_model @@ -15060,7 +15657,8 @@ def test_replication_database_serialization(self): replication_database_model_json2 = replication_database_model.to_dict() assert replication_database_model_json2 == replication_database_model_json -class TestModel_ReplicationDatabaseAuth(): + +class TestModel_ReplicationDatabaseAuth: """ Test Class for ReplicationDatabaseAuth """ @@ -15072,11 +15670,11 @@ def test_replication_database_auth_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic + replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic replication_database_auth_basic_model['password'] = 'testString' replication_database_auth_basic_model['username'] = 'testString' - replication_database_auth_iam_model = {} # ReplicationDatabaseAuthIam + replication_database_auth_iam_model = {} # ReplicationDatabaseAuthIam replication_database_auth_iam_model['api_key'] = 'testString' # Construct a json representation of a ReplicationDatabaseAuth model @@ -15099,7 +15697,8 @@ def test_replication_database_auth_serialization(self): replication_database_auth_model_json2 = replication_database_auth_model.to_dict() assert replication_database_auth_model_json2 == replication_database_auth_model_json -class TestModel_ReplicationDatabaseAuthBasic(): + +class TestModel_ReplicationDatabaseAuthBasic: """ Test Class for ReplicationDatabaseAuthBasic """ @@ -15129,7 +15728,8 @@ def test_replication_database_auth_basic_serialization(self): replication_database_auth_basic_model_json2 = replication_database_auth_basic_model.to_dict() assert replication_database_auth_basic_model_json2 == replication_database_auth_basic_model_json -class TestModel_ReplicationDatabaseAuthIam(): + +class TestModel_ReplicationDatabaseAuthIam: """ Test Class for ReplicationDatabaseAuthIam """ @@ -15158,7 +15758,8 @@ def test_replication_database_auth_iam_serialization(self): replication_database_auth_iam_model_json2 = replication_database_auth_iam_model.to_dict() assert replication_database_auth_iam_model_json2 == replication_database_auth_iam_model_json -class TestModel_ReplicationDocument(): + +class TestModel_ReplicationDocument: """ Test Class for ReplicationDocument """ @@ -15170,7 +15771,7 @@ def test_replication_document_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -15181,36 +15782,36 @@ def test_replication_document_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - replication_create_target_parameters_model = {} # ReplicationCreateTargetParameters + replication_create_target_parameters_model = {} # ReplicationCreateTargetParameters replication_create_target_parameters_model['n'] = 1 replication_create_target_parameters_model['partitioned'] = False replication_create_target_parameters_model['q'] = 26 - replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic + replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic replication_database_auth_basic_model['password'] = 'testString' replication_database_auth_basic_model['username'] = 'testString' - replication_database_auth_iam_model = {} # ReplicationDatabaseAuthIam + replication_database_auth_iam_model = {} # ReplicationDatabaseAuthIam replication_database_auth_iam_model['api_key'] = 'testString' - replication_database_auth_model = {} # ReplicationDatabaseAuth + replication_database_auth_model = {} # ReplicationDatabaseAuth replication_database_auth_model['basic'] = replication_database_auth_basic_model replication_database_auth_model['iam'] = replication_database_auth_iam_model - replication_database_model = {} # ReplicationDatabase + replication_database_model = {} # ReplicationDatabase replication_database_model['auth'] = replication_database_auth_model replication_database_model['headers'] = {'key1': 'testString'} replication_database_model['url'] = 'testString' - user_context_model = {} # UserContext + user_context_model = {} # UserContext user_context_model['db'] = 'testString' user_context_model['name'] = 'testString' user_context_model['roles'] = ['_reader'] @@ -15277,7 +15878,8 @@ def test_replication_document_serialization(self): actual_dict = replication_document_model.get_properties() assert actual_dict == expected_dict -class TestModel_Revisions(): + +class TestModel_Revisions: """ Test Class for Revisions """ @@ -15307,7 +15909,8 @@ def test_revisions_serialization(self): revisions_model_json2 = revisions_model.to_dict() assert revisions_model_json2 == revisions_model_json -class TestModel_RevsDiff(): + +class TestModel_RevsDiff: """ Test Class for RevsDiff """ @@ -15337,7 +15940,8 @@ def test_revs_diff_serialization(self): revs_diff_model_json2 = revs_diff_model.to_dict() assert revs_diff_model_json2 == revs_diff_model_json -class TestModel_SchedulerDocsResult(): + +class TestModel_SchedulerDocsResult: """ Test Class for SchedulerDocsResult """ @@ -15349,7 +15953,7 @@ def test_scheduler_docs_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - scheduler_info_model = {} # SchedulerInfo + scheduler_info_model = {} # SchedulerInfo scheduler_info_model['changes_pending'] = 0 scheduler_info_model['checkpointed_source_seq'] = 'testString' scheduler_info_model['doc_write_failures'] = 0 @@ -15361,7 +15965,7 @@ def test_scheduler_docs_result_serialization(self): scheduler_info_model['source_seq'] = 'testString' scheduler_info_model['through_seq'] = 'testString' - scheduler_document_model = {} # SchedulerDocument + scheduler_document_model = {} # SchedulerDocument scheduler_document_model['database'] = 'testString' scheduler_document_model['doc_id'] = 'testString' scheduler_document_model['error_count'] = 0 @@ -15396,7 +16000,8 @@ def test_scheduler_docs_result_serialization(self): scheduler_docs_result_model_json2 = scheduler_docs_result_model.to_dict() assert scheduler_docs_result_model_json2 == scheduler_docs_result_model_json -class TestModel_SchedulerDocument(): + +class TestModel_SchedulerDocument: """ Test Class for SchedulerDocument """ @@ -15408,7 +16013,7 @@ def test_scheduler_document_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - scheduler_info_model = {} # SchedulerInfo + scheduler_info_model = {} # SchedulerInfo scheduler_info_model['changes_pending'] = 0 scheduler_info_model['checkpointed_source_seq'] = 'testString' scheduler_info_model['doc_write_failures'] = 0 @@ -15451,7 +16056,8 @@ def test_scheduler_document_serialization(self): scheduler_document_model_json2 = scheduler_document_model.to_dict() assert scheduler_document_model_json2 == scheduler_document_model_json -class TestModel_SchedulerInfo(): + +class TestModel_SchedulerInfo: """ Test Class for SchedulerInfo """ @@ -15489,7 +16095,8 @@ def test_scheduler_info_serialization(self): scheduler_info_model_json2 = scheduler_info_model.to_dict() assert scheduler_info_model_json2 == scheduler_info_model_json -class TestModel_SchedulerJob(): + +class TestModel_SchedulerJob: """ Test Class for SchedulerJob """ @@ -15501,12 +16108,12 @@ def test_scheduler_job_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - scheduler_job_event_model = {} # SchedulerJobEvent + scheduler_job_event_model = {} # SchedulerJobEvent scheduler_job_event_model['reason'] = 'testString' scheduler_job_event_model['timestamp'] = '2019-01-01T12:00:00Z' scheduler_job_event_model['type'] = 'testString' - scheduler_info_model = {} # SchedulerInfo + scheduler_info_model = {} # SchedulerInfo scheduler_info_model['changes_pending'] = 0 scheduler_info_model['checkpointed_source_seq'] = 'testString' scheduler_info_model['doc_write_failures'] = 0 @@ -15547,7 +16154,8 @@ def test_scheduler_job_serialization(self): scheduler_job_model_json2 = scheduler_job_model.to_dict() assert scheduler_job_model_json2 == scheduler_job_model_json -class TestModel_SchedulerJobEvent(): + +class TestModel_SchedulerJobEvent: """ Test Class for SchedulerJobEvent """ @@ -15578,7 +16186,8 @@ def test_scheduler_job_event_serialization(self): scheduler_job_event_model_json2 = scheduler_job_event_model.to_dict() assert scheduler_job_event_model_json2 == scheduler_job_event_model_json -class TestModel_SchedulerJobsResult(): + +class TestModel_SchedulerJobsResult: """ Test Class for SchedulerJobsResult """ @@ -15590,12 +16199,12 @@ def test_scheduler_jobs_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - scheduler_job_event_model = {} # SchedulerJobEvent + scheduler_job_event_model = {} # SchedulerJobEvent scheduler_job_event_model['reason'] = 'testString' scheduler_job_event_model['timestamp'] = '2019-01-01T12:00:00Z' scheduler_job_event_model['type'] = 'testString' - scheduler_info_model = {} # SchedulerInfo + scheduler_info_model = {} # SchedulerInfo scheduler_info_model['changes_pending'] = 0 scheduler_info_model['checkpointed_source_seq'] = 'testString' scheduler_info_model['doc_write_failures'] = 0 @@ -15607,7 +16216,7 @@ def test_scheduler_jobs_result_serialization(self): scheduler_info_model['source_seq'] = 'testString' scheduler_info_model['through_seq'] = 'testString' - scheduler_job_model = {} # SchedulerJob + scheduler_job_model = {} # SchedulerJob scheduler_job_model['database'] = 'testString' scheduler_job_model['doc_id'] = 'testString' scheduler_job_model['history'] = [scheduler_job_event_model] @@ -15640,7 +16249,8 @@ def test_scheduler_jobs_result_serialization(self): scheduler_jobs_result_model_json2 = scheduler_jobs_result_model.to_dict() assert scheduler_jobs_result_model_json2 == scheduler_jobs_result_model_json -class TestModel_SearchAnalyzeResult(): + +class TestModel_SearchAnalyzeResult: """ Test Class for SearchAnalyzeResult """ @@ -15669,7 +16279,8 @@ def test_search_analyze_result_serialization(self): search_analyze_result_model_json2 = search_analyze_result_model.to_dict() assert search_analyze_result_model_json2 == search_analyze_result_model_json -class TestModel_SearchIndexDefinition(): + +class TestModel_SearchIndexDefinition: """ Test Class for SearchIndexDefinition """ @@ -15681,11 +16292,11 @@ def test_search_index_definition_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - analyzer_model = {} # Analyzer + analyzer_model = {} # Analyzer analyzer_model['name'] = 'classic' analyzer_model['stopwords'] = ['testString'] - analyzer_configuration_model = {} # AnalyzerConfiguration + analyzer_configuration_model = {} # AnalyzerConfiguration analyzer_configuration_model['name'] = 'classic' analyzer_configuration_model['stopwords'] = ['testString'] analyzer_configuration_model['fields'] = {'key1': analyzer_model} @@ -15710,7 +16321,8 @@ def test_search_index_definition_serialization(self): search_index_definition_model_json2 = search_index_definition_model.to_dict() assert search_index_definition_model_json2 == search_index_definition_model_json -class TestModel_SearchIndexInfo(): + +class TestModel_SearchIndexInfo: """ Test Class for SearchIndexInfo """ @@ -15744,7 +16356,8 @@ def test_search_index_info_serialization(self): search_index_info_model_json2 = search_index_info_model.to_dict() assert search_index_info_model_json2 == search_index_info_model_json -class TestModel_SearchInfoResult(): + +class TestModel_SearchInfoResult: """ Test Class for SearchInfoResult """ @@ -15756,7 +16369,7 @@ def test_search_info_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - search_index_info_model = {} # SearchIndexInfo + search_index_info_model = {} # SearchIndexInfo search_index_info_model['committed_seq'] = 26 search_index_info_model['disk_size'] = 0 search_index_info_model['doc_count'] = 0 @@ -15784,7 +16397,8 @@ def test_search_info_result_serialization(self): search_info_result_model_json2 = search_info_result_model.to_dict() assert search_info_result_model_json2 == search_info_result_model_json -class TestModel_SearchResult(): + +class TestModel_SearchResult: """ Test Class for SearchResult """ @@ -15796,7 +16410,7 @@ def test_search_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -15807,15 +16421,15 @@ def test_search_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -15827,13 +16441,13 @@ def test_search_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - search_result_row_model = {} # SearchResultRow + search_result_row_model = {} # SearchResultRow search_result_row_model['doc'] = document_model search_result_row_model['fields'] = {'foo': 'bar'} search_result_row_model['highlights'] = {'key1': ['testString']} search_result_row_model['id'] = 'testString' - search_result_properties_model = {} # SearchResultProperties + search_result_properties_model = {} # SearchResultProperties search_result_properties_model['total_rows'] = 0 search_result_properties_model['bookmark'] = 'testString' search_result_properties_model['by'] = 'testString' @@ -15866,7 +16480,8 @@ def test_search_result_serialization(self): search_result_model_json2 = search_result_model.to_dict() assert search_result_model_json2 == search_result_model_json -class TestModel_SearchResultProperties(): + +class TestModel_SearchResultProperties: """ Test Class for SearchResultProperties """ @@ -15878,7 +16493,7 @@ def test_search_result_properties_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -15889,15 +16504,15 @@ def test_search_result_properties_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -15909,7 +16524,7 @@ def test_search_result_properties_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - search_result_row_model = {} # SearchResultRow + search_result_row_model = {} # SearchResultRow search_result_row_model['doc'] = document_model search_result_row_model['fields'] = {'foo': 'bar'} search_result_row_model['highlights'] = {'key1': ['testString']} @@ -15939,7 +16554,8 @@ def test_search_result_properties_serialization(self): search_result_properties_model_json2 = search_result_properties_model.to_dict() assert search_result_properties_model_json2 == search_result_properties_model_json -class TestModel_SearchResultRow(): + +class TestModel_SearchResultRow: """ Test Class for SearchResultRow """ @@ -15951,7 +16567,7 @@ def test_search_result_row_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -15962,15 +16578,15 @@ def test_search_result_row_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -16004,7 +16620,8 @@ def test_search_result_row_serialization(self): search_result_row_model_json2 = search_result_row_model.to_dict() assert search_result_row_model_json2 == search_result_row_model_json -class TestModel_Security(): + +class TestModel_Security: """ Test Class for Security """ @@ -16016,7 +16633,7 @@ def test_security_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - security_object_model = {} # SecurityObject + security_object_model = {} # SecurityObject security_object_model['names'] = ['testString'] security_object_model['roles'] = ['testString'] @@ -16042,7 +16659,8 @@ def test_security_serialization(self): security_model_json2 = security_model.to_dict() assert security_model_json2 == security_model_json -class TestModel_SecurityObject(): + +class TestModel_SecurityObject: """ Test Class for SecurityObject """ @@ -16072,7 +16690,8 @@ def test_security_object_serialization(self): security_object_model_json2 = security_object_model.to_dict() assert security_object_model_json2 == security_object_model_json -class TestModel_ServerInformation(): + +class TestModel_ServerInformation: """ Test Class for ServerInformation """ @@ -16084,7 +16703,7 @@ def test_server_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - server_vendor_model = {} # ServerVendor + server_vendor_model = {} # ServerVendor server_vendor_model['name'] = 'testString' server_vendor_model['variant'] = 'testString' server_vendor_model['version'] = 'testString' @@ -16112,7 +16731,8 @@ def test_server_information_serialization(self): server_information_model_json2 = server_information_model.to_dict() assert server_information_model_json2 == server_information_model_json -class TestModel_ServerVendor(): + +class TestModel_ServerVendor: """ Test Class for ServerVendor """ @@ -16143,7 +16763,8 @@ def test_server_vendor_serialization(self): server_vendor_model_json2 = server_vendor_model.to_dict() assert server_vendor_model_json2 == server_vendor_model_json -class TestModel_SessionAuthentication(): + +class TestModel_SessionAuthentication: """ Test Class for SessionAuthentication """ @@ -16174,7 +16795,8 @@ def test_session_authentication_serialization(self): session_authentication_model_json2 = session_authentication_model.to_dict() assert session_authentication_model_json2 == session_authentication_model_json -class TestModel_SessionInformation(): + +class TestModel_SessionInformation: """ Test Class for SessionInformation """ @@ -16186,12 +16808,12 @@ def test_session_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - session_authentication_model = {} # SessionAuthentication + session_authentication_model = {} # SessionAuthentication session_authentication_model['authenticated'] = 'testString' session_authentication_model['authentication_db'] = 'testString' session_authentication_model['authentication_handlers'] = ['testString'] - user_context_model = {} # UserContext + user_context_model = {} # UserContext user_context_model['db'] = 'testString' user_context_model['name'] = 'testString' user_context_model['roles'] = ['_reader'] @@ -16217,7 +16839,8 @@ def test_session_information_serialization(self): session_information_model_json2 = session_information_model.to_dict() assert session_information_model_json2 == session_information_model_json -class TestModel_ShardsInformation(): + +class TestModel_ShardsInformation: """ Test Class for ShardsInformation """ @@ -16246,7 +16869,8 @@ def test_shards_information_serialization(self): shards_information_model_json2 = shards_information_model.to_dict() assert shards_information_model_json2 == shards_information_model_json -class TestModel_ThroughputInformation(): + +class TestModel_ThroughputInformation: """ Test Class for ThroughputInformation """ @@ -16278,7 +16902,8 @@ def test_throughput_information_serialization(self): throughput_information_model_json2 = throughput_information_model.to_dict() assert throughput_information_model_json2 == throughput_information_model_json -class TestModel_UpInformation(): + +class TestModel_UpInformation: """ Test Class for UpInformation """ @@ -16308,7 +16933,8 @@ def test_up_information_serialization(self): up_information_model_json2 = up_information_model.to_dict() assert up_information_model_json2 == up_information_model_json -class TestModel_UserContext(): + +class TestModel_UserContext: """ Test Class for UserContext """ @@ -16339,7 +16965,8 @@ def test_user_context_serialization(self): user_context_model_json2 = user_context_model.to_dict() assert user_context_model_json2 == user_context_model_json -class TestModel_UuidsResult(): + +class TestModel_UuidsResult: """ Test Class for UuidsResult """ @@ -16368,7 +16995,8 @@ def test_uuids_result_serialization(self): uuids_result_model_json2 = uuids_result_model.to_dict() assert uuids_result_model_json2 == uuids_result_model_json -class TestModel_ViewQueriesResult(): + +class TestModel_ViewQueriesResult: """ Test Class for ViewQueriesResult """ @@ -16380,7 +17008,7 @@ def test_view_queries_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -16391,15 +17019,15 @@ def test_view_queries_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -16411,7 +17039,7 @@ def test_view_queries_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - view_result_row_model = {} # ViewResultRow + view_result_row_model = {} # ViewResultRow view_result_row_model['caused_by'] = 'testString' view_result_row_model['error'] = 'testString' view_result_row_model['reason'] = 'testString' @@ -16420,7 +17048,7 @@ def test_view_queries_result_serialization(self): view_result_row_model['key'] = 'testString' view_result_row_model['value'] = 'testString' - view_result_model = {} # ViewResult + view_result_model = {} # ViewResult view_result_model['total_rows'] = 0 view_result_model['update_seq'] = 'testString' view_result_model['rows'] = [view_result_row_model] @@ -16444,7 +17072,8 @@ def test_view_queries_result_serialization(self): view_queries_result_model_json2 = view_queries_result_model.to_dict() assert view_queries_result_model_json2 == view_queries_result_model_json -class TestModel_ViewQuery(): + +class TestModel_ViewQuery: """ Test Class for ViewQuery """ @@ -16492,7 +17121,8 @@ def test_view_query_serialization(self): view_query_model_json2 = view_query_model.to_dict() assert view_query_model_json2 == view_query_model_json -class TestModel_ViewResult(): + +class TestModel_ViewResult: """ Test Class for ViewResult """ @@ -16504,7 +17134,7 @@ def test_view_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -16515,15 +17145,15 @@ def test_view_result_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True @@ -16535,7 +17165,7 @@ def test_view_result_serialization(self): document_model['_revs_info'] = [document_revision_status_model] document_model['foo'] = 'testString' - view_result_row_model = {} # ViewResultRow + view_result_row_model = {} # ViewResultRow view_result_row_model['caused_by'] = 'testString' view_result_row_model['error'] = 'testString' view_result_row_model['reason'] = 'testString' @@ -16565,7 +17195,8 @@ def test_view_result_serialization(self): view_result_model_json2 = view_result_model.to_dict() assert view_result_model_json2 == view_result_model_json -class TestModel_ViewResultRow(): + +class TestModel_ViewResultRow: """ Test Class for ViewResultRow """ @@ -16577,7 +17208,7 @@ def test_view_result_row_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - attachment_model = {} # Attachment + attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' attachment_model['digest'] = 'testString' @@ -16588,15 +17219,15 @@ def test_view_result_row_serialization(self): attachment_model['revpos'] = 1 attachment_model['stub'] = True - revisions_model = {} # Revisions + revisions_model = {} # Revisions revisions_model['ids'] = ['testString'] revisions_model['start'] = 1 - document_revision_status_model = {} # DocumentRevisionStatus + document_revision_status_model = {} # DocumentRevisionStatus document_revision_status_model['rev'] = 'testString' document_revision_status_model['status'] = 'available' - document_model = {} # Document + document_model = {} # Document document_model['_attachments'] = {'key1': attachment_model} document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True From b1b98d55c9dde107f1e414be5b9b125a411923f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 09:40:21 +0200 Subject: [PATCH 134/669] build(deps-dev): Bump pytest from 7.3.0 to 7.3.1 (#465) Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.0 to 7.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.3.0...7.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 103e03a9..10b50eee 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.3.0 +pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.2 From 63cbef734166c8cd4073c8fc8ed18ae57cf20065 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:25:50 +0100 Subject: [PATCH 135/669] build(generated): do linting as part of tests for python (#467) * build(generated): do linting as part of tests for python Generated SDK source code using: - Generator version 3.69.0 - Specification version 1.0.0-dev0.0.50 - Automation (cloudant-sdks) version 337927a Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> * build: remove "Useless option value" settings from pylintrc --------- Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Co-authored-by: Thomas Blench --- .pylintrc | 76 ++--------------------------------------------------- Jenkinsfile | 1 + tox.ini | 6 ++--- 3 files changed, 6 insertions(+), 77 deletions(-) diff --git a/.pylintrc b/.pylintrc index 74f46e48..44bbda31 100644 --- a/.pylintrc +++ b/.pylintrc @@ -52,19 +52,8 @@ disable=too-many-arguments, too-many-branches, too-many-lines, line-too-long, - bad-continuation, similarities, - print-statement, - parameter-unpacking, - unpacking-in-except, - old-raise-syntax, - backtick, - long-suffix, - old-ne-operator, - old-octal-literal, import-error, - import-star-module-level, - non-ascii-bytes-literal, raw-checker-failed, bad-inline-option, locally-disabled, @@ -73,67 +62,6 @@ disable=too-many-arguments, useless-suppression, deprecated-pragma, use-symbolic-message-instead, - apply-builtin, - basestring-builtin, - buffer-builtin, - cmp-builtin, - coerce-builtin, - execfile-builtin, - file-builtin, - long-builtin, - raw_input-builtin, - reduce-builtin, - standarderror-builtin, - unicode-builtin, - xrange-builtin, - coerce-method, - delslice-method, - getslice-method, - setslice-method, - no-absolute-import, - old-division, - dict-iter-method, - dict-view-method, - next-method-called, - metaclass-assignment, - indexing-exception, - raising-string, - reload-builtin, - oct-method, - hex-method, - nonzero-method, - cmp-method, - input-builtin, - round-builtin, - intern-builtin, - unichr-builtin, - map-builtin-not-iterating, - zip-builtin-not-iterating, - range-builtin-not-iterating, - filter-builtin-not-iterating, - using-cmp-argument, - eq-without-hash, - div-method, - idiv-method, - rdiv-method, - exception-message-attribute, - invalid-str-codec, - sys-max-int, - bad-python3-import, - deprecated-string-function, - deprecated-str-translate-call, - deprecated-itertools-function, - deprecated-types-field, - next-method-defined, - dict-items-not-iterating, - dict-keys-not-iterating, - dict-values-not-iterating, - deprecated-operator-function, - deprecated-urllib-function, - xreadlines-attribute, - deprecated-sys-function, - exception-escape, - comprehension-escape, invalid-name # Enable the message, report, category or checker with the given id(s). You can @@ -573,5 +501,5 @@ valid-metaclass-classmethod-first-arg=cls # Exceptions that will emit a warning when being caught. Defaults to # "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception +overgeneral-exceptions=builtin.BaseException, + builtin.Exception diff --git a/Jenkinsfile b/Jenkinsfile index 7cba78ae..13f3f649 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -294,6 +294,7 @@ void applyCustomizations() { void runTests() { sh ''' export PIP_INDEX_URL=https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL_DOWN##'https://'}/api/pypi/cloudant-sdks-pypi-virtual/simple + python3 -m tox -e py311-lint python3 -m tox -e py311 ''' } diff --git a/tox.ini b/tox.ini index ebc40720..3d57a0a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py39-lint, py37, py38, py39, py310, py311 +envlist = py311-lint, py37, py38, py39, py310, py311 -[testenv:py39-lint] -basepython = python3.9 +[testenv:py311-lint] +basepython = python3.11 deps = pylint commands = pylint --rcfile=.pylintrc ibmcloudant test setenv = PYTHONPATH = pylint/checkers From 3c3d6cea721f4e99633e3df3b42f15dec42cafd1 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 24 Apr 2023 15:33:33 +0100 Subject: [PATCH 136/669] build(generated): Update spec version to 0.0.51 (#709) (#469) Generated SDK source code using: - Generator version 3.69.0 - Specification version 1.0.0-dev0.0.51 - Automation (cloudant-sdks) version d87ff5b Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 99 +++++++++++++++++++++++++++++++++++ test/unit/test_cloudant_v1.py | 48 ++++++++++++++++- 2 files changed, 145 insertions(+), 2 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 7e1c39af..c42d5570 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -11720,6 +11720,8 @@ class DesignDocumentViewIndex: :attr str signature: MD5 signature of the views for the design document. :attr ContentInformationSizes sizes: Schema for size information of content. :attr bool updater_running: Indicates if the view is currently being updated. + :attr UpdatesPending updates_pending: Schema for an ability to tell if view is + up-to-date without querying it. :attr int waiting_clients: Number of clients waiting on views from this design document. :attr bool waiting_commit: Indicates if there are outstanding commits to the @@ -11734,6 +11736,7 @@ def __init__( signature: str, sizes: 'ContentInformationSizes', updater_running: bool, + updates_pending: 'UpdatesPending', waiting_clients: int, waiting_commit: bool, ) -> None: @@ -11751,6 +11754,8 @@ def __init__( content. :param bool updater_running: Indicates if the view is currently being updated. + :param UpdatesPending updates_pending: Schema for an ability to tell if + view is up-to-date without querying it. :param int waiting_clients: Number of clients waiting on views from this design document. :param bool waiting_commit: Indicates if there are outstanding commits to @@ -11762,6 +11767,7 @@ def __init__( self.signature = signature self.sizes = sizes self.updater_running = updater_running + self.updates_pending = updates_pending self.waiting_clients = waiting_clients self.waiting_commit = waiting_commit @@ -11793,6 +11799,10 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewIndex': args['updater_running'] = _dict.get('updater_running') else: raise ValueError('Required property \'updater_running\' not present in DesignDocumentViewIndex JSON') + if 'updates_pending' in _dict: + args['updates_pending'] = UpdatesPending.from_dict(_dict.get('updates_pending')) + else: + raise ValueError('Required property \'updates_pending\' not present in DesignDocumentViewIndex JSON') if 'waiting_clients' in _dict: args['waiting_clients'] = _dict.get('waiting_clients') else: @@ -11826,6 +11836,11 @@ def to_dict(self) -> Dict: _dict['sizes'] = self.sizes.to_dict() if hasattr(self, 'updater_running') and self.updater_running is not None: _dict['updater_running'] = self.updater_running + if hasattr(self, 'updates_pending') and self.updates_pending is not None: + if isinstance(self.updates_pending, dict): + _dict['updates_pending'] = self.updates_pending + else: + _dict['updates_pending'] = self.updates_pending.to_dict() if hasattr(self, 'waiting_clients') and self.waiting_clients is not None: _dict['waiting_clients'] = self.waiting_clients if hasattr(self, 'waiting_commit') and self.waiting_commit is not None: @@ -17312,6 +17327,90 @@ class StatusEnum(str, Enum): +class UpdatesPending: + """ + Schema for an ability to tell if view is up-to-date without querying it. + + :attr int minimum: Sum of shard copies with the least amount of work to do. + :attr int preferred: Sum of unique shards. This value is zero when at least one + copy of every shard range is up-to-date and the view is able to answer a query + without index building delays. + :attr int total: Sum of all shard copies. + """ + + def __init__( + self, + minimum: int, + preferred: int, + total: int, + ) -> None: + """ + Initialize a UpdatesPending object. + + :param int minimum: Sum of shard copies with the least amount of work to + do. + :param int preferred: Sum of unique shards. This value is zero when at + least one copy of every shard range is up-to-date and the view is able to + answer a query without index building delays. + :param int total: Sum of all shard copies. + """ + self.minimum = minimum + self.preferred = preferred + self.total = total + + @classmethod + def from_dict(cls, _dict: Dict) -> 'UpdatesPending': + """Initialize a UpdatesPending object from a json dictionary.""" + args = {} + if 'minimum' in _dict: + args['minimum'] = _dict.get('minimum') + else: + raise ValueError('Required property \'minimum\' not present in UpdatesPending JSON') + if 'preferred' in _dict: + args['preferred'] = _dict.get('preferred') + else: + raise ValueError('Required property \'preferred\' not present in UpdatesPending JSON') + if 'total' in _dict: + args['total'] = _dict.get('total') + else: + raise ValueError('Required property \'total\' not present in UpdatesPending JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a UpdatesPending object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'minimum') and self.minimum is not None: + _dict['minimum'] = self.minimum + if hasattr(self, 'preferred') and self.preferred is not None: + _dict['preferred'] = self.preferred + if hasattr(self, 'total') and self.total is not None: + _dict['total'] = self.total + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this UpdatesPending object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'UpdatesPending') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'UpdatesPending') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class UserContext: """ Schema for the user context of a session. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index ffa3d676..f4c86b39 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -5182,7 +5182,7 @@ def test_get_design_document_information_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_info') - mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "waiting_clients": 0, "waiting_commit": true}}' + mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "updates_pending": {"minimum": 7, "preferred": 9, "total": 5}, "waiting_clients": 0, "waiting_commit": true}}' responses.add( responses.GET, url, @@ -5222,7 +5222,7 @@ def test_get_design_document_information_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_info') - mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "waiting_clients": 0, "waiting_commit": true}}' + mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "updates_pending": {"minimum": 7, "preferred": 9, "total": 5}, "waiting_clients": 0, "waiting_commit": true}}' responses.add( responses.GET, url, @@ -14482,6 +14482,11 @@ def test_design_document_information_serialization(self): content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 + updates_pending_model = {} # UpdatesPending + updates_pending_model['minimum'] = 26 + updates_pending_model['preferred'] = 26 + updates_pending_model['total'] = 26 + design_document_view_index_model = {} # DesignDocumentViewIndex design_document_view_index_model['collator_versions'] = ['testString'] design_document_view_index_model['compact_running'] = True @@ -14489,6 +14494,7 @@ def test_design_document_information_serialization(self): design_document_view_index_model['signature'] = 'testString' design_document_view_index_model['sizes'] = content_information_sizes_model design_document_view_index_model['updater_running'] = True + design_document_view_index_model['updates_pending'] = updates_pending_model design_document_view_index_model['waiting_clients'] = 0 design_document_view_index_model['waiting_commit'] = True @@ -14560,6 +14566,11 @@ def test_design_document_view_index_serialization(self): content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 + updates_pending_model = {} # UpdatesPending + updates_pending_model['minimum'] = 26 + updates_pending_model['preferred'] = 26 + updates_pending_model['total'] = 26 + # Construct a json representation of a DesignDocumentViewIndex model design_document_view_index_model_json = {} design_document_view_index_model_json['collator_versions'] = ['testString'] @@ -14568,6 +14579,7 @@ def test_design_document_view_index_serialization(self): design_document_view_index_model_json['signature'] = 'testString' design_document_view_index_model_json['sizes'] = content_information_sizes_model design_document_view_index_model_json['updater_running'] = True + design_document_view_index_model_json['updates_pending'] = updates_pending_model design_document_view_index_model_json['waiting_clients'] = 0 design_document_view_index_model_json['waiting_commit'] = True @@ -16934,6 +16946,38 @@ def test_up_information_serialization(self): assert up_information_model_json2 == up_information_model_json +class TestModel_UpdatesPending: + """ + Test Class for UpdatesPending + """ + + def test_updates_pending_serialization(self): + """ + Test serialization/deserialization for UpdatesPending + """ + + # Construct a json representation of a UpdatesPending model + updates_pending_model_json = {} + updates_pending_model_json['minimum'] = 26 + updates_pending_model_json['preferred'] = 26 + updates_pending_model_json['total'] = 26 + + # Construct a model instance of UpdatesPending by calling from_dict on the json representation + updates_pending_model = UpdatesPending.from_dict(updates_pending_model_json) + assert updates_pending_model != False + + # Construct a model instance of UpdatesPending by calling from_dict on the json representation + updates_pending_model_dict = UpdatesPending.from_dict(updates_pending_model_json).__dict__ + updates_pending_model2 = UpdatesPending(**updates_pending_model_dict) + + # Verify the model instances are equivalent + assert updates_pending_model == updates_pending_model2 + + # Convert model instance back to dict and verify no loss of data + updates_pending_model_json2 = updates_pending_model.to_dict() + assert updates_pending_model_json2 == updates_pending_model_json + + class TestModel_UserContext: """ Test Class for UserContext From f982f43eca9ea8eadaa1f483b607bc8f54c4f3dd Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:46:46 +0000 Subject: [PATCH 137/669] Update version 0.4.0 -> 0.4.1 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ea3564ad..1c02488f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.0 +current_version = 0.4.1 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index e2d4f34e..ee2c0109 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.4.0 +# IBM Cloudant Python SDK Version 0.4.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.4.0" +pip install --upgrade "ibmcloudant>=0.4.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.4.0" +easy_install --upgrade "ibmcloudant>=0.4.1" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index a6b3a5b6..5211606e 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.4.0' +__version__ = '0.4.1' diff --git a/setup.py b/setup.py index c8d78fa2..ead01cba 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.4.0' +__version__ = '0.4.1' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From fc132b3a28898b6d00a83af86f8d2eb4e93826ed Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 25 Apr 2023 09:14:43 +0000 Subject: [PATCH 138/669] Update version 0.4.1 -> 0.4.1 --- ibmcloudant/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 5211606e..78697255 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.4.1' +__version__ = '__version__ = '0.4.1'' diff --git a/setup.py b/setup.py index ead01cba..d422713e 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.4.1' +__version__ = '__version__ = '0.4.1'' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From a699a4529d1c6940c68cdb0b25039e1d481377bb Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 25 Apr 2023 10:31:16 +0100 Subject: [PATCH 139/669] revert: "Update version 0.4.1 -> 0.4.1" This reverts commit fc132b3a28898b6d00a83af86f8d2eb4e93826ed. Refs: fc132b3 --- ibmcloudant/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 78697255..5211606e 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '__version__ = '0.4.1'' +__version__ = '0.4.1' diff --git a/setup.py b/setup.py index d422713e..ead01cba 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '__version__ = '0.4.1'' +__version__ = '0.4.1' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From 0743dcc826204691a408e9dd0c3509c36bdf282c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:56:53 +0000 Subject: [PATCH 140/669] build(deps-dev): Bump pylint from 2.17.2 to 2.17.3 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.17.2 to 2.17.3. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.17.2...v2.17.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 10b50eee..b6b150db 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 -pylint==2.17.2 +pylint==2.17.3 tox==4.4.12 pytest-rerunfailures==11.1.2 From 151936b32b0f0a661c634360589dd50934ff415a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 09:09:49 +0000 Subject: [PATCH 141/669] build(deps-dev): Bump tox from 4.4.12 to 4.5.0 Bumps [tox](https://github.com/tox-dev/tox) from 4.4.12 to 4.5.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.4.12...4.5.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b6b150db..07d76ac5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.3 -tox==4.4.12 +tox==4.5.0 pytest-rerunfailures==11.1.2 # code coverage From a5fd88fa2602c01e850708695d9c878d8024a4c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:56:49 +0000 Subject: [PATCH 142/669] build(deps-dev): Bump tox from 4.5.0 to 4.5.1 Bumps [tox](https://github.com/tox-dev/tox) from 4.5.0 to 4.5.1. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.5.0...4.5.1) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 07d76ac5..55e08e2e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.3 -tox==4.5.0 +tox==4.5.1 pytest-rerunfailures==11.1.2 # code coverage From 415917725b74e4380e40a27224034484779bc2c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:12:01 -0400 Subject: [PATCH 143/669] build(deps-dev): Bump coverage from 7.2.3 to 7.2.4 (#477) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.3 to 7.2.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.3...7.2.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 55e08e2e..4998bea2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.5.1 pytest-rerunfailures==11.1.2 # code coverage -coverage==7.2.3 +coverage==7.2.4 pytest-cov==4.0.0 # documentation From ea726264f0a9d4bbbdfcafa30411b2056702138f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 14:25:44 -0400 Subject: [PATCH 144/669] build(deps-dev): Bump coverage from 7.2.4 to 7.2.5 (#479) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.4 to 7.2.5. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.4...7.2.5) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4998bea2..01c09411 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.5.1 pytest-rerunfailures==11.1.2 # code coverage -coverage==7.2.4 +coverage==7.2.5 pytest-cov==4.0.0 # documentation From c2f0ffb811dfee51804145f02180f89fa3f252d7 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 5 May 2023 08:24:38 +0100 Subject: [PATCH 145/669] docs(generated): fix links and grammar in README (#480) Generated SDK source code using: - Generator version 3.69.0 - Specification version 1.0.0-dev0.0.51 - Automation (cloudant-sdks) version 47004ea Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee2c0109..82464fa0 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/READ ### Code examples The following code examples -[authenticate with the environment variables](#authenticate-with-environment-variables). +[authenticate with the environment variables](#authentication-with-environment-variables). #### 1. Create a database and add a document @@ -236,7 +236,7 @@ the *service url*, *authentication type* and *authentication credentials* of your Cloudant service. Cloudant environment variable naming starts with a *service name* prefix that identifies your service. -By default this is `CLOUDANT`, see the settings in the +By default, this is `CLOUDANT`, see the settings in the [authentication with environment variables section](#authentication-with-environment-variables). If you would like to rename your Cloudant service from `CLOUDANT`, From 1fd8f202e580b51240c1aa6f56572e64c9e05e65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 15:21:49 -0300 Subject: [PATCH 146/669] build(deps-dev): Bump pylint from 2.17.3 to 2.17.4 (#481) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.17.3 to 2.17.4. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.17.3...v2.17.4) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 01c09411..b97e0878 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 -pylint==2.17.3 +pylint==2.17.4 tox==4.5.1 pytest-rerunfailures==11.1.2 From de73d1c79802d97cf8326e515adec648236c7042 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 12 May 2023 16:31:34 +0100 Subject: [PATCH 147/669] fix(generated): add missing wiremock stub for delete of missing doc (#483) Generated SDK source code using: - Generator version 3.69.0 - Specification version 1.0.0-dev0.0.51 - Automation (cloudant-sdks) version d79e2c3 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- stubs/mappings.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/stubs/mappings.json b/stubs/mappings.json index ef50d50b..25face60 100644 --- a/stubs/mappings.json +++ b/stubs/mappings.json @@ -1,4 +1,26 @@ {"mappings":[{ + "id" : "4e7ecd46-9129-42a1-8899-985567444ad6", + "name" : "orders_example", + "request" : { + "url" : "/orders/example?rev=4-bf3f53fe029a70e6451e375ccd36599c", + "method" : "DELETE" + }, + "response" : { + "status" : 404, + "body" : "{\"error\":\"not_found\",\"reason\":\"deleted\"}\n", + "headers" : { + "Cache-Control" : "must-revalidate", + "Content-Type" : "application/json", + "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", + "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID" : "750c2d635a", + "X-CouchDB-Body-Time" : "0" + } + }, + "uuid" : "4e7ecd46-9129-42a1-8899-985567444ad6", + "persistent" : true, + "insertionIndex" : 18 +},{ "id" : "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", "name" : "orders_example", "request" : { From 40d1fd537a48ef02aee432f341146fe3947eaaeb Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 22 May 2023 09:55:50 +0000 Subject: [PATCH 148/669] feat(generated): update spec to 1.0.0-dev0.0.52 Generated SDK source code using: - Generator version 3.69.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version e72f200 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 52 +++++++++++++++++++++++------------ test/unit/test_cloudant_v1.py | 5 ++-- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index c42d5570..77de099c 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -12656,12 +12656,15 @@ class ExplainResult: """ Schema for information about the index used for a find query. - :attr str dbname: dbname. - :attr List[str] fields: fields. + :attr bool covered: When `true`, the query is answered using the index only and + no documents are fetched. + :attr str dbname: Name of database. + :attr List[str] fields: Fields to be returned by the query. :attr IndexInformation index: Schema for information about an index. - :attr int limit: limit. - :attr dict opts: opts. - :attr ExplainResultRange range: (optional) range. + :attr int limit: The used maximum number of results returned. + :attr dict opts: Query options used. + :attr ExplainResultRange range: (optional) Range parameters passed to the + underlying view. :attr dict selector: 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 other data. @@ -12691,11 +12694,12 @@ class ExplainResult: For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). - :attr int skip: skip. + :attr int skip: Skip parameter used. """ def __init__( self, + covered: bool, dbname: str, fields: List[str], index: 'IndexInformation', @@ -12709,11 +12713,13 @@ def __init__( """ Initialize a ExplainResult object. - :param str dbname: dbname. - :param List[str] fields: fields. + :param bool covered: When `true`, the query is answered using the index + only and no documents are fetched. + :param str dbname: Name of database. + :param List[str] fields: Fields to be returned by the query. :param IndexInformation index: Schema for information about an index. - :param int limit: limit. - :param dict opts: opts. + :param int limit: The used maximum number of results returned. + :param dict opts: Query options used. :param dict selector: 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 other data. @@ -12745,9 +12751,11 @@ def __init__( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). - :param int skip: skip. - :param ExplainResultRange range: (optional) range. + :param int skip: Skip parameter used. + :param ExplainResultRange range: (optional) Range parameters passed to the + underlying view. """ + self.covered = covered self.dbname = dbname self.fields = fields self.index = index @@ -12761,6 +12769,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ExplainResult': """Initialize a ExplainResult object from a json dictionary.""" args = {} + if 'covered' in _dict: + args['covered'] = _dict.get('covered') + else: + raise ValueError('Required property \'covered\' not present in ExplainResult JSON') if 'dbname' in _dict: args['dbname'] = _dict.get('dbname') else: @@ -12801,6 +12813,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'covered') and self.covered is not None: + _dict['covered'] = self.covered if hasattr(self, 'dbname') and self.dbname is not None: _dict['dbname'] = self.dbname if hasattr(self, 'fields') and self.fields is not None: @@ -12846,10 +12860,12 @@ def __ne__(self, other: 'ExplainResult') -> bool: class ExplainResultRange: """ - range. + Range parameters passed to the underlying view. - :attr List[object] end_key: (optional) end_key. - :attr List[object] start_key: (optional) start_key. + :attr List[object] end_key: (optional) End key parameter passed to the + underlying view. + :attr List[object] start_key: (optional) Start key parameter passed to the + underlying view. """ def __init__( @@ -12861,8 +12877,10 @@ def __init__( """ Initialize a ExplainResultRange object. - :param List[object] end_key: (optional) end_key. - :param List[object] start_key: (optional) start_key. + :param List[object] end_key: (optional) End key parameter passed to the + underlying view. + :param List[object] start_key: (optional) Start key parameter passed to the + underlying view. """ self.end_key = end_key self.start_key = start_key diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index f4c86b39..02a2d7ae 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -7748,7 +7748,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add( responses.POST, url, @@ -7827,7 +7827,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add( responses.POST, url, @@ -14979,6 +14979,7 @@ def test_explain_result_serialization(self): # Construct a json representation of a ExplainResult model explain_result_model_json = {} + explain_result_model_json['covered'] = True explain_result_model_json['dbname'] = 'testString' explain_result_model_json['fields'] = ['testString'] explain_result_model_json['index'] = index_information_model From 6476a5f10d660ee707a58de7facbdda9e412cbe8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 08:12:46 +0000 Subject: [PATCH 149/669] build(deps): Bump ibm-cloud-sdk-core from 3.16.5 to 3.16.6 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.5 to 3.16.6. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.5...v3.16.6) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1cb4d659..489a1c2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_cloud_sdk_core==3.16.5 +ibm_cloud_sdk_core==3.16.6 # dependencies of ibm_cloud_sdk_core: requests>=2.20,<3.0 python_dateutil>=2.5.3,<3.0.0 From d1a407d8e1de3fe930ddff9cdcfe45ce8c40a749 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 May 2023 07:42:27 +0000 Subject: [PATCH 150/669] build(deps-dev): Bump coverage from 7.2.5 to 7.2.6 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.5 to 7.2.6. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.5...7.2.6) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b97e0878..befca811 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ tox==4.5.1 pytest-rerunfailures==11.1.2 # code coverage -coverage==7.2.5 +coverage==7.2.6 pytest-cov==4.0.0 # documentation From d51befe3ba0233969cd95528fe9b097cff8df290 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 24 May 2023 09:07:59 +0000 Subject: [PATCH 151/669] Update version 0.4.1 -> 0.4.2 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1c02488f..0915a194 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.1 +current_version = 0.4.2 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 82464fa0..2f881dba 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.4.1 +# IBM Cloudant Python SDK Version 0.4.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.4.1" +pip install --upgrade "ibmcloudant>=0.4.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.4.1" +easy_install --upgrade "ibmcloudant>=0.4.2" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 5211606e..a7ae9258 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.4.1' +__version__ = '0.4.2' diff --git a/setup.py b/setup.py index ead01cba..c6246170 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.4.1' +__version__ = '0.4.2' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From 75defbad8282b16b33c0e7bd1626af92050ebd9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 17:56:50 +0000 Subject: [PATCH 152/669] build(deps-dev): Bump pytest-cov from 4.0.0 to 4.1.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 4.0.0 to 4.1.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index befca811..fce075de 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ pytest-rerunfailures==11.1.2 # code coverage coverage==7.2.6 -pytest-cov==4.0.0 +pytest-cov==4.1.0 # documentation recommonmark==0.7.1 From b53e2af5716748cef1609bb8bbed2d03f7d09e37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 16:49:06 -0300 Subject: [PATCH 153/669] build(deps-dev): Bump tox from 4.5.1 to 4.5.2 (#492) Bumps [tox](https://github.com/tox-dev/tox) from 4.5.1 to 4.5.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.5.1...4.5.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fce075de..28de8566 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 -tox==4.5.1 +tox==4.5.2 pytest-rerunfailures==11.1.2 # code coverage From 8b256ba5de67a897c0c323bff3d3a5c33a1ad755 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Wed, 31 May 2023 09:04:27 -0300 Subject: [PATCH 154/669] refactor(docs): parse docstrings as markdown (#491) We use markdown in docstrings of our generated modules. This causes issues with sphinx autodoc parser. - Switch to autodoc2 and myst to properly parse markdown. - Patch invalid markdown before parsing. - Switch to "Read the Docs" theme and normalize TOC for better presentation. - Remove documentation on private module `couchdb_session_token_manager.py` Closes #78 --- .gitignore | 1 + requirements-dev.txt | 4 --- requirements-docs.txt | 6 +++++ source/conf.py | 62 +++++++++++++++++++++++++++++++++++++++---- source/index.rst | 21 ++++++++++----- tox.ini | 7 ++--- 6 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 requirements-docs.txt diff --git a/.gitignore b/.gitignore index d5720c66..9f9c0457 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ python3/ # resources resources/output.wav +apidocs/ docs/_build/ deploy.sh docs/apis diff --git a/requirements-dev.txt b/requirements-dev.txt index 28de8566..bab47a8b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,7 +9,3 @@ pytest-rerunfailures==11.1.2 # code coverage coverage==7.2.6 pytest-cov==4.1.0 - -# documentation -recommonmark==0.7.1 -Sphinx==5.3.0 diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 00000000..46b172eb --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,6 @@ +# documentation +recommonmark==0.7.1 +Sphinx==5.3.0 +sphinx-autodoc2==0.4.2 +myst-parser==1.0.0 +sphinx-rtd-theme==1.2.1 diff --git a/source/conf.py b/source/conf.py index 5997ccda..60d286e6 100644 --- a/source/conf.py +++ b/source/conf.py @@ -18,11 +18,10 @@ sys.path.insert(0, os.path.abspath('..')) print(os.path.abspath('..')) - # -- Project information ----------------------------------------------------- project = 'Cloudant Python SDK' -copyright = 'Copyright IBM Corp. 2021' +copyright = 'Copyright IBM Corp. 2021, 2023.' author = '@IBM/cloudant-sdks' # -- General configuration --------------------------------------------------- @@ -31,7 +30,34 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc' + 'autodoc2', + 'myst_parser', + 'sphinx_rtd_theme', +] + +myst_enable_extensions = ['colon_fence', 'fieldlist'] + +autodoc2_packages = [ + { + 'path': '../ibmcloudant', + 'exclude_files': [ + 'common.py', + 'version.py', + 'cloudant_base_service.py', + 'couchdb_session_get_authenticator_patch.py', + 'couchdb_session_token_manager.py' + ] + } +] + +autodoc2_sort_names = True + +autodoc2_index_template = None + +autodoc2_hidden_objects = ['dunder', 'private', 'inherited'] + +autodoc2_docstring_parser_regexes = [ + (r'.*', 'myst'), ] # Add any paths that contain templates here, relative to this directory. @@ -40,15 +66,41 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ['apidocs/ibmcloudant/ibmcloudant.rst'] + +# -- Patch generated rst ----------------------------------------------------- +file_path = '../ibmcloudant/cloudant_v1.py' +print(f'[patching] file {file_path}') +# read source file +with open(file_path, 'r') as file: + lines = file.readlines() +# patch broken markup +codeblock = False +for i in range(len(lines)): + # replace class vars to :param: for better rendering + if ':attr ' in lines[i]: + lines[i] = lines[i].replace(':attr', ':param') + # replace note with tip admonition + if '### Note' in lines[i]: + lines[i] = ' :::{tip}\n' + codeblock = True + if codeblock and lines[i] == '\n': + lines[i] = ' :::\n\n' + codeblock = False +# write back +with open(file_path, 'w') as file: + file.writelines(lines) # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' +html_theme_options = { + 'collapse_navigation': False +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/source/index.rst b/source/index.rst index 36870288..0dc30aac 100644 --- a/source/index.rst +++ b/source/index.rst @@ -1,22 +1,29 @@ .. Cloudant Python SDK documentation master file, created by sphinx-quickstart on Tue Jan 5 13:47:50 2021. - Copyright IBM Corporation 2021. + Copyright IBM Corporation 2021, 2023. SPDX-License-Identifier: Apache-2.0 You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to Cloudant Python SDK's documentation! -=============================================== +Cloudant Python SDK's Documentation +=================================== + +CloudantV1 class +---------------- + +:class:`CloudantV1 ` + +Modules +------- .. toctree:: :maxdepth: 4 - :caption: Contents: - modules + cloudant_v1 + couchdb_session_authenticator Indices and tables -================== +------------------ * :ref:`genindex` * :ref:`modindex` -* :ref:`search` diff --git a/tox.ini b/tox.ini index 3d57a0a9..bcb7d784 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,8 @@ exclude = .venv,.git,.tox,docs [testenv:docs] description = invoke sphinx-build to build the HTML docs -deps = {[testenv]deps} +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements-docs.txt basepython = python3.11 -commands = sphinx-apidoc -o {toxinidir}/source ibmcloudant "**/common.py" "**/version.py" "**/cloudant_base_service.py" "**/couchdb_session_get_authenticator_patch.py" - sphinx-build -d "{toxinidir}/docs_doctree" {toxinidir}/source "{toxinidir}/apidocs" --color -bhtml +commands = sphinx-build {toxinidir}/source "{toxinidir}/apidocs" -bhtml From 3c9396fdf3561f0e6ee4aeca4541c94c042f13c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 12:05:33 +0000 Subject: [PATCH 155/669] build(deps-dev): Bump coverage from 7.2.6 to 7.2.7 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.6 to 7.2.7. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.6...7.2.7) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bab47a8b..9d46a561 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,5 +7,5 @@ tox==4.5.2 pytest-rerunfailures==11.1.2 # code coverage -coverage==7.2.6 +coverage==7.2.7 pytest-cov==4.1.0 From 8d6b2245956727a4a7f2fa9c256058fd47b5d681 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 17:56:54 +0000 Subject: [PATCH 156/669] build(deps): Bump ibm-cloud-sdk-core from 3.16.6 to 3.16.7 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.6 to 3.16.7. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.6...v3.16.7) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 489a1c2d..cb088387 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ibm_cloud_sdk_core==3.16.6 +ibm_cloud_sdk_core==3.16.7 # dependencies of ibm_cloud_sdk_core: requests>=2.20,<3.0 python_dateutil>=2.5.3,<3.0.0 From 788ddba2a40fa358e346f7a09986ef0281876515 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 2 Jun 2023 14:13:07 +0000 Subject: [PATCH 157/669] build(generated): update generator to 3.72.2 Generated SDK source code using: - Generator version 3.72.2 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 24efc60 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- stubs/gen-its-mappings.json | 16 +- test/integration/test_cloudant_v1.py | 64 +++---- test/unit/test_cloudant_v1.py | 238 +++++++++++++-------------- 3 files changed, 159 insertions(+), 159 deletions(-) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index c4a8a5f0..8f945a6c 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -383,13 +383,13 @@ "equalTo": "normal" }, "heartbeat": { - "equalTo": "0" + "equalTo": "60000" }, "since": { "equalTo": "0" }, "timeout": { - "equalTo": "0" + "equalTo": "60000" } } }, @@ -735,7 +735,7 @@ { "id": "5c158d49-97e6-3f2b-99ec-2f6629a13c77", "request": { - "url": "/_scheduler/jobs?limit=0&skip=0", + "url": "/_scheduler/jobs?limit=25&skip=0", "method": "GET" }, "response": { @@ -1222,7 +1222,7 @@ "equalTo": "testString" }, "heartbeat": { - "equalTo": "0" + "equalTo": "60000" }, "include_docs": { "equalTo": "false" @@ -1240,7 +1240,7 @@ "equalTo": "main_only" }, "timeout": { - "equalTo": "0" + "equalTo": "60000" }, "view": { "equalTo": "testString" @@ -1690,7 +1690,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 0, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"r\" : 1, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", "ignoreArrayOrder": true, "ignoreExtraElements": true } @@ -1725,7 +1725,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 0, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"r\" : 1, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", "ignoreArrayOrder": true, "ignoreExtraElements": true } @@ -2128,7 +2128,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 0, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", "ignoreArrayOrder": true, "ignoreExtraElements": true } diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 4f5a987e..028964b5 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -100,8 +100,8 @@ def test_put_capacity_throughput_configuration(self): def test_get_db_updates(self): response = self.cloudant_service.get_db_updates( feed='normal', - heartbeat=0, - timeout=0, + heartbeat=60000, + timeout=60000, since='0', ) @@ -115,7 +115,7 @@ def test_post_changes(self): db='testString', doc_ids=['testString'], fields=['testString'], - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, last_event_id='testString', att_encoding_info=False, attachments=False, @@ -123,13 +123,13 @@ def test_post_changes(self): descending=False, feed='normal', filter='testString', - heartbeat=0, + heartbeat=60000, include_docs=False, limit=0, seq_interval=1, since='0', style='main_only', - timeout=0, + timeout=60000, view='testString', ) @@ -143,7 +143,7 @@ def test_post_changes_as_stream(self): db='testString', doc_ids=['testString'], fields=['testString'], - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, last_event_id='testString', att_encoding_info=False, attachments=False, @@ -151,13 +151,13 @@ def test_post_changes_as_stream(self): descending=False, feed='normal', filter='testString', - heartbeat=0, + heartbeat=60000, include_docs=False, limit=0, seq_interval=1, since='0', style='main_only', - timeout=0, + timeout=60000, view='testString', ) @@ -1053,7 +1053,7 @@ def test_post_partition_search(self): highlight_number=1, highlight_post_tag='', highlight_pre_tag='', - highlight_size=1, + highlight_size=100, include_docs=False, include_fields=['testString'], limit=0, @@ -1078,7 +1078,7 @@ def test_post_partition_search_as_stream(self): highlight_number=1, highlight_post_tag='', highlight_pre_tag='', - highlight_size=1, + highlight_size=100, include_docs=False, include_fields=['testString'], limit=0, @@ -1159,12 +1159,12 @@ def test_post_partition_find(self): response = self.cloudant_service.post_partition_find( db='testString', partition_key='testString', - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, bookmark='testString', conflicts=True, execution_stats=True, fields=['testString'], - limit=0, + limit=25, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1181,12 +1181,12 @@ def test_post_partition_find_as_stream(self): response = self.cloudant_service.post_partition_find_as_stream( db='testString', partition_key='testString', - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, bookmark='testString', conflicts=True, execution_stats=True, fields=['testString'], - limit=0, + limit=25, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1202,12 +1202,12 @@ def test_post_partition_find_as_stream(self): def test_post_explain(self): response = self.cloudant_service.post_explain( db='testString', - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, bookmark='testString', conflicts=True, execution_stats=True, fields=['testString'], - limit=0, + limit=25, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1224,12 +1224,12 @@ def test_post_explain(self): def test_post_find(self): response = self.cloudant_service.post_find( db='testString', - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, bookmark='testString', conflicts=True, execution_stats=True, fields=['testString'], - limit=0, + limit=25, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1246,12 +1246,12 @@ def test_post_find(self): def test_post_find_as_stream(self): response = self.cloudant_service.post_find_as_stream( db='testString', - selector={'foo': 'bar'}, + selector={'anyKey': 'anyValue'}, bookmark='testString', conflicts=True, execution_stats=True, fields=['testString'], - limit=0, + limit=25, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1298,7 +1298,7 @@ def test_post_index(self): 'default_field': index_text_operator_default_field_model, 'fields': [index_field_model], 'index_array_lengths': True, - 'partial_filter_selector': {'foo': 'bar'}, + 'partial_filter_selector': {'anyKey': 'anyValue'}, } response = self.cloudant_service.post_index( @@ -1338,7 +1338,7 @@ def test_post_search(self): highlight_number=1, highlight_post_tag='', highlight_pre_tag='', - highlight_size=1, + highlight_size=100, include_docs=False, include_fields=['testString'], limit=0, @@ -1368,7 +1368,7 @@ def test_post_search_as_stream(self): highlight_number=1, highlight_post_tag='', highlight_pre_tag='', - highlight_size=1, + highlight_size=100, include_docs=False, include_fields=['testString'], limit=0, @@ -1470,7 +1470,7 @@ def test_put_replication_document(self): } # Construct a dict representation of a ReplicationCreateTargetParameters model replication_create_target_parameters_model = { - 'n': 1, + 'n': 3, 'partitioned': False, 'q': 26, } @@ -1512,17 +1512,17 @@ def test_put_replication_document(self): '_revisions': revisions_model, '_revs_info': [document_revision_status_model], 'cancel': True, - 'checkpoint_interval': 0, - 'connection_timeout': 0, + 'checkpoint_interval': 30000, + 'connection_timeout': 30000, 'continuous': False, 'create_target': False, 'create_target_params': replication_create_target_parameters_model, 'doc_ids': ['testString'], 'filter': 'testString', - 'http_connections': 1, + 'http_connections': 20, 'query_params': {'key1': 'testString'}, - 'retries_per_request': 0, - 'selector': {'foo': 'bar'}, + 'retries_per_request': 5, + 'selector': {'anyKey': 'anyValue'}, 'since_seq': 'testString', 'socket_options': 'testString', 'source': replication_database_model, @@ -1533,8 +1533,8 @@ def test_put_replication_document(self): 'use_checkpoints': True, 'user_ctx': user_context_model, 'winning_revs_only': False, - 'worker_batch_size': 1, - 'worker_processes': 1, + 'worker_batch_size': 500, + 'worker_processes': 4, 'foo': 'testString', } @@ -1576,7 +1576,7 @@ def test_get_scheduler_document(self): @needscredentials def test_get_scheduler_jobs(self): response = self.cloudant_service.get_scheduler_jobs( - limit=0, + limit=25, skip=0, ) diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 02a2d7ae..7d14d779 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -447,8 +447,8 @@ def test_get_db_updates_all_params(self): # Set up parameter values feed = 'normal' - heartbeat = 0 - timeout = 0 + heartbeat = 60000 + timeout = 60000 since = '0' # Invoke method @@ -538,7 +538,7 @@ def test_post_changes_all_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} last_event_id = 'testString' att_encoding_info = False attachments = False @@ -546,13 +546,13 @@ def test_post_changes_all_params(self): descending = False feed = 'normal' filter = 'testString' - heartbeat = 0 + heartbeat = 60000 include_docs = False limit = 0 seq_interval = 1 since = '0' style = 'main_only' - timeout = 0 + timeout = 60000 view = 'testString' # Invoke method @@ -606,7 +606,7 @@ def test_post_changes_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} def test_post_changes_all_params_with_retries(self): # Enable retries and run test_post_changes_all_params. @@ -637,7 +637,7 @@ def test_post_changes_required_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} # Invoke method response = _service.post_changes( @@ -658,7 +658,7 @@ def test_post_changes_required_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} def test_post_changes_required_params_with_retries(self): # Enable retries and run test_post_changes_required_params. @@ -689,7 +689,7 @@ def test_post_changes_value_error(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -735,7 +735,7 @@ def test_post_changes_as_stream_all_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} last_event_id = 'testString' att_encoding_info = False attachments = False @@ -743,13 +743,13 @@ def test_post_changes_as_stream_all_params(self): descending = False feed = 'normal' filter = 'testString' - heartbeat = 0 + heartbeat = 60000 include_docs = False limit = 0 seq_interval = 1 since = '0' style = 'main_only' - timeout = 0 + timeout = 60000 view = 'testString' # Invoke method @@ -803,7 +803,7 @@ def test_post_changes_as_stream_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} # Verify streamed JSON response result = response.get_result() @@ -840,7 +840,7 @@ def test_post_changes_as_stream_required_params(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} # Invoke method response = _service.post_changes_as_stream( @@ -861,7 +861,7 @@ def test_post_changes_as_stream_required_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['doc_ids'] == ['testString'] assert req_body['fields'] == ['testString'] - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} # Verify streamed JSON response result = response.get_result() @@ -898,7 +898,7 @@ def test_post_changes_as_stream_value_error(self): db = 'testString' doc_ids = ['testString'] fields = ['testString'] - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -1137,7 +1137,7 @@ def test_post_dbs_info_all_params(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' responses.add( responses.POST, url, @@ -1181,7 +1181,7 @@ def test_post_dbs_info_value_error(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' responses.add( responses.POST, url, @@ -1305,7 +1305,7 @@ def test_get_database_information_all_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' + mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' responses.add( responses.GET, url, @@ -1343,7 +1343,7 @@ def test_get_database_information_value_error(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 1, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' + mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' responses.add( responses.GET, url, @@ -6799,7 +6799,7 @@ def test_post_partition_search_all_params(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -6841,7 +6841,7 @@ def test_post_partition_search_all_params(self): assert req_body['highlight_number'] == 1 assert req_body['highlight_post_tag'] == '' assert req_body['highlight_pre_tag'] == '' - assert req_body['highlight_size'] == 1 + assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] assert req_body['limit'] == 0 @@ -6884,7 +6884,7 @@ def test_post_partition_search_value_error(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -6946,7 +6946,7 @@ def test_post_partition_search_as_stream_all_params(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -6988,7 +6988,7 @@ def test_post_partition_search_as_stream_all_params(self): assert req_body['highlight_number'] == 1 assert req_body['highlight_post_tag'] == '' assert req_body['highlight_pre_tag'] == '' - assert req_body['highlight_size'] == 1 + assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] assert req_body['limit'] == 0 @@ -7037,7 +7037,7 @@ def test_post_partition_search_as_stream_value_error(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -7445,12 +7445,12 @@ def test_post_partition_find_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7483,12 +7483,12 @@ def test_post_partition_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -7523,12 +7523,12 @@ def test_post_partition_find_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7580,12 +7580,12 @@ def test_post_partition_find_as_stream_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7618,12 +7618,12 @@ def test_post_partition_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -7664,12 +7664,12 @@ def test_post_partition_find_as_stream_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7748,7 +7748,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 25, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add( responses.POST, url, @@ -7759,12 +7759,12 @@ def test_post_explain_all_params(self): # Set up parameter values db = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7798,12 +7798,12 @@ def test_post_explain_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -7827,7 +7827,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 0, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 25, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add( responses.POST, url, @@ -7838,12 +7838,12 @@ def test_post_explain_value_error(self): # Set up parameter values db = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7894,12 +7894,12 @@ def test_post_find_all_params(self): # Set up parameter values db = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7933,12 +7933,12 @@ def test_post_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -7973,12 +7973,12 @@ def test_post_find_value_error(self): # Set up parameter values db = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8029,12 +8029,12 @@ def test_post_find_as_stream_all_params(self): # Set up parameter values db = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8068,12 +8068,12 @@ def test_post_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'foo': 'bar'} + assert req_body['selector'] == {'anyKey': 'anyValue'} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -8114,12 +8114,12 @@ def test_post_find_as_stream_value_error(self): # Set up parameter values db = 'testString' - selector = {'foo': 'bar'} + selector = {'anyKey': 'anyValue'} bookmark = 'testString' conflicts = True execution_stats = True fields = ['testString'] - limit = 0 + limit = 25 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8271,7 +8271,7 @@ def test_post_index_all_params(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'foo': 'bar'} + index_definition_model['partial_filter_selector'] = {'anyKey': 'anyValue'} # Set up parameter values db = 'testString' @@ -8356,7 +8356,7 @@ def test_post_index_value_error(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'foo': 'bar'} + index_definition_model['partial_filter_selector'] = {'anyKey': 'anyValue'} # Set up parameter values db = 'testString' @@ -8642,7 +8642,7 @@ def test_post_search_all_params(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -8695,7 +8695,7 @@ def test_post_search_all_params(self): assert req_body['highlight_number'] == 1 assert req_body['highlight_post_tag'] == '' assert req_body['highlight_pre_tag'] == '' - assert req_body['highlight_size'] == 1 + assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] assert req_body['limit'] == 0 @@ -8743,7 +8743,7 @@ def test_post_search_value_error(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -8809,7 +8809,7 @@ def test_post_search_as_stream_all_params(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -8862,7 +8862,7 @@ def test_post_search_as_stream_all_params(self): assert req_body['highlight_number'] == 1 assert req_body['highlight_post_tag'] == '' assert req_body['highlight_pre_tag'] == '' - assert req_body['highlight_size'] == 1 + assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] assert req_body['limit'] == 0 @@ -8916,7 +8916,7 @@ def test_post_search_as_stream_value_error(self): highlight_number = 1 highlight_post_tag = '' highlight_pre_tag = '' - highlight_size = 1 + highlight_size = 100 include_docs = False include_fields = ['testString'] limit = 0 @@ -9483,7 +9483,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9556,7 +9556,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9594,7 +9594,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 0, "connection_timeout": 0, "continuous": false, "create_target": false, "create_target_params": {"n": 1, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 1, "query_params": {"mapKey": "inner"}, "retries_per_request": 0, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 1, "worker_processes": 1}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9670,7 +9670,7 @@ def test_put_replication_document_all_params(self): # Construct a dict representation of a ReplicationCreateTargetParameters model replication_create_target_parameters_model = {} - replication_create_target_parameters_model['n'] = 1 + replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False replication_create_target_parameters_model['q'] = 26 @@ -9712,17 +9712,17 @@ def test_put_replication_document_all_params(self): replication_document_model['_revisions'] = revisions_model replication_document_model['_revs_info'] = [document_revision_status_model] replication_document_model['cancel'] = True - replication_document_model['checkpoint_interval'] = 0 - replication_document_model['connection_timeout'] = 0 + replication_document_model['checkpoint_interval'] = 30000 + replication_document_model['connection_timeout'] = 30000 replication_document_model['continuous'] = False replication_document_model['create_target'] = False replication_document_model['create_target_params'] = replication_create_target_parameters_model replication_document_model['doc_ids'] = ['testString'] replication_document_model['filter'] = 'testString' - replication_document_model['http_connections'] = 1 + replication_document_model['http_connections'] = 20 replication_document_model['query_params'] = {'key1': 'testString'} - replication_document_model['retries_per_request'] = 0 - replication_document_model['selector'] = {'foo': 'bar'} + replication_document_model['retries_per_request'] = 5 + replication_document_model['selector'] = {'anyKey': 'anyValue'} replication_document_model['since_seq'] = 'testString' replication_document_model['socket_options'] = 'testString' replication_document_model['source'] = replication_database_model @@ -9733,8 +9733,8 @@ def test_put_replication_document_all_params(self): replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False - replication_document_model['worker_batch_size'] = 1 - replication_document_model['worker_processes'] = 1 + replication_document_model['worker_batch_size'] = 500 + replication_document_model['worker_processes'] = 4 replication_document_model['foo'] = 'testString' # Set up parameter values @@ -9821,7 +9821,7 @@ def test_put_replication_document_required_params(self): # Construct a dict representation of a ReplicationCreateTargetParameters model replication_create_target_parameters_model = {} - replication_create_target_parameters_model['n'] = 1 + replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False replication_create_target_parameters_model['q'] = 26 @@ -9863,17 +9863,17 @@ def test_put_replication_document_required_params(self): replication_document_model['_revisions'] = revisions_model replication_document_model['_revs_info'] = [document_revision_status_model] replication_document_model['cancel'] = True - replication_document_model['checkpoint_interval'] = 0 - replication_document_model['connection_timeout'] = 0 + replication_document_model['checkpoint_interval'] = 30000 + replication_document_model['connection_timeout'] = 30000 replication_document_model['continuous'] = False replication_document_model['create_target'] = False replication_document_model['create_target_params'] = replication_create_target_parameters_model replication_document_model['doc_ids'] = ['testString'] replication_document_model['filter'] = 'testString' - replication_document_model['http_connections'] = 1 + replication_document_model['http_connections'] = 20 replication_document_model['query_params'] = {'key1': 'testString'} - replication_document_model['retries_per_request'] = 0 - replication_document_model['selector'] = {'foo': 'bar'} + replication_document_model['retries_per_request'] = 5 + replication_document_model['selector'] = {'anyKey': 'anyValue'} replication_document_model['since_seq'] = 'testString' replication_document_model['socket_options'] = 'testString' replication_document_model['source'] = replication_database_model @@ -9884,8 +9884,8 @@ def test_put_replication_document_required_params(self): replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False - replication_document_model['worker_batch_size'] = 1 - replication_document_model['worker_processes'] = 1 + replication_document_model['worker_batch_size'] = 500 + replication_document_model['worker_processes'] = 4 replication_document_model['foo'] = 'testString' # Set up parameter values @@ -9958,7 +9958,7 @@ def test_put_replication_document_value_error(self): # Construct a dict representation of a ReplicationCreateTargetParameters model replication_create_target_parameters_model = {} - replication_create_target_parameters_model['n'] = 1 + replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False replication_create_target_parameters_model['q'] = 26 @@ -10000,17 +10000,17 @@ def test_put_replication_document_value_error(self): replication_document_model['_revisions'] = revisions_model replication_document_model['_revs_info'] = [document_revision_status_model] replication_document_model['cancel'] = True - replication_document_model['checkpoint_interval'] = 0 - replication_document_model['connection_timeout'] = 0 + replication_document_model['checkpoint_interval'] = 30000 + replication_document_model['connection_timeout'] = 30000 replication_document_model['continuous'] = False replication_document_model['create_target'] = False replication_document_model['create_target_params'] = replication_create_target_parameters_model replication_document_model['doc_ids'] = ['testString'] replication_document_model['filter'] = 'testString' - replication_document_model['http_connections'] = 1 + replication_document_model['http_connections'] = 20 replication_document_model['query_params'] = {'key1': 'testString'} - replication_document_model['retries_per_request'] = 0 - replication_document_model['selector'] = {'foo': 'bar'} + replication_document_model['retries_per_request'] = 5 + replication_document_model['selector'] = {'anyKey': 'anyValue'} replication_document_model['since_seq'] = 'testString' replication_document_model['socket_options'] = 'testString' replication_document_model['source'] = replication_database_model @@ -10021,8 +10021,8 @@ def test_put_replication_document_value_error(self): replication_document_model['use_checkpoints'] = True replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False - replication_document_model['worker_batch_size'] = 1 - replication_document_model['worker_processes'] = 1 + replication_document_model['worker_batch_size'] = 500 + replication_document_model['worker_processes'] = 4 replication_document_model['foo'] = 'testString' # Set up parameter values @@ -10238,7 +10238,7 @@ def test_get_scheduler_jobs_all_params(self): ) # Set up parameter values - limit = 0 + limit = 25 skip = 0 # Invoke method @@ -12690,7 +12690,7 @@ def test_get_active_tasks_all_params(self): """ # Set up mock url = preprocess_url('/_active_tasks') - mock_response = '[{"bulk_get_attempts": 0, "bulk_get_docs": 0, "changes_done": 0, "changes_pending": 0, "checkpoint_interval": 0, "checkpointed_source_seq": "checkpointed_source_seq", "continuous": false, "database": "database", "design_document": "design_document", "doc_id": "doc_id", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "index": "index", "indexer_pid": "indexer_pid", "missing_revisions_found": 0, "node": "node", "phase": "docid_sort", "pid": "pid", "process_status": "exiting", "progress": 0, "replication_id": "replication_id", "retry": false, "revisions_checked": 0, "source": "source", "source_seq": "source_seq", "started_on": 0, "target": "target", "through_seq": "through_seq", "total_changes": 0, "type": "database_compaction", "updated_on": 0, "user": "user", "view": 0}]' + mock_response = '[{"bulk_get_attempts": 0, "bulk_get_docs": 0, "changes_done": 0, "changes_pending": 0, "checkpoint_interval": 30000, "checkpointed_source_seq": "checkpointed_source_seq", "continuous": false, "database": "database", "design_document": "design_document", "doc_id": "doc_id", "doc_write_failures": 0, "docs_read": 0, "docs_written": 0, "index": "index", "indexer_pid": "indexer_pid", "missing_revisions_found": 0, "node": "node", "phase": "docid_sort", "pid": "pid", "process_status": "exiting", "progress": 0, "replication_id": "replication_id", "retry": false, "revisions_checked": 0, "source": "source", "source_seq": "source_seq", "started_on": 0, "target": "target", "through_seq": "through_seq", "total_changes": 0, "type": "database_compaction", "updated_on": 0, "user": "user", "view": 0}]' responses.add( responses.GET, url, @@ -12945,7 +12945,7 @@ def test_active_task_serialization(self): active_task_model_json['bulk_get_docs'] = 0 active_task_model_json['changes_done'] = 0 active_task_model_json['changes_pending'] = 0 - active_task_model_json['checkpoint_interval'] = 0 + active_task_model_json['checkpoint_interval'] = 30000 active_task_model_json['checkpointed_source_seq'] = 'testString' active_task_model_json['continuous'] = False active_task_model_json['database'] = 'testString' @@ -14127,7 +14127,7 @@ def test_database_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. database_information_cluster_model = {} # DatabaseInformationCluster - database_information_cluster_model['n'] = 1 + database_information_cluster_model['n'] = 3 database_information_cluster_model['q'] = 26 database_information_cluster_model['r'] = 1 database_information_cluster_model['w'] = 1 @@ -14184,7 +14184,7 @@ def test_database_information_cluster_serialization(self): # Construct a json representation of a DatabaseInformationCluster model database_information_cluster_model_json = {} - database_information_cluster_model_json['n'] = 1 + database_information_cluster_model_json['n'] = 3 database_information_cluster_model_json['q'] = 26 database_information_cluster_model_json['r'] = 1 database_information_cluster_model_json['w'] = 1 @@ -14318,7 +14318,7 @@ def test_dbs_info_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. database_information_cluster_model = {} # DatabaseInformationCluster - database_information_cluster_model['n'] = 1 + database_information_cluster_model['n'] = 3 database_information_cluster_model['q'] = 26 database_information_cluster_model['r'] = 1 database_information_cluster_model['w'] = 1 @@ -14965,7 +14965,7 @@ def test_explain_result_serialization(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'foo': 'bar'} + index_definition_model['partial_filter_selector'] = {'anyKey': 'anyValue'} index_information_model = {} # IndexInformation index_information_model['ddoc'] = 'testString' @@ -14983,10 +14983,10 @@ def test_explain_result_serialization(self): explain_result_model_json['dbname'] = 'testString' explain_result_model_json['fields'] = ['testString'] explain_result_model_json['index'] = index_information_model - explain_result_model_json['limit'] = 0 - explain_result_model_json['opts'] = {'foo': 'bar'} + explain_result_model_json['limit'] = 25 + explain_result_model_json['opts'] = {'anyKey': 'anyValue'} explain_result_model_json['range'] = explain_result_range_model - explain_result_model_json['selector'] = {'foo': 'bar'} + explain_result_model_json['selector'] = {'anyKey': 'anyValue'} explain_result_model_json['skip'] = 0 # Construct a model instance of ExplainResult by calling from_dict on the json representation @@ -15140,7 +15140,7 @@ def test_index_definition_serialization(self): index_definition_model_json['default_field'] = index_text_operator_default_field_model index_definition_model_json['fields'] = [index_field_model] index_definition_model_json['index_array_lengths'] = True - index_definition_model_json['partial_filter_selector'] = {'foo': 'bar'} + index_definition_model_json['partial_filter_selector'] = {'anyKey': 'anyValue'} # Construct a model instance of IndexDefinition by calling from_dict on the json representation index_definition_model = IndexDefinition.from_dict(index_definition_model_json) @@ -15230,7 +15230,7 @@ def test_index_information_serialization(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'foo': 'bar'} + index_definition_model['partial_filter_selector'] = {'anyKey': 'anyValue'} # Construct a json representation of a IndexInformation model index_information_model_json = {} @@ -15354,7 +15354,7 @@ def test_indexes_information_serialization(self): index_definition_model['default_field'] = index_text_operator_default_field_model index_definition_model['fields'] = [index_field_model] index_definition_model['index_array_lengths'] = True - index_definition_model['partial_filter_selector'] = {'foo': 'bar'} + index_definition_model['partial_filter_selector'] = {'anyKey': 'anyValue'} index_information_model = {} # IndexInformation index_information_model['ddoc'] = 'testString' @@ -15606,7 +15606,7 @@ def test_replication_create_target_parameters_serialization(self): # Construct a json representation of a ReplicationCreateTargetParameters model replication_create_target_parameters_model_json = {} - replication_create_target_parameters_model_json['n'] = 1 + replication_create_target_parameters_model_json['n'] = 3 replication_create_target_parameters_model_json['partitioned'] = False replication_create_target_parameters_model_json['q'] = 26 @@ -15804,7 +15804,7 @@ def test_replication_document_serialization(self): document_revision_status_model['status'] = 'available' replication_create_target_parameters_model = {} # ReplicationCreateTargetParameters - replication_create_target_parameters_model['n'] = 1 + replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False replication_create_target_parameters_model['q'] = 26 @@ -15841,17 +15841,17 @@ def test_replication_document_serialization(self): replication_document_model_json['_revisions'] = revisions_model replication_document_model_json['_revs_info'] = [document_revision_status_model] replication_document_model_json['cancel'] = True - replication_document_model_json['checkpoint_interval'] = 0 - replication_document_model_json['connection_timeout'] = 0 + replication_document_model_json['checkpoint_interval'] = 30000 + replication_document_model_json['connection_timeout'] = 30000 replication_document_model_json['continuous'] = False replication_document_model_json['create_target'] = False replication_document_model_json['create_target_params'] = replication_create_target_parameters_model replication_document_model_json['doc_ids'] = ['testString'] replication_document_model_json['filter'] = 'testString' - replication_document_model_json['http_connections'] = 1 + replication_document_model_json['http_connections'] = 20 replication_document_model_json['query_params'] = {'key1': 'testString'} - replication_document_model_json['retries_per_request'] = 0 - replication_document_model_json['selector'] = {'foo': 'bar'} + replication_document_model_json['retries_per_request'] = 5 + replication_document_model_json['selector'] = {'anyKey': 'anyValue'} replication_document_model_json['since_seq'] = 'testString' replication_document_model_json['socket_options'] = 'testString' replication_document_model_json['source'] = replication_database_model @@ -15862,8 +15862,8 @@ def test_replication_document_serialization(self): replication_document_model_json['use_checkpoints'] = True replication_document_model_json['user_ctx'] = user_context_model replication_document_model_json['winning_revs_only'] = False - replication_document_model_json['worker_batch_size'] = 1 - replication_document_model_json['worker_processes'] = 1 + replication_document_model_json['worker_batch_size'] = 500 + replication_document_model_json['worker_processes'] = 4 replication_document_model_json['foo'] = 'testString' # Construct a model instance of ReplicationDocument by calling from_dict on the json representation @@ -16456,7 +16456,7 @@ def test_search_result_serialization(self): search_result_row_model = {} # SearchResultRow search_result_row_model['doc'] = document_model - search_result_row_model['fields'] = {'foo': 'bar'} + search_result_row_model['fields'] = {'anyKey': 'anyValue'} search_result_row_model['highlights'] = {'key1': ['testString']} search_result_row_model['id'] = 'testString' @@ -16539,7 +16539,7 @@ def test_search_result_properties_serialization(self): search_result_row_model = {} # SearchResultRow search_result_row_model['doc'] = document_model - search_result_row_model['fields'] = {'foo': 'bar'} + search_result_row_model['fields'] = {'anyKey': 'anyValue'} search_result_row_model['highlights'] = {'key1': ['testString']} search_result_row_model['id'] = 'testString' @@ -16614,7 +16614,7 @@ def test_search_result_row_serialization(self): # Construct a json representation of a SearchResultRow model search_result_row_model_json = {} search_result_row_model_json['doc'] = document_model - search_result_row_model_json['fields'] = {'foo': 'bar'} + search_result_row_model_json['fields'] = {'anyKey': 'anyValue'} search_result_row_model_json['highlights'] = {'key1': ['testString']} search_result_row_model_json['id'] = 'testString' @@ -16928,7 +16928,7 @@ def test_up_information_serialization(self): # Construct a json representation of a UpInformation model up_information_model_json = {} - up_information_model_json['seeds'] = {'foo': 'bar'} + up_information_model_json['seeds'] = {'anyKey': 'anyValue'} up_information_model_json['status'] = 'maintenance_mode' # Construct a model instance of UpInformation by calling from_dict on the json representation From dd077d190f309965c468dfc52bdc49250fbf15e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:56:48 +0000 Subject: [PATCH 158/669] build(deps-dev): Bump tox from 4.5.2 to 4.6.0 Bumps [tox](https://github.com/tox-dev/tox) from 4.5.2 to 4.6.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.5.2...4.6.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9d46a561..47246b11 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.1 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 -tox==4.5.2 +tox==4.6.0 pytest-rerunfailures==11.1.2 # code coverage From db5f29f5e247178a438830090aa714aca92d53ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 18:17:10 +0000 Subject: [PATCH 159/669] build(deps): Bump sphinx-rtd-theme from 1.2.1 to 1.2.2 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.2.1 to 1.2.2. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.2.1...1.2.2) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 46b172eb..18c6e19a 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==5.3.0 sphinx-autodoc2==0.4.2 myst-parser==1.0.0 -sphinx-rtd-theme==1.2.1 +sphinx-rtd-theme==1.2.2 From 43d33508d4b742428b6bac04861f4d60cfd47bcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:08:52 +0200 Subject: [PATCH 160/669] build(deps-dev): Bump pytest from 7.3.1 to 7.3.2 (#499) Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.3.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.3.1...7.3.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 47246b11..40c5b1f1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.3.1 +pytest==7.3.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 From 9d42f735c67832c24d1025220a4c26873e23ad1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:20:25 +0200 Subject: [PATCH 161/669] build(deps): Bump myst-parser from 1.0.0 to 2.0.0 (#500) Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 1.0.0 to 2.0.0. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/executablebooks/MyST-Parser/compare/v1.0.0...v2.0.0) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 18c6e19a..ca152eab 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 Sphinx==5.3.0 sphinx-autodoc2==0.4.2 -myst-parser==1.0.0 +myst-parser==2.0.0 sphinx-rtd-theme==1.2.2 From 0bc8b1b77ce8f7e9f3d25ff19de6cf7f187e1cce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 08:26:10 +0000 Subject: [PATCH 162/669] build(deps-dev): Bump tox from 4.6.0 to 4.6.2 Bumps [tox](https://github.com/tox-dev/tox) from 4.6.0 to 4.6.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.6.0...4.6.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 40c5b1f1..927f0592 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 -tox==4.6.0 +tox==4.6.2 pytest-rerunfailures==11.1.2 # code coverage From 8235fd3a84471baab94b7ad9d0090ca455d6f977 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 17:02:31 +0000 Subject: [PATCH 163/669] build(deps-dev): Bump tox from 4.6.2 to 4.6.3 Bumps [tox](https://github.com/tox-dev/tox) from 4.6.2 to 4.6.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.6.2...4.6.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 927f0592..ca77b1b2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.3.2 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 -tox==4.6.2 +tox==4.6.3 pytest-rerunfailures==11.1.2 # code coverage From f783493ce07c8d34da5ed0899ad30f05117ece8f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 21 Jun 2023 08:46:32 +0000 Subject: [PATCH 164/669] Update version 0.4.2 -> 0.4.3 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0915a194..8bb1937d 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.2 +current_version = 0.4.3 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 2f881dba..9466a581 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.4.2 +# IBM Cloudant Python SDK Version 0.4.3 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.4.2" +pip install --upgrade "ibmcloudant>=0.4.3" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.4.2" +easy_install --upgrade "ibmcloudant>=0.4.3" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index a7ae9258..c5a6361c 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.4.2' +__version__ = '0.4.3' diff --git a/setup.py b/setup.py index c6246170..a8ff7d4d 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.4.2' +__version__ = '0.4.3' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From 2535ad3fc58e06701e795593422079fe4f3cdf43 Mon Sep 17 00:00:00 2001 From: Ildiko Eigel Date: Wed, 21 Jun 2023 11:39:46 +0200 Subject: [PATCH 165/669] Revert "build(deps): Bump myst-parser from 1.0.0 to 2.0.0 (#500)" This reverts commit 9d42f735c67832c24d1025220a4c26873e23ad1c. --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index ca152eab..18c6e19a 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 Sphinx==5.3.0 sphinx-autodoc2==0.4.2 -myst-parser==2.0.0 +myst-parser==1.0.0 sphinx-rtd-theme==1.2.2 From c76fafafab3b7a75a53b1efd57f1932efa756b1d Mon Sep 17 00:00:00 2001 From: Ildiko Eigel Date: Wed, 21 Jun 2023 13:06:40 +0200 Subject: [PATCH 166/669] build(deps-docs): bump Sphinx from 5.3.0 to 6.2.1 and myst-parser from 1.0.0 to 2.0.0 --- requirements-docs.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 18c6e19a..0493edeb 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==5.3.0 +Sphinx==6.2.1 sphinx-autodoc2==0.4.2 -myst-parser==1.0.0 +myst-parser==2.0.0 sphinx-rtd-theme==1.2.2 From 469fc7a81a07a7c86c6f405cf0c2ca33fda88f2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 17:56:45 +0000 Subject: [PATCH 167/669] build(deps-dev): Bump pytest from 7.3.2 to 7.4.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.2 to 7.4.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.3.2...7.4.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ca77b1b2..8525deef 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # test dependencies -pytest==7.3.2 +pytest==7.4.0 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 From 9d7047863d2fed92b45a871d5b23f424b58d5091 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 17:09:25 +0000 Subject: [PATCH 168/669] build(deps-dev): Bump pytest-rerunfailures from 11.1.2 to 12.0 Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1.2 to 12.0. - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.1.2...12.0) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8525deef..365b2ae1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 tox==4.6.3 -pytest-rerunfailures==11.1.2 +pytest-rerunfailures==12.0 # code coverage coverage==7.2.7 From a8ccd759db0eb2e5f3210e0d5fbf83640abfce61 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 6 Jul 2023 20:04:13 +0000 Subject: [PATCH 169/669] docs(generated): remove Python 3.7 Generated SDK source code using: - Generator version 3.72.2 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 1e583b0 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 022be875..fc336c19 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ assignees: '' **Must gather (please complete the following information):** - SDK Version [e.g. 1.2.1] - - Python Version [e.g. Python 3.7] + - Python Version [e.g. Python 3.8] - Name of service that you're trying to use (if applicable) - Name of operation that you're trying to invoke (if applicable) diff --git a/README.md b/README.md index 9466a581..693bfa7a 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ project: service instance or a [CouchDB](https://docs.couchdb.org/en/latest/install/index.html) server. -- Python 3.7 or above. +- Python 3.8 or above. ## Installation From 433454868dff4b72807b26ee8e53ea7fb1bb40ab Mon Sep 17 00:00:00 2001 From: Esteban Laver Date: Thu, 6 Jul 2023 15:16:55 -0400 Subject: [PATCH 170/669] ci: remove Python 3.7 Signed-off-by: Esteban Laver --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45cb1529..9b8b8a49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: test: strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.8', '3.9', '3.10', '3.11'] runs-on: ubuntu-latest services: couchdb: From af6b6fd4fc9642a463c354500d308106f4125530 Mon Sep 17 00:00:00 2001 From: Esteban Laver Date: Thu, 6 Jul 2023 16:07:45 -0400 Subject: [PATCH 171/669] docs: remove Python 3.7 in setup.py Signed-off-by: Esteban Laver --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index a8ff7d4d..8d5a4453 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,6 @@ def finalize_options(self): classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', From 34eb1b9df23042dd7c044e51eabfdc671db1e54e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 12:24:13 +0000 Subject: [PATCH 172/669] build(deps-dev): Bump tox from 4.6.3 to 4.6.4 Bumps [tox](https://github.com/tox-dev/tox) from 4.6.3 to 4.6.4. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.6.3...4.6.4) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 365b2ae1..4cffb457 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ pytest==7.4.0 responses==0.23.1 python_dotenv==0.21.1 pylint==2.17.4 -tox==4.6.3 +tox==4.6.4 pytest-rerunfailures==12.0 # code coverage From 962d08ed54f5d2d6022aceab170cf52dbfca709e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:55:40 +0000 Subject: [PATCH 173/669] build(deps): Bump sphinx from 6.2.1 to 7.0.1 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 6.2.1 to 7.0.1. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v6.2.1...v7.0.1) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 0493edeb..b7ba45f0 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==6.2.1 +Sphinx==7.0.1 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.2.2 From 39ddf1a6f42cc7dfa16c776ba6007424620982f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:22:41 +0000 Subject: [PATCH 174/669] build(deps-dev): Bump python-dotenv from 0.21.1 to 1.0.0 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.21.1 to 1.0.0. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v0.21.1...v1.0.0) --- updated-dependencies: - dependency-name: python-dotenv dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4cffb457..91386c86 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # test dependencies pytest==7.4.0 responses==0.23.1 -python_dotenv==0.21.1 +python_dotenv==1.0.0 pylint==2.17.4 tox==4.6.4 pytest-rerunfailures==12.0 From 299ecbef3ea5b857f0748664a51b604719f94f1e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:27:18 +0000 Subject: [PATCH 175/669] docs(generated): update known_issues Generated SDK source code using: - Generator version 3.74.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version e722cfe Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- KNOWN_ISSUES.md | 85 ++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 392b0dde..3e94f004 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -1,14 +1,15 @@ - # Limitations, Restrictions, and Known Issues ## All Cloudant SDKs ### Path elements containing the `+` character -Path elements containing the `+` character in the SDKs are not interoperable with Apache CouchDB and Cloudant. -* This is because standard URL encoding libraries following the [RFC3986 URI specification](https://tools.ietf.org/html/rfc3986#section-3.3) do not encode this character in path elements. -* Apache CouchDB violates the specification by treating the `+` in path elements as a space character (see https://github.com/apache/couchdb/issues/2235). -* Path elements include database names, all document names, and index and view names. +Path elements containing the `+` character in the SDKs are not interoperable with: +* Cloudant +* Apache CouchDB versions older than 3.2.0 +* Apache CouchDB versions 3.2.0 or newer with the setting `decode_plus_to_space = true` + +This is because standard URL encoding libraries following the [RFC3986 URI specification](https://tools.ietf.org/html/rfc3986#section-3.3) do not encode the `+` character in path elements. * It is possible to workaround for document names with a `+` in the ID (e.g. `docidwith+char`) by using: * For reading: use the `post` all docs operation and the `key` or `keys` parameter with a value of the document ID including the `+`. * For writing: use the `post` document operation or `post` bulk docs operation with the value of the document ID including the `+`. @@ -22,23 +23,6 @@ Using JSON objects as keys (e.g. `start_key`, `end_key`, `key`, `keys`) can cause inconsistent results because the ordering of the members of the JSON object after serialization is not guaranteed. -### Search - -#### Cannot use `drilldown` parameters - -Drilldown parameters cannot be used for search queries with server versions: -* CouchDB versions < 3.2.0 -* Cloudant (Classic) <= 8158 - -### Changes - -#### Terminated connections - -When using the `post` changes operation the connection may intermittently terminate with an early `EOF` when using -server versions: -* CouchDB versions < 3.2.0 -* Cloudant (Classic) <= 8169 - ### Documents #### Attachments @@ -82,37 +66,13 @@ Example JSON request body: } ``` -### Monitoring, Authorization, and CORS - -The server (Cloudant (Classic) <= 8169) incorrectly processes gzip compressed request bodies for the following endpoints: -| Endpoint | HTTP operation | -|---------------------------------------|----------------| -|`/_api/v2/user/activity_tracker/events`|`POST` | -|`/_api/v2/user/capacity/throughput` |`PUT` | -|`/_api/v2/api_keys` |`POST` | -|`/_api/v2/db/{db}/_security` |`PUT` | -|`/_api/v2/user/config/cors` |`PUT` | - -The workaround is to [disable request body compression](#disabling-request-body-compression). - -### Replication - -The server (Cloudant (Classic) <= 8169) incorrectly processes gzip compressed request bodies for `_replicate` endpoint. -The workaround is to [disable request body compression](#disabling-request-body-compression). - -The `basic` property of `ReplicationDatabaseAuth` is not available in CouchDB < 3.2.0 and Cloudant <= 8914. For those versions use the `headers` property to add a header with a key of `Authorization` and a value of `Basic `. - ### Compression * Manually setting an `Accept-Encoding` header on requests will disable the transparent gzip decompression of response bodies from the server. * Manually setting a `Content-Encoding` header on requests will disable the transparent gzip compression of request bodies to the server. - - - - ## Cloudant SDK for Python - + ### Request bodies containing the `headers` parameter The `headers` dict is always reserved for the API request headers. @@ -145,8 +105,39 @@ The example above represents this JSON body: } ``` +### Documents + +#### Name collisions with reserved metadata fields + +The cloudant-python-sdk internal representation of the `Document` model in a Python dict +currently does not allow for members with the same names as the reserved (`_` prefixed) +document metadata members. + +This means that members named any of the following will be removed by the `Document` +`from_dict` and `to_dict` functions: +* `attachments` +* `conflicts` +* `deleted` +* `deleted_conflicts` +* `id` +* `local_seq` +* `rev` +* `revisions` +* `revs_info` + +Potential workarounds are: +* use [Raw IO](/#raw-io) functions to serialize/deserialize +documents into a custom dict or class. +* use a different member name +* nest the members inside another object member + +See [issue #490](/issues/490). + ### Disabling request body compression +Some issues with older server versions can be worked around by disabling +compression of request bodies. This is an example of how to do that. + ```python from ibmcloudant.cloudant_v1 import CloudantV1 client = CloudantV1.new_instance(service_name="YOUR_SERVICE_NAME") From f956db49c998dff83b55faa212368ad0037afcee Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 12 Jul 2023 09:02:41 +0000 Subject: [PATCH 176/669] docs(generated): fix broken links in known_issues Generated SDK source code using: - Generator version 3.74.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 403e9cd Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- KNOWN_ISSUES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 3e94f004..5d5df0c5 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -131,7 +131,7 @@ documents into a custom dict or class. * use a different member name * nest the members inside another object member -See [issue #490](/issues/490). +See [issue #490](https://github.com/IBM/cloudant-python-sdk/issues/490). ### Disabling request body compression From bf48a34696c2c2d1aaf040fad0d36d8c7d5cf919 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 13 Jul 2023 10:30:45 +0000 Subject: [PATCH 177/669] Update version 0.4.3 -> 0.4.4 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 8bb1937d..db3d6e6c 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.3 +current_version = 0.4.4 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 693bfa7a..77316da8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.4.3 +# IBM Cloudant Python SDK Version 0.4.4 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -102,13 +102,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.4.3" +pip install --upgrade "ibmcloudant>=0.4.4" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.4.3" +easy_install --upgrade "ibmcloudant>=0.4.4" ``` ## Authentication diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index c5a6361c..f0e0fe5b 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.4.3' +__version__ = '0.4.4' diff --git a/setup.py b/setup.py index 8d5a4453..779c397f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import sys import pkg_resources -__version__ = '0.4.3' +__version__ = '0.4.4' PACKAGE_NAME = 'ibmcloudant' PACKAGE_DESC = 'Python client library for IBM Cloudant' From bc5bca705617aba98268d05fc67b77af0b51cbdb Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 13 Jul 2023 13:48:08 +0100 Subject: [PATCH 178/669] Revert "build(deps): Bump sphinx from 6.2.1 to 7.0.1" This reverts commit 962d08ed54f5d2d6022aceab170cf52dbfca709e. --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index b7ba45f0..0493edeb 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.0.1 +Sphinx==6.2.1 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.2.2 From bcab29c61787852e4f0e9cce416ded066f0242fc Mon Sep 17 00:00:00 2001 From: Esteban Laver Date: Fri, 14 Jul 2023 11:25:07 -0400 Subject: [PATCH 179/669] ci: Update publishing to PEP517/PEP621 style - Use flit for build and publish Signed-off-by: Esteban Laver --- .bumpversion.cfg | 6 +-- Jenkinsfile | 16 ++++---- pyproject.toml | 39 ++++++++++++++++++ requirements-dev.txt | 3 +- requirements.txt | 5 --- setup.py | 94 -------------------------------------------- tox.ini | 5 +-- 7 files changed, 53 insertions(+), 115 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index db3d6e6c..66b2dcb7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -17,9 +17,9 @@ serialize = search = __version__ = '{current_version}' replace = __version__ = '{new_version}' -[bumpversion:file:setup.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' +[bumpversion:file:pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" [bumpversion:file:README.md] search = {current_version} diff --git a/Jenkinsfile b/Jenkinsfile index 13f3f649..dd395861 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -294,31 +294,31 @@ void applyCustomizations() { void runTests() { sh ''' export PIP_INDEX_URL=https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL_DOWN##'https://'}/api/pypi/cloudant-sdks-pypi-virtual/simple - python3 -m tox -e py311-lint - python3 -m tox -e py311 + pip install -r requirements-dev.txt && flit install --only-deps + pylint --rcfile=.pylintrc ibmcloudant test + python3 -m pytest --junitxml=junitreports/junit-pytest.xml --cov=ibmcloudant ''' } void publishStaging() { - withEnv(["TWINE_REPOSITORY_URL=${env.STAGE_ROOT}pypi/cloudant-sdks-pypi-local", 'TWINE_USERNAME=' + env.ARTIFACTORY_CREDS_USR, 'TWINE_PASSWORD=' + env.ARTIFACTORY_CREDS_PSW]) { - publishTwine() + withEnv(["FLIT_INDEX_URL=${env.STAGE_ROOT}pypi/cloudant-sdks-pypi-local", 'FLIT_USERNAME=' + env.ARTIFACTORY_CREDS_USR, 'FLIT_PASSWORD=' + env.ARTIFACTORY_CREDS_PSW]) { + publishFlit() } } void publishPublic() { withCredentials([usernamePassword(credentialsId: 'pypi', passwordVariable: 'TWINE_PASSWORD', usernameVariable: 'TWINE_USERNAME')]) { - publishTwine() + publishFlit() } } -void publishTwine() { +void publishFlit() { dir('dist') { deleteDir() } sh ''' python3 --version - python3 setup.py sdist - python3 -m twine upload dist/* + flit publish --no-use-vcs ''' } diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..400a09a1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["flit_core >=3.9,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "ibmcloudant" +version = "0.4.4" +description = "Python client library for IBM Cloudant" +dependencies = [ + "ibm_cloud_sdk_core==3.16.7", + "requests>=2.20,<3.0", + "python_dateutil>=2.5.3,<3.0.0", + "PyJWT>=2.0.1,<3.0.0", +] +authors = [ + { name="IBM", email="cldtsdks@us.ibm.com" }, +] +readme = "README.md" +requires-python = ">=3.8" +license = {file = "LICENSE"} +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Libraries :: Application Frameworks", +] +keywords = ["ibmcloudant"] + +[project.urls] +"Homepage" = "https://github.com/IBM/cloudant-python-sdk" +"Bug Tracker" = "https://github.com/IBM/cloudant-python-sdk/issues" diff --git a/requirements-dev.txt b/requirements-dev.txt index 91386c86..47bc3d0c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,8 +4,7 @@ responses==0.23.1 python_dotenv==1.0.0 pylint==2.17.4 tox==4.6.4 -pytest-rerunfailures==12.0 - +flit==3.9.0 # code coverage coverage==7.2.7 pytest-cov==4.1.0 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cb088387..00000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -ibm_cloud_sdk_core==3.16.7 -# dependencies of ibm_cloud_sdk_core: -requests>=2.20,<3.0 -python_dateutil>=2.5.3,<3.0.0 -PyJWT>=2.0.1,<3.0.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 779c397f..00000000 --- a/setup.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python - -# © Copyright IBM Corporation 2020. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import setup -from setuptools.command.test import test as TestCommand -import os -import sys -import pkg_resources - -__version__ = '0.4.4' -PACKAGE_NAME = 'ibmcloudant' -PACKAGE_DESC = 'Python client library for IBM Cloudant' - -with open('requirements.txt') as f: - install_requires = [str(req) for req in pkg_resources.parse_requirements(f)] -with open('requirements-dev.txt') as f: - tests_require = [str(req) for req in pkg_resources.parse_requirements(f)] - -if sys.argv[-1] == 'publish': - # test server - os.system('python setup.py register -r pypitest') - os.system('python setup.py sdist upload -r pypitest') - - # production server - os.system('python setup.py register -r pypi') - os.system('python setup.py sdist upload -r pypi') - sys.exit() - -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = ['--strict', '--verbose', '--tb=long', 'test'] - self.test_suite = True - - def run_tests(self): - import pytest - errcode = pytest.main(self.test_args) - sys.exit(errcode) - -class PyTestUnit(PyTest): - def finalize_options(self): - self.test_args = ['--strict', '--verbose', '--tb=long', 'test/unit'] - -class PyTestIntegration(PyTest): - def finalize_options(self): - self.test_args = ['--strict', '--verbose', '--tb=long', 'test/integration'] - -with open('README.md', 'r', encoding='utf-8') as fh: - readme = fh.read() - -setup(name=PACKAGE_NAME.replace('_', '-'), - version=__version__, - description=PACKAGE_DESC, - license='Apache 2.0', - install_requires=install_requires, - tests_require=tests_require, - cmdclass={'test': PyTest, 'test_unit': PyTestUnit, 'test_integration': PyTestIntegration}, - author='IBM', - author_email='cldtsdks@us.ibm.com', - long_description=readme, - long_description_content_type='text/markdown', - url='https://github.com/IBM/cloudant-python-sdk', - packages=[PACKAGE_NAME], - include_package_data=True, - keywords=PACKAGE_NAME, - classifiers=[ - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Software Development :: Libraries :: Application Frameworks', - ], - zip_safe=True - ) diff --git a/tox.ini b/tox.ini index bcb7d784..0e11fa48 100644 --- a/tox.ini +++ b/tox.ini @@ -10,9 +10,9 @@ setenv = PYTHONPATH = pylint/checkers [testenv] passenv = TOXENV, CI, TRAVIS* commands = - py.test --reruns 3 -o junit_family=xunit2 --junitxml=junitreports/junit-{envname}.xml --cov=ibmcloudant {posargs} + flit install --only-deps + python3 -m pytest --junitxml=junitreports/junit-{envname}.xml --cov=ibmcloudant {posargs} deps = - -r{toxinidir}/requirements.txt -r{toxinidir}/requirements-dev.txt usedevelop = True exclude = .venv,.git,.tox,docs @@ -20,7 +20,6 @@ exclude = .venv,.git,.tox,docs [testenv:docs] description = invoke sphinx-build to build the HTML docs deps = - -r{toxinidir}/requirements.txt -r{toxinidir}/requirements-docs.txt basepython = python3.11 commands = sphinx-build {toxinidir}/source "{toxinidir}/apidocs" -bhtml From 2138b830963883038b98fd86cb14996b99536a1a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:33:07 +0000 Subject: [PATCH 180/669] build(generated): Modernize python build and publishing (#779) Generated SDK source code using: - Generator version 3.74.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 3ad9cab Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index dd395861..411546eb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -307,7 +307,7 @@ void publishStaging() { } void publishPublic() { - withCredentials([usernamePassword(credentialsId: 'pypi', passwordVariable: 'TWINE_PASSWORD', usernameVariable: 'TWINE_USERNAME')]) { + withCredentials([usernamePassword(credentialsId: 'pypi', passwordVariable: 'FLIT_PASSWORD', usernameVariable: 'FLIT_USERNAME')]) { publishFlit() } } From fa493bfd852f7f4c0637fd5d0202d09993c928b0 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 21 Jul 2023 10:26:32 +0100 Subject: [PATCH 181/669] chore: update secrets baseline --- .secrets.baseline | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 045ca711..c65a6514 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "stubs/.+\\.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2023-03-27T14:50:33Z", + "generated_at": "2023-07-21T09:25:51Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -138,7 +138,7 @@ } ] }, - "version": "0.13.1+ibm.57.dss", + "version": "0.13.1+ibm.61.dss", "word_list": { "file": null, "hash": null From 55c1a6c008937a079547829616353ad80d0d45b0 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 21 Jul 2023 10:26:42 +0100 Subject: [PATCH 182/669] ci: remove tox from actions --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b8b8a49..cf2f0dbf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,6 +50,7 @@ jobs: - name: Install deps run: | python -m pip install --upgrade pip - pip install tox + pip install -r requirements-dev.txt + flit install --only-deps - name: Run tests - run: tox -e py + run: python -m pytest From c6a5310623aa76105338d1a0cf999ee60e480fd3 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 21 Jul 2023 10:27:02 +0100 Subject: [PATCH 183/669] ci: remove tox from docs script --- scripts/pydoc/publish-doc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/pydoc/publish-doc.sh b/scripts/pydoc/publish-doc.sh index 39b5c19f..fe71d9ed 100755 --- a/scripts/pydoc/publish-doc.sh +++ b/scripts/pydoc/publish-doc.sh @@ -8,7 +8,8 @@ GIT_REPO=$(git remote get-url origin) # Create documentation printf ">>>>> Generate new documentation\n" -python3 -m tox -e docs +pip install -r requirements-docs.txt +sphinx-build source apidocs -bhtml # Clone gh-pages branch printf ">>>>> Publishing pydoc for release build: repo=%s branch=%s build_num=%s job_name=%s\n" ${GIT_REPO} ${BRANCH_NAME} ${BUILD_NUMBER} ${JOB_NAME} From 0fbd09929d5307d582e8d78a72bab6f9a3561d28 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 21 Jul 2023 10:28:15 +0100 Subject: [PATCH 184/669] ci: remove tox --- requirements-dev.txt | 4 ++-- tox.ini | 25 ------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 tox.ini diff --git a/requirements-dev.txt b/requirements-dev.txt index 47bc3d0c..3019d025 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,10 @@ +# build dependencies +flit==3.9.0 # test dependencies pytest==7.4.0 responses==0.23.1 python_dotenv==1.0.0 pylint==2.17.4 -tox==4.6.4 -flit==3.9.0 # code coverage coverage==7.2.7 pytest-cov==4.1.0 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 0e11fa48..00000000 --- a/tox.ini +++ /dev/null @@ -1,25 +0,0 @@ -[tox] -envlist = py311-lint, py37, py38, py39, py310, py311 - -[testenv:py311-lint] -basepython = python3.11 -deps = pylint -commands = pylint --rcfile=.pylintrc ibmcloudant test -setenv = PYTHONPATH = pylint/checkers - -[testenv] -passenv = TOXENV, CI, TRAVIS* -commands = - flit install --only-deps - python3 -m pytest --junitxml=junitreports/junit-{envname}.xml --cov=ibmcloudant {posargs} -deps = - -r{toxinidir}/requirements-dev.txt -usedevelop = True -exclude = .venv,.git,.tox,docs - -[testenv:docs] -description = invoke sphinx-build to build the HTML docs -deps = - -r{toxinidir}/requirements-docs.txt -basepython = python3.11 -commands = sphinx-build {toxinidir}/source "{toxinidir}/apidocs" -bhtml From c55a0dce6cd4e42145bc16c78b8726668fbcdc27 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 21 Jul 2023 10:28:42 +0100 Subject: [PATCH 185/669] ci: remove unused manifest file --- MANIFEST.in | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 68bc171c..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include requirements.txt -include requirements-dev.txt -include LICENSE From a8d3f6092f871266225f84a40b206fe6e7ed036c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:28:52 +0000 Subject: [PATCH 186/669] build(deps-dev): Bump responses from 0.23.1 to 0.23.2 Bumps [responses](https://github.com/getsentry/responses) from 0.23.1 to 0.23.2. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.23.1...0.23.2) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3019d025..5ee21f8c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==7.4.0 -responses==0.23.1 +responses==0.23.2 python_dotenv==1.0.0 pylint==2.17.4 # code coverage From 864ebce2960d43f8d23071c4685a0475a80145f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:31:33 +0000 Subject: [PATCH 187/669] build(deps-dev): Bump pylint from 2.17.4 to 2.17.5 Bumps [pylint](https://github.com/pylint-dev/pylint) from 2.17.4 to 2.17.5. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.17.4...v2.17.5) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5ee21f8c..04e1f74e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==7.4.0 responses==0.23.2 python_dotenv==1.0.0 -pylint==2.17.4 +pylint==2.17.5 # code coverage coverage==7.2.7 pytest-cov==4.1.0 From 53bdcdf7c064b0fb21a62618dcec0423f2cec1bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:34:43 +0000 Subject: [PATCH 188/669] build(deps-dev): Bump responses from 0.23.2 to 0.23.3 Bumps [responses](https://github.com/getsentry/responses) from 0.23.2 to 0.23.3. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.23.2...0.23.3) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 04e1f74e..df575898 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==7.4.0 -responses==0.23.2 +responses==0.23.3 python_dotenv==1.0.0 pylint==2.17.5 # code coverage From 8c006f4c84dfa040212ffda96c98add805445fb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:04:04 +0000 Subject: [PATCH 189/669] build(deps-dev): Bump coverage from 7.2.7 to 7.3.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.7 to 7.3.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.2.7...7.3.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index df575898..dce1dbca 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.23.3 python_dotenv==1.0.0 pylint==2.17.5 # code coverage -coverage==7.2.7 +coverage==7.3.0 pytest-cov==4.1.0 From 71b1caa1acef8b8bf97ddcf7a2c2b311d14e6d23 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:27:56 +0000 Subject: [PATCH 190/669] docs(generated): update auth information Generated SDK source code using: - Generator version 3.76.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 5c467f6 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 151 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 91 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 77316da8..baf76724 100644 --- a/README.md +++ b/README.md @@ -32,14 +32,15 @@ to avoid surprises. - [Features](#features) - [Prerequisites](#prerequisites) - [Installation](#installation) -- [Authentication](#authentication) - * [Authentication with environment variables](#authentication-with-environment-variables) - + [IAM authentication](#iam-authentication) - + [Session cookie authentication](#session-cookie-authentication) - + [Basic authentication](#basic-authentication) - * [Authentication with external configuration](#authentication-with-external-configuration) - * [Programmatic authentication](#programmatic-authentication) - [Using the SDK](#using-the-sdk) + * [Authentication](#authentication) + + [Authentication with environment variables](#authentication-with-environment-variables) + - [IAM API key authentication](#iam-api-key-authentication) + - [IAM Trusted profile (container) authentication](#iam-trusted-profile-container-authentication) + - [IAM Trusted profile (VPC) authentication](#iam-trusted-profile-vpc-authentication) + - [Session cookie authentication](#session-cookie-authentication) + + [Authentication with external configuration](#authentication-with-external-configuration) + + [Programmatic authentication](#programmatic-authentication) * [Request timeout configuration](#request-timeout-configuration) * [Code examples](#code-examples) + [1. Create a database and add a document](#1-create-a-database-and-add-a-document) @@ -97,6 +98,7 @@ project: server. - Python 3.8 or above. + ## Installation To install, use `pip` or `easy_install`: @@ -111,90 +113,123 @@ or easy_install --upgrade "ibmcloudant>=0.4.4" ``` -## Authentication + +## Using the SDK + +For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) documentation. + +This library requires configuration with a service URL and +[Cloudant service credentials][service-credentials] to authenticate with your +account. + +There are several ways to **set** these authentication properties: + +1. As [environment variables](#authentication-with-environment-variables) +1. The [programmatic approach](#programmatic-authentication) +1. With an [external credentials file](#authentication-with-external-configuration) + +The following section describes the different authentication types and provides environment variable examples. +Examples for other configuration methods are available by following the provided links. + +### Authentication [service-credentials]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials [cloud-IAM-mgmt]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai [couch-cookie-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication [cloudant-cookie-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication [couch-basic-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication +[couch-jwt-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication [cloudant-basic-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication +[cloudant-legacy-api-keys]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys -This library requires some of your -[Cloudant service credentials][service-credentials] to authenticate with your -account. +This library requires credentials to authenticate with IBM Cloudant. These credentials may be: +* IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`) + * [IBM Cloud account][cloud-IAM-mgmt] user, service ID or trusted profile credentials + that have been granted access to the IBM Cloud Cloudant resource instance. + * [IBM Cloudant service credentials][service-credentials] generated by the IBM Cloud Cloudant resource instance. +* Username and password credentials (can be used with authentication types `COUCHDB_SESSION` and `BASIC`) + * [IBM Cloudant service credentials][service-credentials] generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`. + * IBM Cloudant [legacy credentials][cloudant-basic-auth] (i.e. username and password) for instances not in IBM Cloud. + * IBM Cloudant [legacy API keys][cloudant-legacy-api-keys]. -1. `IAM`, `COUCHDB_SESSION`, `BASIC` or `NOAUTH` **authentication type**. - 1. [*IAM authentication*](#iam-authentication) is highly recommended when your - back-end database server is [**Cloudant**][cloud-IAM-mgmt]. This - authentication type requires a server-generated `apikey` instead of a - user-given password. You can create one - [here](https://cloud.ibm.com/iam/apikeys). - 1. [*Session cookie (`COUCHDB_SESSION`) authentication*](#session-cookie-authentication) - is recommended for [Apache CouchDB][couch-cookie-auth] or for - [Cloudant][cloudant-cookie-auth] when IAM is unavailable. It exchanges username - and password credentials for an `AuthSession` cookie from the `/_session` - endpoint. - 1. [*Basic* (or legacy) *authentication*](#basic-authentication) is a fallback - for both [Cloudant][cloudant-basic-auth] and [Apache CouchDB][couch-basic-auth] - back-end database servers. This authentication type requires the good old - `username` and `password` credentials. - 1. *Noauth* authentication does not require credentials. Note that this - authentication type only works with queries against a database with read - access for everyone. -1. The service `url`. - -There are several ways to **set** these properties: +For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types +must be used. -1. As [environment variables](#authentication-with-environment-variables) -1. The [programmatic approach](#programmatic-authentication) -1. With an [external credentials file](#authentication-with-external-configuration) +This table summarizes the available authentication types. +The authentication types are listed in order of recommendation, preferably use the authentication type +from the first row in the table that is compatible with your environment. + +| Authenitcation type | Recommended for | `AUTH_TYPE` | Description | +| --- | --- | --- | --- | +| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC)| `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| [Session cookie](#session-cookie-authentication) | [Cloudant][cloudant-cookie-auth]
(legacy credentials & instances without IAM)

[Apache CouchDB][couch-cookie-auth] | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | +| [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB][couch-jwt-auth]
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | +| [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB][couch-basic-auth]
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | +| [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. + +The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`. + +#### Authentication with environment variables -### Authentication with environment variables +The default service name is `CLOUDANT` so `CLOUDANT_` prefixed names are used in these examples. -#### IAM authentication +Any custom service name prefix can be used as long as the matching name is used to instantiate the SDK client +and the same prefix is used for all configuration options. -For Cloudant *IAM authentication*, set the following environmental variables by +##### IAM API key authentication + +For Cloudant *IAM API key authentication*, set the following environmental variables by replacing the `` and `` with your proper [service credentials][service-credentials]. There is no need to set -`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default. +`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when an `APIKEY` is set. ```bash CLOUDANT_URL= CLOUDANT_APIKEY= ``` -#### Session cookie authentication +##### IAM Trusted profile (container) authentication -For `COUCHDB_SESSION` authentication, set the following environmental variables -by replacing the ``, `` and `` with your proper -[service credentials][service-credentials]. +For Cloudant *IAM Trusted profile compute resource container authentication*, set the following environmental variables by +replacing the `` and `` with your values. There is no need to set +`CLOUDANT_AUTH_TYPE` to `CONTAINER` because it is the default. ```bash -CLOUDANT_AUTH_TYPE=COUCHDB_SESSION CLOUDANT_URL= -CLOUDANT_USERNAME= -CLOUDANT_PASSWORD= +CLOUDANT_IAM_PROFILE_ID= ``` -#### Basic authentication +Alternatively a profile name may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_NAME`. + +##### IAM Trusted profile (VPC) authentication + +For Cloudant *IAM Trusted profile compute resource vpc authentication*, set the following environmental variables by +replacing the `` and `` with your values. -For *Basic authentication*, set the following environmental variables by -replacing the ``, `` and `` with your proper +```bash +CLODUANT_AUTH_TYPE=VPC +CLOUDANT_URL= +CLOUDANT_IAM_PROFILE_ID= +``` + +Alternatively a profile CRN may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_CRN`. + +##### Session cookie authentication + +For `COUCHDB_SESSION` authentication, set the following environmental variables +by replacing the ``, `` and `` with your proper [service credentials][service-credentials]. ```bash -CLOUDANT_AUTH_TYPE=BASIC +CLOUDANT_AUTH_TYPE=COUCHDB_SESSION CLOUDANT_URL= CLOUDANT_USERNAME= CLOUDANT_PASSWORD= ``` -**Note**: There are also additional [*Bearer token*](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication), [*Container*](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication) and [*VPC Instance*](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication) authentication methods. For more details, please follow the provided links. -We recommend that you use [IAM](#iam-authentication) for Cloudant and -[Session](#session-cookie-authentication) for CouchDB authentication. - -### Authentication with external configuration +#### Authentication with external configuration To use an external configuration file, the [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#authentication-with-external-configuration), @@ -202,7 +237,7 @@ or the [general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration) will guide you. -### Programmatic authentication +#### Programmatic authentication To learn more about how to use programmatic authentication, see the related documentation in the @@ -210,10 +245,6 @@ documentation in the or in the [Python SDK Core document](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md) about authentication. -## Using the SDK - -For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) documentation. - ### Request timeout configuration No request timeout is defined, but a 2.5m read and a 60s connect timeout are set by default. Be sure to set a request timeout appropriate to your application usage and environment. From 19ca7fb4dbc05f548d3f2f4431308966aac7baa5 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 21 Aug 2023 12:34:11 +0100 Subject: [PATCH 191/669] chore: remove unneeded log level set from examples --- test/examples/src/create_db_and_doc.py | 7 +------ test/examples/src/delete_doc.py | 7 +------ test/examples/src/update_doc.py | 6 +----- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/test/examples/src/create_db_and_doc.py b/test/examples/src/create_db_and_doc.py index 1e6c78c1..8481784c 100644 --- a/test/examples/src/create_db_and_doc.py +++ b/test/examples/src/create_db_and_doc.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2022. +# © Copyright IBM Corporation 2020, 2023. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1, Document -# Set logging level to show only critical logs -logging.basicConfig(level=logging.CRITICAL) - # 1. Create a client with `CLOUDANT` default service name ============= client = CloudantV1.new_instance() diff --git a/test/examples/src/delete_doc.py b/test/examples/src/delete_doc.py index a345b7bc..b0d80467 100644 --- a/test/examples/src/delete_doc.py +++ b/test/examples/src/delete_doc.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2022. +# © Copyright IBM Corporation 2020, 2023. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1 -# Set logging level to show only critical logs -logging.basicConfig(level=logging.CRITICAL) - # 1. Create a client with `CLOUDANT` default service name ============= client = CloudantV1.new_instance() diff --git a/test/examples/src/update_doc.py b/test/examples/src/update_doc.py index d15232ce..de680934 100644 --- a/test/examples/src/update_doc.py +++ b/test/examples/src/update_doc.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2022. +# © Copyright IBM Corporation 2020, 2023. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,14 +15,10 @@ # limitations under the License. import json -import logging from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1 -# Set logging level to show only critical logs -logging.basicConfig(level=logging.CRITICAL) - # 1. Create a client with `CLOUDANT` default service name ============= client = CloudantV1.new_instance() From 381a49461d23f1e688f58818bb996034de50b553 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:24:16 +0000 Subject: [PATCH 192/669] build(deps): Bump sphinx-rtd-theme from 1.2.2 to 1.3.0 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.2.2 to 1.3.0. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.2.2...1.3.0) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 0493edeb..b508b099 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==6.2.1 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 -sphinx-rtd-theme==1.2.2 +sphinx-rtd-theme==1.3.0 From 8abc744c8e7903cbf7adb9e3fd470ab144e6ef72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 08:32:25 +0000 Subject: [PATCH 193/669] build(deps): Bump sphinx from 6.2.1 to 7.2.2 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 6.2.1 to 7.2.2. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v6.2.1...v7.2.2) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index b508b099..e3e957bf 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==6.2.1 +Sphinx==7.2.2 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 From a71ed2b69c0b1867413fa488ae4e143928f37b49 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:03:43 +0000 Subject: [PATCH 194/669] docs(generated): update README with latest examples Generated SDK source code using: - Generator version 3.76.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 942cb05 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index baf76724..f23ed03d 100644 --- a/README.md +++ b/README.md @@ -275,16 +275,11 @@ you must use your defined service name as the prefix for all Cloudant related en Once the environment variables are set, you can try out the code examples. -[embedmd]:# (test/examples/src/create_db_and_doc.py /import/ $) +[embedmd]:# (test/examples/src/create_db_and_doc.py /from ibm_cloud_sdk_core import/ $) ```py -import logging - from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1, Document -# Set logging level to show only critical logs -logging.basicConfig(level=logging.CRITICAL) - # 1. Create a client with `CLOUDANT` default service name ============= client = CloudantV1.new_instance() @@ -433,14 +428,10 @@ database or 'example' document was not found." [embedmd]:# (test/examples/src/update_doc.py /import/ $) ```py import json -import logging from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1 -# Set logging level to show only critical logs -logging.basicConfig(level=logging.CRITICAL) - # 1. Create a client with `CLOUDANT` default service name ============= client = CloudantV1.new_instance() @@ -541,16 +532,11 @@ database or 'example' document was not found."
Delete code example -[embedmd]:# (test/examples/src/delete_doc.py /import/ $) +[embedmd]:# (test/examples/src/delete_doc.py /from ibm_cloud_sdk_core import/ $) ```py -import logging - from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1 -# Set logging level to show only critical logs -logging.basicConfig(level=logging.CRITICAL) - # 1. Create a client with `CLOUDANT` default service name ============= client = CloudantV1.new_instance() From ac5587310a8c3b0db6377f89da0aae17df557256 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 20 Oct 2022 10:05:34 -0300 Subject: [PATCH 195/669] feat: changes follower MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ildikó Eigel <17944122+mojito317@users.noreply.github.com> Co-authored-by: Rich Ellis Co-authored-by: Esteban Laver <10552966+emlaver@users.noreply.github.com> --- ibmcloudant/__init__.py | 1 + ibmcloudant/features/__init__.py | 14 + ibmcloudant/features/changes_follower.py | 455 ++++++++++++ test/examples/src/features/initialize.py | 30 + test/examples/src/features/start.py | 29 + .../src/features/start_and_process.py | 42 ++ test/examples/src/features/start_one_off.py | 29 + .../src/features/start_one_off_and_process.py | 40 ++ test/examples/src/features/stop.py | 37 + test/unit/features/conftest.py | 243 +++++++ test/unit/features/test_changes_follower.py | 661 ++++++++++++++++++ 11 files changed, 1581 insertions(+) create mode 100644 ibmcloudant/features/__init__.py create mode 100644 ibmcloudant/features/changes_follower.py create mode 100644 test/examples/src/features/initialize.py create mode 100644 test/examples/src/features/start.py create mode 100644 test/examples/src/features/start_and_process.py create mode 100644 test/examples/src/features/start_one_off.py create mode 100644 test/examples/src/features/start_one_off_and_process.py create mode 100644 test/examples/src/features/stop.py create mode 100644 test/unit/features/conftest.py create mode 100644 test/unit/features/test_changes_follower.py diff --git a/ibmcloudant/__init__.py b/ibmcloudant/__init__.py index c212bfa1..7046d6cf 100644 --- a/ibmcloudant/__init__.py +++ b/ibmcloudant/__init__.py @@ -22,6 +22,7 @@ from .cloudant_base_service import new_init, new_prepare_request, new_set_service_url, new_set_default_headers from .couchdb_session_token_manager import CouchDbSessionTokenManager from .cloudant_v1 import CloudantV1 +from .features.changes_follower import ChangesFollower # sdk-core's __construct_authenticator works with a long switch-case so monkey-patching is required get_authenticator.__construct_authenticator = new_construct_authenticator diff --git a/ibmcloudant/features/__init__.py b/ibmcloudant/features/__init__.py new file mode 100644 index 00000000..c366e733 --- /dev/null +++ b/ibmcloudant/features/__init__.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# © Copyright IBM Corporation 2022, 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py new file mode 100644 index 00000000..dc65d2e2 --- /dev/null +++ b/ibmcloudant/features/changes_follower.py @@ -0,0 +1,455 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2022, 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +A helper for using the changes feed. +""" +import logging +import time +import random +import math +from datetime import datetime, timezone, timedelta +import functools +from queue import Queue +from threading import Thread, Event + +from enum import Enum, auto +from typing import Dict, Iterator + +from ibm_cloud_sdk_core import ApiException + +from ibmcloudant.cloudant_v1 import ( + CloudantV1, + PostChangesEnums, + ChangesResultItem, +) + +# max timedelta in milliseconds +FOREVER = round(timedelta.max.total_seconds() * 1000) - 1 +# 1 minute in millisec +MIN_CLIENT_TIMEOUT = 60000 +# To give the changes request a chance to be answered +# before the client timeout it is set to 3 seconds less. +LONGPOLL_TIMEOUT = MIN_CLIENT_TIMEOUT - 3000 +BATCH_SIZE = 10000 + +# Base delay in milliseconds between unsuccessful attempts to pull changes feed +# in presence of transient errors +BASE_DELAY = 100 +# Once we reach this number of retries we'll be capping the backoff +EXP_RETRY_GATE = int(math.log(LONGPOLL_TIMEOUT / BASE_DELAY) / math.log(2)) + + +class Mode(Enum): + """ + Enums for changes follower's operation mode. + """ + FINITE = auto() + LISTEN = auto() + + +class TransientErrorSuppression(Enum): + """ + Enums for changes follower's transient errors suppression mode. + """ + ALWAYS = auto() + NEVER = auto() + TIMER = auto() + + +class ChangesFollowerIterator: + """ + The ChangesFollowerIterator implements iterator interface. + + This class is for internal use by ChangesFollower, which provides + the user facing API. + + Args: + changes_caller: A partial function that pulls changes feed from CouchDB + for a given "since" parameter. + mode: Enum representing either one-off consumption of changes feed (FINITE) + or constant following the changes feed (LISTEN) + error_tolerance: The duration to suppress errors, + measured from the previous successful request. + """ + + def __init__( + self, changes_caller, mode: Mode, error_tolerance: int + ) -> None: + self.changes_caller = changes_caller + self._changes_iter = iter([]) + self.mode = mode + self._transient_suppression = TransientErrorSuppression.TIMER + if error_tolerance == 0: + self._transient_suppression = TransientErrorSuppression.NEVER + elif error_tolerance == FOREVER: + self._transient_suppression = TransientErrorSuppression.ALWAYS + self.error_tolerance = timedelta(milliseconds=error_tolerance) + self.since = 'now' if mode is Mode.LISTEN else '0' + self._success_timestamp = datetime.now(timezone.utc) + self._request_thread = Thread(target=self._request_callback) + self._buffer = Queue() + self._pending = None + self._has_next = True + self._retry = 0 + self._limit = None + self._stop = Event() + self.logger = logging.getLogger(__name__) + self._request_thread.start() + + @property + def limit(self) -> int: + return self._limit + + @limit.setter + def limit(self, value: int) -> None: + if value < 0: + raise ValueError('Limit must not be negative.') + self._limit = value + + @property + def since(self) -> str: + return self._since + + @since.setter + def since(self, value: str) -> None: + self._since = value + + def stop(self) -> None: + # shortcut limit and cancel in-flight + self.limit = 0 + self._stop.set() + try: + self._buffer.task_done() + except Exception: + pass + self._request_thread.join() + + def __iter__(self): + return self + + def __next__(self): + while True: + if self.limit is not None and self.limit == 0: + if not self._stop.is_set(): + self.stop() + raise StopIteration + try: + item = next(self._changes_iter) + if self.limit is not None and self.limit > 0: + self.limit -= 1 + return item + except StopIteration as exc: + data = self._buffer.get() + if self._stop.is_set(): + raise StopIteration from exc + if isinstance(data, Exception): + raise data from None + self._changes_iter = data + self._buffer.task_done() + + def _request_callback(self): + while True: + try: + if not self._has_next or self._stop.is_set(): + raise StopIteration + result = self.changes_caller(since=self.since).get_result() + self.since = result.get('last_seq') + self._pending = result.get('pending') + self._retry = 0 + if self._transient_suppression == TransientErrorSuppression.TIMER: + self._success_timestamp = datetime.now(timezone.utc) + if self.mode == Mode.FINITE and self._pending == 0: + self._has_next = False + results = result['results'] + self.logger.debug(f'_request_callback results {results}') + self._buffer.join() + if self._stop.is_set(): + raise StopIteration + self._buffer.put(( + ChangesResultItem.from_dict(item) for item in results + )) + except Exception as e: + self.logger.debug(f'Exception getting changes {e}') + if ( + self._transient_suppression == TransientErrorSuppression.NEVER + or ( + self._transient_suppression + == TransientErrorSuppression.TIMER + and self._success_timestamp + self.error_tolerance + < datetime.now(timezone.utc) + ) + ): + self.logger.debug('Error tolerance deadline exceeded.') + self._buffer.join() + self._buffer.put(e) + break + if ( + type(e) is ApiException and e.code in [400, 401, 403, 404] + or type(e) is StopIteration + ): + self.logger.debug('Terminal error.') + self._buffer.join() + self._buffer.put(e) + break + self.retry_delay() + + def retry_delay(self): + """ + Method retry_delay implements full jitter delay algorithm. + This is an exponential capped backoff with added jitter + to spread retry calls in case of multiple followers + started simultaneously for different feeds on the same account. + + The base delay is set to 100 ms and cap is set to the changes + feed pull's timeout. + + Algorithm reference: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ + """ + if (self._retry >= EXP_RETRY_GATE): + exp_delay = LONGPOLL_TIMEOUT + else: + exp_delay = pow(2, self._retry) * BASE_DELAY + jitter_delay = random.uniform(0, exp_delay) + time.sleep(round(jitter_delay / 1000, 3)) + self._retry += 1 + + +class ChangesFollower: + """ + ChangesFollower is a helper for using the changes feed. + + There are two modes of operation: + start_one_off() to fetch the changes from the supplied since sequence + until there are no further pending changes. + start() to fetch the changes from the supplied since sequence + and then continuing to listen indefinitely for further new changes. + + The starting sequence ID can be changed for either mode by using "since". + + By default when using: + start_one_off() the feed will start from the beginning. + start() the feed will start from "now". + + In either mode the iterator can be terminated early by calling stop(). + + By default ChangesFollower will suppress transient errors indefinitely + and endeavour to run to completion or listen forever. For applications + where that behaviour is not desirable an alternate options is + available where a duration may be specified to limit the time since the + last successful response that transient errors will be suppressed. + + It should be noted that errors considered terminal, for example, the + database not existing or invalid credentials are never suppressed and will + throw an exception immediately. + + The named arguments for "post_changes" are used to configure the behaviour + of the ChangesFollower. However, a subset of the options are invalid as + they are configured internally by the implementation and will cause an + ValueError exception to be thrown if supplied. + + These invalid options are: + - descending + - feed + - heartbeat + - last_event_id + - timeout + + Only the value of "_selector" is permitted for the post_changes's "filter" option. + Selector based filters perform better than JS based filters and using one + of the alternative JS based filter types will cause ChangesFollower + to throw a ValueError exception. + + It should also be noted that the "limit" parameter will truncate the + iterator at the given number of changes in either operating mode. + + The ChangesFollower requires the Cloudant client to have HTTP call and + read timeouts of at least 1 minute. The default client configuration has + sufficiently long timeouts. + + :param CloudantV1 service: A client for the Cloudant service. + :param int error_tolerance: A duration to suppress transient errors for set in milliseconds. + :return: None + """ + + def __init__( + self, service: CloudantV1, *, error_tolerance: int = FOREVER, **kwargs + ) -> None: + self.options = kwargs + self.limit = self.options.get('limit') + self._set_defaults() + self.service = service + self.error_tolerance = error_tolerance + self._iter = None + self.logger = logging.getLogger(__name__) + # Check the timeouts are suitable + timeouts = self.service.http_config.get('timeout', 0) + if isinstance(timeouts, int): + call_timeout, read_timeout = timeouts, timeouts + else: + call_timeout, read_timeout = timeouts + call_timeout, read_timeout = call_timeout * 1000, read_timeout * 1000 + if ( + call_timeout > 0 + and call_timeout < MIN_CLIENT_TIMEOUT + or read_timeout > 0 + and read_timeout < MIN_CLIENT_TIMEOUT + ): + raise ValueError( + 'To use {} the client read and call timeouts must be at least' + ' {:d} ms. The client read timeout is {:d}' + ' ms and the call timeout is {:d} ms.'.format( + type(self).__name__, + MIN_CLIENT_TIMEOUT, + read_timeout, + call_timeout, + ) + ) + + @property + def error_tolerance(self) -> int: + return self._error_tolerance + + @error_tolerance.setter + def error_tolerance(self, value: int) -> None: + if value > FOREVER: + raise ValueError( + f'Error tolerance duration must not be larger than {FOREVER}.' + ) + if value < 0: + raise ValueError('Error tolerance duration must not be negative.') + self._error_tolerance = value + + @property + def options(self) -> Dict: + return self._options + + @options.setter + def options(self, value: Dict): + class_name = type(self).__name__ + if value.get('db') is None: + error_fmt = 'The option db must be provided when using {}.' + raise ValueError(error_fmt.format(class_name)) + opts = ['descending', 'feed', 'heartbeat', 'last_event_id', 'timeout'] + invalid_options = [o for o in opts if value.get(o) is not None] + if value.get('filter') and value.get('filter') != '_selector': + invalid_options.append(f"filter={value.get('filter')}") + if len(invalid_options) > 0: + invalid_opts_list = ', '.join(invalid_options) + error_fmt = 'The options {} are invalid when using {}.' + if len(invalid_options) == 1: + error_fmt = "The option '{}' is invalid when using {}." + raise ValueError(error_fmt.format(invalid_opts_list, class_name)) + self._options = value + + def _set_defaults(self, limit: int = None): + defaults = { + 'feed': PostChangesEnums.Feed.LONGPOLL, + 'timeout': LONGPOLL_TIMEOUT, + } + if limit is not None: + self.logger.debug(f'Applying changes limit {limit}') + defaults['limit'] = limit + self._options = {**self._options, **defaults} + + def start(self) -> Iterator[ChangesResultItem]: + """ + Return all available changes and keep listening for new changes + until reaching an end condition. + + The end conditions are: + - a terminal error (e.g. unauthorized client). + - transient errors occur for longer than the error + suppression duration. + - the number of changes received reaches the limit specified + in the "post_changes" args used to instantiate + this ChangesFollower. + - ChangesFollower's stop() is called. + + The same change may be received more than once. + + Returns an iterator of ChangesResultItem per change. + + Throws ValueError if ChangesFollower's start() or start_one_off() + was already called or ApiException if a terminal error + or unsupressed transient error is recevied from the service + when fetching changes + """ + return self._run(Mode.LISTEN) + + def start_one_off(self) -> Iterator[ChangesResultItem]: + """ + Return all available changes until there are no further changes + pending or reaching an end condition. + + The end conditions are: + - a terminal error (e.g. unauthorized client). + - transient errors occur for longer than the error + suppression duration. + - the number of changes received reaches the limit specified + in the "post_changes" args used to instantiate + this ChangesFollower. + - ChangesFollower's stop() is called. + + The same change may be received more than once. + + Returns an iterator of ChangesResultItem per change. + + Throws ValueError if ChangesFollower's start() or start_one_off() + was already called or ApiException if a terminal error + or unsupressed transient error is recevied from the service + when fetching changes + """ + return self._run(Mode.FINITE) + + def stop(self) -> None: + """ + Stop this ChangesFollower. + + Note that synchronous iterator blocks so this stop method + needs to be called from a different thread to have any effect. + """ + self._iter.stop() + + def _run(self, mode: Mode): + if self._iter is not None: + raise RuntimeError('Cannot start a feed that has already started.') + + batch_size = BATCH_SIZE + if self.options.get('include_docs', False): + resp = self.service.get_database_information( + db=self.options.get('db') + ).get_result() + docs = resp.get('doc_count', 0) + sizes = resp.get('sizes', {}) + external_size = sizes.get('external', 0) + if external_size > 0 and docs > 0: + batch_size = max(int(5 * 1024 * 1024 / (external_size / docs + 500)), 1) + + if self.limit is not None: + batch_size = self.limit if self.limit < batch_size else batch_size + + self._set_defaults(batch_size) + changes_caller = functools.partial( + self.service.post_changes, **self.options + ) + self._iter = ChangesFollowerIterator( + changes_caller, mode, self.error_tolerance + ) + if self.limit is not None: + self._iter.limit = self.limit + if self.options.get('since') is not None: + self._iter.since = self.options.get('since') + return self._iter diff --git a/test/examples/src/features/initialize.py b/test/examples/src/features/initialize.py new file mode 100644 index 00000000..48420e02 --- /dev/null +++ b/test/examples/src/features/initialize.py @@ -0,0 +1,30 @@ +# © Copyright IBM Corporation 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +cf_params = { + 'db': 'example', # Required: the database name. + 'limit': 100, # Optional: return only 100 changes (including duplicates). + 'since': '3-g1AG3...' # Optional: start from this sequence ID (e.g. with a value read from persistent storage). +} + +changes_follower = ChangesFollower( + service=client, # Required: the Cloudant service client instance. + error_tolerance=10000, # Optional: suppress transient errors for at least 10 seconds before terminating. + **cf_params # Required: changes feed configuration options dict. +) diff --git a/test/examples/src/features/start.py b/test/examples/src/features/start.py new file mode 100644 index 00000000..bb78ebbe --- /dev/null +++ b/test/examples/src/features/start.py @@ -0,0 +1,29 @@ +# © Copyright IBM Corporation 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from collections.abc import Iterable + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem + +client = CloudantV1.new_instance() + +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) + +changes_items: Iterable[ChangesResultItem] = changes_follower.start() +# Note: iterable will not do anything until it is iterated +# Create a for loop to iterate over the flow of changes +# for changes_item in changes_items: ... diff --git a/test/examples/src/features/start_and_process.py b/test/examples/src/features/start_and_process.py new file mode 100644 index 00000000..997ab87d --- /dev/null +++ b/test/examples/src/features/start_and_process.py @@ -0,0 +1,42 @@ +# © Copyright IBM Corporation 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +# Start from a previously persisted seq +# Normally this would be read by the app from persistent storage +# e.g. previously_persisted_seq = your_app_persistence_read_func() +previously_persisted_seq = '3-g1AG3...' +changes_follower = ChangesFollower( + service=client, + **{'db': 'example', 'since': previously_persisted_seq}) + +changes_items = changes_follower.start() +for changes_item in changes_items: + # do something with changes + print(changes_item.id) + for change in changes_item.changes: + print(change.rev) + # when change item processing is complete app can store seq + seq = changes_item.seq + # write seq to persistent storage for use as since if required to resume later + # e.g. your_app_persistence_write_func(seq) + # keep processing changes until the application is terminated or some other stop condition is reached + +# Note: iterator above is blocking, code here will be unreachable +# until the iteration is stopped or another stop condition is reached. +# For long running followers careful consideration should be made of where to call stop on the iterator. diff --git a/test/examples/src/features/start_one_off.py b/test/examples/src/features/start_one_off.py new file mode 100644 index 00000000..bdb615f1 --- /dev/null +++ b/test/examples/src/features/start_one_off.py @@ -0,0 +1,29 @@ +# © Copyright IBM Corporation 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from collections.abc import Iterable + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem + +client = CloudantV1.new_instance() + +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) + +changes_items: Iterable[ChangesResultItem] = changes_follower.start_one_off() +# Note: iterable will not do anything until it is iterated +# Create a for loop to iterate over the flow of changes +# for changes_item in changes_items: ... diff --git a/test/examples/src/features/start_one_off_and_process.py b/test/examples/src/features/start_one_off_and_process.py new file mode 100644 index 00000000..29fc905d --- /dev/null +++ b/test/examples/src/features/start_one_off_and_process.py @@ -0,0 +1,40 @@ +# © Copyright IBM Corporation 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +# Start from a previously persisted seq +# Normally this would be read by the app from persistent storage +# e.g. previously_persisted_seq = your_app_persistence_read_func() +previously_persisted_seq = '3-g1AG3...' +changes_follower = ChangesFollower( + service=client, + **{'db': 'example', 'since': previously_persisted_seq}) + +changes_items = changes_follower.start_one_off() +for changes_item in changes_items: + # do something with changes + print(changes_item.id) + for change in changes_item.changes: + print(change.rev) + # when change item processing is complete app can store seq + seq = changes_item.seq + # write seq to persistent storage for use as since if required to resume later + # e.g. your_app_persistence_write_func(seq) + +# Note: iterator above is blocking, code here will be unreachable +# until all changes are processed (or another stop condition is reached). diff --git a/test/examples/src/features/stop.py b/test/examples/src/features/stop.py new file mode 100644 index 00000000..90de2a38 --- /dev/null +++ b/test/examples/src/features/stop.py @@ -0,0 +1,37 @@ +# © Copyright IBM Corporation 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) +changes_items = changes_follower.start() + +for changes_item in changes_items: + # Option 1: call stop after some condition + # Note that since the iterator is blocking at least one item + # must be returned from it to reach to this point. + # Additional changes may be processed before the iterator stops. + changes_follower.stop() + +# Option 2: call stop method when you want to end the continuous loop from +# outside the iterator. For example, you've put the changes follower in a +# separate thread and need to call stop on the main thread. +# Note: in this context the call must be made from a different thread because +# code immediately following the iterator is unreachable until the iterator +# has stopped. +changes_follower.stop() diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py new file mode 100644 index 00000000..71af42a8 --- /dev/null +++ b/test/unit/features/conftest.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2022, 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Shared tests' fixtures +""" + +import unittest +import pytest +import os +import json +import responses + +import threading +import queue + +import itertools + +from requests import codes +from requests.exceptions import ConnectionError + +from ibmcloudant.cloudant_v1 import ( + CloudantV1, + PostChangesEnums, + ChangesResult, + ChangesResultItem, +) + +from ibmcloudant.features.changes_follower import LONGPOLL_TIMEOUT, BATCH_SIZE, Mode + + +@pytest.fixture(scope='class') +def kwargs(request): + request.cls.kwarg_valid = { + 'include_docs': True, + 'doc_ids': ['foo', 'bar', 'baz'], + 'att_encoding_info': True, + 'attachments': True, + 'conflicts': True, + 'filter': '_selector', + 'selector': {'selector': {'foo': 'bar'}}, + } + + request.cls.kwarg_invalid = { + 'descending': True, + 'feed': PostChangesEnums.Feed.CONTINUOUS, + 'heartbeat': 150, + 'last_event_id': '9876-alotofcharactersthatarenotreallyrandom', + 'timeout': 3600000, + 'filter': '_view', + } + + +@pytest.fixture(scope='class') +def timeouts(request): + longpoll_timeout = int(LONGPOLL_TIMEOUT / 1000) + request.cls.timeouts_valid = [60, (60, 60), 120, 300, (120, 300)] + request.cls.timeouts_invalid = [ + 15, + 30, + (30, 15), + longpoll_timeout, + (longpoll_timeout, longpoll_timeout), + ] + + +@pytest.fixture(scope='class') +def errors(request): + request.cls.terminal_errors = [ + 'bad_request', + 'unauthorized', + 'forbidden', + 'not_found', + ] + request.cls.transient_errors = [ + 'too_many_requests', + 'internal_server_error', + 'bad_gateway', + 'gateway_timeout', + 'bad_json', + 'bad_io', + ] + + +@pytest.fixture(scope='class') +def limits(request): + request.cls.limits = [ + 100, + BATCH_SIZE, + BATCH_SIZE + 123, + ] + + +class ChangesFollowerBaseCase(unittest.TestCase): + @classmethod + def setUpClass(cls): + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + cls.client = CloudantV1.new_instance( + service_name='TEST_SERVICE', + ) + + def prepare_mock_changes(self, batches=0, errors=[], db_info_doc_count=500_000, db_info_doc_size=523): + class changes_callback: + def __init__(self): + self._batch_num = 1 + self._errors = itertools.cycle(errors) + self._return_error = False + + def __call__(self, request): + if self._return_error: + self._return_error = False + error = next(self._errors) + if error == 'bad_io': + return (200, {}, ConnectionError('peer reset')) + elif error == 'bad_json': + return (200, {}, '{') + else: + return ( + codes[error], + {}, + json.dumps({'error': error}), + ) + # this stands for "large" seq in empty result case + last_seq = f'{batches * BATCH_SIZE}-abcdef' + pending = 0 + items = [] + if self._batch_num <= batches: + # we start from doc idx 000001 + start = (self._batch_num - 1) * BATCH_SIZE + 1 + stop = start + BATCH_SIZE + last_seq = f'{stop-1}-abcdef' + pending = ( + batches * BATCH_SIZE - (self._batch_num) * BATCH_SIZE + ) + for idx in range(start, stop, 1): + items.append( + ChangesResultItem( + id=f'{idx:06}', + changes=[], + seq=f'{idx}-abcdef', + ) + ) + resp = ChangesResult( + last_seq=last_seq, pending=pending, results=items + ).to_dict() + self._batch_num += 1 + if len(errors) > 0: + self._return_error = True + return ( + 200, + {}, + json.dumps(resp), + ) + + _base_url = 'http://localhost:5984' + url = _base_url + '/db' + responses.get( + url, + status=200, + content_type='application/json', + json={'doc_count': db_info_doc_count, 'sizes': {'external': db_info_doc_count * db_info_doc_size}}, + ) + + url = _base_url + '/db/_changes' + return responses.add_callback( + responses.POST, + url, + content_type='application/json', + callback=changes_callback(), + ) + + def prepare_mock_with_error(self, error: str): + _base_url = 'http://localhost:5984' + url = _base_url + '/db/_changes' + if error == 'bad_io': + return responses.post(url, body=ConnectionError('peer reset')) + elif error == 'bad_json': + return responses.post( + url, + status=200, + content_type='application/json', + body='{', + ) + else: + return responses.post( + url, + status=codes[error], + content_type='application/json', + json={'error': error}, + ) + + def runner(self, follower, mode, timeout=0, stop_after=0): + """ + blocking runner with timeout + """ + + class TimeoutError(Exception): + pass + + def looper(changes, buf): + counter = 0 + try: + for _ in changes: + counter += 1 + if stop_after > 0 and stop_after == counter: + follower.stop() + buf.put(counter) + except Exception as e: + buf.put(e) + + def main(): + if mode == Mode.LISTEN: + changes = follower.start() + elif mode == Mode.FINITE: + changes = follower.start_one_off() + buf = queue.Queue() + thread = threading.Thread(target=looper, args=(changes, buf)) + thread.start() + while True: + thread.join(timeout) + if thread.is_alive(): + follower.stop() + else: + break + data = buf.get() + if isinstance(data, Exception): + raise data + return data + + return main() diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py new file mode 100644 index 00000000..f2e47065 --- /dev/null +++ b/test/unit/features/test_changes_follower.py @@ -0,0 +1,661 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2022, 2023. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Test methods in the changes follower module +""" + +import pytest +import responses +import sys +import timeit + +from requests.exceptions import ConnectionError + +from ibm_cloud_sdk_core import ApiException + +from ibmcloudant.cloudant_v1 import PostChangesEnums + +from ibmcloudant.features.changes_follower import ( + ChangesFollower, + FOREVER, + LONGPOLL_TIMEOUT, + BATCH_SIZE, + Mode, +) + + +from conftest import ChangesFollowerBaseCase + +# the largest positive integer supported by the platform +MAX_BATCHES = sys.maxsize / BATCH_SIZE + + +@pytest.mark.usefixtures('timeouts') +class TestChangesFollowerInitialization(ChangesFollowerBaseCase): + def test_minimal_initialization(self): + try: + ChangesFollower(self.client, db='db') + except BaseException: + self.fail('There should be no exception.') + + def test_validate_missing_database_name(self): + regx = 'The option db must be provided when using ChangesFollower.' + with self.assertRaisesRegex(ValueError, regx): + ChangesFollower(self.client) + + def test_validate_overflow_tolerance(self): + regx = 'Error tolerance duration must not be larger than' + with self.assertRaisesRegex(ValueError, regx): + ChangesFollower(self.client, db='db', error_tolerance=FOREVER + 1) + + def test_validate_negative_tolerance(self): + regx = 'Error tolerance duration must not be negative.' + with self.assertRaisesRegex(ValueError, regx): + ChangesFollower(self.client, db='db', error_tolerance=-1) + + def test_initialization_with_valid_client_timeout(self): + for timeout in self.timeouts_valid: + try: + self.client.set_http_config({'timeout': timeout}) + ChangesFollower(self.client, db='db') + except BaseException: + self.fail('There should be no exception.') + + def test_initialization_with_invalid_client_timeout(self): + for timeout in self.timeouts_invalid: + self.client.set_http_config({'timeout': timeout}) + regx = 'timeouts must be at least' + with self.assertRaisesRegex(ValueError, regx): + ChangesFollower(self.client, db='db') + + +@pytest.mark.usefixtures('kwargs') +class TestChangesFollowerOptions(ChangesFollowerBaseCase): + def test_validate_options_valid_cases(self): + try: + ChangesFollower(self.client, db='db', **self.kwarg_valid) + except BaseException: + self.fail('There should be no illegal argument exception.') + + def test_validate_options_invalid_cases(self): + for opt, val in self.kwarg_invalid.items(): + if opt == 'filter': + error_opt = f"filter={val}" + else: + error_opt = opt + regx = f"The option '{error_opt}' is invalid when using ChangesFollower." + with self.assertRaisesRegex(ValueError, regx): + ChangesFollower(self.client, db='db', **{opt: val}) + + def test_validate_options_multiple_invalid_cases(self): + error_opts = '' + for opt, val in self.kwarg_invalid.items(): + if opt == 'filter': + error_opts += f'filter={val}, ' + else: + error_opts += f'{opt}, ' + if error_opts.endswith(', '): + error_opts = error_opts[:-len(', ')] + regx = ( + f'The options {error_opts} are invalid when using ChangesFollower.' + ) + with self.assertRaisesRegex(ValueError, regx): + ChangesFollower(self.client, db='db', **self.kwarg_invalid) + + def test_set_defaults(self): + follower = ChangesFollower(self.client, db='db', **self.kwarg_valid) + expected = { + 'feed': PostChangesEnums.Feed.LONGPOLL, + 'timeout': LONGPOLL_TIMEOUT, + } + for opt, val in expected.items(): + self.assertEqual(follower.options.get(opt), val) + + def test_set_defaults_with_limit(self): + follower = ChangesFollower(self.client, db='db', **self.kwarg_valid) + follower._set_defaults(limit=12) + expected = { + 'feed': PostChangesEnums.Feed.LONGPOLL, + 'timeout': LONGPOLL_TIMEOUT, + 'limit': 12, + } + for opt, val in expected.items(): + self.assertEqual(follower.options.get(opt), val) + + def test_set_defaults_with_kwarg_limit(self): + kwarg = {**self.kwarg_valid, **{'limit': 24}} + follower = ChangesFollower(self.client, db='db', **kwarg) + follower._set_defaults(limit=12) + self.assertEqual(follower.options.get('limit'), 12) + + +@pytest.mark.usefixtures('limits', 'errors') +class TestChangesFollowerFinite(ChangesFollowerBaseCase): + @responses.activate + def test_start_one_off(self): + """ + Checks that a FINITE mode completes successfully + for a fixed number of batches. + """ + batches = 6 + self.prepare_mock_changes(batches=batches) + follower = ChangesFollower(self.client, db='db') + changes = follower.start_one_off() + count = sum(1 for _ in changes) + self.assertEqual( + count, + batches * BATCH_SIZE, + 'There should be the expected number of changes.', + ) + + @responses.activate + def test_start_one_off_terminal_errors(self): + """ + Checks that a FINITE mode errors for all terminal errors. + """ + for error in self.terminal_errors: + self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db') + changes = follower.start_one_off() + with self.assertRaisesRegex(ApiException, error): + next(changes) + + @responses.activate + def test_start_one_off_transient_errors_no_suppression(self): + """ + Checks that a FINITE mode errors for all transient errors + when not suppressing. + """ + for error in self.transient_errors: + self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db', error_tolerance=0) + start = timeit.default_timer() + changes = follower.start_one_off() + if error == 'bad_io': + with self.assertRaises(ConnectionError): + next(changes) + else: + if error == 'bad_json': + error = 'Error processing the HTTP response' + with self.assertRaisesRegex(ApiException, error): + next(changes) + stop = timeit.default_timer() - start + self.assertLess( + stop, + 0.100, + 'There should be no exception delay.', + ) + + @responses.activate + def test_start_one_off_transient_errors_with_suppression_duration(self): + """ + Checks that a FINITE mode repeatedly encountering transient errors + will terminate with an exception after a duration. + """ + for error in self.transient_errors: + self.prepare_mock_with_error(error) + follower = ChangesFollower( + self.client, db='db', error_tolerance=100 + ) + start = timeit.default_timer() + changes = follower.start_one_off() + if error == 'bad_io': + with self.assertRaises(ConnectionError): + next(changes) + else: + if error == 'bad_json': + error = 'Error processing the HTTP response' + with self.assertRaisesRegex(ApiException, error): + next(changes) + stop = timeit.default_timer() - start + self.assertGreaterEqual( + stop, + 0.100, + 'The exception delay should be longer error_tolerance.', + ) + + @responses.activate + def test_start_one_off_transient_errors_with_suppression_does_complete( + self, + ): + """ + Checks that a FINITE mode repeatedly encountering transient errors + will complete successfully if not exceeding the duration. + """ + batches = 5 + self.prepare_mock_changes( + batches=batches, + errors=self.transient_errors, + ) + follower = ChangesFollower(self.client, db='db', error_tolerance=300) + changes = follower.start_one_off() + count = sum(1 for _ in changes) + self.assertEqual( + count, + batches * BATCH_SIZE, + 'There should be the expected number of changes.', + ) + + @responses.activate + def test_start_one_off_transient_errors_max_suppression_does_not_complete( + self, + ): + """ + Checks that a FINITE mode repeatedly encountering transient errors + will keep trying indefinitely with max suppression. + """ + for error in self.transient_errors: + try: + self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db') + count = self.runner(follower, Mode.FINITE, timeout=0.5) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual(count, 0, 'There should be no changes.') + + @responses.activate + def test_start_one_off_transient_errors_with_max_suppression_does_complete( + self, + ): + """ + Checks that a FINITE mode encountering transient errors + will complete successfully with max suppression. + """ + batches = 4 + self.prepare_mock_changes( + batches=batches, errors=self.transient_errors + ) + follower = ChangesFollower(self.client, db='db') + changes = follower.start_one_off() + count = sum(1 for _ in changes) + self.assertEqual( + count, + batches * BATCH_SIZE, + 'There should be the expected number of changes.', + ) + + @responses.activate + def test_stop(self): + """ + Checks calling stop for the FINITE case. + """ + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db') + start = timeit.default_timer() + count = self.runner( + follower, Mode.FINITE, timeout=5, stop_after=1000 + ) + stop = timeit.default_timer() - start + except BaseException: + self.fail('There should be no exception.') + self.assertGreaterEqual(count, 1000, 'There should be some changes.') + self.assertLess( + stop, 5, 'The thread should have stopped before the wait time.' + ) + + @responses.activate + def test_state_error(self): + """ + Checks that a FINITE follower can only be started once. + """ + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db') + self.runner(follower, Mode.FINITE, timeout=1, stop_after=1000) + with self.assertRaisesRegex( + RuntimeError, 'Cannot start a feed that has already started.' + ): + follower.start_one_off() + with self.assertRaisesRegex( + RuntimeError, 'Cannot start a feed that has already started.' + ): + follower.start() + except BaseException: + self.fail('There should be no exception.') + + @responses.activate + def test_limit(self): + """ + Checks that setting a limit terminates iterations early for FINITE mode + and limits smaller, the same and larger than the default batch size. + """ + for limit in self.limits: + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db', limit=limit) + count = self.runner(follower, Mode.FINITE, timeout=3600) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual( + count, + limit, + 'There should be the correct number of changes.', + ) + + @responses.activate + def test_retry_delay(self): + """ + Checks that a FINITE follower delays between retries. + + For a time frame in 600ms an exponential backoff would make 3 retry + attempts (first immideately, for duration of 100ms, second after + that for duration of 200ms, and third after 100ms+200ms for duration + of 400ms). + + In the same time frame a full jitter backoff would make more attempts + because of its random delay, realistically we can expect ~4-5. + + We can safely tripple this number, check for no more for 15 calls + and still be sure that we have delay working, because without it + we are looking at +1000 calls in the same time frame. + """ + try: + error = self.transient_errors[0] + resp = self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db') + count = self.runner(follower, Mode.FINITE, timeout=0.6) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual(count, 0, 'There should be no changes.') + self.assertLessEqual( + resp.call_count, 15, 'Call count should not exceed limit.' + ) + + @responses.activate + def test_batch_size(self): + """ + Checks that setting includeDocs forces a calculation of batch size + and asserts the size. + + Mocks a DB of 500_000 docs of 523 bytes each to give an expected batch + size of 5125 + + 523 bytes + 500 bytes of changes overhead = 1023 bytes + 5 MiB / 1023 bytes = 5125 docs per batch + """ + self.prepare_mock_changes(batches=1) + follower = ChangesFollower( + self.client, db='db', error_tolerance=0, include_docs=True + ) + changes = follower.start_one_off() + next(changes) + params = responses.calls[1].request.params + self.assertEqual( + params['limit'], + '5125', + 'Limit should be set to the expected value.', + ) + + @responses.activate + def test_batch_size_minimum(self): + """ + Checks that setting includeDocs forces a calculation of batch size + and asserts the size. + + Mocks a DB of 1 docs of less than 5 MiB size to give an expected batch + size of 0 + + Checks that the minimum batch_size of 1 is set. + """ + self.prepare_mock_changes(batches=1, db_info_doc_count=1, db_info_doc_size=(5 * 1024 * 1024 - 1)) + follower = ChangesFollower( + self.client, db='db', error_tolerance=0, include_docs=True + ) + changes = follower.start_one_off() + next(changes) + params = responses.calls[1].request.params + self.assertEqual( + params['limit'], + '1', + 'Limit should be set to the expected value.', + ) + + @responses.activate + def test_batch_size_with_limit(self): + """ + Checks that setting includeDocs and limit that below calculated + batch sets batch size to limit + """ + self.prepare_mock_changes(batches=1) + follower = ChangesFollower( + self.client, + db='db', + error_tolerance=0, + limit=1000, + include_docs=True, + ) + changes = follower.start_one_off() + next(changes) + params = responses.calls[1].request.params + self.assertEqual( + params['limit'], + '1000', + 'Limit should be set to the expected value.', + ) + + +@pytest.mark.usefixtures('limits', 'errors') +class TestChangesFollowerListen(ChangesFollowerBaseCase): + @responses.activate + def test_start(self): + """ + Checks that a LISTEN mode completes successfully (after stopping) + with some batches. + """ + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db') + count = self.runner(follower, Mode.LISTEN, timeout=5) + except BaseException: + self.fail('There should be no exception.') + self.assertGreater( + count, 2 * BATCH_SIZE + 1, 'There should be some changes.' + ) + + @responses.activate + def test_start_terminal_errors(self): + """ + Checks that a LISTEN mode errors for all terminal errors. + """ + for error in self.terminal_errors: + self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db') + with self.assertRaisesRegex(ApiException, error): + self.runner(follower, Mode.LISTEN, timeout=1) + + @responses.activate + def test_start_transient_errors_no_suppression(self): + """ + Checks that a LISTEN mode errors for all transient errors + when not suppressing. + """ + for error in self.transient_errors: + self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db', error_tolerance=0) + if error == 'bad_io': + with self.assertRaises(ConnectionError): + self.runner(follower, Mode.LISTEN, timeout=1) + else: + if error == 'bad_json': + error = 'Error processing the HTTP response' + with self.assertRaisesRegex(ApiException, error): + self.runner(follower, Mode.LISTEN, timeout=1) + + @responses.activate + def test_start_transient_errors_with_suppression_error_termination(self): + """ + Checks that a LISTEN mode errors for all transient errors + when exceeding the suppression duration. + """ + for error in self.transient_errors: + resp = self.prepare_mock_with_error(error) + follower = ChangesFollower( + self.client, db='db', error_tolerance=100 + ) + if error == 'bad_io': + with self.assertRaises(ConnectionError): + self.runner(follower, Mode.LISTEN, timeout=1) + else: + if error == 'bad_json': + error = 'Error processing the HTTP response' + with self.assertRaisesRegex(ApiException, error): + self.runner(follower, Mode.LISTEN, timeout=1) + self.assertGreater( + resp.call_count, 1, 'Mock server should receive calls.' + ) + + @responses.activate + def test_start_transient_errors_with_suppression_all_changes(self): + """ + Checks that a LISTEN mode gets changes and can be stopped cleanly + with transient errors when not exceeding the suppression duration. + """ + batches = 2 + self.prepare_mock_changes( + batches=batches, + errors=self.transient_errors, + ) + try: + follower = ChangesFollower( + self.client, db='db', error_tolerance=300 + ) + count = self.runner(follower, Mode.LISTEN, timeout=1) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual( + count, + batches * BATCH_SIZE, + 'There should be the correct number of changes.', + ) + + @responses.activate + def test_start_transient_errors_with_max_suppression(self): + """ + Checks that a LISTEN mode keeps running with transient errors + (until stopped cleanly) with max suppression. + """ + for error in self.transient_errors: + try: + resp = self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db') + count = self.runner(follower, Mode.LISTEN, timeout=1) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual(count, 0, 'There should be no changes.') + self.assertGreater( + resp.call_count, 1, 'Mock server should receive calls.' + ) + + @responses.activate + def test_start_transient_errors_with_max_suppression_all_changes(self): + """ + Checks that a LISTEN mode runs through transient errors + with max suppression to receive changes until stopped. + """ + batches = 3 + self.prepare_mock_changes( + batches=batches, + errors=self.transient_errors, + ) + try: + follower = ChangesFollower(self.client, db='db') + count = self.runner(follower, Mode.LISTEN, timeout=1) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual( + count, + batches * BATCH_SIZE, + 'There should be the correct number of changes.', + ) + + @responses.activate + def test_stop(self): + """ + Checks calling stop for the LISTEN case. + """ + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db') + start = timeit.default_timer() + count = self.runner( + follower, Mode.LISTEN, timeout=5, stop_after=1000 + ) + stop = timeit.default_timer() - start + except BaseException: + self.fail('There should be no exception.') + self.assertGreaterEqual(count, 1000, 'There should be some changes.') + self.assertLess( + stop, 5, 'The thread should have stopped before the wait time.' + ) + + @responses.activate + def test_state_error(self): + """ + Checks that a LISTEN follower can only be started once. + """ + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db') + self.runner(follower, Mode.LISTEN, timeout=1, stop_after=1000) + with self.assertRaisesRegex( + RuntimeError, 'Cannot start a feed that has already started.' + ): + follower.start_one_off() + with self.assertRaisesRegex( + RuntimeError, 'Cannot start a feed that has already started.' + ): + follower.start() + except BaseException: + self.fail('There should be no exception.') + + @responses.activate + def test_limit(self): + """ + Checks that setting a limit terminates iterations early for LISTEN mode + and limits smaller, the same and larger than the default batch size. + """ + for limit in self.limits: + try: + self.prepare_mock_changes(batches=MAX_BATCHES) + follower = ChangesFollower(self.client, db='db', limit=limit) + count = self.runner(follower, Mode.LISTEN, timeout=3600) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual( + count, + limit, + 'There should be the correct number of changes.', + ) + + @responses.activate + def test_retry_delay(self): + """ + Checks that a LISTEN follower delays between retries. + See the FINITE version of the test for additional comments. + """ + try: + error = self.transient_errors[0] + resp = self.prepare_mock_with_error(error) + follower = ChangesFollower(self.client, db='db') + count = self.runner(follower, Mode.LISTEN, timeout=0.6) + except BaseException: + self.fail('There should be no exception.') + self.assertEqual(count, 0, 'There should be no changes.') + self.assertLessEqual( + resp.call_count, 15, 'Call count should not exceed limit.' + ) From 56c1cccf67b0264ad80a4303e79741786a56967e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:22:31 +0100 Subject: [PATCH 196/669] build(generated): changes follower README content and examples (#539) Generated SDK source code using: - Generator version 3.76.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version c118012 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 291 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) diff --git a/README.md b/README.md index f23ed03d..fa69f23e 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,22 @@ to avoid surprises. * [Raw IO](#raw-io) * [Model classes vs dictionaries](#model-classes-vs-dictionaries) * [Further resources](#further-resources) + * [Changes feed follower (beta)](#changes-feed-follower-beta) + + [Introduction](#introduction) + + [Modes of operation](#modes-of-operation) + + [Configuring the changes follower](#configuring-the-changes-follower) + + [Error suppression](#error-suppression) + + [Follower operation](#follower-operation) + + [Checkpointing](#checkpointing) + + [Code examples](#code-examples-1) + - [Initializing a changes follower](#initializing-a-changes-follower) + - [Starting the changes follower](#starting-the-changes-follower) + * [Start mode for continuous listening](#start-mode-for-continuous-listening) + * [Start mode for one-off fetching](#start-mode-for-one-off-fetching) + - [Processing changes](#processing-changes) + * [Process continuous changes](#process-continuous-changes) + * [Process one-off changes](#process-one-off-changes) + - [Stopping the changes follower](#stopping-the-changes-follower) - [Questions](#questions) - [Issues](#issues) - [Open source at IBM](#open-source-at-ibm) @@ -87,6 +103,7 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. +- Built-in [Changes feed follower](#changes-feed-follower-beta) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -712,6 +729,7 @@ print(response)
+ ### Further resources - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): @@ -723,6 +741,279 @@ print(response) - [Cloudant blog](https://blog.cloudant.com/): Many useful articles about how to optimize Cloudant for common problems. +### Changes feed follower (beta) + +#### Introduction + +The SDK provides a changes feed follower utility (currently beta). +This helper utility connects to the `_changes` endpoint and returns the individual change items. +It removes some of the complexity of using the `_changes` endpoint by setting some options automatically +and providing error suppression and retries. + +*Tip: the changes feed often does not meet user expectations or assumptions.* + +Consult the [Cloudant changes feed FAQ](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) +to get a better understanding of the limitations and suitable use-cases before using the changes feed in your application. + +#### Modes of operation + +There are two modes of operation: +* Start mode + * Fetches the changes from the supplied `since` sequence (by default the feed will start from `now`). + * Fetches all available changes and then continues listening for new changes indefinitely unless encountering an end condition. + * An example use case for this mode is event driven workloads. +* Start one-off mode + * Fetches the changes from the supplied `since` sequence (by default the feed will start from the beginning). + * Fetches all available changes and then stops when either there are no further changes pending or encountering an end condition. + * An example use case for this mode is ETL style workloads. + +#### Configuring the changes follower + +The SDK's model of changes feed options is also used to configure the follower. +However, a subset of the options are invalid as they are configured internally by the implementation. +Supplying these options when instantiating the follower causes an error. +The invalid options are: +* `descending` +* `feed` +* `heartbeat` +* `lastEventId` - use `since` instead +* `timeout` +* Only the value of `_selector` is permitted for the `filter` option. This restriction is because selector + based filters perform better than JavaScript backed filters. Configuring a non-selector based filter will + cause the follower to error. + +Note that that the `limit` parameter will terminate the follower at the given number of changes in either +operating mode. + +The changes follower requires the client to have HTTP timeouts of at least 1 minute and will error during +instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. + +For use-cases where these configuration limitations are deemed too restrictive then it is recommended to +write code to use the SDK's [POST `_changes` API](examples#postchanges) instead of the follower. + +#### Error suppression + +By default the changes follower will suppress transient errors indefinitely and attempt to run to completion or listen forever as +dictated by the opreating mode. +For applications where that is not desirable an optional error tolerance duration may be specified to control the time since +the last successful response that transient errors will be suppressed. This can be used, for example, by applications as a grace period +before reporting an error and requiring intervention. + +There are some additional points to consider for error suppression: +* Errors considered terminal, for example, the database not existing or invalid credentials are never suppressed and will error immediately. +* The error suppression duration is not guaranteed to fire immediately after lapsing and should be considered a minimum supppression time. +* The changes follower will back-off between retries and as such may remain paused for a short while after the transient errors have resolved. +* If the underlying SDK client used to initialize the follower also has retries configured then errors could be suppressed for significantly + longer than the follower's configured error tolerance duration depending on the configuration options. + +#### Follower operation + +For both modes: +* The end conditions are: + * A terminal error (HTTP codes `400`, `401`, `403` `404`). + * Transient errors occur for longer than the error tolerance duration. Transient errors are all other HTTP status codes and connection errors. + * The number of changes received reaches the configured `limit`. + * The feed is terminated early by calling stop. + +As is true for the `_changes` endpoint change items have _at least once_ delivery and an individual item +may be received multiple times. When using the follower change items may be repeated even within a limited +number of changes (i.e. using the `limit` option) this is a minor difference from using `limit` on the HTTP native API. + +The follower is not optimized for some use cases and it is not recommended to use it in cases where: +* Setting `include_docs` and larger document sizes (for example > 10 kiB). +* The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). + +In these cases use-case specific control over the number of change requests made and the content size of the responses +may be achived by using the SDK's [POST `_changes` API](examples#postchanges). + +#### Checkpointing + +The changes follower does not checkpoint since it has no information about whether a change item has been +processed by the consuming application after being received. It is the application developer's responsibility +to store the sequence IDs to have appropriate checkpoints and to re-initialize the follower with the required +`since` value after, for example, the application restarts. + +The frequency and conditions for checkpointing are application specific and some applications may be tolerant +of dropped changes. This section is intended only to provide general guidance on how to avoid missing changes. + +To guarantee processing of all changes the sequence ID from a change item must not be persisted until _after_ +the processing of the change item by the application has completed. As indicated previously change items are +delivered _at least once_ so application code must be able to handle repeated changes already and it is +preferable to restart from an older `since` value and receive changes again than risk missing them. + +The sequence IDs are available on each change item by default, but may be ommitted from some change items when +using the `seq_interval` configuration option. Infrequent sequence IDs may improve performance by reducing +the amount of data that needs to be transferred, but the trade-off is that more changes will be repeated if +it is necessary to resume the changes follower. + +Extreme care should be taken with persisting sequences if choosing to process change items in parallel as there +is a considerable risk of missing changes on a restart if the sequence is recorded out of order. + +#### Code examples + +##### Initializing a changes follower +[embedmd]:# (test/examples/src/features/initialize.py /import/ $) +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +cf_params = { + 'db': 'example', # Required: the database name. + 'limit': 100, # Optional: return only 100 changes (including duplicates). + 'since': '3-g1AG3...' # Optional: start from this sequence ID (e.g. with a value read from persistent storage). +} + +changes_follower = ChangesFollower( + service=client, # Required: the Cloudant service client instance. + error_tolerance=10000, # Optional: suppress transient errors for at least 10 seconds before terminating. + **cf_params # Required: changes feed configuration options dict. +) +``` + + +##### Starting the changes follower + +###### Start mode for continuous listening +[embedmd]:# (test/examples/src/features/start.py /import/ $) +```py +import Iterable + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem + +client = CloudantV1.new_instance() + +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) + +changes_items: Iterable[ChangesResultItem] = changes_follower.start() +# Note: iterable will not do anything until it is iterated +# Create a for loop to iterate over the flow of changes +# for changes_item in changes_items: ... +``` + + +###### Start mode for one-off fetching +[embedmd]:# (test/examples/src/features/start_one_off.py /import/ $) +```py +import Iterable + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem + +client = CloudantV1.new_instance() + +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) + +changes_items: Iterable[ChangesResultItem] = changes_follower.start_one_off() +# Note: iterable will not do anything until it is iterated +# Create a for loop to iterate over the flow of changes +# for changes_item in changes_items: ... +``` + + +##### Processing changes + +###### Process continuous changes +[embedmd]:# (test/examples/src/features/start_and_process.py /import/ $) +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +# Start from a previously persisted seq +# Normally this would be read by the app from persistent storage +# e.g. previously_persisted_seq = your_app_persistence_read_func() +previously_persisted_seq = '3-g1AG3...' +changes_follower = ChangesFollower( + service=client, + **{'db': 'example', 'since': previously_persisted_seq}) + +changes_items = changes_follower.start() +for changes_item in changes_items: + # do something with changes + print(changes_item.id) + for change in changes_item.changes: + print(change.rev) + # when change item processing is complete app can store seq + seq = changes_item.seq + # write seq to persistent storage for use as since if required to resume later + # e.g. your_app_persistence_write_func(seq) + # keep processing changes until the application is terminated or some other stop condition is reached + +# Note: iterator above is blocking, code here will be unreachable +# until the iteration is stopped or another stop condition is reached. +# For long running followers careful consideration should be made of where to call stop on the iterator. +``` + + +###### Process one-off changes +[embedmd]:# (test/examples/src/features/start_one_off_and_process.py /import/ $) +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +# Start from a previously persisted seq +# Normally this would be read by the app from persistent storage +# e.g. previously_persisted_seq = your_app_persistence_read_func() +previously_persisted_seq = '3-g1AG3...' +changes_follower = ChangesFollower( + service=client, + **{'db': 'example', 'since': previously_persisted_seq}) + +changes_items = changes_follower.start_one_off() +for changes_item in changes_items: + # do something with changes + print(changes_item.id) + for change in changes_item.changes: + print(change.rev) + # when change item processing is complete app can store seq + seq = changes_item.seq + # write seq to persistent storage for use as since if required to resume later + # e.g. your_app_persistence_write_func(seq) + +# Note: iterator above is blocking, code here will be unreachable +# until all changes are processed (or another stop condition is reached). +``` + + +##### Stopping the changes follower +[embedmd]:# (test/examples/src/features/stop.py /import/ $) +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) +changes_items = changes_follower.start() + +for changes_item in changes_items: + # Option 1: call stop after some condition + # Note that since the iterator is blocking at least one item + # must be returned from it to reach to this point. + # Additional changes may be processed before the iterator stops. + changes_follower.stop() + +# Option 2: call stop method when you want to end the continuous loop from +# outside the iterator. For example, you've put the changes follower in a +# separate thread and need to call stop on the main thread. +# Note: in this context the call must be made from a different thread because +# code immediately following the iterator is unreachable until the iterator +# has stopped. +changes_follower.stop() +``` + + ## Questions If you are having difficulties using this SDK or have a question about the From 9debac5144fbe35fb6674ba077e88f1cb0eae6ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 20:56:52 +0000 Subject: [PATCH 197/669] build(deps): Bump sphinx from 7.2.2 to 7.2.3 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.2 to 7.2.3. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.2...v7.2.3) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index e3e957bf..9c281ba7 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.2.2 +Sphinx==7.2.3 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 From 9694540f1dc9977684b4818109bb10ffd32ac05e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:49:02 +0000 Subject: [PATCH 198/669] build(deps): Bump sphinx from 7.2.3 to 7.2.4 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.3 to 7.2.4. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.3...v7.2.4) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 9c281ba7..64a34048 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.2.3 +Sphinx==7.2.4 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 From dd8c42b478c1356f2bbde4c271d631b303e61473 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 30 Aug 2023 10:41:23 +0000 Subject: [PATCH 199/669] Update version 0.4.4 -> 0.5.0 --- .bumpversion.cfg | 2 +- README.md | 6 +++--- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 66b2dcb7..05692cc8 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.4 +current_version = 0.5.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index fa69f23e..5b0ad908 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.4.4 +# IBM Cloudant Python SDK Version 0.5.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -121,13 +121,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.4.4" +pip install --upgrade "ibmcloudant>=0.5.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.4.4" +easy_install --upgrade "ibmcloudant>=0.5.0" ``` diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index f0e0fe5b..c50fc7c4 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.4.4' +__version__ = '0.5.0' diff --git a/pyproject.toml b/pyproject.toml index 400a09a1..78d27023 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.4.4" +version = "0.5.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.16.7", From 3ebfe69b2c1618e0cd30c6cfbea23b5d8bb5d033 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 29 Aug 2023 15:02:27 -0300 Subject: [PATCH 200/669] ci: add github action to test docs builder --- .github/workflows/docs.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..1ccf2f37 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,21 @@ +name: docs +on: + pull_request: + branches: ['main'] +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Setup python 3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' + - name: Install deps + run: pip install -r requirements-docs.txt + - name: Build docs + run: sphinx-build source apidocs -bhtml From 5e1ccd89eb3047356943fa3ad86e50e8ab442031 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 18:53:36 +0000 Subject: [PATCH 201/669] build(deps): Bump sphinx from 7.2.4 to 7.2.5 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.4 to 7.2.5. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.4...v7.2.5) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 64a34048..86a70d5b 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.2.4 +Sphinx==7.2.5 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 From 5a70e197adc02054289a36762361bd34f1db900c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:26:46 +0000 Subject: [PATCH 202/669] docs(generated): fix link to getting started with Cloudant Generated SDK source code using: - Generator version 3.76.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version fd63735 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5b0ad908..eff8ce9f 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ project: ## Prerequisites - A - [Cloudant](https://cloud.ibm.com/docs/Cloudant/getting-started.html#step-1-connect-to-your-cloudant-nosql-db-service-instance-on-ibm-cloud) + [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant) service instance or a [CouchDB](https://docs.couchdb.org/en/latest/install/index.html) server. @@ -158,6 +158,12 @@ Examples for other configuration methods are available by following the provided [couch-jwt-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication [cloudant-basic-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication [cloudant-legacy-api-keys]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys +[core-container-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication +[core-vpc-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication +[core-iam-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication +[core-bearer-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication +[core-basic-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication +[core-no-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication This library requires credentials to authenticate with IBM Cloudant. These credentials may be: * IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`) @@ -176,15 +182,15 @@ This table summarizes the available authentication types. The authentication types are listed in order of recommendation, preferably use the authentication type from the first row in the table that is compatible with your environment. -| Authenitcation type | Recommended for | `AUTH_TYPE` | Description | +| Authentication type | Recommended for | `AUTH_TYPE` | Description | | --- | --- | --- | --- | -| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC)| `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles compute resource ([container][core-container-auth]) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles compute resource ([VPC][core-vpc-auth]) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| [IAM API key][core-iam-auth] | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | | [Session cookie](#session-cookie-authentication) | [Cloudant][cloudant-cookie-auth]
(legacy credentials & instances without IAM)

[Apache CouchDB][couch-cookie-auth] | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | -| [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB][couch-jwt-auth]
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | -| [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB][couch-basic-auth]
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | -| [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. +| [Bearer token][core-bearer-auth] | [Apache CouchDB][couch-jwt-auth]
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | +| [Basic][core-basic-auth] | [Apache CouchDB][couch-basic-auth]
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | +| [None][core-no-auth] | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`. @@ -226,7 +232,7 @@ For Cloudant *IAM Trusted profile compute resource vpc authentication*, set the replacing the `` and `` with your values. ```bash -CLODUANT_AUTH_TYPE=VPC +CLOUDANT_AUTH_TYPE=VPC CLOUDANT_URL= CLOUDANT_IAM_PROFILE_ID= ``` @@ -595,7 +601,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/examples#examples-for-python). ### Error handling @@ -782,26 +788,26 @@ The invalid options are: based filters perform better than JavaScript backed filters. Configuring a non-selector based filter will cause the follower to error. -Note that that the `limit` parameter will terminate the follower at the given number of changes in either +Note that the `limit` parameter will terminate the follower at the given number of changes in either operating mode. The changes follower requires the client to have HTTP timeouts of at least 1 minute and will error during instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/examples#postchanges) instead of the follower. #### Error suppression -By default the changes follower will suppress transient errors indefinitely and attempt to run to completion or listen forever as -dictated by the opreating mode. +By default, the changes follower will suppress transient errors indefinitely and attempt to run to completion or listen forever as +dictated by the operating mode. For applications where that is not desirable an optional error tolerance duration may be specified to control the time since the last successful response that transient errors will be suppressed. This can be used, for example, by applications as a grace period before reporting an error and requiring intervention. There are some additional points to consider for error suppression: * Errors considered terminal, for example, the database not existing or invalid credentials are never suppressed and will error immediately. -* The error suppression duration is not guaranteed to fire immediately after lapsing and should be considered a minimum supppression time. +* The error suppression duration is not guaranteed to fire immediately after lapsing and should be considered a minimum suppression time. * The changes follower will back-off between retries and as such may remain paused for a short while after the transient errors have resolved. * If the underlying SDK client used to initialize the follower also has retries configured then errors could be suppressed for significantly longer than the follower's configured error tolerance duration depending on the configuration options. @@ -824,7 +830,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achived by using the SDK's [POST `_changes` API](examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/examples#postchanges). #### Checkpointing @@ -841,7 +847,7 @@ the processing of the change item by the application has completed. As indicated delivered _at least once_ so application code must be able to handle repeated changes already and it is preferable to restart from an older `since` value and receive changes again than risk missing them. -The sequence IDs are available on each change item by default, but may be ommitted from some change items when +The sequence IDs are available on each change item by default, but may be omitted from some change items when using the `seq_interval` configuration option. Infrequent sequence IDs may improve performance by reducing the amount of data that needs to be transferred, but the trade-off is that more changes will be repeated if it is necessary to resume the changes follower. @@ -1027,7 +1033,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1037,8 +1043,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/LICENSE). From b6ce2181c44fdd79b47293daa6b9fa0fa2779693 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:01:39 +0000 Subject: [PATCH 203/669] build(deps-dev): Bump pytest from 7.4.0 to 7.4.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.0 to 7.4.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.0...7.4.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dce1dbca..f70ea0fc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==7.4.0 +pytest==7.4.1 responses==0.23.3 python_dotenv==1.0.0 pylint==2.17.5 From c1f2d7da27f0325d7dc7af416ee128106f103173 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 5 Sep 2023 16:36:37 -0300 Subject: [PATCH 204/669] fix(docs): add changes_follower to doc's index --- source/conf.py | 2 +- source/index.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/conf.py b/source/conf.py index 60d286e6..c51b1348 100644 --- a/source/conf.py +++ b/source/conf.py @@ -66,7 +66,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['apidocs/ibmcloudant/ibmcloudant.rst'] +exclude_patterns = ['apidocs/ibmcloudant/ibmcloudant.rst', 'apidocs/ibmcloudant/ibmcloudant.features.rst'] # -- Patch generated rst ----------------------------------------------------- diff --git a/source/index.rst b/source/index.rst index 0dc30aac..f7836149 100644 --- a/source/index.rst +++ b/source/index.rst @@ -21,6 +21,7 @@ Modules cloudant_v1 couchdb_session_authenticator + changes_follower Indices and tables ------------------ From 99328c6a964419180a9a6a38adf08028e25d2bec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:31:54 +0000 Subject: [PATCH 205/669] build(deps-dev): Bump coverage from 7.3.0 to 7.3.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.0 to 7.3.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.3.0...7.3.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f70ea0fc..45076741 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.23.3 python_dotenv==1.0.0 pylint==2.17.5 # code coverage -coverage==7.3.0 +coverage==7.3.1 pytest-cov==4.1.0 From 4fabd3ad0cfc9cb3de02ff79fadba0629bc960a5 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:10:42 +0000 Subject: [PATCH 206/669] docs(generated): clarify LTS support and semver info Generated SDK source code using: - Generator version 3.76.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version 91a0802 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index eff8ce9f..5726237a 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ to avoid surprises. - [Stopping the changes follower](#stopping-the-changes-follower) - [Questions](#questions) - [Issues](#issues) +- [Versioning and LTS support](#versioning-and-lts-support) - [Open source at IBM](#open-source-at-ibm) - [Contributing](#contributing) - [License](#license) @@ -1037,6 +1038,26 @@ Before you submit a bug report, search for Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. +## Versioning and LTS support + +This SDK follows semantic versioning with respect to the definition of user facing APIs. +This means under some circumstances breaking changes may occur within a major or minor version +of the SDK related to changes in supported language platforms. + +The SDK is supported on the available LTS releases of the language platform. +The LTS language versions are listed in the prerequisites: +* [LTS versions currently supported by the SDK](https://github.com/IBM/cloudant-python-sdk/#prerequisites) +* [LTS versions for this release of the SDK](#prerequisites) + +Incompatible changes from new language versions are not added to the SDK +until they are available in the minimum supported language version. + +When language LTS versions move out of support the following will happen: +* Existing SDK releases will continue to run on obsolete language versions, but will no longer be supported. +* The minimum language version supported by the SDK will be updated to the next available LTS. +* New language features may be added in subsequent SDK releases that will cause breaking changes + if the new releases of the SDK are used with older, now unsupported, language levels. + ## Open source at IBM Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. From d5a28030a7d3278b42b49d2100f853c82d48763f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:18:19 +0000 Subject: [PATCH 207/669] build(deps-dev): Bump pytest from 7.4.1 to 7.4.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.1 to 7.4.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.1...7.4.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 45076741..f6db3460 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==7.4.1 +pytest==7.4.2 responses==0.23.3 python_dotenv==1.0.0 pylint==2.17.5 From f3809ca4d5ab5e9438dc8492f3e42fa93c005339 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:18:11 +0000 Subject: [PATCH 208/669] chore(generated): update mend settings Generated SDK source code using: - Generator version 3.76.0 - Specification version 1.0.0-dev0.0.52 - Automation (cloudant-sdks) version b18b599 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .whitesource | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.whitesource b/.whitesource index c42d1f0e..038c9085 100644 --- a/.whitesource +++ b/.whitesource @@ -2,5 +2,8 @@ "settingsInheritedFrom": "whitesource-config/whitesource-config@master", "issueSettings": { "issueRepoName": "sdks" + }, + "scanSettings": { + "javaVersion": "17" } } From 94663f6349d2418f32ff0141c9febaa9ed946946 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 17:37:03 +0000 Subject: [PATCH 209/669] build(deps): Bump sphinx from 7.2.5 to 7.2.6 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.5 to 7.2.6. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.5...v7.2.6) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 86a70d5b..0547afd9 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.2.5 +Sphinx==7.2.6 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 From 1699e881fd8ca8bd743799a884f28dc867d2f30b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 22 Sep 2023 10:41:08 +0000 Subject: [PATCH 210/669] feat(generated): update definition to 1.0.0-dev0.1.4 Generated SDK source code using: - Generator version 3.79.0 - Specification version 1.0.0-dev0.1.4 - Automation (cloudant-sdks) version 7d017eb Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 999 ++++++++++++++++++++++----- stubs/gen-its-mappings.json | 41 +- test/integration/test_cloudant_v1.py | 29 +- test/unit/test_cloudant_v1.py | 373 +++++++++- 4 files changed, 1220 insertions(+), 222 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 77de099c..eace5f22 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -25,6 +25,7 @@ from typing import BinaryIO, Dict, List, Union import base64 import json +import logging from ibm_cloud_sdk_core import BaseService, DetailedResponse from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator @@ -314,21 +315,30 @@ def get_db_updates( """ Retrieve change events for all databases. + **This endpoint is not available in IBM Cloudant.** Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order and might repeat changes. Polling modes for this method work like polling modes for the changes feed. - **Note: This endpoint requires _admin or _db_updates role and is only available on - dedicated clusters.**. :param str feed: (optional) Query parameter to specify the changes feed type. :param int heartbeat: (optional) Query parameter to specify the period in - milliseconds after which an empty line is sent in the results. Only - applicable for longpoll, continuous, and eventsource feeds. Overrides any - timeout to keep the feed alive indefinitely. May also be `true` to use - default value of 60000. + milliseconds after which an empty line is sent in the results. Off by + default and only applicable for + `continuous` and `eventsource` feeds. Overrides any timeout to keep the + feed alive indefinitely. May also be `true` to use a value of `60000`. + **Note:** Delivery of heartbeats cannot be relied on at specific intervals. + If your application runs in an environment where idle network connections + may break, `heartbeat` is not suitable as a keepalive mechanism. Instead, + consider one of the following options: + * Use the `timeout` parameter with a value that is compatible with your + network environment. + * Switch to scheduled usage of one of the non-continuous changes feed + types + (`normal` or `longpoll`). + * Use TCP keepalive. :param int timeout: (optional) Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for `longpoll` or @@ -341,8 +351,12 @@ def get_db_updates( :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DbUpdates` object + + Deprecated: this method is deprecated and may be removed in a future release. """ + logging.warning('A deprecated operation has been invoked: get_db_updates') + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, @@ -413,7 +427,7 @@ def post_changes( :param List[str] doc_ids: (optional) Schema for a list of document IDs. :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param dict 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 other data. @@ -430,21 +444,21 @@ def post_changes( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str last_event_id: (optional) Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides `since` query parameter. @@ -474,10 +488,20 @@ def post_changes( * `_view` - Returns changes for documents that match an existing map function in the view specified by the query parameter `view`. :param int heartbeat: (optional) Query parameter to specify the period in - milliseconds after which an empty line is sent in the results. Only - applicable for longpoll, continuous, and eventsource feeds. Overrides any - timeout to keep the feed alive indefinitely. May also be `true` to use - default value of 60000. + milliseconds after which an empty line is sent in the results. Off by + default and only applicable for + `continuous` and `eventsource` feeds. Overrides any timeout to keep the + feed alive indefinitely. May also be `true` to use a value of `60000`. + **Note:** Delivery of heartbeats cannot be relied on at specific intervals. + If your application runs in an environment where idle network connections + may break, `heartbeat` is not suitable as a keepalive mechanism. Instead, + consider one of the following options: + * Use the `timeout` parameter with a value that is compatible with your + network environment. + * Switch to scheduled usage of one of the non-continuous changes feed + types + (`normal` or `longpoll`). + * Use TCP keepalive. :param bool include_docs: (optional) Query parameter to specify whether to include the full content of the documents in the response. :param int limit: (optional) Query parameter to specify the number of @@ -607,7 +631,7 @@ def post_changes_as_stream( :param List[str] doc_ids: (optional) Schema for a list of document IDs. :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param dict 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 other data. @@ -624,21 +648,21 @@ def post_changes_as_stream( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str last_event_id: (optional) Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides `since` query parameter. @@ -668,10 +692,20 @@ def post_changes_as_stream( * `_view` - Returns changes for documents that match an existing map function in the view specified by the query parameter `view`. :param int heartbeat: (optional) Query parameter to specify the period in - milliseconds after which an empty line is sent in the results. Only - applicable for longpoll, continuous, and eventsource feeds. Overrides any - timeout to keep the feed alive indefinitely. May also be `true` to use - default value of 60000. + milliseconds after which an empty line is sent in the results. Off by + default and only applicable for + `continuous` and `eventsource` feeds. Overrides any timeout to keep the + feed alive indefinitely. May also be `true` to use a value of `60000`. + **Note:** Delivery of heartbeats cannot be relied on at specific intervals. + If your application runs in an environment where idle network connections + may break, `heartbeat` is not suitable as a keepalive mechanism. Instead, + consider one of the following options: + * Use the `timeout` parameter with a value that is compatible with your + network environment. + * Switch to scheduled usage of one of the non-continuous changes feed + types + (`normal` or `longpoll`). + * Use TCP keepalive. :param bool include_docs: (optional) Query parameter to specify whether to include the full content of the documents in the response. :param int limit: (optional) Query parameter to specify the number of @@ -4425,6 +4459,153 @@ def post_partition_view_as_stream( response = self.send(request, stream=True, **kwargs) return response + def post_partition_explain( + self, + db: str, + partition_key: str, + selector: dict, + *, + bookmark: str = None, + conflicts: bool = None, + execution_stats: bool = None, + fields: List[str] = None, + limit: int = None, + skip: int = None, + sort: List[dict] = None, + stable: bool = None, + update: str = None, + use_index: List[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve information about which partition index is used for a query. + + Shows which index is being used by the query. Parameters are the same as the + [`/{db}/_partition/{partition_key}/_find` endpoint](#postpartitionfind-queries). + + :param str db: Path parameter to specify the database name. + :param str partition_key: Path parameter to specify the database partition + key. + :param dict selector: 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 other data. + The selector object must: + * Be structured as valid JSON. + * Contain a valid query expression. + Using a selector is significantly more efficient than using a JavaScript + filter function, and is the recommended option if filtering on document + attributes only. + Elementary selector syntax requires you to specify one or more fields, and + the corresponding values required for those fields. You can create more + complex selector expressions by combining operators. + Operators are identified by the use of a dollar sign `$` prefix in the name + field. + There are two core types of operators in the selector syntax: + * Combination operators: applied at the topmost level of selection. They + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of + selectors. + * Condition operators: are specific to a field, and are used to evaluate + the value stored in that field. For instance, the basic `$eq` operator + matches when the specified field contains a value that is equal to the + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` + (but not `$ne`) can be used as the basis of a query. You should include at + least one of these in a selector. + For further reference see + [selector + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param str bookmark: (optional) Opaque bookmark token used when paginating + results. + :param bool conflicts: (optional) A boolean value that indicates whether or + not to include information about existing conflicts in the document. + :param bool execution_stats: (optional) Use this option to find information + about the query that was run. This information includes total key lookups, + total document lookups (when `include_docs=true` is used), and total quorum + document lookups (when each document replica is fetched). + :param List[str] fields: (optional) JSON array that uses the field syntax. + Use this parameter to specify which fields of a document must be returned. + If it is omitted or empty, the entire document is returned. + :param int limit: (optional) Maximum number of results returned. The `type: + text` indexes are limited to 200 results when queried. + :param int skip: (optional) Skip the first 'n' results, where 'n' is the + value that is specified. + :param List[dict] sort: (optional) The sort field contains a list of pairs, + each mapping a field name to a sort direction (asc or desc). The first + field name and direction pair is the topmost level of sort. The second + pair, if provided, is the next level of sort. The field can be any field, + using dotted notation if desired for sub-document fields. + For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": + "desc"}]` + When sorting with multiple fields, ensure that there is an index already + defined with all the sort fields in the same order and each object in the + sort array has a single key or at least one of the sort fields is included + in the selector. All sorting fields must use the same sort direction, + either all ascending or all descending. + :param bool stable: (optional) Whether or not the view results should be + returned from a "stable" set of shards. + :param str update: (optional) Whether to update the index prior to + returning the result. + :param List[str] use_index: (optional) Use this option to identify a + specific index for query to run against, rather than by using the IBM + Cloudant Query algorithm to find the best index. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ExplainResult` object + """ + + if not db: + raise ValueError('db must be provided') + if not partition_key: + raise ValueError('partition_key must be provided') + if selector is None: + raise ValueError('selector must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_partition_explain', + ) + headers.update(sdk_headers) + + data = { + 'selector': selector, + 'bookmark': bookmark, + 'conflicts': conflicts, + 'execution_stats': execution_stats, + 'fields': fields, + 'limit': limit, + 'skip': skip, + 'sort': sort, + 'stable': stable, + 'update': update, + 'use_index': use_index, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['db', 'partition_key'] + path_param_values = self.encode_path_vars(db, partition_key) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/{db}/_partition/{partition_key}/_explain'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + data=data, + ) + + response = self.send(request, **kwargs) + return response + def post_partition_find( self, db: str, @@ -4473,21 +4654,21 @@ def post_partition_find( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4498,7 +4679,7 @@ def post_partition_find( document lookups (when each document replica is fetched). :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param int limit: (optional) Maximum number of results returned. The `type: text` indexes are limited to 200 results when queried. :param int skip: (optional) Skip the first 'n' results, where 'n' is the @@ -4625,21 +4806,21 @@ def post_partition_find_as_stream( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4650,7 +4831,7 @@ def post_partition_find_as_stream( document lookups (when each document replica is fetched). :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param int limit: (optional) Maximum number of results returned. The `type: text` indexes are limited to 200 results when queried. :param int skip: (optional) Skip the first 'n' results, where 'n' is the @@ -4755,7 +4936,7 @@ def post_explain( Retrieve information about which index is used for a query. Shows which index is being used by the query. Parameters are the same as the - [`_find` endpoint](#query-an-index-by-using-selector-syntax). + [`_find` endpoint](#postfind). :param str db: Path parameter to specify the database name. :param dict selector: JSON object describing criteria used to select @@ -4774,21 +4955,21 @@ def post_explain( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4799,7 +4980,7 @@ def post_explain( document lookups (when each document replica is fetched). :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param int limit: (optional) Maximum number of results returned. The `type: text` indexes are limited to 200 results when queried. :param int skip: (optional) Skip the first 'n' results, where 'n' is the @@ -4930,21 +5111,21 @@ def post_find( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4955,7 +5136,7 @@ def post_find( document lookups (when each document replica is fetched). :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param int limit: (optional) Maximum number of results returned. The `type: text` indexes are limited to 200 results when queried. :param int skip: (optional) Skip the first 'n' results, where 'n' is the @@ -5086,21 +5267,21 @@ def post_find_as_stream( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5111,7 +5292,7 @@ def post_find_as_stream( document lookups (when each document replica is fetched). :param List[str] fields: (optional) JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. - If it is omitted, the entire document is returned. + If it is omitted or empty, the entire document is returned. :param int limit: (optional) Maximum number of results returned. The `type: text` indexes are limited to 200 results when queried. :param int skip: (optional) Skip the first 'n' results, where 'n' is the @@ -5248,7 +5429,6 @@ def post_index( index: 'IndexDefinition', *, ddoc: str = None, - def_: 'IndexDefinition' = None, name: str = None, partitioned: bool = None, type: str = None, @@ -5266,14 +5446,9 @@ def post_index( * `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) Name of the design document in which the index - will be created. - :param IndexDefinition def_: (optional) 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. + :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. :param str name: (optional) name. :param bool partitioned: (optional) The default value is `true` for databases with `partitioned: true` and `false` otherwise. For databases @@ -5290,8 +5465,6 @@ def post_index( if index is None: raise ValueError('index must be provided') index = convert_model(index) - if def_ is not None: - def_ = convert_model(def_) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, @@ -5303,7 +5476,6 @@ def post_index( data = { 'index': index, 'ddoc': ddoc, - 'def': def_, 'name': name, 'partitioned': partitioned, 'type': type, @@ -10630,6 +10802,8 @@ class DatabaseInformation: :attr str update_seq: An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates. :attr str uuid: (optional) The UUID of the database. + :attr PartitionedIndexesInformation partitioned_indexes: (optional) Information + about database's partitioned indexes. """ def __init__( @@ -10648,6 +10822,7 @@ def __init__( compacted_seq: str = None, engine: str = None, uuid: str = None, + partitioned_indexes: 'PartitionedIndexesInformation' = None, ) -> None: """ Initialize a DatabaseInformation object. @@ -10672,6 +10847,8 @@ def __init__( compaction state of the database. :param str engine: (optional) The engine used for the database. :param str uuid: (optional) The UUID of the database. + :param PartitionedIndexesInformation partitioned_indexes: (optional) + Information about database's partitioned indexes. """ self.cluster = cluster self.committed_update_seq = committed_update_seq @@ -10686,6 +10863,7 @@ def __init__( self.sizes = sizes self.update_seq = update_seq self.uuid = uuid + self.partitioned_indexes = partitioned_indexes @classmethod def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': @@ -10735,6 +10913,8 @@ def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': raise ValueError('Required property \'update_seq\' not present in DatabaseInformation JSON') if 'uuid' in _dict: args['uuid'] = _dict.get('uuid') + if 'partitioned_indexes' in _dict: + args['partitioned_indexes'] = PartitionedIndexesInformation.from_dict(_dict.get('partitioned_indexes')) return cls(**args) @classmethod @@ -10780,6 +10960,11 @@ def to_dict(self) -> Dict: _dict['update_seq'] = self.update_seq if hasattr(self, 'uuid') and self.uuid is not None: _dict['uuid'] = self.uuid + if hasattr(self, 'partitioned_indexes') and self.partitioned_indexes is not None: + if isinstance(self.partitioned_indexes, dict): + _dict['partitioned_indexes'] = self.partitioned_indexes + else: + _dict['partitioned_indexes'] = self.partitioned_indexes.to_dict() return _dict def _to_dict(self): @@ -12656,15 +12841,18 @@ class ExplainResult: """ Schema for information about the index used for a find query. - :attr bool covered: When `true`, the query is answered using the index only and + :attr bool covering: When `true`, the query is answered using the index only and no documents are fetched. :attr str dbname: Name of database. - :attr List[str] fields: Fields to be returned by the query. + :attr List[str] fields: Fields that were requested to be projected from the + document. If no fields were requested to be projected this will be empty and all + fields will be returned. :attr IndexInformation index: Schema for information about an index. :attr int limit: The used maximum number of results returned. - :attr dict opts: Query options used. - :attr ExplainResultRange range: (optional) Range parameters passed to the - underlying view. + :attr ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying + view. + :attr ExplainResultOpts opts: Options used for the request. + :attr object partitioned: (optional) Schema for any JSON type. :attr dict selector: 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 other data. @@ -12681,45 +12869,49 @@ class ExplainResult: field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are - used to combine selectors. In addition to the common boolean operators (`$and`, - `$or`, `$not`, `$nor`) there are three combination operators: `$all`, - `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. - The argument is either another selector, or an array of selectors. + used to combine selectors. A combination operator takes a single argument. The + argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when - the specified field contains a value that is equal to the supplied argument. + the specified field contains a value that is equal to the supplied argument. See + [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list + of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :attr int skip: Skip parameter used. """ def __init__( self, - covered: bool, + covering: bool, dbname: str, fields: List[str], index: 'IndexInformation', limit: int, - opts: dict, + opts: 'ExplainResultOpts', selector: dict, skip: int, *, - range: 'ExplainResultRange' = None, + mrargs: 'ExplainResultMrArgs' = None, + partitioned: object = None, ) -> None: """ Initialize a ExplainResult object. - :param bool covered: When `true`, the query is answered using the index + :param bool covering: When `true`, the query is answered using the index only and no documents are fetched. :param str dbname: Name of database. - :param List[str] fields: Fields to be returned by the query. + :param List[str] fields: Fields that were requested to be projected from + the document. If no fields were requested to be projected this will be + empty and all fields will be returned. :param IndexInformation index: Schema for information about an index. :param int limit: The used maximum number of results returned. - :param dict opts: Query options used. + :param ExplainResultOpts opts: Options used for the request. :param dict selector: 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 other data. @@ -12736,32 +12928,34 @@ def __init__( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param int skip: Skip parameter used. - :param ExplainResultRange range: (optional) Range parameters passed to the + :param ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying view. + :param object partitioned: (optional) Schema for any JSON type. """ - self.covered = covered + self.covering = covering self.dbname = dbname self.fields = fields self.index = index self.limit = limit + self.mrargs = mrargs self.opts = opts - self.range = range + self.partitioned = partitioned self.selector = selector self.skip = skip @@ -12769,10 +12963,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ExplainResult': """Initialize a ExplainResult object from a json dictionary.""" args = {} - if 'covered' in _dict: - args['covered'] = _dict.get('covered') + if 'covering' in _dict: + args['covering'] = _dict.get('covering') else: - raise ValueError('Required property \'covered\' not present in ExplainResult JSON') + raise ValueError('Required property \'covering\' not present in ExplainResult JSON') if 'dbname' in _dict: args['dbname'] = _dict.get('dbname') else: @@ -12789,12 +12983,14 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResult': args['limit'] = _dict.get('limit') else: raise ValueError('Required property \'limit\' not present in ExplainResult JSON') + if 'mrargs' in _dict: + args['mrargs'] = ExplainResultMrArgs.from_dict(_dict.get('mrargs')) if 'opts' in _dict: - args['opts'] = _dict.get('opts') + args['opts'] = ExplainResultOpts.from_dict(_dict.get('opts')) else: raise ValueError('Required property \'opts\' not present in ExplainResult JSON') - if 'range' in _dict: - args['range'] = ExplainResultRange.from_dict(_dict.get('range')) + if 'partitioned' in _dict: + args['partitioned'] = _dict.get('partitioned') if 'selector' in _dict: args['selector'] = _dict.get('selector') else: @@ -12813,8 +13009,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'covered') and self.covered is not None: - _dict['covered'] = self.covered + if hasattr(self, 'covering') and self.covering is not None: + _dict['covering'] = self.covering if hasattr(self, 'dbname') and self.dbname is not None: _dict['dbname'] = self.dbname if hasattr(self, 'fields') and self.fields is not None: @@ -12826,13 +13022,18 @@ def to_dict(self) -> Dict: _dict['index'] = self.index.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit + if hasattr(self, 'mrargs') and self.mrargs is not None: + if isinstance(self.mrargs, dict): + _dict['mrargs'] = self.mrargs + else: + _dict['mrargs'] = self.mrargs.to_dict() if hasattr(self, 'opts') and self.opts is not None: - _dict['opts'] = self.opts - if hasattr(self, 'range') and self.range is not None: - if isinstance(self.range, dict): - _dict['range'] = self.range + if isinstance(self.opts, dict): + _dict['opts'] = self.opts else: - _dict['range'] = self.range.to_dict() + _dict['opts'] = self.opts.to_dict() + if hasattr(self, 'partitioned') and self.partitioned is not None: + _dict['partitioned'] = self.partitioned if hasattr(self, 'selector') and self.selector is not None: _dict['selector'] = self.selector if hasattr(self, 'skip') and self.skip is not None: @@ -12858,55 +13059,324 @@ def __ne__(self, other: 'ExplainResult') -> bool: return not self == other -class ExplainResultRange: +class ExplainResultMrArgs: """ - Range parameters passed to the underlying view. + Arguments passed to the underlying view. - :attr List[object] end_key: (optional) End key parameter passed to the - underlying view. - :attr List[object] start_key: (optional) Start key parameter passed to the + :attr object conflicts: (optional) Schema for any JSON type. + :attr str direction: (optional) Direction parameter passed to the underlying + view. + :attr object end_key: (optional) Schema for any JSON type. + :attr bool include_docs: (optional) A parameter that specifies whether to + include the full content of the documents in the response in the underlying + view. + :attr str partition: (optional) Partition parameter passed to the underlying + view. + :attr bool reduce: (optional) A parameter that specifies returning only + documents that match any of the specified keys in the underlying view. + :attr bool stable: (optional) A parameter that specifies whether the view + results should be returned form a "stable" set of shards passed to the underlying view. + :attr object start_key: (optional) Schema for any JSON type. + :attr object update: (optional) Schema for any JSON type. + :attr str view_type: (optional) The type of the underlying view. """ def __init__( self, *, - end_key: List[object] = None, - start_key: List[object] = None, + conflicts: object = None, + direction: str = None, + end_key: object = None, + include_docs: bool = None, + partition: str = None, + reduce: bool = None, + stable: bool = None, + start_key: object = None, + update: object = None, + view_type: str = None, ) -> None: """ - Initialize a ExplainResultRange object. + Initialize a ExplainResultMrArgs object. - :param List[object] end_key: (optional) End key parameter passed to the + :param object conflicts: (optional) Schema for any JSON type. + :param str direction: (optional) Direction parameter passed to the underlying view. - :param List[object] start_key: (optional) Start key parameter passed to the + :param object end_key: (optional) Schema for any JSON type. + :param bool include_docs: (optional) A parameter that specifies whether to + include the full content of the documents in the response in the underlying + view. + :param str partition: (optional) Partition parameter passed to the + underlying view. + :param bool reduce: (optional) A parameter that specifies returning only + documents that match any of the specified keys in the underlying view. + :param bool stable: (optional) A parameter that specifies whether the view + results should be returned form a "stable" set of shards passed to the underlying view. + :param object start_key: (optional) Schema for any JSON type. + :param object update: (optional) Schema for any JSON type. + :param str view_type: (optional) The type of the underlying view. """ + self.conflicts = conflicts + self.direction = direction self.end_key = end_key + self.include_docs = include_docs + self.partition = partition + self.reduce = reduce + self.stable = stable self.start_key = start_key + self.update = update + self.view_type = view_type @classmethod - def from_dict(cls, _dict: Dict) -> 'ExplainResultRange': - """Initialize a ExplainResultRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': + """Initialize a ExplainResultMrArgs object from a json dictionary.""" args = {} + if 'conflicts' in _dict: + args['conflicts'] = _dict.get('conflicts') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') if 'end_key' in _dict: args['end_key'] = _dict.get('end_key') + if 'include_docs' in _dict: + args['include_docs'] = _dict.get('include_docs') + if 'partition' in _dict: + args['partition'] = _dict.get('partition') + if 'reduce' in _dict: + args['reduce'] = _dict.get('reduce') + if 'stable' in _dict: + args['stable'] = _dict.get('stable') if 'start_key' in _dict: args['start_key'] = _dict.get('start_key') + if 'update' in _dict: + args['update'] = _dict.get('update') + if 'view_type' in _dict: + args['view_type'] = _dict.get('view_type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ExplainResultRange object from a json dictionary.""" + """Initialize a ExplainResultMrArgs object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'conflicts') and self.conflicts is not None: + _dict['conflicts'] = self.conflicts + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction if hasattr(self, 'end_key') and self.end_key is not None: _dict['end_key'] = self.end_key + if hasattr(self, 'include_docs') and self.include_docs is not None: + _dict['include_docs'] = self.include_docs + if hasattr(self, 'partition') and self.partition is not None: + _dict['partition'] = self.partition + if hasattr(self, 'reduce') and self.reduce is not None: + _dict['reduce'] = self.reduce + if hasattr(self, 'stable') and self.stable is not None: + _dict['stable'] = self.stable if hasattr(self, 'start_key') and self.start_key is not None: _dict['start_key'] = self.start_key + if hasattr(self, 'update') and self.update is not None: + _dict['update'] = self.update + if hasattr(self, 'view_type') and self.view_type is not None: + _dict['view_type'] = self.view_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ExplainResultMrArgs object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ExplainResultMrArgs') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ExplainResultMrArgs') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ViewTypeEnum(str, Enum): + """ + The type of the underlying view. + """ + + MAP = 'map' + REDUCE = 'reduce' + + + +class ExplainResultOpts: + """ + Options used for the request. + + :attr str bookmark: Opaque bookmark token used when paginating results. + :attr bool conflicts: Conflicts used in the request query. + :attr bool execution_stats: Execution statistics used in the request query. + :attr List[str] fields: JSON array that uses the field syntax. Use this + parameter to specify which fields of a document must be returned. If it is + omitted or empty, the entire document is returned. + :attr int limit: Limit used in the request query. + :attr str partition: On which database partition the request was used. If it was + not used on a database partition, it returns with `""`. + :attr int r: The read quorum that is needed for the result. + :attr int skip: Skip used in the request query. + :attr object sort: Schema for any JSON type. + :attr bool stable: Stable used in the request query. + :attr bool stale: Deprecated: Stale used in the request query. + :attr bool update: Update used in the request query. + :attr List[str] use_index: Use index used in the request query. + """ + + def __init__( + self, + bookmark: str, + conflicts: bool, + execution_stats: bool, + fields: List[str], + limit: int, + partition: str, + r: int, + skip: int, + sort: object, + stable: bool, + stale: bool, + update: bool, + use_index: List[str], + ) -> None: + """ + Initialize a ExplainResultOpts object. + + :param str bookmark: Opaque bookmark token used when paginating results. + :param bool conflicts: Conflicts used in the request query. + :param bool execution_stats: Execution statistics used in the request + query. + :param List[str] fields: JSON array that uses the field syntax. Use this + parameter to specify which fields of a document must be returned. If it is + omitted or empty, the entire document is returned. + :param int limit: Limit used in the request query. + :param str partition: On which database partition the request was used. If + it was not used on a database partition, it returns with `""`. + :param int r: The read quorum that is needed for the result. + :param int skip: Skip used in the request query. + :param object sort: Schema for any JSON type. + :param bool stable: Stable used in the request query. + :param bool stale: Deprecated: Stale used in the request query. + :param bool update: Update used in the request query. + :param List[str] use_index: Use index used in the request query. + """ + self.bookmark = bookmark + self.conflicts = conflicts + self.execution_stats = execution_stats + self.fields = fields + self.limit = limit + self.partition = partition + self.r = r + self.skip = skip + self.sort = sort + self.stable = stable + self.stale = stale + self.update = update + self.use_index = use_index + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ExplainResultOpts': + """Initialize a ExplainResultOpts object from a json dictionary.""" + args = {} + if 'bookmark' in _dict: + args['bookmark'] = _dict.get('bookmark') + else: + raise ValueError('Required property \'bookmark\' not present in ExplainResultOpts JSON') + if 'conflicts' in _dict: + args['conflicts'] = _dict.get('conflicts') + else: + raise ValueError('Required property \'conflicts\' not present in ExplainResultOpts JSON') + if 'execution_stats' in _dict: + args['execution_stats'] = _dict.get('execution_stats') + else: + raise ValueError('Required property \'execution_stats\' not present in ExplainResultOpts JSON') + if 'fields' in _dict: + args['fields'] = _dict.get('fields') + else: + raise ValueError('Required property \'fields\' not present in ExplainResultOpts JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in ExplainResultOpts JSON') + if 'partition' in _dict: + args['partition'] = _dict.get('partition') + else: + raise ValueError('Required property \'partition\' not present in ExplainResultOpts JSON') + if 'r' in _dict: + args['r'] = _dict.get('r') + else: + raise ValueError('Required property \'r\' not present in ExplainResultOpts JSON') + if 'skip' in _dict: + args['skip'] = _dict.get('skip') + else: + raise ValueError('Required property \'skip\' not present in ExplainResultOpts JSON') + if 'sort' in _dict: + args['sort'] = _dict.get('sort') + else: + raise ValueError('Required property \'sort\' not present in ExplainResultOpts JSON') + if 'stable' in _dict: + args['stable'] = _dict.get('stable') + else: + raise ValueError('Required property \'stable\' not present in ExplainResultOpts JSON') + if 'stale' in _dict: + args['stale'] = _dict.get('stale') + else: + raise ValueError('Required property \'stale\' not present in ExplainResultOpts JSON') + if 'update' in _dict: + args['update'] = _dict.get('update') + else: + raise ValueError('Required property \'update\' not present in ExplainResultOpts JSON') + if 'use_index' in _dict: + args['use_index'] = _dict.get('use_index') + else: + raise ValueError('Required property \'use_index\' not present in ExplainResultOpts JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ExplainResultOpts object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'bookmark') and self.bookmark is not None: + _dict['bookmark'] = self.bookmark + if hasattr(self, 'conflicts') and self.conflicts is not None: + _dict['conflicts'] = self.conflicts + if hasattr(self, 'execution_stats') and self.execution_stats is not None: + _dict['execution_stats'] = self.execution_stats + if hasattr(self, 'fields') and self.fields is not None: + _dict['fields'] = self.fields + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'partition') and self.partition is not None: + _dict['partition'] = self.partition + if hasattr(self, 'r') and self.r is not None: + _dict['r'] = self.r + if hasattr(self, 'skip') and self.skip is not None: + _dict['skip'] = self.skip + if hasattr(self, 'sort') and self.sort is not None: + _dict['sort'] = self.sort + if hasattr(self, 'stable') and self.stable is not None: + _dict['stable'] = self.stable + if hasattr(self, 'stale') and self.stale is not None: + _dict['stale'] = self.stale + if hasattr(self, 'update') and self.update is not None: + _dict['update'] = self.update + if hasattr(self, 'use_index') and self.use_index is not None: + _dict['use_index'] = self.use_index return _dict def _to_dict(self): @@ -12914,16 +13384,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ExplainResultRange object.""" + """Return a `str` version of this ExplainResultOpts object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ExplainResultRange') -> bool: + def __eq__(self, other: 'ExplainResultOpts') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ExplainResultRange') -> bool: + def __ne__(self, other: 'ExplainResultOpts') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -13066,19 +13536,20 @@ class IndexDefinition: field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are - used to combine selectors. In addition to the common boolean operators (`$and`, - `$or`, `$not`, `$nor`) there are three combination operators: `$all`, - `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. - The argument is either another selector, or an array of selectors. + used to combine selectors. A combination operator takes a single argument. The + argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when - the specified field contains a value that is equal to the supplied argument. + the specified field contains a value that is equal to the supplied argument. See + [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list + of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). """ def __init__( @@ -13130,21 +13601,21 @@ def __init__( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). """ self.default_analyzer = default_analyzer self.default_field = default_field @@ -13326,7 +13797,7 @@ class IndexInformation: """ Schema for information about an index. - :attr str ddoc: Design document ID. + :attr str ddoc: Design document ID including a `_design/` prefix. :attr 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: @@ -13334,6 +13805,7 @@ class IndexInformation: whether to index the text in all document fields and what analyzer to use for that purpose. :attr str name: Index name. + :attr bool partitioned: (optional) Indicates if index is partitioned. :attr str type: Schema for the type of an index. """ @@ -13343,11 +13815,13 @@ def __init__( def_: 'IndexDefinition', name: str, type: str, + *, + partitioned: bool = None, ) -> None: """ Initialize a IndexInformation object. - :param str ddoc: Design document ID. + :param str ddoc: Design document ID including a `_design/` prefix. :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: @@ -13356,10 +13830,12 @@ def __init__( 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. """ self.ddoc = ddoc self.def_ = def_ self.name = name + self.partitioned = partitioned self.type = type @classmethod @@ -13378,6 +13854,8 @@ def from_dict(cls, _dict: Dict) -> 'IndexInformation': args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in IndexInformation JSON') + if 'partitioned' in _dict: + args['partitioned'] = _dict.get('partitioned') if 'type' in _dict: args['type'] = _dict.get('type') else: @@ -13401,6 +13879,8 @@ def to_dict(self) -> Dict: _dict['def'] = self.def_.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'partitioned') and self.partitioned is not None: + _dict['partitioned'] = self.partitioned if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict @@ -14135,6 +14615,154 @@ def __ne__(self, other: 'PartitionInformationSizes') -> bool: return not self == other +class PartitionedIndexesDetailedInformation: + """ + Number of partitioned indexes by type. + + :attr int search: (optional) Number of partitioned indexes of search type. + :attr int view: (optional) Number of partitioned indexes of view type. + """ + + def __init__( + self, + *, + search: int = None, + view: int = None, + ) -> None: + """ + Initialize a PartitionedIndexesDetailedInformation object. + + :param int search: (optional) Number of partitioned indexes of search type. + :param int view: (optional) Number of partitioned indexes of view type. + """ + self.search = search + self.view = view + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PartitionedIndexesDetailedInformation': + """Initialize a PartitionedIndexesDetailedInformation object from a json dictionary.""" + args = {} + if 'search' in _dict: + args['search'] = _dict.get('search') + if 'view' in _dict: + args['view'] = _dict.get('view') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PartitionedIndexesDetailedInformation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'search') and self.search is not None: + _dict['search'] = self.search + if hasattr(self, 'view') and self.view is not None: + _dict['view'] = self.view + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this PartitionedIndexesDetailedInformation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PartitionedIndexesDetailedInformation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'PartitionedIndexesDetailedInformation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PartitionedIndexesInformation: + """ + Information about database's partitioned indexes. + + :attr int count: (optional) Total number of partitioned indexes in the database. + :attr PartitionedIndexesDetailedInformation indexes: (optional) Number of + partitioned indexes by type. + :attr int limit: (optional) Maximum allowed number of partitioned indexes in the + database. + """ + + def __init__( + self, + *, + count: int = None, + indexes: 'PartitionedIndexesDetailedInformation' = None, + limit: int = None, + ) -> None: + """ + Initialize a PartitionedIndexesInformation object. + + :param int count: (optional) Total number of partitioned indexes in the + database. + :param PartitionedIndexesDetailedInformation indexes: (optional) Number of + partitioned indexes by type. + :param int limit: (optional) Maximum allowed number of partitioned indexes + in the database. + """ + self.count = count + self.indexes = indexes + self.limit = limit + + @classmethod + def from_dict(cls, _dict: Dict) -> 'PartitionedIndexesInformation': + """Initialize a PartitionedIndexesInformation object from a json dictionary.""" + args = {} + if 'count' in _dict: + args['count'] = _dict.get('count') + if 'indexes' in _dict: + args['indexes'] = PartitionedIndexesDetailedInformation.from_dict(_dict.get('indexes')) + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a PartitionedIndexesInformation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count + if hasattr(self, 'indexes') and self.indexes is not None: + if isinstance(self.indexes, dict): + _dict['indexes'] = self.indexes + else: + _dict['indexes'] = self.indexes.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this PartitionedIndexesInformation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'PartitionedIndexesInformation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'PartitionedIndexesInformation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ReplicationCreateTargetParameters: """ Request parameters to use during target database creation. @@ -14559,30 +15187,37 @@ class ReplicationDocument: field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They are - used to combine selectors. In addition to the common boolean operators (`$and`, - `$or`, `$not`, `$nor`) there are three combination operators: `$all`, - `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. - The argument is either another selector, or an array of selectors. + used to combine selectors. A combination operator takes a single argument. The + argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when - the specified field contains a value that is equal to the supplied argument. + the specified field contains a value that is equal to the supplied argument. See + [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list + of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :attr str since_seq: (optional) Start the replication at a specific sequence value. :attr str socket_options: (optional) Replication socket options. :attr ReplicationDatabase source: Schema for a replication source or target database. - :attr str source_proxy: (optional) Address of a (http or socks5 protocol) proxy - server through which replication with the source database should occur. + :attr str source_proxy: (optional) Deprecated: This setting is forbidden in IBM + Cloudant replication documents. This setting may be used with alternative + replication mediators. + Address of a (http or socks5 protocol) proxy server through which replication + with the source database should occur. :attr ReplicationDatabase target: Schema for a replication source or target database. - :attr str target_proxy: (optional) Address of a (http or socks5 protocol) proxy - server through which replication with the target database should occur. + :attr str target_proxy: (optional) Deprecated: This setting is forbidden in IBM + Cloudant replication documents. This setting may be used with alternative + replication mediators. + Address of a (http or socks5 protocol) proxy server through which replication + with the target database should occur. :attr bool use_bulk_get: (optional) Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used. @@ -14708,30 +15343,34 @@ def __init__( field. There are two core types of operators in the selector syntax: * Combination operators: applied at the topmost level of selection. They - are used to combine selectors. In addition to the common boolean operators - (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: - `$all`, `$elemMatch`, and `$allMatch`. A combination operator takes a - single argument. The argument is either another selector, or an array of + are used to combine selectors. A combination operator takes a single + argument. The argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. + supplied argument. See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a + list of all available combination and conditional operators. * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. For further reference see [selector - syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax). + syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str since_seq: (optional) Start the replication at a specific sequence value. :param str socket_options: (optional) Replication socket options. - :param str source_proxy: (optional) Address of a (http or socks5 protocol) - proxy server through which replication with the source database should - occur. - :param str target_proxy: (optional) Address of a (http or socks5 protocol) - proxy server through which replication with the target database should - occur. + :param str source_proxy: (optional) Deprecated: This setting is forbidden + in IBM Cloudant replication documents. This setting may be used with + alternative replication mediators. + Address of a (http or socks5 protocol) proxy server through which + replication with the source database should occur. + :param str target_proxy: (optional) Deprecated: This setting is forbidden + in IBM Cloudant replication documents. This setting may be used with + alternative replication mediators. + Address of a (http or socks5 protocol) proxy server through which + replication with the target database should occur. :param bool use_bulk_get: (optional) Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used. @@ -15241,13 +15880,17 @@ class SchedulerDocument: :attr datetime last_updated: Timestamp of last state update. :attr str node: (optional) Cluster node where the job is running. :attr str source: (optional) Replication source. - :attr str source_proxy: (optional) Address of the (http or socks5 protocol) - proxy server through which replication with the source database occurs. + :attr str source_proxy: (optional) Deprecated: Forbidden in IBM Cloudant + mediated replications. + Address of the (http or socks5 protocol) proxy server through which replication + with the source database occurs. :attr datetime start_time: Timestamp of when the replication was started. :attr str state: Schema for replication state. :attr str target: (optional) Replication target. - :attr str target_proxy: (optional) Address of the (http or socks5 protocol) - proxy server through which replication with the target database occurs. + :attr str target_proxy: (optional) Deprecated: Forbidden in IBM Cloudant + mediated replications. + Address of the (http or socks5 protocol) proxy server through which replication + with the target database occurs. """ def __init__( @@ -15286,13 +15929,15 @@ def __init__( :param str state: Schema for replication state. :param str node: (optional) Cluster node where the job is running. :param str source: (optional) Replication source. - :param str source_proxy: (optional) Address of the (http or socks5 - protocol) proxy server through which replication with the source database - occurs. + :param str source_proxy: (optional) Deprecated: Forbidden in IBM Cloudant + mediated replications. + Address of the (http or socks5 protocol) proxy server through which + replication with the source database occurs. :param str target: (optional) Replication target. - :param str target_proxy: (optional) Address of the (http or socks5 - protocol) proxy server through which replication with the target database - occurs. + :param str target_proxy: (optional) Deprecated: Forbidden in IBM Cloudant + mediated replications. + Address of the (http or socks5 protocol) proxy server through which + replication with the target database occurs. """ self.database = database self.doc_id = doc_id diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 8f945a6c..04fed043 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -383,7 +383,7 @@ "equalTo": "normal" }, "heartbeat": { - "equalTo": "60000" + "equalTo": "0" }, "since": { "equalTo": "0" @@ -1222,7 +1222,7 @@ "equalTo": "testString" }, "heartbeat": { - "equalTo": "60000" + "equalTo": "0" }, "include_docs": { "equalTo": "false" @@ -1698,7 +1698,7 @@ }, "response": { "status": 200, - "body": "{\"dbname\":\"account-bluemix/testString\",\"index\":{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},\"partitioned\":\"undefined\",\"selector\":{\"key1\":{\"$eq\":\"testString\"}},\"opts\":{\"use_index\":[],\"bookmark\":\"nil\",\"limit\":10000000000,\"skip\":0,\"sort\":{},\"fields\":[\"testString\"],\"partition\":\"\",\"r\":[49],\"conflicts\":false,\"stale\":false,\"update\":true,\"stable\":false,\"execution_stats\":false},\"limit\":10000000000,\"skip\":0,\"fields\":[\"testString\"],\"mrargs\":{\"include_docs\":true,\"view_type\":\"map\",\"reduce\":false,\"partition\":null,\"start_key\":null,\"end_key\":\"\",\"direction\":\"fwd\",\"stable\":false,\"update\":true,\"conflicts\":\"undefined\"}}", + "body": "{\"dbname\":\"account-bluemix/testString\",\"index\":{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},\"partitioned\":\"undefined\",\"selector\":{\"key1\":{\"$eq\":\"testString\"}},\"opts\":{\"use_index\":[],\"bookmark\":\"nil\",\"limit\":10000000000,\"skip\":0,\"sort\":{},\"fields\":[\"testString\"],\"partition\":\"\",\"r\":1,\"conflicts\":false,\"stale\":false,\"update\":true,\"stable\":false,\"execution_stats\":false},\"limit\":10000000000,\"skip\":0,\"fields\":[\"testString\"],\"mrargs\":{\"include_docs\":true,\"view_type\":\"map\",\"reduce\":false,\"partition\":null,\"start_key\":null,\"end_key\":\"\",\"direction\":\"fwd\",\"stable\":false,\"update\":true,\"conflicts\":\"undefined\"}}", "headers": { "Cache-Control": "must-revalidate", "Content-Type": "application/json", @@ -2121,6 +2121,41 @@ }, "uuid": "ecaf4992-8865-3623-86d5-9181c46ed721" }, + { + "id": "ca84624c-4bda-11ee-be56-0242ac120002", + "request": { + "url": "/testString/_partition/testString/_explain", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"dbname\":\"account-bluemix/testString\",\"index\":{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},\"partitioned\":\"undefined\",\"selector\":{\"key1\":{\"$eq\":\"testString\"}},\"opts\":{\"use_index\":[],\"bookmark\":\"nil\",\"limit\":10000000000,\"skip\":0,\"sort\":{},\"fields\":[\"testString\"],\"partition\":\"testString\",\"r\":1,\"conflicts\":false,\"stale\":false,\"update\":true,\"stable\":false,\"execution_stats\":false},\"limit\":10000000000,\"skip\":0,\"fields\":[\"testString\"],\"mrargs\":{\"include_docs\":true,\"view_type\":\"map\",\"reduce\":false,\"partition\":\"testString\",\"start_key\":null,\"end_key\":\"\",\"direction\":\"fwd\",\"stable\":false,\"update\":true,\"conflicts\":\"undefined\"}}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 05 Sep 2023 12:10:54 GMT", + "Server": "CouchDB/3.3.2 (Erlang OTP/24)", + "transaction-id": "5ebc08e24c058f8a9d9793c32c226bf3", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "5baeb05f80", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ca84624c-4bda-11ee-be56-0242ac120002" + }, { "id": "337c4338-3094-3c88-a44e-981e449b1d7a", "request": { diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 028964b5..244609ec 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -100,7 +100,7 @@ def test_put_capacity_throughput_configuration(self): def test_get_db_updates(self): response = self.cloudant_service.get_db_updates( feed='normal', - heartbeat=60000, + heartbeat=0, timeout=60000, since='0', ) @@ -123,7 +123,7 @@ def test_post_changes(self): descending=False, feed='normal', filter='testString', - heartbeat=60000, + heartbeat=0, include_docs=False, limit=0, seq_interval=1, @@ -151,7 +151,7 @@ def test_post_changes_as_stream(self): descending=False, feed='normal', filter='testString', - heartbeat=60000, + heartbeat=0, include_docs=False, limit=0, seq_interval=1, @@ -1154,6 +1154,28 @@ def test_post_partition_view_as_stream(self): result = response.get_result() assert result is not None + @needscredentials + def test_post_partition_explain(self): + response = self.cloudant_service.post_partition_explain( + db='testString', + partition_key='testString', + selector={'anyKey': 'anyValue'}, + bookmark='testString', + conflicts=True, + execution_stats=True, + fields=['testString'], + limit=25, + skip=0, + sort=[{'key1': 'asc'}], + stable=True, + update='true', + use_index=['testString'], + ) + + assert response.get_status_code() == 200 + explain_result = response.get_result() + assert explain_result is not None + @needscredentials def test_post_partition_find(self): response = self.cloudant_service.post_partition_find( @@ -1305,7 +1327,6 @@ def test_post_index(self): db='testString', index=index_definition_model, ddoc='testString', - def_=index_definition_model, name='testString', partitioned=True, type='json', diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 7d14d779..8146fe17 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -447,7 +447,7 @@ def test_get_db_updates_all_params(self): # Set up parameter values feed = 'normal' - heartbeat = 60000 + heartbeat = 0 timeout = 60000 since = '0' @@ -546,7 +546,7 @@ def test_post_changes_all_params(self): descending = False feed = 'normal' filter = 'testString' - heartbeat = 60000 + heartbeat = 0 include_docs = False limit = 0 seq_interval = 1 @@ -743,7 +743,7 @@ def test_post_changes_as_stream_all_params(self): descending = False feed = 'normal' filter = 'testString' - heartbeat = 60000 + heartbeat = 0 include_docs = False limit = 0 seq_interval = 1 @@ -1137,7 +1137,7 @@ def test_post_dbs_info_all_params(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' responses.add( responses.POST, url, @@ -1181,7 +1181,7 @@ def test_post_dbs_info_value_error(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' responses.add( responses.POST, url, @@ -1305,7 +1305,7 @@ def test_get_database_information_all_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' + mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' responses.add( responses.GET, url, @@ -1343,7 +1343,7 @@ def test_get_database_information_value_error(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid"}' + mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' responses.add( responses.GET, url, @@ -7421,6 +7421,141 @@ def test_post_partition_view_as_stream_value_error_with_retries(self): self.test_post_partition_view_as_stream_value_error() +class TestPostPartitionExplain: + """ + Test Class for post_partition_explain + """ + + @responses.activate + def test_post_partition_explain_all_params(self): + """ + post_partition_explain() + """ + # Set up mock + url = preprocess_url('/testString/_partition/testString/_explain') + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + db = 'testString' + partition_key = 'testString' + selector = {'anyKey': 'anyValue'} + bookmark = 'testString' + conflicts = True + execution_stats = True + fields = ['testString'] + limit = 25 + skip = 0 + sort = [{'key1': 'asc'}] + stable = True + update = 'true' + use_index = ['testString'] + + # Invoke method + response = _service.post_partition_explain( + db, + partition_key, + selector, + bookmark=bookmark, + conflicts=conflicts, + execution_stats=execution_stats, + fields=fields, + limit=limit, + skip=skip, + sort=sort, + stable=stable, + update=update, + use_index=use_index, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # decompress gzip compressed request body + responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['bookmark'] == 'testString' + assert req_body['conflicts'] == True + assert req_body['execution_stats'] == True + assert req_body['fields'] == ['testString'] + assert req_body['limit'] == 25 + assert req_body['skip'] == 0 + assert req_body['sort'] == [{'key1': 'asc'}] + assert req_body['stable'] == True + assert req_body['update'] == 'true' + assert req_body['use_index'] == ['testString'] + + def test_post_partition_explain_all_params_with_retries(self): + # Enable retries and run test_post_partition_explain_all_params. + _service.enable_retries() + self.test_post_partition_explain_all_params() + + # Disable retries and run test_post_partition_explain_all_params. + _service.disable_retries() + self.test_post_partition_explain_all_params() + + @responses.activate + def test_post_partition_explain_value_error(self): + """ + test_post_partition_explain_value_error() + """ + # Set up mock + url = preprocess_url('/testString/_partition/testString/_explain') + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + db = 'testString' + partition_key = 'testString' + selector = {'anyKey': 'anyValue'} + bookmark = 'testString' + conflicts = True + execution_stats = True + fields = ['testString'] + limit = 25 + skip = 0 + sort = [{'key1': 'asc'}] + stable = True + update = 'true' + use_index = ['testString'] + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "db": db, + "partition_key": partition_key, + "selector": selector, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.post_partition_explain(**req_copy) + + def test_post_partition_explain_value_error_with_retries(self): + # Enable retries and run test_post_partition_explain_value_error. + _service.enable_retries() + self.test_post_partition_explain_value_error() + + # Disable retries and run test_post_partition_explain_value_error. + _service.disable_retries() + self.test_post_partition_explain_value_error() + + class TestPostPartitionFind: """ Test Class for post_partition_find @@ -7748,7 +7883,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 25, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add( responses.POST, url, @@ -7827,7 +7962,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covered": false, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}, "limit": 25, "opts": {"anyKey": "anyValue"}, "range": {"end_key": ["anyValue"], "start_key": ["anyValue"]}, "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' responses.add( responses.POST, url, @@ -8159,7 +8294,7 @@ def test_get_indexes_information_all_params(self): """ # Set up mock url = preprocess_url('/testString/_index') - mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}]}' + mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}]}' responses.add( responses.GET, url, @@ -8197,7 +8332,7 @@ def test_get_indexes_information_value_error(self): """ # Set up mock url = preprocess_url('/testString/_index') - mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "type": "json"}]}' + mock_response = '{"total_rows": 0, "indexes": [{"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}]}' responses.add( responses.GET, url, @@ -8277,7 +8412,6 @@ def test_post_index_all_params(self): db = 'testString' index = index_definition_model ddoc = 'testString' - def_ = index_definition_model name = 'testString' partitioned = True type = 'json' @@ -8287,7 +8421,6 @@ def test_post_index_all_params(self): db, index, ddoc=ddoc, - def_=def_, name=name, partitioned=partitioned, type=type, @@ -8304,7 +8437,6 @@ def test_post_index_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['index'] == index_definition_model assert req_body['ddoc'] == 'testString' - assert req_body['def'] == index_definition_model assert req_body['name'] == 'testString' assert req_body['partitioned'] == True assert req_body['type'] == 'json' @@ -8362,7 +8494,6 @@ def test_post_index_value_error(self): db = 'testString' index = index_definition_model ddoc = 'testString' - def_ = index_definition_model name = 'testString' partitioned = True type = 'json' @@ -14140,6 +14271,15 @@ def test_database_information_serialization(self): content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 + partitioned_indexes_detailed_information_model = {} # PartitionedIndexesDetailedInformation + partitioned_indexes_detailed_information_model['search'] = 0 + partitioned_indexes_detailed_information_model['view'] = 0 + + partitioned_indexes_information_model = {} # PartitionedIndexesInformation + partitioned_indexes_information_model['count'] = 0 + partitioned_indexes_information_model['indexes'] = partitioned_indexes_detailed_information_model + partitioned_indexes_information_model['limit'] = 10 + # Construct a json representation of a DatabaseInformation model database_information_model_json = {} database_information_model_json['cluster'] = database_information_cluster_model @@ -14155,6 +14295,7 @@ def test_database_information_serialization(self): database_information_model_json['sizes'] = content_information_sizes_model database_information_model_json['update_seq'] = 'testString' database_information_model_json['uuid'] = 'testString' + database_information_model_json['partitioned_indexes'] = partitioned_indexes_information_model # Construct a model instance of DatabaseInformation by calling from_dict on the json representation database_information_model = DatabaseInformation.from_dict(database_information_model_json) @@ -14331,6 +14472,15 @@ def test_dbs_info_result_serialization(self): content_information_sizes_model['external'] = 26 content_information_sizes_model['file'] = 26 + partitioned_indexes_detailed_information_model = {} # PartitionedIndexesDetailedInformation + partitioned_indexes_detailed_information_model['search'] = 0 + partitioned_indexes_detailed_information_model['view'] = 0 + + partitioned_indexes_information_model = {} # PartitionedIndexesInformation + partitioned_indexes_information_model['count'] = 0 + partitioned_indexes_information_model['indexes'] = partitioned_indexes_detailed_information_model + partitioned_indexes_information_model['limit'] = 10 + database_information_model = {} # DatabaseInformation database_information_model['cluster'] = database_information_cluster_model database_information_model['committed_update_seq'] = 'testString' @@ -14345,6 +14495,7 @@ def test_dbs_info_result_serialization(self): database_information_model['sizes'] = content_information_sizes_model database_information_model['update_seq'] = 'testString' database_information_model['uuid'] = 'testString' + database_information_model['partitioned_indexes'] = partitioned_indexes_information_model # Construct a json representation of a DbsInfoResult model dbs_info_result_model_json = {} @@ -14971,21 +15122,46 @@ def test_explain_result_serialization(self): index_information_model['ddoc'] = 'testString' index_information_model['def'] = index_definition_model index_information_model['name'] = 'testString' + index_information_model['partitioned'] = True index_information_model['type'] = 'json' - explain_result_range_model = {} # ExplainResultRange - explain_result_range_model['end_key'] = ['testString'] - explain_result_range_model['start_key'] = ['testString'] + explain_result_mr_args_model = {} # ExplainResultMrArgs + explain_result_mr_args_model['conflicts'] = 'testString' + explain_result_mr_args_model['direction'] = 'testString' + explain_result_mr_args_model['end_key'] = 'testString' + explain_result_mr_args_model['include_docs'] = True + explain_result_mr_args_model['partition'] = 'testString' + explain_result_mr_args_model['reduce'] = True + explain_result_mr_args_model['stable'] = True + explain_result_mr_args_model['start_key'] = 'testString' + explain_result_mr_args_model['update'] = 'testString' + explain_result_mr_args_model['view_type'] = 'map' + + explain_result_opts_model = {} # ExplainResultOpts + explain_result_opts_model['bookmark'] = 'testString' + explain_result_opts_model['conflicts'] = False + explain_result_opts_model['execution_stats'] = False + explain_result_opts_model['fields'] = ['testString'] + explain_result_opts_model['limit'] = 25 + explain_result_opts_model['partition'] = 'testString' + explain_result_opts_model['r'] = 1 + explain_result_opts_model['skip'] = 0 + explain_result_opts_model['sort'] = 'testString' + explain_result_opts_model['stable'] = False + explain_result_opts_model['stale'] = False + explain_result_opts_model['update'] = True + explain_result_opts_model['use_index'] = ['testString'] # Construct a json representation of a ExplainResult model explain_result_model_json = {} - explain_result_model_json['covered'] = True + explain_result_model_json['covering'] = True explain_result_model_json['dbname'] = 'testString' explain_result_model_json['fields'] = ['testString'] explain_result_model_json['index'] = index_information_model explain_result_model_json['limit'] = 25 - explain_result_model_json['opts'] = {'anyKey': 'anyValue'} - explain_result_model_json['range'] = explain_result_range_model + explain_result_model_json['mrargs'] = explain_result_mr_args_model + explain_result_model_json['opts'] = explain_result_opts_model + explain_result_model_json['partitioned'] = 'testString' explain_result_model_json['selector'] = {'anyKey': 'anyValue'} explain_result_model_json['skip'] = 0 @@ -15005,35 +15181,85 @@ def test_explain_result_serialization(self): assert explain_result_model_json2 == explain_result_model_json -class TestModel_ExplainResultRange: +class TestModel_ExplainResultMrArgs: """ - Test Class for ExplainResultRange + Test Class for ExplainResultMrArgs """ - def test_explain_result_range_serialization(self): + def test_explain_result_mr_args_serialization(self): """ - Test serialization/deserialization for ExplainResultRange + Test serialization/deserialization for ExplainResultMrArgs """ - # Construct a json representation of a ExplainResultRange model - explain_result_range_model_json = {} - explain_result_range_model_json['end_key'] = ['testString'] - explain_result_range_model_json['start_key'] = ['testString'] + # Construct a json representation of a ExplainResultMrArgs model + explain_result_mr_args_model_json = {} + explain_result_mr_args_model_json['conflicts'] = 'testString' + explain_result_mr_args_model_json['direction'] = 'testString' + explain_result_mr_args_model_json['end_key'] = 'testString' + explain_result_mr_args_model_json['include_docs'] = True + explain_result_mr_args_model_json['partition'] = 'testString' + explain_result_mr_args_model_json['reduce'] = True + explain_result_mr_args_model_json['stable'] = True + explain_result_mr_args_model_json['start_key'] = 'testString' + explain_result_mr_args_model_json['update'] = 'testString' + explain_result_mr_args_model_json['view_type'] = 'map' - # Construct a model instance of ExplainResultRange by calling from_dict on the json representation - explain_result_range_model = ExplainResultRange.from_dict(explain_result_range_model_json) - assert explain_result_range_model != False + # Construct a model instance of ExplainResultMrArgs by calling from_dict on the json representation + explain_result_mr_args_model = ExplainResultMrArgs.from_dict(explain_result_mr_args_model_json) + assert explain_result_mr_args_model != False - # Construct a model instance of ExplainResultRange by calling from_dict on the json representation - explain_result_range_model_dict = ExplainResultRange.from_dict(explain_result_range_model_json).__dict__ - explain_result_range_model2 = ExplainResultRange(**explain_result_range_model_dict) + # Construct a model instance of ExplainResultMrArgs by calling from_dict on the json representation + explain_result_mr_args_model_dict = ExplainResultMrArgs.from_dict(explain_result_mr_args_model_json).__dict__ + explain_result_mr_args_model2 = ExplainResultMrArgs(**explain_result_mr_args_model_dict) # Verify the model instances are equivalent - assert explain_result_range_model == explain_result_range_model2 + assert explain_result_mr_args_model == explain_result_mr_args_model2 # Convert model instance back to dict and verify no loss of data - explain_result_range_model_json2 = explain_result_range_model.to_dict() - assert explain_result_range_model_json2 == explain_result_range_model_json + explain_result_mr_args_model_json2 = explain_result_mr_args_model.to_dict() + assert explain_result_mr_args_model_json2 == explain_result_mr_args_model_json + + +class TestModel_ExplainResultOpts: + """ + Test Class for ExplainResultOpts + """ + + def test_explain_result_opts_serialization(self): + """ + Test serialization/deserialization for ExplainResultOpts + """ + + # Construct a json representation of a ExplainResultOpts model + explain_result_opts_model_json = {} + explain_result_opts_model_json['bookmark'] = 'testString' + explain_result_opts_model_json['conflicts'] = False + explain_result_opts_model_json['execution_stats'] = False + explain_result_opts_model_json['fields'] = ['testString'] + explain_result_opts_model_json['limit'] = 25 + explain_result_opts_model_json['partition'] = 'testString' + explain_result_opts_model_json['r'] = 1 + explain_result_opts_model_json['skip'] = 0 + explain_result_opts_model_json['sort'] = 'testString' + explain_result_opts_model_json['stable'] = False + explain_result_opts_model_json['stale'] = False + explain_result_opts_model_json['update'] = True + explain_result_opts_model_json['use_index'] = ['testString'] + + # Construct a model instance of ExplainResultOpts by calling from_dict on the json representation + explain_result_opts_model = ExplainResultOpts.from_dict(explain_result_opts_model_json) + assert explain_result_opts_model != False + + # Construct a model instance of ExplainResultOpts by calling from_dict on the json representation + explain_result_opts_model_dict = ExplainResultOpts.from_dict(explain_result_opts_model_json).__dict__ + explain_result_opts_model2 = ExplainResultOpts(**explain_result_opts_model_dict) + + # Verify the model instances are equivalent + assert explain_result_opts_model == explain_result_opts_model2 + + # Convert model instance back to dict and verify no loss of data + explain_result_opts_model_json2 = explain_result_opts_model.to_dict() + assert explain_result_opts_model_json2 == explain_result_opts_model_json class TestModel_FindResult: @@ -15237,6 +15463,7 @@ def test_index_information_serialization(self): index_information_model_json['ddoc'] = 'testString' index_information_model_json['def'] = index_definition_model index_information_model_json['name'] = 'testString' + index_information_model_json['partitioned'] = True index_information_model_json['type'] = 'json' # Construct a model instance of IndexInformation by calling from_dict on the json representation @@ -15360,6 +15587,7 @@ def test_indexes_information_serialization(self): index_information_model['ddoc'] = 'testString' index_information_model['def'] = index_definition_model index_information_model['name'] = 'testString' + index_information_model['partitioned'] = True index_information_model['type'] = 'json' # Construct a json representation of a IndexesInformation model @@ -15594,6 +15822,75 @@ def test_partition_information_sizes_serialization(self): assert partition_information_sizes_model_json2 == partition_information_sizes_model_json +class TestModel_PartitionedIndexesDetailedInformation: + """ + Test Class for PartitionedIndexesDetailedInformation + """ + + def test_partitioned_indexes_detailed_information_serialization(self): + """ + Test serialization/deserialization for PartitionedIndexesDetailedInformation + """ + + # Construct a json representation of a PartitionedIndexesDetailedInformation model + partitioned_indexes_detailed_information_model_json = {} + partitioned_indexes_detailed_information_model_json['search'] = 0 + partitioned_indexes_detailed_information_model_json['view'] = 0 + + # Construct a model instance of PartitionedIndexesDetailedInformation by calling from_dict on the json representation + partitioned_indexes_detailed_information_model = PartitionedIndexesDetailedInformation.from_dict(partitioned_indexes_detailed_information_model_json) + assert partitioned_indexes_detailed_information_model != False + + # Construct a model instance of PartitionedIndexesDetailedInformation by calling from_dict on the json representation + partitioned_indexes_detailed_information_model_dict = PartitionedIndexesDetailedInformation.from_dict(partitioned_indexes_detailed_information_model_json).__dict__ + partitioned_indexes_detailed_information_model2 = PartitionedIndexesDetailedInformation(**partitioned_indexes_detailed_information_model_dict) + + # Verify the model instances are equivalent + assert partitioned_indexes_detailed_information_model == partitioned_indexes_detailed_information_model2 + + # Convert model instance back to dict and verify no loss of data + partitioned_indexes_detailed_information_model_json2 = partitioned_indexes_detailed_information_model.to_dict() + assert partitioned_indexes_detailed_information_model_json2 == partitioned_indexes_detailed_information_model_json + + +class TestModel_PartitionedIndexesInformation: + """ + Test Class for PartitionedIndexesInformation + """ + + def test_partitioned_indexes_information_serialization(self): + """ + Test serialization/deserialization for PartitionedIndexesInformation + """ + + # Construct dict forms of any model objects needed in order to build this model. + + partitioned_indexes_detailed_information_model = {} # PartitionedIndexesDetailedInformation + partitioned_indexes_detailed_information_model['search'] = 0 + partitioned_indexes_detailed_information_model['view'] = 0 + + # Construct a json representation of a PartitionedIndexesInformation model + partitioned_indexes_information_model_json = {} + partitioned_indexes_information_model_json['count'] = 0 + partitioned_indexes_information_model_json['indexes'] = partitioned_indexes_detailed_information_model + partitioned_indexes_information_model_json['limit'] = 10 + + # Construct a model instance of PartitionedIndexesInformation by calling from_dict on the json representation + partitioned_indexes_information_model = PartitionedIndexesInformation.from_dict(partitioned_indexes_information_model_json) + assert partitioned_indexes_information_model != False + + # Construct a model instance of PartitionedIndexesInformation by calling from_dict on the json representation + partitioned_indexes_information_model_dict = PartitionedIndexesInformation.from_dict(partitioned_indexes_information_model_json).__dict__ + partitioned_indexes_information_model2 = PartitionedIndexesInformation(**partitioned_indexes_information_model_dict) + + # Verify the model instances are equivalent + assert partitioned_indexes_information_model == partitioned_indexes_information_model2 + + # Convert model instance back to dict and verify no loss of data + partitioned_indexes_information_model_json2 = partitioned_indexes_information_model.to_dict() + assert partitioned_indexes_information_model_json2 == partitioned_indexes_information_model_json + + class TestModel_ReplicationCreateTargetParameters: """ Test Class for ReplicationCreateTargetParameters From 4116d541bba1ca7be77003161b4a220f9978887c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:22:06 +0000 Subject: [PATCH 211/669] Update version 0.5.0 -> 0.6.0 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 05692cc8..048793e0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.5.0 +current_version = 0.6.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 5726237a..4331612a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.5.0 +# IBM Cloudant Python SDK Version 0.6.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -122,13 +122,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.5.0" +pip install --upgrade "ibmcloudant>=0.6.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.5.0" +easy_install --upgrade "ibmcloudant>=0.6.0" ``` @@ -602,7 +602,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/examples#examples-for-python). ### Error handling @@ -796,7 +796,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/examples#postchanges) instead of the follower. #### Error suppression @@ -831,7 +831,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/examples#postchanges). #### Checkpointing @@ -1034,7 +1034,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1064,8 +1064,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.5.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index c50fc7c4..43ba2725 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.5.0' +__version__ = '0.6.0' diff --git a/pyproject.toml b/pyproject.toml index 78d27023..61178c9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.5.0" +version = "0.6.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.16.7", From 4809b128934425ef1e1c2a34e1d8c2c256d7506e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:22:47 +0000 Subject: [PATCH 212/669] build(deps-dev): Bump pylint from 2.17.5 to 2.17.6 Bumps [pylint](https://github.com/pylint-dev/pylint) from 2.17.5 to 2.17.6. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.17.5...v2.17.6) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f6db3460..75a5a055 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==7.4.2 responses==0.23.3 python_dotenv==1.0.0 -pylint==2.17.5 +pylint==2.17.6 # code coverage coverage==7.3.1 pytest-cov==4.1.0 From 68a96644e79c9d38f5f67d627c45e09012a1d1ea Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 3 Oct 2023 11:52:11 -0300 Subject: [PATCH 213/669] fix(docs): pin asteroid lib to 2.x to fix autodoc2 analyzer --- requirements-docs.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-docs.txt b/requirements-docs.txt index 0547afd9..0d4bf4e0 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -4,3 +4,4 @@ Sphinx==7.2.6 sphinx-autodoc2==0.4.2 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 +astroid==2.15.8 From 5d9c3040d0d2dcfcd83995f5c6c507434bd37697 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:10:25 +0000 Subject: [PATCH 214/669] build(deps-dev): Bump pylint from 2.17.6 to 3.0.0 Bumps [pylint](https://github.com/pylint-dev/pylint) from 2.17.6 to 3.0.0. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.17.6...v3.0.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 75a5a055..b0913650 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==7.4.2 responses==0.23.3 python_dotenv==1.0.0 -pylint==2.17.6 +pylint==3.0.0 # code coverage coverage==7.3.1 pytest-cov==4.1.0 From 029255312f1a0075b2aeb44dd2e9535f9f575874 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:05:27 +0000 Subject: [PATCH 215/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.16.7 to 3.17.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.16.7 to 3.17.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.16.7...v3.17.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 61178c9e..d34b53b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.6.0" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.16.7", + "ibm_cloud_sdk_core==3.17.0", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From b709da74c33526fc62a5d88973d79d7d6fe3f3c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:19:46 +0000 Subject: [PATCH 216/669] build(deps-dev): Bump coverage from 7.3.1 to 7.3.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.1 to 7.3.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.3.1...7.3.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b0913650..31f2897e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.23.3 python_dotenv==1.0.0 pylint==3.0.0 # code coverage -coverage==7.3.1 +coverage==7.3.2 pytest-cov==4.1.0 From 6e709d974199d6ccde5b75bf9918c312977f10d9 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 5 Oct 2023 17:16:12 -0300 Subject: [PATCH 217/669] fix(test): bump allowed runtime slack in follower's tests (#566) --- test/unit/features/test_changes_follower.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index f2e47065..6ca652a8 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -196,7 +196,7 @@ def test_start_one_off_transient_errors_no_suppression(self): stop = timeit.default_timer() - start self.assertLess( stop, - 0.100, + 0.300, 'There should be no exception delay.', ) From 604d9fe4c864aebf53b359bf2722cf8c50f6cdff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:04:06 +0000 Subject: [PATCH 218/669] build(deps-dev): Bump pylint from 3.0.0 to 3.0.1 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 31f2897e..eacd84d2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==7.4.2 responses==0.23.3 python_dotenv==1.0.0 -pylint==3.0.0 +pylint==3.0.1 # code coverage coverage==7.3.2 pytest-cov==4.1.0 From 324a06e5298c6500f476d90ad347f29695274b4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:13:11 +0000 Subject: [PATCH 219/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.17.0 to 3.17.2 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.17.0 to 3.17.2. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.17.0...v3.17.2) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d34b53b2..afc189eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.6.0" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.17.0", + "ibm_cloud_sdk_core==3.17.2", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 8a10fba905285016402fd20e4c39589fbe64903f Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 10 Oct 2023 18:52:08 -0300 Subject: [PATCH 220/669] chore(ci): add python 3.12 in test matrix --- .github/workflows/docs.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1ccf2f37..6855de6f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,10 +10,10 @@ jobs: uses: actions/checkout@v3 with: persist-credentials: false - - name: Setup python 3.11 + - name: Setup python 3.12 uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' cache: 'pip' - name: Install deps run: pip install -r requirements-docs.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf2f0dbf..5b39e31a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: test: strategy: matrix: - python: ['3.8', '3.9', '3.10', '3.11'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] runs-on: ubuntu-latest services: couchdb: From cc9ab1d467ef8466a40057e0438a6f5e4761d867 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 19 Oct 2023 20:09:57 +0000 Subject: [PATCH 221/669] feat(generated): spec version to 1.0.0-dev0.1.5 Generated SDK source code using: - Generator version 3.79.0 - Specification version 1.0.0-dev0.1.5 - Automation (cloudant-sdks) version 43c1ef9 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index eace5f22..5ad0d96d 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -1063,9 +1063,11 @@ def put_database( :param bool partitioned: (optional) Query parameter to specify whether to enable database partitions when creating a database. :param int q: (optional) The number of shards in the database. Each shard - is a partition of the hash value range. Its value is set by the service. - For more information about modifying database configuration, contact IBM - Cloudant support. + is a partition of the hash value range. Cloudant recommends using the + default value for most databases. However, if your database is expected to + be larger than 250 GB or have a lot of indexes, you may need to adjust the + settings. In these cases, it's best to reach out to IBM Cloudant customer + support for guidance on how to meet your specific needs and requirements. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Ok` object @@ -10990,7 +10992,8 @@ class DatabaseInformationCluster: """ Schema for database cluster information. - :attr int n: Schema for the number of replicas of a database in a cluster. + :attr int n: Schema for the number of replicas of a database in a cluster. The + cluster is using the default value and it cannot be changed by the user. :attr int q: Schema for the number of shards in a database. Each shard is a partition of the hash value range. :attr int r: Read quorum. The number of consistent copies of a document that @@ -11010,6 +11013,8 @@ def __init__( Initialize a DatabaseInformationCluster object. :param int n: Schema for the number of replicas of a database in a cluster. + The cluster is using the default value and it cannot be changed by the + user. :param int q: Schema for the number of shards in a database. Each shard is a partition of the hash value range. :param int r: Read quorum. The number of consistent copies of a document @@ -14768,7 +14773,8 @@ class ReplicationCreateTargetParameters: Request parameters to use during target database creation. :attr int n: (optional) Schema for the number of replicas of a database in a - cluster. + cluster. The cluster is using the default value and it cannot be changed by the + user. :attr bool partitioned: (optional) Parameter to specify whether to enable database partitions when creating the target database. :attr int q: (optional) Schema for the number of shards in a database. Each @@ -14786,7 +14792,8 @@ def __init__( Initialize a ReplicationCreateTargetParameters object. :param int n: (optional) Schema for the number of replicas of a database in - a cluster. + a cluster. The cluster is using the default value and it cannot be changed + by the user. :param bool partitioned: (optional) Parameter to specify whether to enable database partitions when creating the target database. :param int q: (optional) Schema for the number of shards in a database. From fd3b56b3d564bc11a57e9b37c03ce81f1d85171f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:28:06 +0000 Subject: [PATCH 222/669] docs(generated): add ddoc filter known issue Generated SDK source code using: - Generator version 3.79.0 - Specification version 1.0.0-dev0.1.5 - Automation (cloudant-sdks) version 7a2df44 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- KNOWN_ISSUES.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 5d5df0c5..01c7c8fd 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -71,6 +71,33 @@ Example JSON request body: * Manually setting an `Accept-Encoding` header on requests will disable the transparent gzip decompression of response bodies from the server. * Manually setting a `Content-Encoding` header on requests will disable the transparent gzip compression of request bodies to the server. +### Changes feed + +#### Filter functions + +The SDK does not support passing user-defined query or body parameters in `_changes` requests for dynamic filter functions in design documents. +The workaround and recommended option is to use a `selector` type filter. +For example, if you are using a `_changes` request like `/{db}/_changes?filter=myDdoc/byName&name=Jane` with a filter function like: +```javascript +function(doc, req) { + if (doc.name !== req.query.name) { + return false; + } + return true; +} +``` +It can be replaced with a request using a selector filter: +```python +service = CloudantV1.new_instance() + +response = service.post_changes( + db='orders', + filter='_selector', + selector={'name': 'Jane'} +).get_result() +``` + + ## Cloudant SDK for Python ### Request bodies containing the `headers` parameter From 7d6a32a9b4ca7f587cd4be4413cb93b61fe2be6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:53:15 +0000 Subject: [PATCH 223/669] build(deps-dev): Bump pylint from 3.0.1 to 3.0.2 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.1...v3.0.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index eacd84d2..7746fe43 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==7.4.2 responses==0.23.3 python_dotenv==1.0.0 -pylint==3.0.1 +pylint==3.0.2 # code coverage coverage==7.3.2 pytest-cov==4.1.0 From ddf81e70ed61741b7a87ba84f14c6933b6441caf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:08:51 +0000 Subject: [PATCH 224/669] build(deps-dev): Bump pytest from 7.4.2 to 7.4.3 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.2 to 7.4.3. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.2...7.4.3) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7746fe43..534f51a9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==7.4.2 +pytest==7.4.3 responses==0.23.3 python_dotenv==1.0.0 pylint==3.0.2 From 23c41578c456735604943b6d4b817ba2ed985b1f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:26:28 +0000 Subject: [PATCH 225/669] build(generated): update generator to 3.81.0 Generated SDK source code using: - Generator version 3.81.0 - Specification version 1.0.0-dev0.1.5 - Automation (cloudant-sdks) version 9b560e4 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 2414 +++++++++++++++++---------------- test/unit/test_cloudant_v1.py | 305 +++-- 2 files changed, 1393 insertions(+), 1326 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 5ad0d96d..d9dc0101 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -22,7 +22,7 @@ from datetime import datetime from enum import Enum -from typing import BinaryIO, Dict, List, Union +from typing import BinaryIO, Dict, List, Optional, Union import base64 import json import logging @@ -163,7 +163,7 @@ def get_membership_information( def get_uuids( self, *, - count: int = None, + count: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -306,10 +306,10 @@ def put_capacity_throughput_configuration( def get_db_updates( self, *, - feed: str = None, - heartbeat: int = None, - timeout: int = None, - since: str = None, + feed: Optional[str] = None, + heartbeat: Optional[int] = None, + timeout: Optional[int] = None, + since: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -392,24 +392,24 @@ def post_changes( self, db: str, *, - doc_ids: List[str] = None, - fields: List[str] = None, - selector: dict = None, - last_event_id: str = None, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - feed: str = None, - filter: str = None, - heartbeat: int = None, - include_docs: bool = None, - limit: int = None, - seq_interval: int = None, - since: str = None, - style: str = None, - timeout: int = None, - view: str = None, + doc_ids: Optional[List[str]] = None, + fields: Optional[List[str]] = None, + selector: Optional[dict] = None, + last_event_id: Optional[str] = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + feed: Optional[str] = None, + filter: Optional[str] = None, + heartbeat: Optional[int] = None, + include_docs: Optional[bool] = None, + limit: Optional[int] = None, + seq_interval: Optional[int] = None, + since: Optional[str] = None, + style: Optional[str] = None, + timeout: Optional[int] = None, + view: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -596,24 +596,24 @@ def post_changes_as_stream( self, db: str, *, - doc_ids: List[str] = None, - fields: List[str] = None, - selector: dict = None, - last_event_id: str = None, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - feed: str = None, - filter: str = None, - heartbeat: int = None, - include_docs: bool = None, - limit: int = None, - seq_interval: int = None, - since: str = None, - style: str = None, - timeout: int = None, - view: str = None, + doc_ids: Optional[List[str]] = None, + fields: Optional[List[str]] = None, + selector: Optional[dict] = None, + last_event_id: Optional[str] = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + feed: Optional[str] = None, + filter: Optional[str] = None, + heartbeat: Optional[int] = None, + include_docs: Optional[bool] = None, + limit: Optional[int] = None, + seq_interval: Optional[int] = None, + since: Optional[str] = None, + style: Optional[str] = None, + timeout: Optional[int] = None, + view: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -848,11 +848,11 @@ def head_database( def get_all_dbs( self, *, - descending: bool = None, - end_key: str = None, - limit: int = None, - skip: int = None, - start_key: str = None, + descending: Optional[bool] = None, + end_key: Optional[str] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + start_key: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1052,8 +1052,8 @@ def put_database( self, db: str, *, - partitioned: bool = None, - q: int = None, + partitioned: Optional[bool] = None, + q: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -1116,9 +1116,9 @@ def head_document( db: str, doc_id: str, *, - if_none_match: str = None, - latest: bool = None, - rev: str = None, + if_none_match: Optional[str] = None, + latest: Optional[bool] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1185,8 +1185,8 @@ def post_document( db: str, document: Union['Document', BinaryIO], *, - content_type: str = None, - batch: str = None, + content_type: Optional[str] = None, + batch: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1265,19 +1265,19 @@ def post_all_docs( self, db: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[str] = None, + key: Optional[str] = None, + keys: Optional[List[str]] = None, + start_key: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1373,19 +1373,19 @@ def post_all_docs_as_stream( self, db: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[str] = None, + key: Optional[str] = None, + keys: Optional[List[str]] = None, + start_key: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -1670,10 +1670,10 @@ def post_bulk_get( db: str, docs: List['BulkGetQueryDocument'], *, - attachments: bool = None, - att_encoding_info: bool = None, - latest: bool = None, - revs: bool = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + latest: Optional[bool] = None, + revs: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -1751,10 +1751,10 @@ def post_bulk_get_as_mixed( db: str, docs: List['BulkGetQueryDocument'], *, - attachments: bool = None, - att_encoding_info: bool = None, - latest: bool = None, - revs: bool = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + latest: Optional[bool] = None, + revs: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -1832,10 +1832,10 @@ def post_bulk_get_as_related( db: str, docs: List['BulkGetQueryDocument'], *, - attachments: bool = None, - att_encoding_info: bool = None, - latest: bool = None, - revs: bool = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + latest: Optional[bool] = None, + revs: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -1913,10 +1913,10 @@ def post_bulk_get_as_stream( db: str, docs: List['BulkGetQueryDocument'], *, - attachments: bool = None, - att_encoding_info: bool = None, - latest: bool = None, - revs: bool = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + latest: Optional[bool] = None, + revs: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -1994,9 +1994,9 @@ def delete_document( db: str, doc_id: str, *, - if_match: str = None, - batch: str = None, - rev: str = None, + if_match: Optional[str] = None, + batch: Optional[str] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2064,17 +2064,17 @@ def get_document( db: str, doc_id: str, *, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - conflicts: bool = None, - deleted_conflicts: bool = None, - latest: bool = None, - local_seq: bool = None, - meta: bool = None, - rev: str = None, - revs: bool = None, - revs_info: bool = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + conflicts: Optional[bool] = None, + deleted_conflicts: Optional[bool] = None, + latest: Optional[bool] = None, + local_seq: Optional[bool] = None, + meta: Optional[bool] = None, + rev: Optional[str] = None, + revs: Optional[bool] = None, + revs_info: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2167,17 +2167,17 @@ def get_document_as_mixed( db: str, doc_id: str, *, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - conflicts: bool = None, - deleted_conflicts: bool = None, - latest: bool = None, - local_seq: bool = None, - meta: bool = None, - rev: str = None, - revs: bool = None, - revs_info: bool = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + conflicts: Optional[bool] = None, + deleted_conflicts: Optional[bool] = None, + latest: Optional[bool] = None, + local_seq: Optional[bool] = None, + meta: Optional[bool] = None, + rev: Optional[str] = None, + revs: Optional[bool] = None, + revs_info: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2270,17 +2270,17 @@ def get_document_as_related( db: str, doc_id: str, *, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - conflicts: bool = None, - deleted_conflicts: bool = None, - latest: bool = None, - local_seq: bool = None, - meta: bool = None, - rev: str = None, - revs: bool = None, - revs_info: bool = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + conflicts: Optional[bool] = None, + deleted_conflicts: Optional[bool] = None, + latest: Optional[bool] = None, + local_seq: Optional[bool] = None, + meta: Optional[bool] = None, + rev: Optional[str] = None, + revs: Optional[bool] = None, + revs_info: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2373,17 +2373,17 @@ def get_document_as_stream( db: str, doc_id: str, *, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - conflicts: bool = None, - deleted_conflicts: bool = None, - latest: bool = None, - local_seq: bool = None, - meta: bool = None, - rev: str = None, - revs: bool = None, - revs_info: bool = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + conflicts: Optional[bool] = None, + deleted_conflicts: Optional[bool] = None, + latest: Optional[bool] = None, + local_seq: Optional[bool] = None, + meta: Optional[bool] = None, + rev: Optional[str] = None, + revs: Optional[bool] = None, + revs_info: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2477,11 +2477,11 @@ def put_document( doc_id: str, document: Union['Document', BinaryIO], *, - content_type: str = None, - if_match: str = None, - batch: str = None, - new_edits: bool = None, - rev: str = None, + content_type: Optional[str] = None, + if_match: Optional[str] = None, + batch: Optional[str] = None, + new_edits: Optional[bool] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2574,7 +2574,7 @@ def head_design_document( db: str, ddoc: str, *, - if_none_match: str = None, + if_none_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2635,9 +2635,9 @@ def delete_design_document( db: str, ddoc: str, *, - if_match: str = None, - batch: str = None, - rev: str = None, + if_match: Optional[str] = None, + batch: Optional[str] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2707,17 +2707,17 @@ def get_design_document( db: str, ddoc: str, *, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - conflicts: bool = None, - deleted_conflicts: bool = None, - latest: bool = None, - local_seq: bool = None, - meta: bool = None, - rev: str = None, - revs: bool = None, - revs_info: bool = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + conflicts: Optional[bool] = None, + deleted_conflicts: Optional[bool] = None, + latest: Optional[bool] = None, + local_seq: Optional[bool] = None, + meta: Optional[bool] = None, + rev: Optional[str] = None, + revs: Optional[bool] = None, + revs_info: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -2813,10 +2813,10 @@ def put_design_document( ddoc: str, design_document: 'DesignDocument', *, - if_match: str = None, - batch: str = None, - new_edits: bool = None, - rev: str = None, + if_match: Optional[str] = None, + batch: Optional[str] = None, + new_edits: Optional[bool] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -2950,20 +2950,20 @@ def post_design_docs( self, db: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None, - accept: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[str] = None, + key: Optional[str] = None, + keys: Optional[List[str]] = None, + start_key: Optional[str] = None, + accept: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3063,7 +3063,7 @@ def post_design_docs_queries( db: str, queries: List['AllDocsQuery'], *, - accept: str = None, + accept: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3135,26 +3135,26 @@ def post_view( ddoc: str, view: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: object = None, - end_key_doc_id: str = None, - group: bool = None, - group_level: int = None, - key: object = None, - keys: List[object] = None, - reduce: bool = None, - stable: bool = None, - start_key: object = None, - start_key_doc_id: str = None, - update: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[object] = None, + end_key_doc_id: Optional[str] = None, + group: Optional[bool] = None, + group_level: Optional[int] = None, + key: Optional[object] = None, + keys: Optional[List[object]] = None, + reduce: Optional[bool] = None, + stable: Optional[bool] = None, + start_key: Optional[object] = None, + start_key_doc_id: Optional[str] = None, + update: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3300,26 +3300,26 @@ def post_view_as_stream( ddoc: str, view: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: object = None, - end_key_doc_id: str = None, - group: bool = None, - group_level: int = None, - key: object = None, - keys: List[object] = None, - reduce: bool = None, - stable: bool = None, - start_key: object = None, - start_key_doc_id: str = None, - update: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[object] = None, + end_key_doc_id: Optional[str] = None, + group: Optional[bool] = None, + group_level: Optional[int] = None, + key: Optional[object] = None, + keys: Optional[List[object]] = None, + reduce: Optional[bool] = None, + stable: Optional[bool] = None, + start_key: Optional[object] = None, + start_key_doc_id: Optional[str] = None, + update: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3662,19 +3662,19 @@ def post_partition_all_docs( db: str, partition_key: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[str] = None, + key: Optional[str] = None, + keys: Optional[List[str]] = None, + start_key: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3775,19 +3775,19 @@ def post_partition_all_docs_as_stream( db: str, partition_key: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[str] = None, + key: Optional[str] = None, + keys: Optional[List[str]] = None, + start_key: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3891,17 +3891,17 @@ def post_partition_search( index: str, query: str, *, - bookmark: str = None, - highlight_fields: List[str] = None, - highlight_number: int = None, - highlight_post_tag: str = None, - highlight_pre_tag: str = None, - highlight_size: int = None, - include_docs: bool = None, - include_fields: List[str] = None, - limit: int = None, - sort: List[str] = None, - stale: str = None, + bookmark: Optional[str] = None, + highlight_fields: Optional[List[str]] = None, + highlight_number: Optional[int] = None, + highlight_post_tag: Optional[str] = None, + highlight_pre_tag: Optional[str] = None, + highlight_size: Optional[int] = None, + include_docs: Optional[bool] = None, + include_fields: Optional[List[str]] = None, + limit: Optional[int] = None, + sort: Optional[List[str]] = None, + stale: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -4022,17 +4022,17 @@ def post_partition_search_as_stream( index: str, query: str, *, - bookmark: str = None, - highlight_fields: List[str] = None, - highlight_number: int = None, - highlight_post_tag: str = None, - highlight_pre_tag: str = None, - highlight_size: int = None, - include_docs: bool = None, - include_fields: List[str] = None, - limit: int = None, - sort: List[str] = None, - stale: str = None, + bookmark: Optional[str] = None, + highlight_fields: Optional[List[str]] = None, + highlight_number: Optional[int] = None, + highlight_post_tag: Optional[str] = None, + highlight_pre_tag: Optional[str] = None, + highlight_size: Optional[int] = None, + include_docs: Optional[bool] = None, + include_fields: Optional[List[str]] = None, + limit: Optional[int] = None, + sort: Optional[List[str]] = None, + stale: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -4152,25 +4152,25 @@ def post_partition_view( ddoc: str, view: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: object = None, - end_key_doc_id: str = None, - group: bool = None, - group_level: int = None, - key: object = None, - keys: List[object] = None, - reduce: bool = None, - start_key: object = None, - start_key_doc_id: str = None, - update: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[object] = None, + end_key_doc_id: Optional[str] = None, + group: Optional[bool] = None, + group_level: Optional[int] = None, + key: Optional[object] = None, + keys: Optional[List[object]] = None, + reduce: Optional[bool] = None, + start_key: Optional[object] = None, + start_key_doc_id: Optional[str] = None, + update: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -4310,25 +4310,25 @@ def post_partition_view_as_stream( ddoc: str, view: str, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: object = None, - end_key_doc_id: str = None, - group: bool = None, - group_level: int = None, - key: object = None, - keys: List[object] = None, - reduce: bool = None, - start_key: object = None, - start_key_doc_id: str = None, - update: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[object] = None, + end_key_doc_id: Optional[str] = None, + group: Optional[bool] = None, + group_level: Optional[int] = None, + key: Optional[object] = None, + keys: Optional[List[object]] = None, + reduce: Optional[bool] = None, + start_key: Optional[object] = None, + start_key_doc_id: Optional[str] = None, + update: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -4467,16 +4467,16 @@ def post_partition_explain( partition_key: str, selector: dict, *, - bookmark: str = None, - conflicts: bool = None, - execution_stats: bool = None, - fields: List[str] = None, - limit: int = None, - skip: int = None, - sort: List[dict] = None, - stable: bool = None, - update: str = None, - use_index: List[str] = None, + bookmark: Optional[str] = None, + conflicts: Optional[bool] = None, + execution_stats: Optional[bool] = None, + fields: Optional[List[str]] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + sort: Optional[List[dict]] = None, + stable: Optional[bool] = None, + update: Optional[str] = None, + use_index: Optional[List[str]] = None, **kwargs, ) -> DetailedResponse: """ @@ -4614,16 +4614,16 @@ def post_partition_find( partition_key: str, selector: dict, *, - bookmark: str = None, - conflicts: bool = None, - execution_stats: bool = None, - fields: List[str] = None, - limit: int = None, - skip: int = None, - sort: List[dict] = None, - stable: bool = None, - update: str = None, - use_index: List[str] = None, + bookmark: Optional[str] = None, + conflicts: Optional[bool] = None, + execution_stats: Optional[bool] = None, + fields: Optional[List[str]] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + sort: Optional[List[dict]] = None, + stable: Optional[bool] = None, + update: Optional[str] = None, + use_index: Optional[List[str]] = None, **kwargs, ) -> DetailedResponse: """ @@ -4766,16 +4766,16 @@ def post_partition_find_as_stream( partition_key: str, selector: dict, *, - bookmark: str = None, - conflicts: bool = None, - execution_stats: bool = None, - fields: List[str] = None, - limit: int = None, - skip: int = None, - sort: List[dict] = None, - stable: bool = None, - update: str = None, - use_index: List[str] = None, + bookmark: Optional[str] = None, + conflicts: Optional[bool] = None, + execution_stats: Optional[bool] = None, + fields: Optional[List[str]] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + sort: Optional[List[dict]] = None, + stable: Optional[bool] = None, + update: Optional[str] = None, + use_index: Optional[List[str]] = None, **kwargs, ) -> DetailedResponse: """ @@ -4921,17 +4921,17 @@ def post_explain( db: str, selector: dict, *, - bookmark: str = None, - conflicts: bool = None, - execution_stats: bool = None, - fields: List[str] = None, - limit: int = None, - skip: int = None, - sort: List[dict] = None, - stable: bool = None, - update: str = None, - use_index: List[str] = None, - r: int = None, + bookmark: Optional[str] = None, + conflicts: Optional[bool] = None, + execution_stats: Optional[bool] = None, + fields: Optional[List[str]] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + sort: Optional[List[dict]] = None, + stable: Optional[bool] = None, + update: Optional[str] = None, + use_index: Optional[List[str]] = None, + r: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -5071,17 +5071,17 @@ def post_find( db: str, selector: dict, *, - bookmark: str = None, - conflicts: bool = None, - execution_stats: bool = None, - fields: List[str] = None, - limit: int = None, - skip: int = None, - sort: List[dict] = None, - stable: bool = None, - update: str = None, - use_index: List[str] = None, - r: int = None, + bookmark: Optional[str] = None, + conflicts: Optional[bool] = None, + execution_stats: Optional[bool] = None, + fields: Optional[List[str]] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + sort: Optional[List[dict]] = None, + stable: Optional[bool] = None, + update: Optional[str] = None, + use_index: Optional[List[str]] = None, + r: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -5227,17 +5227,17 @@ def post_find_as_stream( db: str, selector: dict, *, - bookmark: str = None, - conflicts: bool = None, - execution_stats: bool = None, - fields: List[str] = None, - limit: int = None, - skip: int = None, - sort: List[dict] = None, - stable: bool = None, - update: str = None, - use_index: List[str] = None, - r: int = None, + bookmark: Optional[str] = None, + conflicts: Optional[bool] = None, + execution_stats: Optional[bool] = None, + fields: Optional[List[str]] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + sort: Optional[List[dict]] = None, + stable: Optional[bool] = None, + update: Optional[str] = None, + use_index: Optional[List[str]] = None, + r: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -5430,10 +5430,10 @@ def post_index( db: str, index: 'IndexDefinition', *, - ddoc: str = None, - name: str = None, - partitioned: bool = None, - type: str = None, + ddoc: Optional[str] = None, + name: Optional[str] = None, + partitioned: Optional[bool] = None, + type: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -5628,23 +5628,23 @@ def post_search( index: str, query: str, *, - bookmark: str = None, - highlight_fields: List[str] = None, - highlight_number: int = None, - highlight_post_tag: str = None, - highlight_pre_tag: str = None, - highlight_size: int = None, - include_docs: bool = None, - include_fields: List[str] = None, - limit: int = None, - sort: List[str] = None, - stale: str = None, - counts: List[str] = None, - drilldown: List[List[str]] = None, - group_field: str = None, - group_limit: int = None, - group_sort: List[str] = None, - ranges: dict = None, + bookmark: Optional[str] = None, + highlight_fields: Optional[List[str]] = None, + highlight_number: Optional[int] = None, + highlight_post_tag: Optional[str] = None, + highlight_pre_tag: Optional[str] = None, + highlight_size: Optional[int] = None, + include_docs: Optional[bool] = None, + include_fields: Optional[List[str]] = None, + limit: Optional[int] = None, + sort: Optional[List[str]] = None, + stale: Optional[str] = None, + counts: Optional[List[str]] = None, + drilldown: Optional[List[List[str]]] = None, + group_field: Optional[str] = None, + group_limit: Optional[int] = None, + group_sort: Optional[List[str]] = None, + ranges: Optional[dict] = None, **kwargs, ) -> DetailedResponse: """ @@ -5798,23 +5798,23 @@ def post_search_as_stream( index: str, query: str, *, - bookmark: str = None, - highlight_fields: List[str] = None, - highlight_number: int = None, - highlight_post_tag: str = None, - highlight_pre_tag: str = None, - highlight_size: int = None, - include_docs: bool = None, - include_fields: List[str] = None, - limit: int = None, - sort: List[str] = None, - stale: str = None, - counts: List[str] = None, - drilldown: List[List[str]] = None, - group_field: str = None, - group_limit: int = None, - group_sort: List[str] = None, - ranges: dict = None, + bookmark: Optional[str] = None, + highlight_fields: Optional[List[str]] = None, + highlight_number: Optional[int] = None, + highlight_post_tag: Optional[str] = None, + highlight_pre_tag: Optional[str] = None, + highlight_size: Optional[int] = None, + include_docs: Optional[bool] = None, + include_fields: Optional[List[str]] = None, + limit: Optional[int] = None, + sort: Optional[List[str]] = None, + stale: Optional[str] = None, + counts: Optional[List[str]] = None, + drilldown: Optional[List[List[str]]] = None, + group_field: Optional[str] = None, + group_limit: Optional[int] = None, + group_sort: Optional[List[str]] = None, + ranges: Optional[dict] = None, **kwargs, ) -> DetailedResponse: """ @@ -6023,7 +6023,7 @@ def head_replication_document( self, doc_id: str, *, - if_none_match: str = None, + if_none_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -6165,9 +6165,9 @@ def delete_replication_document( self, doc_id: str, *, - if_match: str = None, - batch: str = None, - rev: str = None, + if_match: Optional[str] = None, + batch: Optional[str] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -6228,17 +6228,17 @@ def get_replication_document( self, doc_id: str, *, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - conflicts: bool = None, - deleted_conflicts: bool = None, - latest: bool = None, - local_seq: bool = None, - meta: bool = None, - rev: str = None, - revs: bool = None, - revs_info: bool = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + conflicts: Optional[bool] = None, + deleted_conflicts: Optional[bool] = None, + latest: Optional[bool] = None, + local_seq: Optional[bool] = None, + meta: Optional[bool] = None, + rev: Optional[str] = None, + revs: Optional[bool] = None, + revs_info: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -6328,10 +6328,10 @@ def put_replication_document( doc_id: str, replication_document: 'ReplicationDocument', *, - if_match: str = None, - batch: str = None, - new_edits: bool = None, - rev: str = None, + if_match: Optional[str] = None, + batch: Optional[str] = None, + new_edits: Optional[bool] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -6407,9 +6407,9 @@ def put_replication_document( def get_scheduler_docs( self, *, - limit: int = None, - skip: int = None, - states: List[str] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + states: Optional[List[str]] = None, **kwargs, ) -> DetailedResponse: """ @@ -6510,8 +6510,8 @@ def get_scheduler_document( def get_scheduler_jobs( self, *, - limit: int = None, - skip: int = None, + limit: Optional[int] = None, + skip: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ @@ -6702,10 +6702,10 @@ def put_security( self, db: str, *, - admins: 'SecurityObject' = None, - members: 'SecurityObject' = None, - cloudant: dict = None, - couchdb_auth_only: bool = None, + admins: Optional['SecurityObject'] = None, + members: Optional['SecurityObject'] = None, + cloudant: Optional[dict] = None, + couchdb_auth_only: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -6824,9 +6824,9 @@ def put_cloudant_security_configuration( db: str, cloudant: dict, *, - admins: 'SecurityObject' = None, - members: 'SecurityObject' = None, - couchdb_auth_only: bool = None, + admins: Optional['SecurityObject'] = None, + members: Optional['SecurityObject'] = None, + couchdb_auth_only: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -6947,8 +6947,8 @@ def put_cors_configuration( self, origins: List[str], *, - allow_credentials: bool = None, - enable_cors: bool = None, + allow_credentials: Optional[bool] = None, + enable_cors: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -7015,9 +7015,9 @@ def head_attachment( doc_id: str, attachment_name: str, *, - if_match: str = None, - if_none_match: str = None, - rev: str = None, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -7086,9 +7086,9 @@ def delete_attachment( doc_id: str, attachment_name: str, *, - if_match: str = None, - rev: str = None, - batch: str = None, + if_match: Optional[str] = None, + rev: Optional[str] = None, + batch: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -7158,10 +7158,10 @@ def get_attachment( doc_id: str, attachment_name: str, *, - if_match: str = None, - if_none_match: str = None, - range: str = None, - rev: str = None, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + range: Optional[str] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -7237,8 +7237,8 @@ def put_attachment( attachment: BinaryIO, content_type: str, *, - if_match: str = None, - rev: str = None, + if_match: Optional[str] = None, + rev: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -7323,7 +7323,7 @@ def head_local_document( db: str, doc_id: str, *, - if_none_match: str = None, + if_none_match: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -7378,7 +7378,7 @@ def delete_local_document( db: str, doc_id: str, *, - batch: str = None, + batch: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -7438,11 +7438,11 @@ def get_local_document( db: str, doc_id: str, *, - accept: str = None, - if_none_match: str = None, - attachments: bool = None, - att_encoding_info: bool = None, - local_seq: bool = None, + accept: Optional[str] = None, + if_none_match: Optional[str] = None, + attachments: Optional[bool] = None, + att_encoding_info: Optional[bool] = None, + local_seq: Optional[bool] = None, **kwargs, ) -> DetailedResponse: """ @@ -7515,8 +7515,8 @@ def put_local_document( doc_id: str, document: Union['Document', BinaryIO], *, - content_type: str = None, - batch: str = None, + content_type: Optional[str] = None, + batch: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -8294,70 +8294,70 @@ class ActiveTask: """ Schema for information about a running task. - :attr int bulk_get_attempts: (optional) The total count of attempted doc + :param int bulk_get_attempts: (optional) The total count of attempted doc revisions fetched with `_bulk_get`. Available for `replication` type tasks. - :attr int bulk_get_docs: (optional) The total count of successful docs fetched + :param int bulk_get_docs: (optional) The total count of successful docs fetched with `_bulk_get`. Available for `replication` type tasks. - :attr int changes_done: (optional) Processed changes. Available for + :param int changes_done: (optional) Processed changes. Available for `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type tasks. - :attr int changes_pending: (optional) The count of changes not yet replicated. + :param int changes_pending: (optional) The count of changes not yet replicated. Available for `replication` type tasks. - :attr int checkpoint_interval: (optional) Specifies the checkpoint interval in + :param int checkpoint_interval: (optional) Specifies the checkpoint interval in ms. Available for `replication` type tasks. - :attr str checkpointed_source_seq: (optional) The source sequence id which was + :param str checkpointed_source_seq: (optional) The source sequence id which was last successfully replicated. Available for `replication` type tasks. - :attr bool continuous: (optional) The replication configured to be continuous. + :param bool continuous: (optional) The replication configured to be continuous. Available for `replication` type tasks. - :attr str database: Source database. - :attr str design_document: (optional) The design document that belongs to this + :param str database: Source database. + :param str design_document: (optional) The design document that belongs to this task. Available for `indexer`, `search_indexer`, `view_compaction` type tasks. - :attr str doc_id: (optional) Replication document ID. Available for + :param str doc_id: (optional) Replication document ID. Available for `replication` type tasks. - :attr int doc_write_failures: (optional) Number of document write failures. + :param int doc_write_failures: (optional) Number of document write failures. Available for `replication` type tasks. - :attr int docs_read: (optional) Number of documents read. Available for + :param int docs_read: (optional) Number of documents read. Available for `replication` type tasks. - :attr int docs_written: (optional) Number of documents written to target. + :param int docs_written: (optional) Number of documents written to target. Available for `replication` type tasks. - :attr str index: (optional) The search index that belongs to this task. + :param str index: (optional) The search index that belongs to this task. Available for `search_indexer` type tasks. - :attr str indexer_pid: (optional) Indexer process ID. Available for `indexer` + :param str indexer_pid: (optional) Indexer process ID. Available for `indexer` type tasks. - :attr int missing_revisions_found: (optional) The count of docs which have been + :param int missing_revisions_found: (optional) The count of docs which have been read from the source. Available for `replication` type tasks. - :attr str node: Cluster node where the task is running. - :attr str phase: (optional) The phase the active task is in. `docid_sort`, + :param str node: Cluster node where the task is running. + :param str phase: (optional) The phase the active task is in. `docid_sort`, `docid_copy`, `document_copy` phases are available for `database_compaction`, while `ids` and `view` phases are available for `view_compaction` type tasks. - :attr str pid: Process ID. - :attr str process_status: (optional) Process status. - :attr int progress: (optional) Current percentage progress. Available for + :param str pid: Process ID. + :param str process_status: (optional) Process status. + :param int progress: (optional) Current percentage progress. Available for `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type tasks. - :attr str replication_id: (optional) Replication ID. Available for `replication` - type tasks. - :attr bool retry: (optional) Indicates whether a compaction retry is currently + :param str replication_id: (optional) Replication ID. Available for + `replication` type tasks. + :param bool retry: (optional) Indicates whether a compaction retry is currently running on the database. Available for `database_compaction` type tasks. - :attr int revisions_checked: (optional) The count of revisions which have been + :param int revisions_checked: (optional) The count of revisions which have been checked since this replication began. Available for `replication` type tasks. - :attr str source: (optional) Replication source. Available for `replication` + :param str source: (optional) Replication source. Available for `replication` type tasks. - :attr str source_seq: (optional) The last sequence number obtained from the + :param str source_seq: (optional) The last sequence number obtained from the source database changes feed. Available for `replication` type tasks. - :attr int started_on: Schema for a Unix epoch timestamp. - :attr str target: (optional) Replication target. Available for `replication` + :param int started_on: Schema for a Unix epoch timestamp. + :param str target: (optional) Replication target. Available for `replication` type tasks. - :attr str through_seq: (optional) The last sequence number processed by the + :param str through_seq: (optional) The last sequence number processed by the replicator. Available for `replication` type tasks. - :attr int total_changes: (optional) Total changes to process. Available for + :param int total_changes: (optional) Total changes to process. Available for `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type tasks. - :attr str type: Operation type. - :attr int updated_on: Schema for a Unix epoch timestamp. - :attr str user: (optional) Name of user running replication or owning the + :param str type: Operation type. + :param int updated_on: Schema for a Unix epoch timestamp. + :param str user: (optional) Name of user running replication or owning the indexer. Available for `indexer`, `replication` type tasks. - :attr int view: (optional) Number of view indexes. Available for + :param int view: (optional) Number of view indexes. Available for `view_compaction` type tasks. """ @@ -8370,34 +8370,34 @@ def __init__( type: str, updated_on: int, *, - bulk_get_attempts: int = None, - bulk_get_docs: int = None, - changes_done: int = None, - changes_pending: int = None, - checkpoint_interval: int = None, - checkpointed_source_seq: str = None, - continuous: bool = None, - design_document: str = None, - doc_id: str = None, - doc_write_failures: int = None, - docs_read: int = None, - docs_written: int = None, - index: str = None, - indexer_pid: str = None, - missing_revisions_found: int = None, - phase: str = None, - process_status: str = None, - progress: int = None, - replication_id: str = None, - retry: bool = None, - revisions_checked: int = None, - source: str = None, - source_seq: str = None, - target: str = None, - through_seq: str = None, - total_changes: int = None, - user: str = None, - view: int = None, + bulk_get_attempts: Optional[int] = None, + bulk_get_docs: Optional[int] = None, + changes_done: Optional[int] = None, + changes_pending: Optional[int] = None, + checkpoint_interval: Optional[int] = None, + checkpointed_source_seq: Optional[str] = None, + continuous: Optional[bool] = None, + design_document: Optional[str] = None, + doc_id: Optional[str] = None, + doc_write_failures: Optional[int] = None, + docs_read: Optional[int] = None, + docs_written: Optional[int] = None, + index: Optional[str] = None, + indexer_pid: Optional[str] = None, + missing_revisions_found: Optional[int] = None, + phase: Optional[str] = None, + process_status: Optional[str] = None, + progress: Optional[int] = None, + replication_id: Optional[str] = None, + retry: Optional[bool] = None, + revisions_checked: Optional[int] = None, + source: Optional[str] = None, + source_seq: Optional[str] = None, + target: Optional[str] = None, + through_seq: Optional[str] = None, + total_changes: Optional[int] = None, + user: Optional[str] = None, + view: Optional[int] = None, ) -> None: """ Initialize a ActiveTask object. @@ -8733,7 +8733,7 @@ class ActivityTrackerEvents: """ Schema for Activity Tracker events. - :attr List[str] types: An array of event types that are being sent to IBM Cloud + :param List[str] types: An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance. "management" is a required element of this array. """ @@ -8805,7 +8805,7 @@ class AllDocsQueriesResult: """ Schema for the result of an all documents queries operation. - :attr List[AllDocsResult] results: An array of result objects - one for each + :param List[AllDocsResult] results: An array of result objects - one for each query. Each result object contains the same fields as the response to a regular `/_all_docs` request. """ @@ -8874,49 +8874,49 @@ class AllDocsQuery: """ Schema for an all documents query operation. - :attr bool att_encoding_info: (optional) Parameter to specify whether to include - the encoding information in attachment stubs if the particular attachment is - compressed. - :attr bool attachments: (optional) Parameter to specify whether to include + :param bool att_encoding_info: (optional) Parameter to specify whether to + include the encoding information in attachment stubs if the particular + attachment is compressed. + :param bool attachments: (optional) Parameter to specify whether to include attachments bodies in a response. - :attr bool conflicts: (optional) Parameter to specify whether to include a list + :param bool conflicts: (optional) Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when `include_docs` is `true`. - :attr bool descending: (optional) Parameter to specify whether to return the + :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. - :attr bool include_docs: (optional) Parameter to specify whether to include the + :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :attr bool inclusive_end: (optional) Parameter to specify whether the specified + :param bool inclusive_end: (optional) Parameter to specify whether the specified end key should be included in the result. - :attr int limit: (optional) Parameter to specify the number of returned + :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. - :attr int skip: (optional) Parameter to specify the number of records before + :param int skip: (optional) Parameter to specify the number of records before starting to return the results. - :attr bool update_seq: (optional) Parameter to specify whether to include in the - response an update_seq value indicating the sequence id of the database the view - reflects. - :attr str end_key: (optional) Schema for a document ID. - :attr str key: (optional) Schema for a document ID. - :attr List[str] keys: (optional) Schema for a list of document IDs. - :attr str start_key: (optional) Schema for a document ID. + :param bool update_seq: (optional) Parameter to specify whether to include in + the response an update_seq value indicating the sequence id of the database the + view reflects. + :param str end_key: (optional) Schema for a document ID. + :param str key: (optional) Schema for a document ID. + :param List[str] keys: (optional) Schema for a list of document IDs. + :param str start_key: (optional) Schema for a document ID. """ def __init__( self, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: str = None, - key: str = None, - keys: List[str] = None, - start_key: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[str] = None, + key: Optional[str] = None, + keys: Optional[List[str]] = None, + start_key: Optional[str] = None, ) -> None: """ Initialize a AllDocsQuery object. @@ -9052,9 +9052,9 @@ class AllDocsResult: """ Schema for the result of an all documents operation. - :attr int total_rows: Number of total rows. - :attr List[DocsResultRow] rows: List of doc results. - :attr str update_seq: (optional) Current update sequence for the database. + :param int total_rows: Number of total rows. + :param List[DocsResultRow] rows: List of doc results. + :param str update_seq: (optional) Current update sequence for the database. """ def __init__( @@ -9062,7 +9062,7 @@ def __init__( total_rows: int, rows: List['DocsResultRow'], *, - update_seq: str = None, + update_seq: Optional[str] = None, ) -> None: """ Initialize a AllDocsResult object. @@ -9136,20 +9136,20 @@ class Analyzer: """ Schema for a full text search analyzer. - :attr str name: (optional) Schema for the name of the Apache Lucene analyzer to + :param str name: (optional) 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`. - :attr List[str] stopwords: (optional) Custom stopwords to use with the named + :param List[str] stopwords: (optional) Custom stopwords to use with the named analyzer. """ def __init__( self, *, - name: str = None, - stopwords: List[str] = None, + name: Optional[str] = None, + stopwords: Optional[List[str]] = None, ) -> None: """ Initialize a Analyzer object. @@ -9265,23 +9265,23 @@ class AnalyzerConfiguration: """ Schema for a search analyzer configuration. - :attr str name: (optional) Schema for the name of the Apache Lucene analyzer to + :param str name: (optional) 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`. - :attr List[str] stopwords: (optional) Custom stopwords to use with the named + :param List[str] stopwords: (optional) Custom stopwords to use with the named analyzer. - :attr dict fields: (optional) Schema for mapping a field name to a per field + :param dict fields: (optional) Schema for mapping a field name to a per field analyzer. """ def __init__( self, *, - name: str = None, - stopwords: List[str] = None, - fields: dict = None, + name: Optional[str] = None, + stopwords: Optional[List[str]] = None, + fields: Optional[dict] = None, ) -> None: """ Initialize a AnalyzerConfiguration object. @@ -9410,9 +9410,9 @@ class ApiKeysResult: """ Schema for api keys. - :attr bool ok: ok. - :attr str key: The generated api key. - :attr str password: The password associated with the api key. + :param bool ok: ok. + :param str key: The generated api key. + :param str password: The password associated with the api key. """ def __init__( @@ -9489,42 +9489,42 @@ class Attachment: """ Schema for an attachment. - :attr str content_type: (optional) Attachment MIME type. - :attr bytes data: (optional) Base64-encoded content. Available if attachment + :param str content_type: (optional) Attachment MIME type. + :param bytes data: (optional) Base64-encoded content. Available if attachment content is requested by using the query parameters `attachments=true` or `atts_since`. Note that when used with a view or changes feed `include_docs` must also be `true`. - :attr str digest: (optional) Content hash digest. It starts with prefix which + :param str digest: (optional) Content hash digest. It starts with prefix which announce hash type (e.g. `md5-`) and continues with Base64-encoded hash digest. - :attr int encoded_length: (optional) Compressed attachment size in bytes. + :param int encoded_length: (optional) Compressed attachment size in bytes. Available if content_type was in list of compressible types when the attachment was added and the query parameter `att_encoding_info` is `true`. Note that when used with a view or changes feed `include_docs` must also be `true`. - :attr str encoding: (optional) Compression codec. Available if content_type was + :param str encoding: (optional) Compression codec. Available if content_type was in list of compressible types when the attachment was added and the and the query parameter `att_encoding_info` is `true`. Note that when used with a view or changes feed `include_docs` must also be `true`. - :attr bool follows: (optional) True if the attachment follows in a multipart + :param bool follows: (optional) True if the attachment follows in a multipart request or response. - :attr int length: (optional) Real attachment size in bytes. Not available if + :param int length: (optional) Real attachment size in bytes. Not available if inline attachment content requested. - :attr int revpos: (optional) Revision number when attachment was added. - :attr bool stub: (optional) Has `true` value if object contains stub info and no - content. Otherwise omitted in response. + :param int revpos: (optional) Revision number when attachment was added. + :param bool stub: (optional) Has `true` value if object contains stub info and + no content. Otherwise omitted in response. """ def __init__( self, *, - content_type: str = None, - data: bytes = None, - digest: str = None, - encoded_length: int = None, - encoding: str = None, - follows: bool = None, - length: int = None, - revpos: int = None, - stub: bool = None, + content_type: Optional[str] = None, + data: Optional[bytes] = None, + digest: Optional[str] = None, + encoded_length: Optional[int] = None, + encoding: Optional[str] = None, + follows: Optional[bool] = None, + length: Optional[int] = None, + revpos: Optional[int] = None, + stub: Optional[bool] = None, ) -> None: """ Initialize a Attachment object. @@ -9640,8 +9640,8 @@ class BulkDocs: """ Schema for submitting documents for bulk modifications. - :attr List[Document] docs: Array of documents. - :attr bool new_edits: (optional) If `false`, prevents the database from + :param List[Document] docs: Array of documents. + :param bool new_edits: (optional) If `false`, prevents the database from assigning them new revision IDs. Default is `true`. """ @@ -9649,7 +9649,7 @@ def __init__( self, docs: List['Document'], *, - new_edits: bool = None, + new_edits: Optional[bool] = None, ) -> None: """ Initialize a BulkDocs object. @@ -9716,18 +9716,18 @@ class BulkGetQueryDocument: """ Schema for a document item in a bulk get query. - :attr List[str] atts_since: (optional) Includes attachments only since specified - revisions. - :attr str id: Schema for a document ID. - :attr str rev: (optional) Schema for a document revision identifier. + :param List[str] atts_since: (optional) Includes attachments only since + specified revisions. + :param str id: Schema for a document ID. + :param str rev: (optional) Schema for a document revision identifier. """ def __init__( self, id: str, *, - atts_since: List[str] = None, - rev: str = None, + atts_since: Optional[List[str]] = None, + rev: Optional[str] = None, ) -> None: """ Initialize a BulkGetQueryDocument object. @@ -9794,7 +9794,7 @@ class BulkGetResult: """ Schema for the results object of a bulk get operation. - :attr List[BulkGetResultItem] results: Results. + :param List[BulkGetResultItem] results: Results. """ def __init__( @@ -9860,16 +9860,16 @@ class BulkGetResultDocument: Schema for BulkGetResult object containing a successfully retrieved document or error information. - :attr DocumentResult error: (optional) Schema for the result of a document + :param DocumentResult error: (optional) Schema for the result of a document modification. - :attr Document ok: (optional) Schema for a document. + :param Document ok: (optional) Schema for a document. """ def __init__( self, *, - error: 'DocumentResult' = None, - ok: 'Document' = None, + error: Optional['DocumentResult'] = None, + ok: Optional['Document'] = None, ) -> None: """ Initialize a BulkGetResultDocument object. @@ -9934,9 +9934,9 @@ class BulkGetResultItem: """ Schema for the document revisions information from a bulk get operation. - :attr List[BulkGetResultDocument] docs: Array of document revisions or error + :param List[BulkGetResultDocument] docs: Array of document revisions or error information. - :attr str id: Schema for a document ID. + :param str id: Schema for a document ID. """ def __init__( @@ -10011,9 +10011,9 @@ class CapacityThroughputInformation: """ Schema for information about the currently provisioned and target throughput capacity. - :attr CapacityThroughputInformationCurrent current: Detailed information about + :param CapacityThroughputInformationCurrent current: Detailed information about provisioned throughput capacity. - :attr CapacityThroughputInformationTarget target: (optional) Detailed + :param CapacityThroughputInformationTarget target: (optional) Detailed information about target throughput capacity. """ @@ -10021,7 +10021,7 @@ def __init__( self, current: 'CapacityThroughputInformationCurrent', *, - target: 'CapacityThroughputInformationTarget' = None, + target: Optional['CapacityThroughputInformationTarget'] = None, ) -> None: """ Initialize a CapacityThroughputInformation object. @@ -10089,7 +10089,7 @@ class CapacityThroughputInformationCurrent: """ Detailed information about provisioned throughput capacity. - :attr ThroughputInformation throughput: Schema for detailed information about + :param ThroughputInformation throughput: Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes. """ @@ -10154,7 +10154,7 @@ class CapacityThroughputInformationTarget: """ Detailed information about target throughput capacity. - :attr ThroughputInformation throughput: Schema for detailed information about + :param ThroughputInformation throughput: Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes. """ @@ -10219,7 +10219,7 @@ class Change: """ Schema for a document leaf with single field rev. - :attr str rev: Schema for a document revision identifier. + :param str rev: Schema for a document revision identifier. """ def __init__( @@ -10278,9 +10278,9 @@ class ChangesResult: """ Schema for normal changes feed result. - :attr str last_seq: last_seq. - :attr int pending: pending. - :attr List[ChangesResultItem] results: results. + :param str last_seq: last_seq. + :param int pending: pending. + :param List[ChangesResultItem] results: results. """ def __init__( @@ -10363,11 +10363,11 @@ class ChangesResultItem: """ Schema for an item in the changes results array. - :attr List[Change] changes: List of document's leaves with single field rev. - :attr bool deleted: (optional) if `true` then the document is deleted. - :attr Document doc: (optional) Schema for a document. - :attr str id: Schema for a document ID. - :attr str seq: Update sequence. + :param List[Change] changes: List of document's leaves with single field rev. + :param bool deleted: (optional) if `true` then the document is deleted. + :param Document doc: (optional) Schema for a document. + :param str id: Schema for a document ID. + :param str seq: Update sequence. """ def __init__( @@ -10376,8 +10376,8 @@ def __init__( id: str, seq: str, *, - deleted: bool = None, - doc: 'Document' = None, + deleted: Optional[bool] = None, + doc: Optional['Document'] = None, ) -> None: """ Initialize a ChangesResultItem object. @@ -10469,9 +10469,9 @@ class ContentInformationSizes: """ Schema for size information of content. - :attr int active: The active size of the content, in bytes. - :attr int external: The total uncompressed size of the content, in bytes. - :attr int file: The total size of the content as stored on disk, in bytes. + :param int active: The active size of the content, in bytes. + :param int external: The total uncompressed size of the content, in bytes. + :param int file: The total size of the content as stored on disk, in bytes. """ def __init__( @@ -10548,10 +10548,11 @@ class CorsInformation: """ Schema for information about the CORS configuration. - :attr bool allow_credentials: Boolean value to allow authentication credentials. - If set to true, browser requests must be done by using withCredentials = true. - :attr bool enable_cors: Boolean value to turn CORS on and off. - :attr List[str] origins: An array of strings that contain allowed origin + :param bool allow_credentials: Boolean value to allow authentication + credentials. If set to true, browser requests must be done by using + withCredentials = true. + :param bool enable_cors: Boolean value to turn CORS on and off. + :param List[str] origins: An array of strings that contain allowed origin domains. You have to specify the full URL including the protocol. It is recommended that only the HTTPS protocol is used. Subdomains count as separate domains, so you have to specify all subdomains used. @@ -10636,7 +10637,7 @@ class CurrentThroughputInformation: """ Schema for information about current consumption of a provisioned throughput capacity. - :attr CurrentThroughputInformationThroughput throughput: Detailed information + :param CurrentThroughputInformationThroughput throughput: Detailed information about current consumption. """ @@ -10700,11 +10701,11 @@ class CurrentThroughputInformationThroughput: """ Detailed information about current consumption. - :attr int query: Number of global queries conducted against the instance for a + :param int query: Number of global queries conducted against the instance for a given second. - :attr int read: Number of reads conducted against the instance for a given + :param int read: Number of reads conducted against the instance for a given second. - :attr int write: Number of writes conducted against the instance for a given + :param int write: Number of writes conducted against the instance for a given second. """ @@ -10785,26 +10786,26 @@ class DatabaseInformation: """ Schema for information about a database. - :attr DatabaseInformationCluster cluster: Schema for database cluster + :param DatabaseInformationCluster cluster: Schema for database cluster information. - :attr str committed_update_seq: (optional) An opaque string that describes the + :param str committed_update_seq: (optional) An opaque string that describes the committed state of the database. - :attr bool compact_running: True if the database compaction routine is operating - on this database. - :attr str compacted_seq: (optional) An opaque string that describes the + :param bool compact_running: True if the database compaction routine is + operating on this database. + :param str compacted_seq: (optional) An opaque string that describes the compaction state of the database. - :attr str db_name: The name of the database. - :attr int disk_format_version: The version of the physical format used for the + :param str db_name: The name of the database. + :param int disk_format_version: The version of the physical format used for the data when it is stored on disk. - :attr int doc_count: A count of the documents in the specified database. - :attr int doc_del_count: Number of deleted documents. - :attr str engine: (optional) The engine used for the database. - :attr DatabaseInformationProps props: Schema for database properties. - :attr ContentInformationSizes sizes: Schema for size information of content. - :attr str update_seq: An opaque string that describes the state of the database. - Do not rely on this string for counting the number of updates. - :attr str uuid: (optional) The UUID of the database. - :attr PartitionedIndexesInformation partitioned_indexes: (optional) Information + :param int doc_count: A count of the documents in the specified database. + :param int doc_del_count: Number of deleted documents. + :param str engine: (optional) The engine used for the database. + :param DatabaseInformationProps props: Schema for database properties. + :param ContentInformationSizes sizes: Schema for size information of content. + :param str update_seq: An opaque string that describes the state of the + database. Do not rely on this string for counting the number of updates. + :param str uuid: (optional) The UUID of the database. + :param PartitionedIndexesInformation partitioned_indexes: (optional) Information about database's partitioned indexes. """ @@ -10820,11 +10821,11 @@ def __init__( sizes: 'ContentInformationSizes', update_seq: str, *, - committed_update_seq: str = None, - compacted_seq: str = None, - engine: str = None, - uuid: str = None, - partitioned_indexes: 'PartitionedIndexesInformation' = None, + committed_update_seq: Optional[str] = None, + compacted_seq: Optional[str] = None, + engine: Optional[str] = None, + uuid: Optional[str] = None, + partitioned_indexes: Optional['PartitionedIndexesInformation'] = None, ) -> None: """ Initialize a DatabaseInformation object. @@ -10992,13 +10993,13 @@ class DatabaseInformationCluster: """ Schema for database cluster information. - :attr int n: Schema for the number of replicas of a database in a cluster. The + :param int n: Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user. - :attr int q: Schema for the number of shards in a database. Each shard is a + :param int q: Schema for the number of shards in a database. Each shard is a partition of the hash value range. - :attr int r: Read quorum. The number of consistent copies of a document that + :param int r: Read quorum. The number of consistent copies of a document that need to be read before a successful reply. - :attr int w: Write quorum. The number of copies of a document that need to be + :param int w: Write quorum. The number of copies of a document that need to be written before a successful reply. """ @@ -11090,14 +11091,14 @@ class DatabaseInformationProps: """ Schema for database properties. - :attr bool partitioned: (optional) The value is `true` for a partitioned + :param bool partitioned: (optional) The value is `true` for a partitioned database. """ def __init__( self, *, - partitioned: bool = None, + partitioned: Optional[bool] = None, ) -> None: """ Initialize a DatabaseInformationProps object. @@ -11150,9 +11151,9 @@ class DbEvent: """ Schema for a database change event. - :attr str db_name: Database name. - :attr str seq: Sequence number. - :attr str type: A database event. + :param str db_name: Database name. + :param str seq: Sequence number. + :param str type: A database event. """ def __init__( @@ -11239,8 +11240,8 @@ class DbUpdates: """ Schema for database updates. - :attr str last_seq: Last sequence number. - :attr List[DbEvent] results: results. + :param str last_seq: Last sequence number. + :param List[DbEvent] results: results. """ def __init__( @@ -11314,18 +11315,18 @@ class DbsInfoResult: """ Schema for database information keyed by database name. - :attr str error: (optional) The name of the error. - :attr DatabaseInformation info: (optional) Schema for information about a + :param str error: (optional) The name of the error. + :param DatabaseInformation info: (optional) Schema for information about a database. - :attr str key: Database name. + :param str key: Database name. """ def __init__( self, key: str, *, - error: str = None, - info: 'DatabaseInformation' = None, + error: Optional[str] = None, + info: Optional['DatabaseInformation'] = None, ) -> None: """ Initialize a DbsInfoResult object. @@ -11395,23 +11396,24 @@ class DesignDocument: """ Schema for a design document. - :attr dict attachments: (optional) Schema for a map of attachment name to + :param dict attachments: (optional) Schema for a map of attachment name to attachment metadata. - :attr List[str] conflicts: (optional) Schema for a list of document revision + :param List[str] conflicts: (optional) Schema for a list of document revision identifiers. - :attr bool deleted: (optional) Deletion flag. Available if document was removed. - :attr List[str] deleted_conflicts: (optional) Schema for a list of document + :param bool deleted: (optional) Deletion flag. Available if document was + removed. + :param List[str] deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :attr str id: (optional) Document ID. - :attr str local_seq: (optional) Document's update sequence in current database. + :param str id: (optional) Document ID. + :param str local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. - :attr str rev: (optional) Schema for a document revision identifier. - :attr Revisions revisions: (optional) Schema for list of revision information. - :attr List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of + :param str rev: (optional) Schema for a document revision identifier. + :param Revisions revisions: (optional) Schema for list of revision information. + :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of objects with information about local revisions and their status. - :attr bool autoupdate: (optional) Indicates whether to automatically build + :param bool autoupdate: (optional) Indicates whether to automatically build indexes defined in this design document. - :attr dict filters: (optional) Schema for filter functions definition. This + :param dict filters: (optional) Schema for filter functions definition. This schema is a map where keys are the names of the filter functions and values are the function definition in string format. Filter function formats, or filters the changes feed that pass filter rules. The @@ -11450,12 +11452,12 @@ class DesignDocument: * `uuid` - string, generated UUID by a specified algorithm in the config file. Filter functions must return true if a document passed all the rules. - :attr dict indexes: (optional) Search (text) index function definitions. - :attr str language: (optional) Defines Query Server key to process design + :param dict indexes: (optional) Search (text) index function definitions. + :param str language: (optional) Defines Query Server key to process design document functions. - :attr DesignDocumentOptions options: (optional) Schema for design document + :param DesignDocumentOptions options: (optional) Schema for design document options. - :attr str validate_doc_update: (optional) Validate document update function can + :param str validate_doc_update: (optional) Validate document update function can be used to prevent invalid or unauthorized document update requests from being stored. Validation functions typically examine the structure of the new document to ensure that required fields are present and to verify that the requesting @@ -11478,7 +11480,7 @@ class DesignDocument: user writing the document (if present), see the `UserContext`. * `secObj` - Security Object, with lists of database security roles, see the `SecurityObject`. - :attr dict views: (optional) Schema for design document views. + :param dict views: (optional) Schema for design document views. """ # The set of defined properties for the class @@ -11487,22 +11489,22 @@ class DesignDocument: def __init__( self, *, - attachments: dict = None, - conflicts: List[str] = None, - deleted: bool = None, - deleted_conflicts: List[str] = None, - id: str = None, - local_seq: str = None, - rev: str = None, - revisions: 'Revisions' = None, - revs_info: List['DocumentRevisionStatus'] = None, - autoupdate: bool = None, - filters: dict = None, - indexes: dict = None, - language: str = None, - options: 'DesignDocumentOptions' = None, - validate_doc_update: str = None, - views: dict = None, + attachments: Optional[dict] = None, + conflicts: Optional[List[str]] = None, + deleted: Optional[bool] = None, + deleted_conflicts: Optional[List[str]] = None, + id: Optional[str] = None, + local_seq: Optional[str] = None, + rev: Optional[str] = None, + revisions: Optional['Revisions'] = None, + revs_info: Optional[List['DocumentRevisionStatus']] = None, + autoupdate: Optional[bool] = None, + filters: Optional[dict] = None, + indexes: Optional[dict] = None, + language: Optional[str] = None, + options: Optional['DesignDocumentOptions'] = None, + validate_doc_update: Optional[str] = None, + views: Optional[dict] = None, **kwargs, ) -> None: """ @@ -11769,8 +11771,8 @@ class DesignDocumentInformation: """ Schema for information about a design document. - :attr str name: name. - :attr DesignDocumentViewIndex view_index: View index information. + :param str name: name. + :param DesignDocumentViewIndex view_index: View index information. """ def __init__( @@ -11841,14 +11843,14 @@ class DesignDocumentOptions: """ Schema for design document options. - :attr bool partitioned: (optional) Whether this design document describes + :param bool partitioned: (optional) Whether this design document describes partitioned or global indexes. """ def __init__( self, *, - partitioned: bool = None, + partitioned: Optional[bool] = None, ) -> None: """ Initialize a DesignDocumentOptions object. @@ -11901,20 +11903,20 @@ class DesignDocumentViewIndex: """ View index information. - :attr List[str] collator_versions: List of collator versions. If there are + :param List[str] collator_versions: List of collator versions. If there are multiple entries this implies a libicu upgrade has occurred but compaction has not run yet. - :attr bool compact_running: Indicates whether a compaction routine is currently + :param bool compact_running: Indicates whether a compaction routine is currently running on the view. - :attr str language: Language for the defined views. - :attr str signature: MD5 signature of the views for the design document. - :attr ContentInformationSizes sizes: Schema for size information of content. - :attr bool updater_running: Indicates if the view is currently being updated. - :attr UpdatesPending updates_pending: Schema for an ability to tell if view is + :param str language: Language for the defined views. + :param str signature: MD5 signature of the views for the design document. + :param ContentInformationSizes sizes: Schema for size information of content. + :param bool updater_running: Indicates if the view is currently being updated. + :param UpdatesPending updates_pending: Schema for an ability to tell if view is up-to-date without querying it. - :attr int waiting_clients: Number of clients waiting on views from this design + :param int waiting_clients: Number of clients waiting on views from this design document. - :attr bool waiting_commit: Indicates if there are outstanding commits to the + :param bool waiting_commit: Indicates if there are outstanding commits to the underlying database that need to processed. """ @@ -12060,15 +12062,15 @@ class DesignDocumentViewsMapReduce: """ Schema for view functions definition. - :attr str map: JavaScript map function as a string. - :attr str reduce: (optional) JavaScript reduce function as a string. + :param str map: JavaScript map function as a string. + :param str reduce: (optional) JavaScript reduce function as a string. """ def __init__( self, map: str, *, - reduce: str = None, + reduce: Optional[str] = None, ) -> None: """ Initialize a DesignDocumentViewsMapReduce object. @@ -12128,13 +12130,13 @@ class DocsResultRow: """ Schema for a row of document information in a DocsResult. - :attr str caused_by: (optional) The cause of the error (if available). - :attr str error: (optional) The name of the error. - :attr str reason: (optional) The reason the error occurred (if available). - :attr Document doc: (optional) Schema for a document. - :attr str id: (optional) id. - :attr str key: Document ID. - :attr DocsResultRowValue value: (optional) Value of built-in `/_all_docs` style + :param str caused_by: (optional) The cause of the error (if available). + :param str error: (optional) The name of the error. + :param str reason: (optional) The reason the error occurred (if available). + :param Document doc: (optional) Schema for a document. + :param str id: (optional) id. + :param str key: Document ID. + :param DocsResultRowValue value: (optional) Value of built-in `/_all_docs` style view. """ @@ -12142,12 +12144,12 @@ def __init__( self, key: str, *, - caused_by: str = None, - error: str = None, - reason: str = None, - doc: 'Document' = None, - id: str = None, - value: 'DocsResultRowValue' = None, + caused_by: Optional[str] = None, + error: Optional[str] = None, + reason: Optional[str] = None, + doc: Optional['Document'] = None, + id: Optional[str] = None, + value: Optional['DocsResultRowValue'] = None, ) -> None: """ Initialize a DocsResultRow object. @@ -12244,16 +12246,16 @@ class DocsResultRowValue: """ Value of built-in `/_all_docs` style view. - :attr bool deleted: (optional) If `true` then the document is deleted. Not + :param bool deleted: (optional) If `true` then the document is deleted. Not present for undeleted documents. - :attr str rev: Schema for a document revision identifier. + :param str rev: Schema for a document revision identifier. """ def __init__( self, rev: str, *, - deleted: bool = None, + deleted: Optional[bool] = None, ) -> None: """ Initialize a DocsResultRowValue object. @@ -12314,19 +12316,20 @@ class Document: """ Schema for a document. - :attr dict attachments: (optional) Schema for a map of attachment name to + :param dict attachments: (optional) Schema for a map of attachment name to attachment metadata. - :attr List[str] conflicts: (optional) Schema for a list of document revision + :param List[str] conflicts: (optional) Schema for a list of document revision identifiers. - :attr bool deleted: (optional) Deletion flag. Available if document was removed. - :attr List[str] deleted_conflicts: (optional) Schema for a list of document + :param bool deleted: (optional) Deletion flag. Available if document was + removed. + :param List[str] deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :attr str id: (optional) Document ID. - :attr str local_seq: (optional) Document's update sequence in current database. + :param str id: (optional) Document ID. + :param str local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. - :attr str rev: (optional) Schema for a document revision identifier. - :attr Revisions revisions: (optional) Schema for list of revision information. - :attr List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of + :param str rev: (optional) Schema for a document revision identifier. + :param Revisions revisions: (optional) Schema for list of revision information. + :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of objects with information about local revisions and their status. """ @@ -12336,15 +12339,15 @@ class Document: def __init__( self, *, - attachments: dict = None, - conflicts: List[str] = None, - deleted: bool = None, - deleted_conflicts: List[str] = None, - id: str = None, - local_seq: str = None, - rev: str = None, - revisions: 'Revisions' = None, - revs_info: List['DocumentRevisionStatus'] = None, + attachments: Optional[dict] = None, + conflicts: Optional[List[str]] = None, + deleted: Optional[bool] = None, + deleted_conflicts: Optional[List[str]] = None, + id: Optional[str] = None, + local_seq: Optional[str] = None, + rev: Optional[str] = None, + revisions: Optional['Revisions'] = None, + revs_info: Optional[List['DocumentRevisionStatus']] = None, **kwargs, ) -> None: """ @@ -12490,23 +12493,23 @@ class DocumentResult: """ Schema for the result of a document modification. - :attr str id: Schema for a document ID. - :attr str rev: (optional) Schema for a document revision identifier. - :attr bool ok: (optional) ok. - :attr str caused_by: (optional) The cause of the error (if available). - :attr str error: (optional) The name of the error. - :attr str reason: (optional) The reason the error occurred (if available). + :param str id: Schema for a document ID. + :param str rev: (optional) Schema for a document revision identifier. + :param bool ok: (optional) ok. + :param str caused_by: (optional) The cause of the error (if available). + :param str error: (optional) The name of the error. + :param str reason: (optional) The reason the error occurred (if available). """ def __init__( self, id: str, *, - rev: str = None, - ok: bool = None, - caused_by: str = None, - error: str = None, - reason: str = None, + rev: Optional[str] = None, + ok: Optional[bool] = None, + caused_by: Optional[str] = None, + error: Optional[str] = None, + reason: Optional[str] = None, ) -> None: """ Initialize a DocumentResult object. @@ -12590,10 +12593,10 @@ class DocumentRevisionStatus: """ Schema for information about revisions and their status. - :attr str rev: Schema for a document revision identifier. - :attr str status: Status of the revision. May be one of: - `available`: Revision - is available for retrieving with rev query parameter - `missing`: Revision is - not available - `deleted`: Revision belongs to deleted document. + :param str rev: Schema for a document revision identifier. + :param str status: Status of the revision. May be one of: - `available`: + Revision is available for retrieving with rev query parameter - `missing`: + Revision is not available - `deleted`: Revision belongs to deleted document. """ def __init__( @@ -12676,8 +12679,8 @@ class DocumentShardInfo: """ Schema for document shard information. - :attr List[str] nodes: List of nodes serving a replica of the shard. - :attr str range: The shard range in which the document is stored. + :param List[str] nodes: List of nodes serving a replica of the shard. + :param str range: The shard range in which the document is stored. """ def __init__( @@ -12745,11 +12748,11 @@ class ExecutionStats: """ Schema for find query execution statistics. - :attr float execution_time_ms: Time to execute the query. - :attr int results_returned: Number of results returned. - :attr int total_docs_examined: Number of documents fetched from the index. - :attr int total_keys_examined: Number of rows scanned in the index. - :attr int total_quorum_docs_examined: Number of documents fetched from the + :param float execution_time_ms: Time to execute the query. + :param int results_returned: Number of results returned. + :param int total_docs_examined: Number of documents fetched from the index. + :param int total_keys_examined: Number of rows scanned in the index. + :param int total_quorum_docs_examined: Number of documents fetched from the primary index with the specified read quorum. """ @@ -12846,19 +12849,19 @@ class ExplainResult: """ Schema for information about the index used for a find query. - :attr bool covering: When `true`, the query is answered using the index only and - no documents are fetched. - :attr str dbname: Name of database. - :attr List[str] fields: Fields that were requested to be projected from the + :param bool covering: When `true`, the query is answered using the index only + and no documents are fetched. + :param str dbname: Name of database. + :param List[str] fields: Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned. - :attr IndexInformation index: Schema for information about an index. - :attr int limit: The used maximum number of results returned. - :attr ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying + :param IndexInformation index: Schema for information about an index. + :param int limit: The used maximum number of results returned. + :param ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying view. - :attr ExplainResultOpts opts: Options used for the request. - :attr object partitioned: (optional) Schema for any JSON type. - :attr dict selector: JSON object describing criteria used to select documents. + :param ExplainResultOpts opts: Options used for the request. + :param object partitioned: (optional) Schema for any JSON type. + :param dict selector: 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 other data. The selector object must: @@ -12888,7 +12891,7 @@ class ExplainResult: For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). - :attr int skip: Skip parameter used. + :param int skip: Skip parameter used. """ def __init__( @@ -12902,8 +12905,8 @@ def __init__( selector: dict, skip: int, *, - mrargs: 'ExplainResultMrArgs' = None, - partitioned: object = None, + mrargs: Optional['ExplainResultMrArgs'] = None, + partitioned: Optional[object] = None, ) -> None: """ Initialize a ExplainResult object. @@ -13068,38 +13071,38 @@ class ExplainResultMrArgs: """ Arguments passed to the underlying view. - :attr object conflicts: (optional) Schema for any JSON type. - :attr str direction: (optional) Direction parameter passed to the underlying + :param object conflicts: (optional) Schema for any JSON type. + :param str direction: (optional) Direction parameter passed to the underlying view. - :attr object end_key: (optional) Schema for any JSON type. - :attr bool include_docs: (optional) A parameter that specifies whether to + :param object end_key: (optional) Schema for any JSON type. + :param bool include_docs: (optional) A parameter that specifies whether to include the full content of the documents in the response in the underlying view. - :attr str partition: (optional) Partition parameter passed to the underlying + :param str partition: (optional) Partition parameter passed to the underlying view. - :attr bool reduce: (optional) A parameter that specifies returning only + :param bool reduce: (optional) A parameter that specifies returning only documents that match any of the specified keys in the underlying view. - :attr bool stable: (optional) A parameter that specifies whether the view + :param bool stable: (optional) A parameter that specifies whether the view results should be returned form a "stable" set of shards passed to the underlying view. - :attr object start_key: (optional) Schema for any JSON type. - :attr object update: (optional) Schema for any JSON type. - :attr str view_type: (optional) The type of the underlying view. + :param object start_key: (optional) Schema for any JSON type. + :param object update: (optional) Schema for any JSON type. + :param str view_type: (optional) The type of the underlying view. """ def __init__( self, *, - conflicts: object = None, - direction: str = None, - end_key: object = None, - include_docs: bool = None, - partition: str = None, - reduce: bool = None, - stable: bool = None, - start_key: object = None, - update: object = None, - view_type: str = None, + conflicts: Optional[object] = None, + direction: Optional[str] = None, + end_key: Optional[object] = None, + include_docs: Optional[bool] = None, + partition: Optional[str] = None, + reduce: Optional[bool] = None, + stable: Optional[bool] = None, + start_key: Optional[object] = None, + update: Optional[object] = None, + view_type: Optional[str] = None, ) -> None: """ Initialize a ExplainResultMrArgs object. @@ -13221,22 +13224,22 @@ class ExplainResultOpts: """ Options used for the request. - :attr str bookmark: Opaque bookmark token used when paginating results. - :attr bool conflicts: Conflicts used in the request query. - :attr bool execution_stats: Execution statistics used in the request query. - :attr List[str] fields: JSON array that uses the field syntax. Use this + :param str bookmark: Opaque bookmark token used when paginating results. + :param bool conflicts: Conflicts used in the request query. + :param bool execution_stats: Execution statistics used in the request query. + :param List[str] fields: JSON array that uses the field syntax. Use this parameter to specify which fields of a document must be returned. If it is omitted or empty, the entire document is returned. - :attr int limit: Limit used in the request query. - :attr str partition: On which database partition the request was used. If it was - not used on a database partition, it returns with `""`. - :attr int r: The read quorum that is needed for the result. - :attr int skip: Skip used in the request query. - :attr object sort: Schema for any JSON type. - :attr bool stable: Stable used in the request query. - :attr bool stale: Deprecated: Stale used in the request query. - :attr bool update: Update used in the request query. - :attr List[str] use_index: Use index used in the request query. + :param int limit: Limit used in the request query. + :param str partition: On which database partition the request was used. If it + was not used on a database partition, it returns with `""`. + :param int r: The read quorum that is needed for the result. + :param int skip: Skip used in the request query. + :param object sort: Schema for any JSON type. + :param bool stable: Stable used in the request query. + :param bool stale: Deprecated: Stale used in the request query. + :param bool update: Update used in the request query. + :param List[str] use_index: Use index used in the request query. """ def __init__( @@ -13407,11 +13410,11 @@ class FindResult: """ Schema for the result of a query find operation. - :attr str bookmark: Opaque bookmark token used when paginating results. - :attr List[Document] docs: Documents matching the selector. - :attr ExecutionStats execution_stats: (optional) Schema for find query execution - statistics. - :attr str warning: (optional) warning. + :param str bookmark: Opaque bookmark token used when paginating results. + :param List[Document] docs: Documents matching the selector. + :param ExecutionStats execution_stats: (optional) Schema for find query + execution statistics. + :param str warning: (optional) warning. """ def __init__( @@ -13419,8 +13422,8 @@ def __init__( bookmark: str, docs: List['Document'], *, - execution_stats: 'ExecutionStats' = None, - warning: str = None, + execution_stats: Optional['ExecutionStats'] = None, + warning: Optional[str] = None, ) -> None: """ Initialize a FindResult object. @@ -13507,25 +13510,25 @@ class IndexDefinition: * `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. - :attr Analyzer default_analyzer: (optional) Schema for a full text search + :param Analyzer default_analyzer: (optional) Schema for a full text search analyzer. - :attr IndexTextOperatorDefaultField default_field: (optional) Schema for the + :param IndexTextOperatorDefaultField default_field: (optional) Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator. - :attr List[IndexField] fields: (optional) List of field objects to index. + :param List[IndexField] fields: (optional) List of field objects to index. Nested fields are also allowed, e.g. `person.name`. For "json" type indexes each object is a mapping of field name to sort direction (asc or desc). For "text" type indexes each object has a `name` property of the field name and a `type` property of the field type (string, number, or boolean). - :attr bool index_array_lengths: (optional) Whether to scan every document for + :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. - :attr dict partial_filter_selector: (optional) JSON object describing criteria + :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 other data. The selector object must: @@ -13560,11 +13563,11 @@ class IndexDefinition: def __init__( self, *, - default_analyzer: 'Analyzer' = None, - default_field: 'IndexTextOperatorDefaultField' = None, - fields: List['IndexField'] = None, - index_array_lengths: bool = None, - partial_filter_selector: dict = None, + default_analyzer: Optional['Analyzer'] = None, + default_field: Optional['IndexTextOperatorDefaultField'] = None, + fields: Optional[List['IndexField']] = None, + index_array_lengths: Optional[bool] = None, + partial_filter_selector: Optional[dict] = None, ) -> None: """ Initialize a IndexDefinition object. @@ -13699,8 +13702,8 @@ class IndexField: """ Schema for indexed fields for use with declarative JSON query. - :attr str name: (optional) Name of the field. - :attr str type: (optional) The type of the named field. + :param str name: (optional) Name of the field. + :param str type: (optional) The type of the named field. """ # The set of defined properties for the class @@ -13709,8 +13712,8 @@ class IndexField: def __init__( self, *, - name: str = None, - type: str = None, + name: Optional[str] = None, + type: Optional[str] = None, **kwargs, ) -> None: """ @@ -13802,16 +13805,16 @@ class IndexInformation: """ Schema for information about an index. - :attr str ddoc: Design document ID including a `_design/` prefix. - :attr IndexDefinition def_: Schema for a `json` or `text` query index + :param str ddoc: Design document ID including a `_design/` prefix. + :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. - :attr str name: Index name. - :attr bool partitioned: (optional) Indicates if index is partitioned. - :attr str type: Schema for the type of an index. + :param str name: Index name. + :param bool partitioned: (optional) Indicates if index is partitioned. + :param str type: Schema for the type of an index. """ def __init__( @@ -13821,7 +13824,7 @@ def __init__( name: str, type: str, *, - partitioned: bool = None, + partitioned: Optional[bool] = None, ) -> None: """ Initialize a IndexInformation object. @@ -13923,9 +13926,9 @@ class IndexResult: """ Schema for the result of creating an index. - :attr str id: Id of the design document the index was created in. - :attr str name: Name of the index created. - :attr str result: Flag to show whether the index was created or one already + :param str id: Id of the design document the index was created in. + :param str name: Name of the index created. + :param str result: Flag to show whether the index was created or one already exists. """ @@ -14014,15 +14017,15 @@ class IndexTextOperatorDefaultField: Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator. - :attr Analyzer analyzer: (optional) Schema for a full text search analyzer. - :attr bool enabled: (optional) Whether or not the default_field is enabled. + :param Analyzer analyzer: (optional) Schema for a full text search analyzer. + :param bool enabled: (optional) Whether or not the default_field is enabled. """ def __init__( self, *, - analyzer: 'Analyzer' = None, - enabled: bool = None, + analyzer: Optional['Analyzer'] = None, + enabled: Optional[bool] = None, ) -> None: """ Initialize a IndexTextOperatorDefaultField object. @@ -14085,8 +14088,8 @@ class IndexesInformation: """ Schema for information about the indexes in a database. - :attr int total_rows: Number of total rows. - :attr List[IndexInformation] indexes: Indexes. + :param int total_rows: Number of total rows. + :param List[IndexInformation] indexes: Indexes. """ def __init__( @@ -14160,9 +14163,9 @@ class MembershipInformation: """ Schema for information about known nodes and cluster membership. - :attr List[str] all_nodes: List of nodes this node knows about, including the + :param List[str] all_nodes: List of nodes this node knows about, including the ones that are part of the cluster. - :attr List[str] cluster_nodes: All cluster nodes. + :param List[str] cluster_nodes: All cluster nodes. """ def __init__( @@ -14231,13 +14234,13 @@ class Ok: """ Schema for an OK result. - :attr bool ok: (optional) ok. + :param bool ok: (optional) ok. """ def __init__( self, *, - ok: bool = None, + ok: Optional[bool] = None, ) -> None: """ Initialize a Ok object. @@ -14289,14 +14292,14 @@ class PartitionInformation: """ Schema for information about a database partition. - :attr str db_name: The name of the database. - :attr int doc_count: A count of the documents in the specified database + :param str db_name: The name of the database. + :param int doc_count: A count of the documents in the specified database partition. - :attr int doc_del_count: Number of deleted documents. - :attr str partition: The name of the partition in the database. - :attr PartitionInformationIndexes partitioned_indexes: (optional) Schema for + :param int doc_del_count: Number of deleted documents. + :param str partition: The name of the partition in the database. + :param PartitionInformationIndexes partitioned_indexes: (optional) Schema for information about the partition index count and limit in a database. - :attr PartitionInformationSizes sizes: The size of active and external data, in + :param PartitionInformationSizes sizes: The size of active and external data, in bytes. """ @@ -14308,7 +14311,7 @@ def __init__( partition: str, sizes: 'PartitionInformationSizes', *, - partitioned_indexes: 'PartitionInformationIndexes' = None, + partitioned_indexes: Optional['PartitionInformationIndexes'] = None, ) -> None: """ Initialize a PartitionInformation object. @@ -14409,18 +14412,18 @@ class PartitionInformationIndexes: """ Schema for information about the partition index count and limit in a database. - :attr int count: (optional) Total count of the partitioned indexes. - :attr PartitionInformationIndexesIndexes indexes: (optional) The count breakdown - of partitioned indexes. - :attr int limit: (optional) The partitioned index limit. + :param int count: (optional) Total count of the partitioned indexes. + :param PartitionInformationIndexesIndexes indexes: (optional) The count + breakdown of partitioned indexes. + :param int limit: (optional) The partitioned index limit. """ def __init__( self, *, - count: int = None, - indexes: 'PartitionInformationIndexesIndexes' = None, - limit: int = None, + count: Optional[int] = None, + indexes: Optional['PartitionInformationIndexesIndexes'] = None, + limit: Optional[int] = None, ) -> None: """ Initialize a PartitionInformationIndexes object. @@ -14488,15 +14491,15 @@ class PartitionInformationIndexesIndexes: """ The count breakdown of partitioned indexes. - :attr int search: (optional) Number of partitioned search indexes. - :attr int view: (optional) Number of partitioned view indexes. + :param int search: (optional) Number of partitioned search indexes. + :param int view: (optional) Number of partitioned view indexes. """ def __init__( self, *, - search: int = None, - view: int = None, + search: Optional[int] = None, + view: Optional[int] = None, ) -> None: """ Initialize a PartitionInformationIndexesIndexes object. @@ -14554,17 +14557,17 @@ class PartitionInformationSizes: """ The size of active and external data, in bytes. - :attr int active: (optional) The size of live data inside the database, in + :param int active: (optional) The size of live data inside the database, in bytes. - :attr int external: (optional) The uncompressed size of database contents in + :param int external: (optional) The uncompressed size of database contents in bytes. """ def __init__( self, *, - active: int = None, - external: int = None, + active: Optional[int] = None, + external: Optional[int] = None, ) -> None: """ Initialize a PartitionInformationSizes object. @@ -14624,15 +14627,15 @@ class PartitionedIndexesDetailedInformation: """ Number of partitioned indexes by type. - :attr int search: (optional) Number of partitioned indexes of search type. - :attr int view: (optional) Number of partitioned indexes of view type. + :param int search: (optional) Number of partitioned indexes of search type. + :param int view: (optional) Number of partitioned indexes of view type. """ def __init__( self, *, - search: int = None, - view: int = None, + search: Optional[int] = None, + view: Optional[int] = None, ) -> None: """ Initialize a PartitionedIndexesDetailedInformation object. @@ -14690,19 +14693,20 @@ class PartitionedIndexesInformation: """ Information about database's partitioned indexes. - :attr int count: (optional) Total number of partitioned indexes in the database. - :attr PartitionedIndexesDetailedInformation indexes: (optional) Number of - partitioned indexes by type. - :attr int limit: (optional) Maximum allowed number of partitioned indexes in the + :param int count: (optional) Total number of partitioned indexes in the database. + :param PartitionedIndexesDetailedInformation indexes: (optional) Number of + partitioned indexes by type. + :param int limit: (optional) Maximum allowed number of partitioned indexes in + the database. """ def __init__( self, *, - count: int = None, - indexes: 'PartitionedIndexesDetailedInformation' = None, - limit: int = None, + count: Optional[int] = None, + indexes: Optional['PartitionedIndexesDetailedInformation'] = None, + limit: Optional[int] = None, ) -> None: """ Initialize a PartitionedIndexesInformation object. @@ -14772,21 +14776,21 @@ class ReplicationCreateTargetParameters: """ Request parameters to use during target database creation. - :attr int n: (optional) Schema for the number of replicas of a database in a + :param int n: (optional) Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it cannot be changed by the user. - :attr bool partitioned: (optional) Parameter to specify whether to enable + :param bool partitioned: (optional) Parameter to specify whether to enable database partitions when creating the target database. - :attr int q: (optional) Schema for the number of shards in a database. Each + :param int q: (optional) Schema for the number of shards in a database. Each shard is a partition of the hash value range. """ def __init__( self, *, - n: int = None, - partitioned: bool = None, - q: int = None, + n: Optional[int] = None, + partitioned: Optional[bool] = None, + q: Optional[int] = None, ) -> None: """ Initialize a ReplicationCreateTargetParameters object. @@ -14854,18 +14858,18 @@ class ReplicationDatabase: """ Schema for a replication source or target database. - :attr ReplicationDatabaseAuth auth: (optional) Schema for replication source or + :param ReplicationDatabaseAuth auth: (optional) Schema for replication source or target database authentication. - :attr dict headers_: (optional) Replication request headers. - :attr str url: Replication database URL. + :param dict headers_: (optional) Replication request headers. + :param str url: Replication database URL. """ def __init__( self, url: str, *, - auth: 'ReplicationDatabaseAuth' = None, - headers_: dict = None, + auth: Optional['ReplicationDatabaseAuth'] = None, + headers_: Optional[dict] = None, ) -> None: """ Initialize a ReplicationDatabase object. @@ -14935,17 +14939,17 @@ class ReplicationDatabaseAuth: """ Schema for replication source or target database authentication. - :attr ReplicationDatabaseAuthBasic basic: (optional) Schema for basic + :param ReplicationDatabaseAuthBasic basic: (optional) Schema for basic authentication of replication source or target database. - :attr ReplicationDatabaseAuthIam iam: (optional) Schema for an IAM API key for + :param ReplicationDatabaseAuthIam iam: (optional) Schema for an IAM API key for replication database authentication. """ def __init__( self, *, - basic: 'ReplicationDatabaseAuthBasic' = None, - iam: 'ReplicationDatabaseAuthIam' = None, + basic: Optional['ReplicationDatabaseAuthBasic'] = None, + iam: Optional['ReplicationDatabaseAuthIam'] = None, ) -> None: """ Initialize a ReplicationDatabaseAuth object. @@ -15011,8 +15015,8 @@ class ReplicationDatabaseAuthBasic: """ Schema for basic authentication of replication source or target database. - :attr str password: The password associated with the username. - :attr str username: The username. + :param str password: The password associated with the username. + :param str username: The username. """ def __init__( @@ -15080,7 +15084,7 @@ class ReplicationDatabaseAuthIam: """ Schema for an IAM API key for replication database authentication. - :attr str api_key: IAM API key. + :param str api_key: IAM API key. """ def __init__( @@ -15140,45 +15144,46 @@ class ReplicationDocument: Schema for a replication document. Note that `selector`, `doc_ids`, and `filter` are incompatible with each other. - :attr dict attachments: (optional) Schema for a map of attachment name to + :param dict attachments: (optional) Schema for a map of attachment name to attachment metadata. - :attr List[str] conflicts: (optional) Schema for a list of document revision + :param List[str] conflicts: (optional) Schema for a list of document revision identifiers. - :attr bool deleted: (optional) Deletion flag. Available if document was removed. - :attr List[str] deleted_conflicts: (optional) Schema for a list of document + :param bool deleted: (optional) Deletion flag. Available if document was + removed. + :param List[str] deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :attr str id: (optional) Document ID. - :attr str local_seq: (optional) Document's update sequence in current database. + :param str id: (optional) Document ID. + :param str local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. - :attr str rev: (optional) Schema for a document revision identifier. - :attr Revisions revisions: (optional) Schema for list of revision information. - :attr List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of + :param str rev: (optional) Schema for a document revision identifier. + :param Revisions revisions: (optional) Schema for list of revision information. + :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of objects with information about local revisions and their status. - :attr bool cancel: (optional) Cancels the replication. - :attr int checkpoint_interval: (optional) Defines replication checkpoint + :param bool cancel: (optional) Cancels the replication. + :param int checkpoint_interval: (optional) Defines replication checkpoint interval in milliseconds. - :attr int connection_timeout: (optional) HTTP connection timeout per + :param int connection_timeout: (optional) HTTP connection timeout per replication. Even for very fast/reliable networks it might need to be increased if a remote database is too busy. - :attr bool continuous: (optional) Configure the replication to be continuous. - :attr bool create_target: (optional) Creates the target database. Requires + :param bool continuous: (optional) Configure the replication to be continuous. + :param bool create_target: (optional) Creates the target database. Requires administrator privileges on target server. - :attr ReplicationCreateTargetParameters create_target_params: (optional) Request - parameters to use during target database creation. - :attr List[str] doc_ids: (optional) Schema for a list of document IDs. - :attr str filter: (optional) The name of a filter function which is defined in a - design document in the source database in {ddoc_id}/{filter} format. It + :param ReplicationCreateTargetParameters create_target_params: (optional) + Request parameters to use during target database creation. + :param List[str] doc_ids: (optional) Schema for a list of document IDs. + :param str filter: (optional) The name of a filter function which is defined in + a design document in the source database in {ddoc_id}/{filter} format. It determines which documents get replicated. Using the selector option provides performance benefits when compared with using the filter option. Use the selector option when possible. - :attr int http_connections: (optional) Maximum number of HTTP connections per + :param int http_connections: (optional) Maximum number of HTTP connections per replication. - :attr dict query_params: (optional) Schema for a map of string key value pairs, + :param dict query_params: (optional) Schema for a map of string key value pairs, such as query parameters. - :attr int retries_per_request: (optional) Number of times a replication request + :param int retries_per_request: (optional) Number of times a replication request is retried. The requests are retried with a doubling exponential backoff starting at 0.25 seconds, with a cap at 5 minutes. - :attr dict selector: (optional) JSON object describing criteria used to select + :param dict 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 other data. The selector object must: @@ -15208,40 +15213,41 @@ class ReplicationDocument: For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). - :attr str since_seq: (optional) Start the replication at a specific sequence + :param str since_seq: (optional) Start the replication at a specific sequence value. - :attr str socket_options: (optional) Replication socket options. - :attr ReplicationDatabase source: Schema for a replication source or target + :param str socket_options: (optional) Replication socket options. + :param ReplicationDatabase source: Schema for a replication source or target database. - :attr str source_proxy: (optional) Deprecated: This setting is forbidden in IBM + :param str source_proxy: (optional) Deprecated: This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators. Address of a (http or socks5 protocol) proxy server through which replication with the source database should occur. - :attr ReplicationDatabase target: Schema for a replication source or target + :param ReplicationDatabase target: Schema for a replication source or target database. - :attr str target_proxy: (optional) Deprecated: This setting is forbidden in IBM + :param str target_proxy: (optional) Deprecated: This setting is forbidden in IBM Cloudant replication documents. This setting may be used with alternative replication mediators. Address of a (http or socks5 protocol) proxy server through which replication with the target database should occur. - :attr bool use_bulk_get: (optional) Specify whether to use _bulk_get for + :param bool use_bulk_get: (optional) Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured default will be used. - :attr bool use_checkpoints: (optional) Specify if checkpoints should be saved + :param bool use_checkpoints: (optional) Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be efficiently resumed. - :attr UserContext user_ctx: (optional) Schema for the user context of a session. - :attr bool winning_revs_only: (optional) Replicate only the winning revisions. + :param UserContext user_ctx: (optional) Schema for the user context of a + session. + :param bool winning_revs_only: (optional) Replicate only the winning revisions. Replication with this mode discards conflicting revisions. Replication IDs and checkpoints generated by this mode are different to those generated by default, so it is possible to first replicate the winning revisions then later backfill remaining revisions with a regular replication job. - :attr int worker_batch_size: (optional) Controls how many documents are + :param int worker_batch_size: (optional) Controls how many documents are processed. After each batch a checkpoint is written so this controls how frequently checkpointing occurs. - :attr int worker_processes: (optional) Controls how many separate processes will - read from the changes manager and write to the target. A higher number can + :param int worker_processes: (optional) Controls how many separate processes + will read from the changes manager and write to the target. A higher number can improve throughput. """ @@ -15253,37 +15259,37 @@ def __init__( source: 'ReplicationDatabase', target: 'ReplicationDatabase', *, - attachments: dict = None, - conflicts: List[str] = None, - deleted: bool = None, - deleted_conflicts: List[str] = None, - id: str = None, - local_seq: str = None, - rev: str = None, - revisions: 'Revisions' = None, - revs_info: List['DocumentRevisionStatus'] = None, - cancel: bool = None, - checkpoint_interval: int = None, - connection_timeout: int = None, - continuous: bool = None, - create_target: bool = None, - create_target_params: 'ReplicationCreateTargetParameters' = None, - doc_ids: List[str] = None, - filter: str = None, - http_connections: int = None, - query_params: dict = None, - retries_per_request: int = None, - selector: dict = None, - since_seq: str = None, - socket_options: str = None, - source_proxy: str = None, - target_proxy: str = None, - use_bulk_get: bool = None, - use_checkpoints: bool = None, - user_ctx: 'UserContext' = None, - winning_revs_only: bool = None, - worker_batch_size: int = None, - worker_processes: int = None, + attachments: Optional[dict] = None, + conflicts: Optional[List[str]] = None, + deleted: Optional[bool] = None, + deleted_conflicts: Optional[List[str]] = None, + id: Optional[str] = None, + local_seq: Optional[str] = None, + rev: Optional[str] = None, + revisions: Optional['Revisions'] = None, + revs_info: Optional[List['DocumentRevisionStatus']] = None, + cancel: Optional[bool] = None, + checkpoint_interval: Optional[int] = None, + connection_timeout: Optional[int] = None, + continuous: Optional[bool] = None, + create_target: Optional[bool] = None, + create_target_params: Optional['ReplicationCreateTargetParameters'] = None, + doc_ids: Optional[List[str]] = None, + filter: Optional[str] = None, + http_connections: Optional[int] = None, + query_params: Optional[dict] = None, + retries_per_request: Optional[int] = None, + selector: Optional[dict] = None, + since_seq: Optional[str] = None, + socket_options: Optional[str] = None, + source_proxy: Optional[str] = None, + target_proxy: Optional[str] = None, + use_bulk_get: Optional[bool] = None, + use_checkpoints: Optional[bool] = None, + user_ctx: Optional['UserContext'] = None, + winning_revs_only: Optional[bool] = None, + worker_batch_size: Optional[int] = None, + worker_processes: Optional[int] = None, **kwargs, ) -> None: """ @@ -15658,9 +15664,9 @@ class Revisions: """ Schema for list of revision information. - :attr List[str] ids: Array of valid revision IDs, in reverse order (latest + :param List[str] ids: Array of valid revision IDs, in reverse order (latest first). - :attr int start: Prefix number for the latest revision. + :param int start: Prefix number for the latest revision. """ def __init__( @@ -15729,16 +15735,16 @@ class RevsDiff: """ Schema for information about missing revs and possible ancestors. - :attr List[str] missing: (optional) List of missing revisions. - :attr List[str] possible_ancestors: (optional) List of possible ancestor + :param List[str] missing: (optional) List of missing revisions. + :param List[str] possible_ancestors: (optional) List of possible ancestor revisions. """ def __init__( self, *, - missing: List[str] = None, - possible_ancestors: List[str] = None, + missing: Optional[List[str]] = None, + possible_ancestors: Optional[List[str]] = None, ) -> None: """ Initialize a RevsDiff object. @@ -15797,8 +15803,8 @@ class SchedulerDocsResult: """ Schema for a listing of replication scheduler documents. - :attr int total_rows: Number of total rows. - :attr List[SchedulerDocument] docs: Array of replication scheduler doc objects. + :param int total_rows: Number of total rows. + :param List[SchedulerDocument] docs: Array of replication scheduler doc objects. """ def __init__( @@ -15873,28 +15879,28 @@ class SchedulerDocument: """ Schema for a replication scheduler document. - :attr str database: Database where replication document came from. - :attr str doc_id: Replication document ID. - :attr int error_count: Consecutive errors count. Indicates how many times in a + :param str database: Database where replication document came from. + :param str doc_id: Replication document ID. + :param int error_count: Consecutive errors count. Indicates how many times in a row this replication has crashed. Replication will be retried with an exponential backoff based on this number. As soon as the replication succeeds this count is reset to 0. To can be used to get an idea why a particular replication is not making progress. - :attr str id: Replication ID, or null if state is completed or failed. - :attr SchedulerInfo info: Schema for scheduler document information. A JSON + :param str id: Replication ID, or null if state is completed or failed. + :param SchedulerInfo info: Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value. - :attr datetime last_updated: Timestamp of last state update. - :attr str node: (optional) Cluster node where the job is running. - :attr str source: (optional) Replication source. - :attr str source_proxy: (optional) Deprecated: Forbidden in IBM Cloudant + :param datetime last_updated: Timestamp of last state update. + :param str node: (optional) Cluster node where the job is running. + :param str source: (optional) Replication source. + :param str source_proxy: (optional) Deprecated: Forbidden in IBM Cloudant mediated replications. Address of the (http or socks5 protocol) proxy server through which replication with the source database occurs. - :attr datetime start_time: Timestamp of when the replication was started. - :attr str state: Schema for replication state. - :attr str target: (optional) Replication target. - :attr str target_proxy: (optional) Deprecated: Forbidden in IBM Cloudant + :param datetime start_time: Timestamp of when the replication was started. + :param str state: Schema for replication state. + :param str target: (optional) Replication target. + :param str target_proxy: (optional) Deprecated: Forbidden in IBM Cloudant mediated replications. Address of the (http or socks5 protocol) proxy server through which replication with the target database occurs. @@ -15911,11 +15917,11 @@ def __init__( start_time: datetime, state: str, *, - node: str = None, - source: str = None, - source_proxy: str = None, - target: str = None, - target_proxy: str = None, + node: Optional[str] = None, + source: Optional[str] = None, + source_proxy: Optional[str] = None, + target: Optional[str] = None, + target_proxy: Optional[str] = None, ) -> None: """ Initialize a SchedulerDocument object. @@ -16086,39 +16092,39 @@ class SchedulerInfo: information about the state. For error states this will contain an error field and string value. - :attr int changes_pending: (optional) The count of changes not yet replicated. - :attr str checkpointed_source_seq: (optional) The source sequence id which was + :param int changes_pending: (optional) The count of changes not yet replicated. + :param str checkpointed_source_seq: (optional) The source sequence id which was last successfully replicated. - :attr int doc_write_failures: (optional) The count of docs which failed to be + :param int doc_write_failures: (optional) The count of docs which failed to be written to the target. - :attr int docs_read: (optional) The count of docs which have been read from the + :param int docs_read: (optional) The count of docs which have been read from the source. - :attr int docs_written: (optional) The count of docs which have been written to + :param int docs_written: (optional) The count of docs which have been written to the target. - :attr str error: (optional) Replication error message. - :attr int missing_revisions_found: (optional) The count of revisions which were + :param str error: (optional) Replication error message. + :param int missing_revisions_found: (optional) The count of revisions which were found on the source, but missing from the target. - :attr int revisions_checked: (optional) The count of revisions which have been + :param int revisions_checked: (optional) The count of revisions which have been checked since this replication began. - :attr str source_seq: (optional) The last sequence number obtained from the + :param str source_seq: (optional) The last sequence number obtained from the source database changes feed. - :attr str through_seq: (optional) The last sequence number processed by the + :param str through_seq: (optional) The last sequence number processed by the replicator. """ def __init__( self, *, - changes_pending: int = None, - checkpointed_source_seq: str = None, - doc_write_failures: int = None, - docs_read: int = None, - docs_written: int = None, - error: str = None, - missing_revisions_found: int = None, - revisions_checked: int = None, - source_seq: str = None, - through_seq: str = None, + changes_pending: Optional[int] = None, + checkpointed_source_seq: Optional[str] = None, + doc_write_failures: Optional[int] = None, + docs_read: Optional[int] = None, + docs_written: Optional[int] = None, + error: Optional[str] = None, + missing_revisions_found: Optional[int] = None, + revisions_checked: Optional[int] = None, + source_seq: Optional[str] = None, + through_seq: Optional[str] = None, ) -> None: """ Initialize a SchedulerInfo object. @@ -16233,20 +16239,20 @@ class SchedulerJob: """ Schema for a replication scheduler job. - :attr str database: Replication document database. - :attr str doc_id: Replication document ID. - :attr List[SchedulerJobEvent] history: Timestamped history of events as a list + :param str database: Replication document database. + :param str doc_id: Replication document ID. + :param List[SchedulerJobEvent] history: Timestamped history of events as a list of objects. - :attr str id: Schema for a replication job id. - :attr SchedulerInfo info: Schema for scheduler document information. A JSON + :param str id: Schema for a replication job id. + :param SchedulerInfo info: Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value. - :attr str node: Cluster node where the job is running. - :attr str pid: Replication process ID. - :attr str source: Replication source. - :attr datetime start_time: Timestamp of when the replication was started. - :attr str target: Replication target. - :attr str user: Name of user running replication. + :param str node: Cluster node where the job is running. + :param str pid: Replication process ID. + :param str source: Replication source. + :param datetime start_time: Timestamp of when the replication was started. + :param str target: Replication target. + :param str user: Name of user running replication. """ def __init__( @@ -16407,9 +16413,9 @@ class SchedulerJobEvent: """ Schema for a replication scheduler job event. - :attr str reason: (optional) Reason for current state of event. - :attr datetime timestamp: Timestamp of the event. - :attr str type: Type of the event. + :param str reason: (optional) Reason for current state of event. + :param datetime timestamp: Timestamp of the event. + :param str type: Type of the event. """ def __init__( @@ -16417,7 +16423,7 @@ def __init__( timestamp: datetime, type: str, *, - reason: str = None, + reason: Optional[str] = None, ) -> None: """ Initialize a SchedulerJobEvent object. @@ -16485,8 +16491,8 @@ class SchedulerJobsResult: """ Schema for a listing of replication scheduler jobs. - :attr int total_rows: Number of total rows. - :attr List[SchedulerJob] jobs: Array of replication job objects. + :param int total_rows: Number of total rows. + :param List[SchedulerJob] jobs: Array of replication job objects. """ def __init__( @@ -16560,7 +16566,7 @@ class SearchAnalyzeResult: """ Schema for the output of testing search analyzer tokenization. - :attr List[str] tokens: tokens. + :param List[str] tokens: tokens. """ def __init__( @@ -16619,9 +16625,9 @@ class SearchIndexDefinition: """ Schema for a search index definition. - :attr AnalyzerConfiguration analyzer: (optional) Schema for a search analyzer + :param AnalyzerConfiguration analyzer: (optional) Schema for a search analyzer configuration. - :attr str index: String form of a JavaScript function that is called for each + :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 data. The index function takes 2, or optionally 3, parameters. @@ -16645,7 +16651,7 @@ def __init__( self, index: str, *, - analyzer: 'AnalyzerConfiguration' = None, + analyzer: Optional['AnalyzerConfiguration'] = None, ) -> None: """ Initialize a SearchIndexDefinition object. @@ -16727,12 +16733,12 @@ class SearchIndexInfo: """ Schema for metadata information about a search index. - :attr int committed_seq: The committed sequence identifier. - :attr int disk_size: The size of the search index on disk. - :attr int doc_count: The count of the number of indexed documents. - :attr int doc_del_count: The number of deleted documents. - :attr int pending_seq: The pending sequence identifier. - :attr str signature: Unique signature of the search index. + :param int committed_seq: The committed sequence identifier. + :param int disk_size: The size of the search index on disk. + :param int doc_count: The count of the number of indexed documents. + :param int doc_del_count: The number of deleted documents. + :param int pending_seq: The pending sequence identifier. + :param str signature: Unique signature of the search index. """ def __init__( @@ -16836,9 +16842,9 @@ class SearchInfoResult: """ Schema for search index information. - :attr str name: The name of the search index prefixed by the design document ID + :param str name: The name of the search index prefixed by the design document ID where the index is stored. - :attr SearchIndexInfo search_index: Schema for metadata information about a + :param SearchIndexInfo search_index: Schema for metadata information about a search index. """ @@ -16912,17 +16918,17 @@ class SearchResult: """ Schema for the result of a query search operation. - :attr int total_rows: Number of total rows. - :attr str bookmark: (optional) Opaque bookmark token used when paginating + :param int total_rows: Number of total rows. + :param str bookmark: (optional) Opaque bookmark token used when paginating results. - :attr str by: (optional) Grouped search matches. - :attr dict counts: (optional) The counts facet syntax returns the number of + :param str by: (optional) Grouped search matches. + :param dict counts: (optional) The counts facet syntax returns the number of query results for each unique value of each named field. - :attr dict ranges: (optional) The range facet syntax reuses the standard Lucene + :param dict ranges: (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. - :attr List[SearchResultRow] rows: (optional) Array of row objects. - :attr List[SearchResultProperties] groups: (optional) Array of grouped search + :param List[SearchResultRow] rows: (optional) Array of row objects. + :param List[SearchResultProperties] groups: (optional) Array of grouped search matches. """ @@ -16930,12 +16936,12 @@ def __init__( self, total_rows: int, *, - bookmark: str = None, - by: str = None, - counts: dict = None, - ranges: dict = None, - rows: List['SearchResultRow'] = None, - groups: List['SearchResultProperties'] = None, + bookmark: Optional[str] = None, + by: Optional[str] = None, + counts: Optional[dict] = None, + ranges: Optional[dict] = None, + rows: Optional[List['SearchResultRow']] = None, + groups: Optional[List['SearchResultProperties']] = None, ) -> None: """ Initialize a SearchResult object. @@ -17042,27 +17048,27 @@ class SearchResultProperties: """ Schema for the result of a query search operation. - :attr int total_rows: Number of total rows. - :attr str bookmark: (optional) Opaque bookmark token used when paginating + :param int total_rows: Number of total rows. + :param str bookmark: (optional) Opaque bookmark token used when paginating results. - :attr str by: (optional) Grouped search matches. - :attr dict counts: (optional) The counts facet syntax returns the number of + :param str by: (optional) Grouped search matches. + :param dict counts: (optional) The counts facet syntax returns the number of query results for each unique value of each named field. - :attr dict ranges: (optional) The range facet syntax reuses the standard Lucene + :param dict ranges: (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. - :attr List[SearchResultRow] rows: (optional) Array of row objects. + :param List[SearchResultRow] rows: (optional) Array of row objects. """ def __init__( self, total_rows: int, *, - bookmark: str = None, - by: str = None, - counts: dict = None, - ranges: dict = None, - rows: List['SearchResultRow'] = None, + bookmark: Optional[str] = None, + by: Optional[str] = None, + counts: Optional[dict] = None, + ranges: Optional[dict] = None, + rows: Optional[List['SearchResultRow']] = None, ) -> None: """ Initialize a SearchResultProperties object. @@ -17156,12 +17162,12 @@ class SearchResultRow: """ Schema for a row of the result of a query search operation. - :attr Document doc: (optional) Schema for a document. - :attr dict fields: Schema for the fields returned by a query search operation, a - map of field name to value. - :attr dict highlights: (optional) Returns the context in which a search term was - mentioned so that you can display more emphasized results to a user. - :attr str id: Schema for a document ID. + :param Document doc: (optional) Schema for a document. + :param dict fields: Schema for the fields returned by a query search operation, + a map of field name to value. + :param dict highlights: (optional) Returns the context in which a search term + was mentioned so that you can display more emphasized results to a user. + :param str id: Schema for a document ID. """ def __init__( @@ -17169,8 +17175,8 @@ def __init__( fields: dict, id: str, *, - doc: 'Document' = None, - highlights: dict = None, + doc: Optional['Document'] = None, + highlights: Optional[dict] = None, ) -> None: """ Initialize a SearchResultRow object. @@ -17250,23 +17256,23 @@ class Security: """ Schema for a security document. - :attr SecurityObject admins: (optional) Schema for names and roles to map to a + :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :attr SecurityObject members: (optional) Schema for names and roles to map to a + :param SecurityObject members: (optional) Schema for names and roles to map to a database permission. - :attr dict cloudant: (optional) Database permissions for Cloudant users and/or + :param dict cloudant: (optional) Database permissions for Cloudant users and/or API keys. - :attr bool couchdb_auth_only: (optional) Manage permissions using the `_users` + :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. """ def __init__( self, *, - admins: 'SecurityObject' = None, - members: 'SecurityObject' = None, - cloudant: dict = None, - couchdb_auth_only: bool = None, + admins: Optional['SecurityObject'] = None, + members: Optional['SecurityObject'] = None, + cloudant: Optional[dict] = None, + couchdb_auth_only: Optional[bool] = None, ) -> None: """ Initialize a Security object. @@ -17361,15 +17367,15 @@ class SecurityObject: """ Schema for names and roles to map to a database permission. - :attr List[str] names: (optional) List of usernames. - :attr List[str] roles: (optional) List of roles. + :param List[str] names: (optional) List of usernames. + :param List[str] roles: (optional) List of roles. """ def __init__( self, *, - names: List[str] = None, - roles: List[str] = None, + names: Optional[List[str]] = None, + roles: Optional[List[str]] = None, ) -> None: """ Initialize a SecurityObject object. @@ -17427,11 +17433,11 @@ class ServerInformation: """ Schema for information about the server instance. - :attr str couchdb: Welcome message. - :attr List[str] features: List of enabled optional features. - :attr ServerVendor vendor: Schema for server vendor information. - :attr str version: Apache CouchDB version. - :attr List[str] features_flags: List of feature flags. + :param str couchdb: Welcome message. + :param List[str] features: List of enabled optional features. + :param ServerVendor vendor: Schema for server vendor information. + :param str version: Apache CouchDB version. + :param List[str] features_flags: List of feature flags. """ def __init__( @@ -17529,17 +17535,17 @@ class ServerVendor: """ Schema for server vendor information. - :attr str name: Vendor name. - :attr str variant: (optional) Vendor variant. - :attr str version: (optional) Vendor version. + :param str name: Vendor name. + :param str variant: (optional) Vendor variant. + :param str version: (optional) Vendor version. """ def __init__( self, name: str, *, - variant: str = None, - version: str = None, + variant: Optional[str] = None, + version: Optional[str] = None, ) -> None: """ Initialize a ServerVendor object. @@ -17605,17 +17611,17 @@ class SessionAuthentication: """ Schema for session authentication information. - :attr str authenticated: (optional) authenticated. - :attr str authentication_db: (optional) authentication_db. - :attr List[str] authentication_handlers: authentication_handlers. + :param str authenticated: (optional) authenticated. + :param str authentication_db: (optional) authentication_db. + :param List[str] authentication_handlers: authentication_handlers. """ def __init__( self, authentication_handlers: List[str], *, - authenticated: str = None, - authentication_db: str = None, + authenticated: Optional[str] = None, + authentication_db: Optional[str] = None, ) -> None: """ Initialize a SessionAuthentication object. @@ -17681,9 +17687,10 @@ class SessionInformation: """ Schema for information about a session. - :attr bool ok: ok. - :attr SessionAuthentication info: Schema for session authentication information. - :attr UserContext user_ctx: Schema for the user context of a session. + :param bool ok: ok. + :param SessionAuthentication info: Schema for session authentication + information. + :param UserContext user_ctx: Schema for the user context of a session. """ def __init__( @@ -17768,7 +17775,7 @@ class ShardsInformation: Schema for a shards object that maps the hash value range for each shard to the array of nodes that contain a copy of that shard. - :attr dict shards: Mapping of shard hash value range to a list of nodes. + :param dict shards: Mapping of shard hash value range to a list of nodes. """ def __init__( @@ -17828,12 +17835,12 @@ class ThroughputInformation: Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes. - :attr int blocks: A number of blocks of throughput units. A block consists of + :param int blocks: A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput capacity. - :attr int query: Provisioned global queries capacity in operations per second. - :attr int read: Provisioned reads capacity in operations per second. - :attr int write: Provisioned writes capacity in operations per second. + :param int query: Provisioned global queries capacity in operations per second. + :param int read: Provisioned reads capacity in operations per second. + :param int write: Provisioned writes capacity in operations per second. """ def __init__( @@ -17922,8 +17929,8 @@ class UpInformation: """ Schema for information about the up state of the server. - :attr dict seeds: seeds. - :attr str status: status. + :param dict seeds: seeds. + :param str status: status. """ def __init__( @@ -18001,11 +18008,11 @@ class UpdatesPending: """ Schema for an ability to tell if view is up-to-date without querying it. - :attr int minimum: Sum of shard copies with the least amount of work to do. - :attr int preferred: Sum of unique shards. This value is zero when at least one + :param int minimum: Sum of shard copies with the least amount of work to do. + :param int preferred: Sum of unique shards. This value is zero when at least one copy of every shard range is up-to-date and the view is able to answer a query without index building delays. - :attr int total: Sum of all shard copies. + :param int total: Sum of all shard copies. """ def __init__( @@ -18085,9 +18092,10 @@ class UserContext: """ Schema for the user context of a session. - :attr str db: (optional) Database name in the context of the provided operation. - :attr str name: User name. - :attr List[str] roles: List of user roles. + :param str db: (optional) Database name in the context of the provided + operation. + :param str name: User name. + :param List[str] roles: List of user roles. """ def __init__( @@ -18095,7 +18103,7 @@ def __init__( name: str, roles: List[str], *, - db: str = None, + db: Optional[str] = None, ) -> None: """ Initialize a UserContext object. @@ -18179,7 +18187,7 @@ class UuidsResult: """ Schema for a set of uuids generated by the server. - :attr List[str] uuids: uuids. + :param List[str] uuids: uuids. """ def __init__( @@ -18238,9 +18246,9 @@ class ViewQueriesResult: """ Schema for the results of a queries view operation. - :attr List[ViewResult] results: An array of result objects - one for each query. - Each result object contains the same fields as the response to a regular view - request. + :param List[ViewResult] results: An array of result objects - one for each + query. Each result object contains the same fields as the response to a regular + view request. """ def __init__( @@ -18307,46 +18315,46 @@ class ViewQuery: """ Schema for a query view operation. - :attr bool att_encoding_info: (optional) Parameter to specify whether to include - the encoding information in attachment stubs if the particular attachment is - compressed. - :attr bool attachments: (optional) Parameter to specify whether to include + :param bool att_encoding_info: (optional) Parameter to specify whether to + include the encoding information in attachment stubs if the particular + attachment is compressed. + :param bool attachments: (optional) Parameter to specify whether to include attachments bodies in a response. - :attr bool conflicts: (optional) Parameter to specify whether to include a list + :param bool conflicts: (optional) Parameter to specify whether to include a list of conflicted revisions in each returned document. Active only when `include_docs` is `true`. - :attr bool descending: (optional) Parameter to specify whether to return the + :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. - :attr bool include_docs: (optional) Parameter to specify whether to include the + :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :attr bool inclusive_end: (optional) Parameter to specify whether the specified + :param bool inclusive_end: (optional) Parameter to specify whether the specified end key should be included in the result. - :attr int limit: (optional) Parameter to specify the number of returned + :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. - :attr int skip: (optional) Parameter to specify the number of records before + :param int skip: (optional) Parameter to specify the number of records before starting to return the results. - :attr bool update_seq: (optional) Parameter to specify whether to include in the - response an update_seq value indicating the sequence id of the database the view - reflects. - :attr object end_key: (optional) Schema for any JSON type. - :attr str end_key_doc_id: (optional) Schema for a document ID. - :attr bool group: (optional) Parameter to specify whether to group reduced + :param bool update_seq: (optional) Parameter to specify whether to include in + the response an update_seq value indicating the sequence id of the database the + view reflects. + :param object end_key: (optional) Schema for any JSON type. + :param str end_key_doc_id: (optional) Schema for a document ID. + :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further based on the number of array elements with the `group_level` parameter. - :attr int group_level: (optional) Parameter to specify a group level to be used. - Only applicable if the view uses keys that are JSON arrays. Implies group is - `true`. Group level groups the reduced results by the specified number of array - elements. If unset, results are grouped by the entire array key, returning a - reduced value for each complete key. - :attr object key: (optional) Schema for any JSON type. - :attr List[object] keys: (optional) Parameter to specify returning only + :param int group_level: (optional) Parameter to specify a group level to be + used. Only applicable if the view uses keys that are JSON arrays. Implies group + is `true`. Group level groups the reduced results by the specified number of + array elements. If unset, results are grouped by the entire array key, returning + a reduced value for each complete key. + :param object key: (optional) Schema for any JSON type. + :param List[object] keys: (optional) Parameter to specify returning only documents that match any of the specified keys. A JSON array of keys that match the key type emitted by the view function. - :attr bool reduce: (optional) Parameter to specify whether to use the reduce + :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - :attr bool stable: (optional) Query parameter to specify whether use the same + :param bool stable: (optional) Query parameter to specify whether use the same replica of the index on each request. The default value `false` contacts all replicas and returns the result from the first, fastest, responder. Setting it to `true` when used in conjunction with `update=false` may improve consistency @@ -18354,9 +18362,9 @@ class ViewQuery: replica is not the fastest of the available replicas. **Note:** In general setting `true` is discouraged and is strictly not recommended when using `update=true`. - :attr object start_key: (optional) Schema for any JSON type. - :attr str start_key_doc_id: (optional) Schema for a document ID. - :attr str update: (optional) Parameter to specify whether or not the view in + :param object start_key: (optional) Schema for any JSON type. + :param str start_key_doc_id: (optional) Schema for a document ID. + :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. * `false` - Return results without updating the view. @@ -18367,26 +18375,26 @@ class ViewQuery: def __init__( self, *, - att_encoding_info: bool = None, - attachments: bool = None, - conflicts: bool = None, - descending: bool = None, - include_docs: bool = None, - inclusive_end: bool = None, - limit: int = None, - skip: int = None, - update_seq: bool = None, - end_key: object = None, - end_key_doc_id: str = None, - group: bool = None, - group_level: int = None, - key: object = None, - keys: List[object] = None, - reduce: bool = None, - stable: bool = None, - start_key: object = None, - start_key_doc_id: str = None, - update: str = None, + att_encoding_info: Optional[bool] = None, + attachments: Optional[bool] = None, + conflicts: Optional[bool] = None, + descending: Optional[bool] = None, + include_docs: Optional[bool] = None, + inclusive_end: Optional[bool] = None, + limit: Optional[int] = None, + skip: Optional[int] = None, + update_seq: Optional[bool] = None, + end_key: Optional[object] = None, + end_key_doc_id: Optional[str] = None, + group: Optional[bool] = None, + group_level: Optional[int] = None, + key: Optional[object] = None, + keys: Optional[List[object]] = None, + reduce: Optional[bool] = None, + stable: Optional[bool] = None, + start_key: Optional[object] = None, + start_key_doc_id: Optional[str] = None, + update: Optional[str] = None, ) -> None: """ Initialize a ViewQuery object. @@ -18604,17 +18612,17 @@ class ViewResult: """ Schema for the result of a query view operation. - :attr int total_rows: (optional) Number of total rows. - :attr str update_seq: (optional) Current update sequence for the database. - :attr List[ViewResultRow] rows: rows. + :param int total_rows: (optional) Number of total rows. + :param str update_seq: (optional) Current update sequence for the database. + :param List[ViewResultRow] rows: rows. """ def __init__( self, rows: List['ViewResultRow'], *, - total_rows: int = None, - update_seq: str = None, + total_rows: Optional[int] = None, + update_seq: Optional[str] = None, ) -> None: """ Initialize a ViewResult object. @@ -18686,13 +18694,13 @@ class ViewResultRow: """ Schema for a row of a view result. - :attr str caused_by: (optional) The cause of the error (if available). - :attr str error: (optional) The name of the error. - :attr str reason: (optional) The reason the error occurred (if available). - :attr Document doc: (optional) Schema for a document. - :attr str id: (optional) Schema for a document ID. - :attr object key: Schema for any JSON type. - :attr object value: Schema for any JSON type. + :param str caused_by: (optional) The cause of the error (if available). + :param str error: (optional) The name of the error. + :param str reason: (optional) The reason the error occurred (if available). + :param Document doc: (optional) Schema for a document. + :param str id: (optional) Schema for a document ID. + :param object key: Schema for any JSON type. + :param object value: Schema for any JSON type. """ def __init__( @@ -18700,11 +18708,11 @@ def __init__( key: object, value: object, *, - caused_by: str = None, - error: str = None, - reason: str = None, - doc: 'Document' = None, - id: str = None, + caused_by: Optional[str] = None, + error: Optional[str] = None, + reason: Optional[str] = None, + doc: Optional['Document'] = None, + id: Optional[str] = None, ) -> None: """ Initialize a ViewResultRow object. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 8146fe17..0a45631f 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -21,6 +21,7 @@ from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator from ibm_cloud_sdk_core.utils import datetime_to_string, string_to_datetime import base64 +import gzip import inspect import io import json @@ -32,7 +33,6 @@ import responses import tempfile import urllib -import gzip from ibmcloudant.cloudant_v1 import * @@ -66,8 +66,7 @@ def preprocess_url(operation_path: str): # Otherwise, return a regular expression that matches one or more trailing /. if re.fullmatch('.*/+', request_url) is None: return request_url - else: - return re.compile(request_url.rstrip('/') + '/+') + return re.compile(request_url.rstrip('/') + '/+') ############################################################################## @@ -331,8 +330,9 @@ def test_put_capacity_throughput_configuration_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -599,8 +599,9 @@ def test_post_changes_all_params(self): assert 'style={}'.format(style) in query_string assert 'timeout={}'.format(timeout) in query_string assert 'view={}'.format(view) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -651,8 +652,9 @@ def test_post_changes_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -796,8 +798,9 @@ def test_post_changes_as_stream_all_params(self): assert 'style={}'.format(style) in query_string assert 'timeout={}'.format(timeout) in query_string assert 'view={}'.format(view) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -854,8 +857,9 @@ def test_post_changes_as_stream_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -1158,8 +1162,9 @@ def test_post_dbs_info_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -1746,8 +1751,9 @@ def test_post_document_all_params(self): query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -1825,8 +1831,9 @@ def test_post_document_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -1973,8 +1980,9 @@ def test_post_all_docs_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2111,8 +2119,9 @@ def test_post_all_docs_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2247,8 +2256,9 @@ def test_post_all_docs_queries_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2370,8 +2380,9 @@ def test_post_all_docs_queries_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2523,8 +2534,9 @@ def test_post_bulk_docs_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2675,8 +2687,9 @@ def test_post_bulk_get_all_params(self): assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string assert 'latest={}'.format('true' if latest else 'false') in query_string assert 'revs={}'.format('true' if revs else 'false') in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2727,8 +2740,9 @@ def test_post_bulk_get_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2845,8 +2859,9 @@ def test_post_bulk_get_as_mixed_all_params(self): assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string assert 'latest={}'.format('true' if latest else 'false') in query_string assert 'revs={}'.format('true' if revs else 'false') in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -2897,8 +2912,9 @@ def test_post_bulk_get_as_mixed_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -3015,8 +3031,9 @@ def test_post_bulk_get_as_related_all_params(self): assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string assert 'latest={}'.format('true' if latest else 'false') in query_string assert 'revs={}'.format('true' if revs else 'false') in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -3067,8 +3084,9 @@ def test_post_bulk_get_as_related_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -3185,8 +3203,9 @@ def test_post_bulk_get_as_stream_all_params(self): assert 'att_encoding_info={}'.format('true' if att_encoding_info else 'false') in query_string assert 'latest={}'.format('true' if latest else 'false') in query_string assert 'revs={}'.format('true' if revs else 'false') in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -3243,8 +3262,9 @@ def test_post_bulk_get_as_stream_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -4187,8 +4207,9 @@ def test_put_document_all_params(self): assert 'batch={}'.format(batch) in query_string assert 'new_edits={}'.format('true' if new_edits else 'false') in query_string assert 'rev={}'.format(rev) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -4268,8 +4289,9 @@ def test_put_document_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -4930,8 +4952,9 @@ def test_put_design_document_all_params(self): assert 'batch={}'.format(batch) in query_string assert 'new_edits={}'.format('true' if new_edits else 'false') in query_string assert 'rev={}'.format(rev) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5045,8 +5068,9 @@ def test_put_design_document_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5316,8 +5340,9 @@ def test_post_design_docs_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5398,8 +5423,9 @@ def test_post_design_docs_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5530,8 +5556,9 @@ def test_post_design_docs_queries_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5592,8 +5619,9 @@ def test_post_design_docs_queries_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5780,8 +5808,9 @@ def test_post_view_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -5954,8 +5983,9 @@ def test_post_view_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -6119,8 +6149,9 @@ def test_post_view_queries_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -6264,8 +6295,9 @@ def test_post_view_queries_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -6538,8 +6570,9 @@ def test_post_partition_all_docs_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -6680,8 +6713,9 @@ def test_post_partition_all_docs_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -6830,8 +6864,9 @@ def test_post_partition_search_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -6977,8 +7012,9 @@ def test_post_partition_search_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -7144,8 +7180,9 @@ def test_post_partition_view_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -7318,8 +7355,9 @@ def test_post_partition_view_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -7478,8 +7516,9 @@ def test_post_partition_explain_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -7613,8 +7652,9 @@ def test_post_partition_find_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -7748,8 +7788,9 @@ def test_post_partition_find_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -7928,8 +7969,9 @@ def test_post_explain_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -8063,8 +8105,9 @@ def test_post_find_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -8198,8 +8241,9 @@ def test_post_find_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -8430,8 +8474,9 @@ def test_post_index_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -8685,8 +8730,9 @@ def test_post_search_analyze_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -8815,8 +8861,9 @@ def test_post_search_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -8982,8 +9029,9 @@ def test_post_search_as_stream_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -9896,8 +9944,9 @@ def test_put_replication_document_all_params(self): assert 'batch={}'.format(batch) in query_string assert 'new_edits={}'.format('true' if new_edits else 'false') in query_string assert 'rev={}'.format(rev) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -10033,8 +10082,9 @@ def test_put_replication_document_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -10754,8 +10804,9 @@ def test_put_security_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -10904,8 +10955,9 @@ def test_put_cloudant_security_configuration_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -11085,8 +11137,9 @@ def test_put_cors_configuration_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -11648,8 +11701,9 @@ def test_put_attachment_all_params(self): query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'rev={}'.format(rev) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -11698,8 +11752,9 @@ def test_put_attachment_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -12267,8 +12322,9 @@ def test_put_local_document_all_params(self): query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) assert 'batch={}'.format(batch) in query_string - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -12348,8 +12404,9 @@ def test_put_local_document_required_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 201 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params @@ -12513,8 +12570,9 @@ def test_post_revs_diff_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) @@ -12956,8 +13014,9 @@ def test_post_activity_tracker_events_all_params(self): # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 - # decompress gzip compressed request body - responses.calls[0].request.body = gzip.decompress(responses.calls[0].request.body) + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) From 513317e105eae3564701326bdd93ae7d761e22c6 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Fri, 27 Oct 2023 10:05:17 -0300 Subject: [PATCH 226/669] fix(build): remove :attr to :param override in docstrings (#573) --- source/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/source/conf.py b/source/conf.py index c51b1348..43a4a59d 100644 --- a/source/conf.py +++ b/source/conf.py @@ -78,9 +78,6 @@ # patch broken markup codeblock = False for i in range(len(lines)): - # replace class vars to :param: for better rendering - if ':attr ' in lines[i]: - lines[i] = lines[i].replace(':attr', ':param') # replace note with tip admonition if '### Note' in lines[i]: lines[i] = ' :::{tip}\n' From e256f73407a9430a991932a3b790d9f806c4494b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:06:47 +0000 Subject: [PATCH 227/669] Update version 0.6.0 -> 0.7.0 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 048793e0..5daa9983 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.6.0 +current_version = 0.7.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 4331612a..b96ef222 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.6.0 +# IBM Cloudant Python SDK Version 0.7.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -122,13 +122,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.6.0" +pip install --upgrade "ibmcloudant>=0.7.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.6.0" +easy_install --upgrade "ibmcloudant>=0.7.0" ``` @@ -602,7 +602,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/examples#examples-for-python). ### Error handling @@ -796,7 +796,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/examples#postchanges) instead of the follower. #### Error suppression @@ -831,7 +831,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/examples#postchanges). #### Checkpointing @@ -1034,7 +1034,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1064,8 +1064,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.6.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 43ba2725..d922a356 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.6.0' +__version__ = '0.7.0' diff --git a/pyproject.toml b/pyproject.toml index afc189eb..869e1b19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.6.0" +version = "0.7.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.17.2", From 7efdddf53e3f914b4254bf0a1b30592c809323fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:22:43 +0000 Subject: [PATCH 228/669] build(deps-dev): Bump responses from 0.23.3 to 0.24.0 Bumps [responses](https://github.com/getsentry/responses) from 0.23.3 to 0.24.0. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.23.3...0.24.0) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 534f51a9..b256e1ad 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==7.4.3 -responses==0.23.3 +responses==0.24.0 python_dotenv==1.0.0 pylint==3.0.2 # code coverage From a1cf57fb385b7b6c8808290828ee024149c35de9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:50:34 +0000 Subject: [PATCH 229/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.17.2 to 3.17.3 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.17.2 to 3.17.3. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.17.2...v3.17.3) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 869e1b19..2483b4c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.0" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.17.2", + "ibm_cloud_sdk_core==3.17.3", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From de8d9d008d67179d08f9a3e5e52c8289ffbd6aa0 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:35:08 +0000 Subject: [PATCH 230/669] chore(generated): update mend settings Generated SDK source code using: - Generator version 3.81.0 - Specification version 1.0.0-dev0.1.5 - Automation (cloudant-sdks) version f77a0db Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- .whitesource | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.whitesource b/.whitesource index 038c9085..e916ce12 100644 --- a/.whitesource +++ b/.whitesource @@ -4,6 +4,7 @@ "issueRepoName": "sdks" }, "scanSettings": { - "javaVersion": "17" + "javaVersion": "17", + "python.requirementsFileIncludes": "pyproject.toml,requirements-dev.txt,requirements-docs.txt" } } From 58aa8fb32e5775c7d8f1709e7113e2dc3833b20c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:47:06 +0000 Subject: [PATCH 231/669] build(deps-dev): Bump responses from 0.24.0 to 0.24.1 Bumps [responses](https://github.com/getsentry/responses) from 0.24.0 to 0.24.1. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.24.0...0.24.1) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b256e1ad..18965ed1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==7.4.3 -responses==0.24.0 +responses==0.24.1 python_dotenv==1.0.0 pylint==3.0.2 # code coverage From d1bba8890412cd7f9a2d99e22a853b9111272538 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 14 Nov 2023 14:10:27 -0400 Subject: [PATCH 232/669] chore: update poetry classifiers to add python 3.12 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 2483b4c3..aa7a53ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", From 7317cbb684e90b967f805c7b9702aa2d8f510458 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:02:23 +0000 Subject: [PATCH 233/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.17.3 to 3.18.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.17.3 to 3.18.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.17.3...v3.18.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aa7a53ab..a0569535 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.0" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.17.3", + "ibm_cloud_sdk_core==3.18.0", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 436bdb092f75f5c4143d45748069f3e94c3c2967 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 21 Nov 2023 10:13:43 +0000 Subject: [PATCH 234/669] Update version 0.7.0 -> 0.7.1 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5daa9983..025ac559 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.0 +current_version = 0.7.1 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index b96ef222..23cb273b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.7.0 +# IBM Cloudant Python SDK Version 0.7.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -122,13 +122,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.7.0" +pip install --upgrade "ibmcloudant>=0.7.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.7.0" +easy_install --upgrade "ibmcloudant>=0.7.1" ``` @@ -602,7 +602,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/examples#examples-for-python). ### Error handling @@ -796,7 +796,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/examples#postchanges) instead of the follower. #### Error suppression @@ -831,7 +831,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/examples#postchanges). #### Checkpointing @@ -1034,7 +1034,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1064,8 +1064,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index d922a356..062a61c1 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.7.0' +__version__ = '0.7.1' diff --git a/pyproject.toml b/pyproject.toml index a0569535..b17a0b4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.7.0" +version = "0.7.1" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.18.0", From 2e8db1f11077097df51a6236d9cb72b2ab1cf06f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:38:24 -0400 Subject: [PATCH 235/669] build(deps): Bump sphinx-autodoc2 from 0.4.2 to 0.5.0 (#587) * build(deps): Bump sphinx-autodoc2 from 0.4.2 to 0.5.0 Bumps [sphinx-autodoc2](https://github.com/chrisjsewell/sphinx-autodoc2) from 0.4.2 to 0.5.0. - [Release notes](https://github.com/chrisjsewell/sphinx-autodoc2/releases) - [Commits](https://github.com/chrisjsewell/sphinx-autodoc2/compare/v0.4.2...v0.5.0) --- updated-dependencies: - dependency-name: sphinx-autodoc2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fix(docs): reverse pinning astroid --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eric Avdey --- requirements-docs.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 0d4bf4e0..9ece9396 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,7 +1,6 @@ # documentation recommonmark==0.7.1 Sphinx==7.2.6 -sphinx-autodoc2==0.4.2 +sphinx-autodoc2==0.5.0 myst-parser==2.0.0 sphinx-rtd-theme==1.3.0 -astroid==2.15.8 From 060cb674eae184e55465f167f35f3657c5067599 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:24:09 +0000 Subject: [PATCH 236/669] build(deps): Bump sphinx-rtd-theme from 1.3.0 to 2.0.0 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.3.0 to 2.0.0. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.3.0...2.0.0) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 9ece9396..c458b803 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==7.2.6 sphinx-autodoc2==0.5.0 myst-parser==2.0.0 -sphinx-rtd-theme==1.3.0 +sphinx-rtd-theme==2.0.0 From a394be46d05f0b7f5861f85fd4d213a87b4428f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:37:53 +0000 Subject: [PATCH 237/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.18.0 to 3.18.1 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.18.0 to 3.18.1. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.18.0...v3.18.1) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b17a0b4b..852a801d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.18.0", + "ibm_cloud_sdk_core==3.18.1", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 7c8a44388822e37f473db4742ce869d006277e42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:38:50 +0000 Subject: [PATCH 238/669] build(deps-dev): Bump pylint from 3.0.2 to 3.0.3 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.2...v3.0.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 18965ed1..8532bb4c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==7.4.3 responses==0.24.1 python_dotenv==1.0.0 -pylint==3.0.2 +pylint==3.0.3 # code coverage coverage==7.3.2 pytest-cov==4.1.0 From f4d31ec27989f775cf767be0353b2d4be69952d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:24:46 +0000 Subject: [PATCH 239/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.18.1 to 3.18.2 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.18.1 to 3.18.2. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.18.1...v3.18.2) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 852a801d..0ab91f57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.18.1", + "ibm_cloud_sdk_core==3.18.2", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From ecbbb52599ac71d05bcaa81078062b081210b7be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 17:40:52 +0000 Subject: [PATCH 240/669] build(deps-dev): Bump coverage from 7.3.2 to 7.3.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.2 to 7.3.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.3.2...7.3.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8532bb4c..48311c45 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.24.1 python_dotenv==1.0.0 pylint==3.0.3 # code coverage -coverage==7.3.2 +coverage==7.3.3 pytest-cov==4.1.0 From 07af49c1aa6f5ddb97eba3e2a1b6a41327289b39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:45:01 +0000 Subject: [PATCH 241/669] build(deps-dev): Bump coverage from 7.3.3 to 7.3.4 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.3 to 7.3.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.3.3...7.3.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 48311c45..a7bfeb7c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.24.1 python_dotenv==1.0.0 pylint==3.0.3 # code coverage -coverage==7.3.3 +coverage==7.3.4 pytest-cov==4.1.0 From 7c6c10d6c546b76de11b546c12809cdfbeb43ed2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Dec 2023 17:15:02 +0000 Subject: [PATCH 242/669] build(deps-dev): Bump coverage from 7.3.4 to 7.4.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.3.4 to 7.4.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.3.4...7.4.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a7bfeb7c..f7de977d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.24.1 python_dotenv==1.0.0 pylint==3.0.3 # code coverage -coverage==7.3.4 +coverage==7.4.0 pytest-cov==4.1.0 From 3edc19d979be959aaf2790902373f8c9a125130c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 17:00:43 +0000 Subject: [PATCH 243/669] build(deps-dev): Bump pytest from 7.4.3 to 7.4.4 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.3 to 7.4.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.3...7.4.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f7de977d..55aaf7b5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==7.4.3 +pytest==7.4.4 responses==0.24.1 python_dotenv==1.0.0 pylint==3.0.3 From 9d12583f2497d85dcb02511f4735d4f7a927e150 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 5 Jan 2024 13:48:40 +0000 Subject: [PATCH 244/669] build(generated): update generator to 3.84.0 Generated SDK source code using: - Generator version 3.84.0 - Specification version 1.0.0-dev0.1.5 - Automation (cloudant-sdks) version 1d839cb Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 2 +- test/integration/test_cloudant_v1.py | 2 +- test/unit/test_cloudant_v1.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index d9dc0101..6d5ec949 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2023. +# (C) Copyright IBM Corp. 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 244609ec..1c075eda 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2023. +# (C) Copyright IBM Corp. 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 0a45631f..620fc83b 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2023. +# (C) Copyright IBM Corp. 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From ac1d64c668a58c3a90270b101a7748512b0320ff Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 5 Jan 2024 15:04:16 +0000 Subject: [PATCH 245/669] Update version 0.7.1 -> 0.7.2 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 025ac559..7b177d8a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.1 +current_version = 0.7.2 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 23cb273b..ec8f272e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.7.1 +# IBM Cloudant Python SDK Version 0.7.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -122,13 +122,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.7.1" +pip install --upgrade "ibmcloudant>=0.7.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.7.1" +easy_install --upgrade "ibmcloudant>=0.7.2" ``` @@ -602,7 +602,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/examples#examples-for-python). ### Error handling @@ -796,7 +796,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/examples#postchanges) instead of the follower. #### Error suppression @@ -831,7 +831,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/examples#postchanges). #### Checkpointing @@ -1034,7 +1034,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1064,8 +1064,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.1/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 062a61c1..c6951295 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.7.1' +__version__ = '0.7.2' diff --git a/pyproject.toml b/pyproject.toml index 0ab91f57..5ffc2c87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.7.1" +version = "0.7.2" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.18.2", From 54caf67dd93278a3db79d82d62a8a5b358a442e3 Mon Sep 17 00:00:00 2001 From: Ildiko Eigel Date: Wed, 17 Jan 2024 18:01:34 +0100 Subject: [PATCH 246/669] fix(docs): auto update copyright year --- source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/conf.py b/source/conf.py index 43a4a59d..f379a313 100644 --- a/source/conf.py +++ b/source/conf.py @@ -15,13 +15,14 @@ # import os import sys +import datetime sys.path.insert(0, os.path.abspath('..')) print(os.path.abspath('..')) # -- Project information ----------------------------------------------------- project = 'Cloudant Python SDK' -copyright = 'Copyright IBM Corp. 2021, 2023.' +copyright = f'Copyright IBM Corp. 2021, {datetime.date.today().year}' author = '@IBM/cloudant-sdks' # -- General configuration --------------------------------------------------- From f2d408fae0cbd7dc6dbd3713a494484fc26e7d12 Mon Sep 17 00:00:00 2001 From: Ildiko Eigel Date: Wed, 17 Jan 2024 18:02:16 +0100 Subject: [PATCH 247/669] refactor: make non-API objects private in changes follower * make `BASE_DELAY`, `BATCH_SIZE`, `EXP_RETRY_GATE`, `FOREVER`, `LONGPOLL_TIMEOUT`, `MIN_CLIENT_TIMEOUT` constants private * make `ChangesFollowerIterator` class private * make `Mode` and `TransientErrorSuppression` enums private --- ibmcloudant/features/changes_follower.py | 70 ++++++++++----------- test/unit/features/conftest.py | 20 +++--- test/unit/features/test_changes_follower.py | 64 +++++++++---------- 3 files changed, 77 insertions(+), 77 deletions(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index dc65d2e2..cb238b7f 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2022, 2023. +# © Copyright IBM Corporation 2022, 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,22 +37,22 @@ ) # max timedelta in milliseconds -FOREVER = round(timedelta.max.total_seconds() * 1000) - 1 +_FOREVER = round(timedelta.max.total_seconds() * 1000) - 1 # 1 minute in millisec -MIN_CLIENT_TIMEOUT = 60000 +_MIN_CLIENT_TIMEOUT = 60000 # To give the changes request a chance to be answered # before the client timeout it is set to 3 seconds less. -LONGPOLL_TIMEOUT = MIN_CLIENT_TIMEOUT - 3000 -BATCH_SIZE = 10000 +_LONGPOLL_TIMEOUT = _MIN_CLIENT_TIMEOUT - 3000 +_BATCH_SIZE = 10000 # Base delay in milliseconds between unsuccessful attempts to pull changes feed # in presence of transient errors -BASE_DELAY = 100 +_BASE_DELAY = 100 # Once we reach this number of retries we'll be capping the backoff -EXP_RETRY_GATE = int(math.log(LONGPOLL_TIMEOUT / BASE_DELAY) / math.log(2)) +_EXP_RETRY_GATE = int(math.log(_LONGPOLL_TIMEOUT / _BASE_DELAY) / math.log(2)) -class Mode(Enum): +class _Mode(Enum): """ Enums for changes follower's operation mode. """ @@ -60,7 +60,7 @@ class Mode(Enum): LISTEN = auto() -class TransientErrorSuppression(Enum): +class _TransientErrorSuppression(Enum): """ Enums for changes follower's transient errors suppression mode. """ @@ -69,7 +69,7 @@ class TransientErrorSuppression(Enum): TIMER = auto() -class ChangesFollowerIterator: +class _ChangesFollowerIterator: """ The ChangesFollowerIterator implements iterator interface. @@ -86,18 +86,18 @@ class ChangesFollowerIterator: """ def __init__( - self, changes_caller, mode: Mode, error_tolerance: int + self, changes_caller, mode: _Mode, error_tolerance: int ) -> None: self.changes_caller = changes_caller self._changes_iter = iter([]) self.mode = mode - self._transient_suppression = TransientErrorSuppression.TIMER + self._transient_suppression = _TransientErrorSuppression.TIMER if error_tolerance == 0: - self._transient_suppression = TransientErrorSuppression.NEVER - elif error_tolerance == FOREVER: - self._transient_suppression = TransientErrorSuppression.ALWAYS + self._transient_suppression = _TransientErrorSuppression.NEVER + elif error_tolerance == _FOREVER: + self._transient_suppression = _TransientErrorSuppression.ALWAYS self.error_tolerance = timedelta(milliseconds=error_tolerance) - self.since = 'now' if mode is Mode.LISTEN else '0' + self.since = 'now' if mode is _Mode.LISTEN else '0' self._success_timestamp = datetime.now(timezone.utc) self._request_thread = Thread(target=self._request_callback) self._buffer = Queue() @@ -169,9 +169,9 @@ def _request_callback(self): self.since = result.get('last_seq') self._pending = result.get('pending') self._retry = 0 - if self._transient_suppression == TransientErrorSuppression.TIMER: + if self._transient_suppression == _TransientErrorSuppression.TIMER: self._success_timestamp = datetime.now(timezone.utc) - if self.mode == Mode.FINITE and self._pending == 0: + if self.mode == _Mode.FINITE and self._pending == 0: self._has_next = False results = result['results'] self.logger.debug(f'_request_callback results {results}') @@ -184,10 +184,10 @@ def _request_callback(self): except Exception as e: self.logger.debug(f'Exception getting changes {e}') if ( - self._transient_suppression == TransientErrorSuppression.NEVER + self._transient_suppression == _TransientErrorSuppression.NEVER or ( self._transient_suppression - == TransientErrorSuppression.TIMER + == _TransientErrorSuppression.TIMER and self._success_timestamp + self.error_tolerance < datetime.now(timezone.utc) ) @@ -218,10 +218,10 @@ def retry_delay(self): Algorithm reference: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ """ - if (self._retry >= EXP_RETRY_GATE): - exp_delay = LONGPOLL_TIMEOUT + if (self._retry >= _EXP_RETRY_GATE): + exp_delay = _LONGPOLL_TIMEOUT else: - exp_delay = pow(2, self._retry) * BASE_DELAY + exp_delay = pow(2, self._retry) * _BASE_DELAY jitter_delay = random.uniform(0, exp_delay) time.sleep(round(jitter_delay / 1000, 3)) self._retry += 1 @@ -285,7 +285,7 @@ class ChangesFollower: """ def __init__( - self, service: CloudantV1, *, error_tolerance: int = FOREVER, **kwargs + self, service: CloudantV1, *, error_tolerance: int = _FOREVER, **kwargs ) -> None: self.options = kwargs self.limit = self.options.get('limit') @@ -303,16 +303,16 @@ def __init__( call_timeout, read_timeout = call_timeout * 1000, read_timeout * 1000 if ( call_timeout > 0 - and call_timeout < MIN_CLIENT_TIMEOUT + and call_timeout < _MIN_CLIENT_TIMEOUT or read_timeout > 0 - and read_timeout < MIN_CLIENT_TIMEOUT + and read_timeout < _MIN_CLIENT_TIMEOUT ): raise ValueError( 'To use {} the client read and call timeouts must be at least' ' {:d} ms. The client read timeout is {:d}' ' ms and the call timeout is {:d} ms.'.format( type(self).__name__, - MIN_CLIENT_TIMEOUT, + _MIN_CLIENT_TIMEOUT, read_timeout, call_timeout, ) @@ -324,9 +324,9 @@ def error_tolerance(self) -> int: @error_tolerance.setter def error_tolerance(self, value: int) -> None: - if value > FOREVER: + if value > _FOREVER: raise ValueError( - f'Error tolerance duration must not be larger than {FOREVER}.' + f'Error tolerance duration must not be larger than {_FOREVER}.' ) if value < 0: raise ValueError('Error tolerance duration must not be negative.') @@ -357,7 +357,7 @@ def options(self, value: Dict): def _set_defaults(self, limit: int = None): defaults = { 'feed': PostChangesEnums.Feed.LONGPOLL, - 'timeout': LONGPOLL_TIMEOUT, + 'timeout': _LONGPOLL_TIMEOUT, } if limit is not None: self.logger.debug(f'Applying changes limit {limit}') @@ -387,7 +387,7 @@ def start(self) -> Iterator[ChangesResultItem]: or unsupressed transient error is recevied from the service when fetching changes """ - return self._run(Mode.LISTEN) + return self._run(_Mode.LISTEN) def start_one_off(self) -> Iterator[ChangesResultItem]: """ @@ -412,7 +412,7 @@ def start_one_off(self) -> Iterator[ChangesResultItem]: or unsupressed transient error is recevied from the service when fetching changes """ - return self._run(Mode.FINITE) + return self._run(_Mode.FINITE) def stop(self) -> None: """ @@ -423,11 +423,11 @@ def stop(self) -> None: """ self._iter.stop() - def _run(self, mode: Mode): + def _run(self, mode: _Mode): if self._iter is not None: raise RuntimeError('Cannot start a feed that has already started.') - batch_size = BATCH_SIZE + batch_size = _BATCH_SIZE if self.options.get('include_docs', False): resp = self.service.get_database_information( db=self.options.get('db') @@ -445,7 +445,7 @@ def _run(self, mode: Mode): changes_caller = functools.partial( self.service.post_changes, **self.options ) - self._iter = ChangesFollowerIterator( + self._iter = _ChangesFollowerIterator( changes_caller, mode, self.error_tolerance ) if self.limit is not None: diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index 71af42a8..3aa16c42 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -39,7 +39,7 @@ ChangesResultItem, ) -from ibmcloudant.features.changes_follower import LONGPOLL_TIMEOUT, BATCH_SIZE, Mode +from ibmcloudant.features.changes_follower import _LONGPOLL_TIMEOUT, _BATCH_SIZE, _Mode @pytest.fixture(scope='class') @@ -66,7 +66,7 @@ def kwargs(request): @pytest.fixture(scope='class') def timeouts(request): - longpoll_timeout = int(LONGPOLL_TIMEOUT / 1000) + longpoll_timeout = int(_LONGPOLL_TIMEOUT / 1000) request.cls.timeouts_valid = [60, (60, 60), 120, 300, (120, 300)] request.cls.timeouts_invalid = [ 15, @@ -99,8 +99,8 @@ def errors(request): def limits(request): request.cls.limits = [ 100, - BATCH_SIZE, - BATCH_SIZE + 123, + _BATCH_SIZE, + _BATCH_SIZE + 123, ] @@ -134,16 +134,16 @@ def __call__(self, request): json.dumps({'error': error}), ) # this stands for "large" seq in empty result case - last_seq = f'{batches * BATCH_SIZE}-abcdef' + last_seq = f'{batches * _BATCH_SIZE}-abcdef' pending = 0 items = [] if self._batch_num <= batches: # we start from doc idx 000001 - start = (self._batch_num - 1) * BATCH_SIZE + 1 - stop = start + BATCH_SIZE + start = (self._batch_num - 1) * _BATCH_SIZE + 1 + stop = start + _BATCH_SIZE last_seq = f'{stop-1}-abcdef' pending = ( - batches * BATCH_SIZE - (self._batch_num) * BATCH_SIZE + batches * _BATCH_SIZE - (self._batch_num) * _BATCH_SIZE ) for idx in range(start, stop, 1): items.append( @@ -222,9 +222,9 @@ def looper(changes, buf): buf.put(e) def main(): - if mode == Mode.LISTEN: + if mode == _Mode.LISTEN: changes = follower.start() - elif mode == Mode.FINITE: + elif mode == _Mode.FINITE: changes = follower.start_one_off() buf = queue.Queue() thread = threading.Thread(target=looper, args=(changes, buf)) diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index 6ca652a8..f2508572 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -31,17 +31,17 @@ from ibmcloudant.features.changes_follower import ( ChangesFollower, - FOREVER, - LONGPOLL_TIMEOUT, - BATCH_SIZE, - Mode, + _FOREVER, + _LONGPOLL_TIMEOUT, + _BATCH_SIZE, + _Mode, ) from conftest import ChangesFollowerBaseCase # the largest positive integer supported by the platform -MAX_BATCHES = sys.maxsize / BATCH_SIZE +MAX_BATCHES = sys.maxsize / _BATCH_SIZE @pytest.mark.usefixtures('timeouts') @@ -60,7 +60,7 @@ def test_validate_missing_database_name(self): def test_validate_overflow_tolerance(self): regx = 'Error tolerance duration must not be larger than' with self.assertRaisesRegex(ValueError, regx): - ChangesFollower(self.client, db='db', error_tolerance=FOREVER + 1) + ChangesFollower(self.client, db='db', error_tolerance=_FOREVER + 1) def test_validate_negative_tolerance(self): regx = 'Error tolerance duration must not be negative.' @@ -120,7 +120,7 @@ def test_set_defaults(self): follower = ChangesFollower(self.client, db='db', **self.kwarg_valid) expected = { 'feed': PostChangesEnums.Feed.LONGPOLL, - 'timeout': LONGPOLL_TIMEOUT, + 'timeout': _LONGPOLL_TIMEOUT, } for opt, val in expected.items(): self.assertEqual(follower.options.get(opt), val) @@ -130,7 +130,7 @@ def test_set_defaults_with_limit(self): follower._set_defaults(limit=12) expected = { 'feed': PostChangesEnums.Feed.LONGPOLL, - 'timeout': LONGPOLL_TIMEOUT, + 'timeout': _LONGPOLL_TIMEOUT, 'limit': 12, } for opt, val in expected.items(): @@ -158,7 +158,7 @@ def test_start_one_off(self): count = sum(1 for _ in changes) self.assertEqual( count, - batches * BATCH_SIZE, + batches * _BATCH_SIZE, 'There should be the expected number of changes.', ) @@ -246,7 +246,7 @@ def test_start_one_off_transient_errors_with_suppression_does_complete( count = sum(1 for _ in changes) self.assertEqual( count, - batches * BATCH_SIZE, + batches * _BATCH_SIZE, 'There should be the expected number of changes.', ) @@ -262,7 +262,7 @@ def test_start_one_off_transient_errors_max_suppression_does_not_complete( try: self.prepare_mock_with_error(error) follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, Mode.FINITE, timeout=0.5) + count = self.runner(follower, _Mode.FINITE, timeout=0.5) except BaseException: self.fail('There should be no exception.') self.assertEqual(count, 0, 'There should be no changes.') @@ -284,7 +284,7 @@ def test_start_one_off_transient_errors_with_max_suppression_does_complete( count = sum(1 for _ in changes) self.assertEqual( count, - batches * BATCH_SIZE, + batches * _BATCH_SIZE, 'There should be the expected number of changes.', ) @@ -298,7 +298,7 @@ def test_stop(self): follower = ChangesFollower(self.client, db='db') start = timeit.default_timer() count = self.runner( - follower, Mode.FINITE, timeout=5, stop_after=1000 + follower, _Mode.FINITE, timeout=5, stop_after=1000 ) stop = timeit.default_timer() - start except BaseException: @@ -316,7 +316,7 @@ def test_state_error(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db='db') - self.runner(follower, Mode.FINITE, timeout=1, stop_after=1000) + self.runner(follower, _Mode.FINITE, timeout=1, stop_after=1000) with self.assertRaisesRegex( RuntimeError, 'Cannot start a feed that has already started.' ): @@ -338,7 +338,7 @@ def test_limit(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db='db', limit=limit) - count = self.runner(follower, Mode.FINITE, timeout=3600) + count = self.runner(follower, _Mode.FINITE, timeout=3600) except BaseException: self.fail('There should be no exception.') self.assertEqual( @@ -368,7 +368,7 @@ def test_retry_delay(self): error = self.transient_errors[0] resp = self.prepare_mock_with_error(error) follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, Mode.FINITE, timeout=0.6) + count = self.runner(follower, _Mode.FINITE, timeout=0.6) except BaseException: self.fail('There should be no exception.') self.assertEqual(count, 0, 'There should be no changes.') @@ -460,11 +460,11 @@ def test_start(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, Mode.LISTEN, timeout=5) + count = self.runner(follower, _Mode.LISTEN, timeout=5) except BaseException: self.fail('There should be no exception.') self.assertGreater( - count, 2 * BATCH_SIZE + 1, 'There should be some changes.' + count, 2 * _BATCH_SIZE + 1, 'There should be some changes.' ) @responses.activate @@ -476,7 +476,7 @@ def test_start_terminal_errors(self): self.prepare_mock_with_error(error) follower = ChangesFollower(self.client, db='db') with self.assertRaisesRegex(ApiException, error): - self.runner(follower, Mode.LISTEN, timeout=1) + self.runner(follower, _Mode.LISTEN, timeout=1) @responses.activate def test_start_transient_errors_no_suppression(self): @@ -489,12 +489,12 @@ def test_start_transient_errors_no_suppression(self): follower = ChangesFollower(self.client, db='db', error_tolerance=0) if error == 'bad_io': with self.assertRaises(ConnectionError): - self.runner(follower, Mode.LISTEN, timeout=1) + self.runner(follower, _Mode.LISTEN, timeout=1) else: if error == 'bad_json': error = 'Error processing the HTTP response' with self.assertRaisesRegex(ApiException, error): - self.runner(follower, Mode.LISTEN, timeout=1) + self.runner(follower, _Mode.LISTEN, timeout=1) @responses.activate def test_start_transient_errors_with_suppression_error_termination(self): @@ -509,12 +509,12 @@ def test_start_transient_errors_with_suppression_error_termination(self): ) if error == 'bad_io': with self.assertRaises(ConnectionError): - self.runner(follower, Mode.LISTEN, timeout=1) + self.runner(follower, _Mode.LISTEN, timeout=1) else: if error == 'bad_json': error = 'Error processing the HTTP response' with self.assertRaisesRegex(ApiException, error): - self.runner(follower, Mode.LISTEN, timeout=1) + self.runner(follower, _Mode.LISTEN, timeout=1) self.assertGreater( resp.call_count, 1, 'Mock server should receive calls.' ) @@ -534,12 +534,12 @@ def test_start_transient_errors_with_suppression_all_changes(self): follower = ChangesFollower( self.client, db='db', error_tolerance=300 ) - count = self.runner(follower, Mode.LISTEN, timeout=1) + count = self.runner(follower, _Mode.LISTEN, timeout=1) except BaseException: self.fail('There should be no exception.') self.assertEqual( count, - batches * BATCH_SIZE, + batches * _BATCH_SIZE, 'There should be the correct number of changes.', ) @@ -553,7 +553,7 @@ def test_start_transient_errors_with_max_suppression(self): try: resp = self.prepare_mock_with_error(error) follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, Mode.LISTEN, timeout=1) + count = self.runner(follower, _Mode.LISTEN, timeout=1) except BaseException: self.fail('There should be no exception.') self.assertEqual(count, 0, 'There should be no changes.') @@ -574,12 +574,12 @@ def test_start_transient_errors_with_max_suppression_all_changes(self): ) try: follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, Mode.LISTEN, timeout=1) + count = self.runner(follower, _Mode.LISTEN, timeout=1) except BaseException: self.fail('There should be no exception.') self.assertEqual( count, - batches * BATCH_SIZE, + batches * _BATCH_SIZE, 'There should be the correct number of changes.', ) @@ -593,7 +593,7 @@ def test_stop(self): follower = ChangesFollower(self.client, db='db') start = timeit.default_timer() count = self.runner( - follower, Mode.LISTEN, timeout=5, stop_after=1000 + follower, _Mode.LISTEN, timeout=5, stop_after=1000 ) stop = timeit.default_timer() - start except BaseException: @@ -611,7 +611,7 @@ def test_state_error(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db='db') - self.runner(follower, Mode.LISTEN, timeout=1, stop_after=1000) + self.runner(follower, _Mode.LISTEN, timeout=1, stop_after=1000) with self.assertRaisesRegex( RuntimeError, 'Cannot start a feed that has already started.' ): @@ -633,7 +633,7 @@ def test_limit(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db='db', limit=limit) - count = self.runner(follower, Mode.LISTEN, timeout=3600) + count = self.runner(follower, _Mode.LISTEN, timeout=3600) except BaseException: self.fail('There should be no exception.') self.assertEqual( @@ -652,7 +652,7 @@ def test_retry_delay(self): error = self.transient_errors[0] resp = self.prepare_mock_with_error(error) follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, Mode.LISTEN, timeout=0.6) + count = self.runner(follower, _Mode.LISTEN, timeout=0.6) except BaseException: self.fail('There should be no exception.') self.assertEqual(count, 0, 'There should be no changes.') From 00666ff40553fc8fef142e689495d2e2df5fe30d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:23:14 +0000 Subject: [PATCH 248/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.18.2 to 3.19.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.18.2 to 3.19.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.18.2...v3.19.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5ffc2c87..12de6d15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.2" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.18.2", + "ibm_cloud_sdk_core==3.19.0", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From b431d6e8b428e554279f9c8c6ebfadb5aad7a482 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Mon, 22 Jan 2024 15:44:58 -0400 Subject: [PATCH 249/669] ci: add CodeQL config --- .github/workflows/codeql.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..5beba59f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,34 @@ +name: "CodeQL" +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + schedule: + - cron: '00 4 * * 2' +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + strategy: + fail-fast: false + matrix: + language: ['python'] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + config: | + paths-ignore: + - 'examples/snippets/**/*.py' + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From db5b9bdfdebd82182b1f0108a17f8e0d50c23db9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:39:40 +0000 Subject: [PATCH 250/669] build(deps-dev): Bump python-dotenv from 1.0.0 to 1.0.1 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.0.0...v1.0.1) --- updated-dependencies: - dependency-name: python-dotenv dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 55aaf7b5..a01754ec 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ flit==3.9.0 # test dependencies pytest==7.4.4 responses==0.24.1 -python_dotenv==1.0.0 +python_dotenv==1.0.1 pylint==3.0.3 # code coverage coverage==7.4.0 From 7ab91c824442b139e1f5a89087ca267a7b87328f Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 23 Jan 2024 14:42:32 -0400 Subject: [PATCH 251/669] fix(test): drain counter queue in follower's runner Instead of waiting for looper to stop and return final coutner we push all updates into queue and then drain it from main loop after thread joined or times out. This makes timeout tests into soft timeout, because we are giving looper time to finish processing last batch of the changes. --- test/unit/features/conftest.py | 14 ++++++++------ test/unit/features/test_changes_follower.py | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index 3aa16c42..fef08ff1 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2022, 2023. +# © Copyright IBM Corporation 2022, 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -212,12 +212,13 @@ class TimeoutError(Exception): def looper(changes, buf): counter = 0 + buf.put(counter) try: for _ in changes: counter += 1 + buf.put(counter) if stop_after > 0 and stop_after == counter: follower.stop() - buf.put(counter) except Exception as e: buf.put(e) @@ -229,15 +230,16 @@ def main(): buf = queue.Queue() thread = threading.Thread(target=looper, args=(changes, buf)) thread.start() + thread.join(timeout) + while not buf.empty(): + data = buf.get() + if isinstance(data, Exception): + raise data while True: - thread.join(timeout) if thread.is_alive(): follower.stop() else: break - data = buf.get() - if isinstance(data, Exception): - raise data return data return main() diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index f2508572..09ca0f6c 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2022, 2023. +# © Copyright IBM Corporation 2022, 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -458,7 +458,7 @@ def test_start(self): with some batches. """ try: - self.prepare_mock_changes(batches=MAX_BATCHES) + self.prepare_mock_changes(batches=3) follower = ChangesFollower(self.client, db='db') count = self.runner(follower, _Mode.LISTEN, timeout=5) except BaseException: From 2ded04abe3cb5346ac5d278b5b82ecbbd4e7c8a7 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 23 Jan 2024 22:50:17 -0400 Subject: [PATCH 252/669] refactor: format conftest with blue --- test/unit/features/conftest.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index fef08ff1..b52e71cf 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -39,7 +39,11 @@ ChangesResultItem, ) -from ibmcloudant.features.changes_follower import _LONGPOLL_TIMEOUT, _BATCH_SIZE, _Mode +from ibmcloudant.features.changes_follower import ( + _LONGPOLL_TIMEOUT, + _BATCH_SIZE, + _Mode, +) @pytest.fixture(scope='class') @@ -112,7 +116,13 @@ def setUpClass(cls): service_name='TEST_SERVICE', ) - def prepare_mock_changes(self, batches=0, errors=[], db_info_doc_count=500_000, db_info_doc_size=523): + def prepare_mock_changes( + self, + batches=0, + errors=[], + db_info_doc_count=500_000, + db_info_doc_size=523, + ): class changes_callback: def __init__(self): self._batch_num = 1 @@ -171,7 +181,10 @@ def __call__(self, request): url, status=200, content_type='application/json', - json={'doc_count': db_info_doc_count, 'sizes': {'external': db_info_doc_count * db_info_doc_size}}, + json={ + 'doc_count': db_info_doc_count, + 'sizes': {'external': db_info_doc_count * db_info_doc_size}, + }, ) url = _base_url + '/db/_changes' From a146956252bd80b23ed18b99bb80ac70f9f56643 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 21:00:45 +0000 Subject: [PATCH 253/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.19.0 to 3.19.1 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.19.0 to 3.19.1. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.19.0...v3.19.1) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 12de6d15..47597c97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.2" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.19.0", + "ibm_cloud_sdk_core==3.19.1", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 9529a3242d4e67932f92e0228564b61f48ff1612 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:28:55 +0000 Subject: [PATCH 254/669] build(deps-dev): Bump coverage from 7.4.0 to 7.4.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.0 to 7.4.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.0...7.4.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a01754ec..366b3b46 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.24.1 python_dotenv==1.0.1 pylint==3.0.3 # code coverage -coverage==7.4.0 +coverage==7.4.1 pytest-cov==4.1.0 From fa9aa5cdafcb217e7299a449170cb2d9a776ca8c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:46:22 +0000 Subject: [PATCH 255/669] build(deps-dev): Bump pytest from 7.4.4 to 8.0.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.4...8.0.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 366b3b46..3d8285ef 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==7.4.4 +pytest==8.0.0 responses==0.24.1 python_dotenv==1.0.1 pylint==3.0.3 From f693f7f440a591c3c8409c9ca98fe5db837ee2b1 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Mon, 5 Feb 2024 09:43:58 -0400 Subject: [PATCH 256/669] ci(chore): update actions checkout and setup-python in github workflows --- .github/workflows/docs.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6855de6f..9ec53b12 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Setup python 3.12 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.12' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b39e31a..c9604ba0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,11 +33,11 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: 'pip' From f955eb3f3b4335124b661ac7af22b7ea91ec6a65 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 8 Feb 2024 14:47:35 +0000 Subject: [PATCH 257/669] build(generated): update generator to 3.85.0 Generated SDK source code using: - Generator version 3.85.0 - Specification version 1.0.0-dev0.1.5 - Automation (cloudant-sdks) version 9990b3f Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 1804 ++++++++++++++++++------------------ 1 file changed, 902 insertions(+), 902 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 6d5ec949..e22d8a32 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -8511,86 +8511,86 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ActiveTask': """Initialize a ActiveTask object from a json dictionary.""" args = {} - if 'bulk_get_attempts' in _dict: - args['bulk_get_attempts'] = _dict.get('bulk_get_attempts') - if 'bulk_get_docs' in _dict: - args['bulk_get_docs'] = _dict.get('bulk_get_docs') - if 'changes_done' in _dict: - args['changes_done'] = _dict.get('changes_done') - if 'changes_pending' in _dict: - args['changes_pending'] = _dict.get('changes_pending') - if 'checkpoint_interval' in _dict: - args['checkpoint_interval'] = _dict.get('checkpoint_interval') - if 'checkpointed_source_seq' in _dict: - args['checkpointed_source_seq'] = _dict.get('checkpointed_source_seq') - if 'continuous' in _dict: - args['continuous'] = _dict.get('continuous') - if 'database' in _dict: - args['database'] = _dict.get('database') + if (bulk_get_attempts := _dict.get('bulk_get_attempts')) is not None: + args['bulk_get_attempts'] = bulk_get_attempts + if (bulk_get_docs := _dict.get('bulk_get_docs')) is not None: + args['bulk_get_docs'] = bulk_get_docs + if (changes_done := _dict.get('changes_done')) is not None: + args['changes_done'] = changes_done + if (changes_pending := _dict.get('changes_pending')) is not None: + args['changes_pending'] = changes_pending + if (checkpoint_interval := _dict.get('checkpoint_interval')) is not None: + args['checkpoint_interval'] = checkpoint_interval + if (checkpointed_source_seq := _dict.get('checkpointed_source_seq')) is not None: + args['checkpointed_source_seq'] = checkpointed_source_seq + if (continuous := _dict.get('continuous')) is not None: + args['continuous'] = continuous + if (database := _dict.get('database')) is not None: + args['database'] = database else: raise ValueError('Required property \'database\' not present in ActiveTask JSON') - if 'design_document' in _dict: - args['design_document'] = _dict.get('design_document') - if 'doc_id' in _dict: - args['doc_id'] = _dict.get('doc_id') - if 'doc_write_failures' in _dict: - args['doc_write_failures'] = _dict.get('doc_write_failures') - if 'docs_read' in _dict: - args['docs_read'] = _dict.get('docs_read') - if 'docs_written' in _dict: - args['docs_written'] = _dict.get('docs_written') - if 'index' in _dict: - args['index'] = _dict.get('index') - if 'indexer_pid' in _dict: - args['indexer_pid'] = _dict.get('indexer_pid') - if 'missing_revisions_found' in _dict: - args['missing_revisions_found'] = _dict.get('missing_revisions_found') - if 'node' in _dict: - args['node'] = _dict.get('node') + if (design_document := _dict.get('design_document')) is not None: + args['design_document'] = design_document + if (doc_id := _dict.get('doc_id')) is not None: + args['doc_id'] = doc_id + if (doc_write_failures := _dict.get('doc_write_failures')) is not None: + args['doc_write_failures'] = doc_write_failures + if (docs_read := _dict.get('docs_read')) is not None: + args['docs_read'] = docs_read + if (docs_written := _dict.get('docs_written')) is not None: + args['docs_written'] = docs_written + if (index := _dict.get('index')) is not None: + args['index'] = index + if (indexer_pid := _dict.get('indexer_pid')) is not None: + args['indexer_pid'] = indexer_pid + if (missing_revisions_found := _dict.get('missing_revisions_found')) is not None: + args['missing_revisions_found'] = missing_revisions_found + if (node := _dict.get('node')) is not None: + args['node'] = node else: raise ValueError('Required property \'node\' not present in ActiveTask JSON') - if 'phase' in _dict: - args['phase'] = _dict.get('phase') - if 'pid' in _dict: - args['pid'] = _dict.get('pid') + if (phase := _dict.get('phase')) is not None: + args['phase'] = phase + if (pid := _dict.get('pid')) is not None: + args['pid'] = pid else: raise ValueError('Required property \'pid\' not present in ActiveTask JSON') - if 'process_status' in _dict: - args['process_status'] = _dict.get('process_status') - if 'progress' in _dict: - args['progress'] = _dict.get('progress') - if 'replication_id' in _dict: - args['replication_id'] = _dict.get('replication_id') - if 'retry' in _dict: - args['retry'] = _dict.get('retry') - if 'revisions_checked' in _dict: - args['revisions_checked'] = _dict.get('revisions_checked') - if 'source' in _dict: - args['source'] = _dict.get('source') - if 'source_seq' in _dict: - args['source_seq'] = _dict.get('source_seq') - if 'started_on' in _dict: - args['started_on'] = _dict.get('started_on') + if (process_status := _dict.get('process_status')) is not None: + args['process_status'] = process_status + if (progress := _dict.get('progress')) is not None: + args['progress'] = progress + if (replication_id := _dict.get('replication_id')) is not None: + args['replication_id'] = replication_id + if (retry := _dict.get('retry')) is not None: + args['retry'] = retry + if (revisions_checked := _dict.get('revisions_checked')) is not None: + args['revisions_checked'] = revisions_checked + if (source := _dict.get('source')) is not None: + args['source'] = source + if (source_seq := _dict.get('source_seq')) is not None: + args['source_seq'] = source_seq + if (started_on := _dict.get('started_on')) is not None: + args['started_on'] = started_on else: raise ValueError('Required property \'started_on\' not present in ActiveTask JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') - if 'through_seq' in _dict: - args['through_seq'] = _dict.get('through_seq') - if 'total_changes' in _dict: - args['total_changes'] = _dict.get('total_changes') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (target := _dict.get('target')) is not None: + args['target'] = target + if (through_seq := _dict.get('through_seq')) is not None: + args['through_seq'] = through_seq + if (total_changes := _dict.get('total_changes')) is not None: + args['total_changes'] = total_changes + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in ActiveTask JSON') - if 'updated_on' in _dict: - args['updated_on'] = _dict.get('updated_on') + if (updated_on := _dict.get('updated_on')) is not None: + args['updated_on'] = updated_on else: raise ValueError('Required property \'updated_on\' not present in ActiveTask JSON') - if 'user' in _dict: - args['user'] = _dict.get('user') - if 'view' in _dict: - args['view'] = _dict.get('view') + if (user := _dict.get('user')) is not None: + args['user'] = user + if (view := _dict.get('view')) is not None: + args['view'] = view return cls(**args) @classmethod @@ -8755,8 +8755,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ActivityTrackerEvents': """Initialize a ActivityTrackerEvents object from a json dictionary.""" args = {} - if 'types' in _dict: - args['types'] = _dict.get('types') + if (types := _dict.get('types')) is not None: + args['types'] = types else: raise ValueError('Required property \'types\' not present in ActivityTrackerEvents JSON') return cls(**args) @@ -8827,8 +8827,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'AllDocsQueriesResult': """Initialize a AllDocsQueriesResult object from a json dictionary.""" args = {} - if 'results' in _dict: - args['results'] = [AllDocsResult.from_dict(v) for v in _dict.get('results')] + if (results := _dict.get('results')) is not None: + args['results'] = [AllDocsResult.from_dict(v) for v in results] else: raise ValueError('Required property \'results\' not present in AllDocsQueriesResult JSON') return cls(**args) @@ -8965,32 +8965,32 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'AllDocsQuery': """Initialize a AllDocsQuery object from a json dictionary.""" args = {} - if 'att_encoding_info' in _dict: - args['att_encoding_info'] = _dict.get('att_encoding_info') - if 'attachments' in _dict: - args['attachments'] = _dict.get('attachments') - if 'conflicts' in _dict: - args['conflicts'] = _dict.get('conflicts') - if 'descending' in _dict: - args['descending'] = _dict.get('descending') - if 'include_docs' in _dict: - args['include_docs'] = _dict.get('include_docs') - if 'inclusive_end' in _dict: - args['inclusive_end'] = _dict.get('inclusive_end') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - if 'skip' in _dict: - args['skip'] = _dict.get('skip') - if 'update_seq' in _dict: - args['update_seq'] = _dict.get('update_seq') - if 'end_key' in _dict: - args['end_key'] = _dict.get('end_key') - if 'key' in _dict: - args['key'] = _dict.get('key') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'start_key' in _dict: - args['start_key'] = _dict.get('start_key') + if (att_encoding_info := _dict.get('att_encoding_info')) is not None: + args['att_encoding_info'] = att_encoding_info + if (attachments := _dict.get('attachments')) is not None: + args['attachments'] = attachments + if (conflicts := _dict.get('conflicts')) is not None: + args['conflicts'] = conflicts + if (descending := _dict.get('descending')) is not None: + args['descending'] = descending + if (include_docs := _dict.get('include_docs')) is not None: + args['include_docs'] = include_docs + if (inclusive_end := _dict.get('inclusive_end')) is not None: + args['inclusive_end'] = inclusive_end + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (skip := _dict.get('skip')) is not None: + args['skip'] = skip + if (update_seq := _dict.get('update_seq')) is not None: + args['update_seq'] = update_seq + if (end_key := _dict.get('end_key')) is not None: + args['end_key'] = end_key + if (key := _dict.get('key')) is not None: + args['key'] = key + if (keys := _dict.get('keys')) is not None: + args['keys'] = keys + if (start_key := _dict.get('start_key')) is not None: + args['start_key'] = start_key return cls(**args) @classmethod @@ -9079,16 +9079,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'AllDocsResult': """Initialize a AllDocsResult object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows else: raise ValueError('Required property \'total_rows\' not present in AllDocsResult JSON') - if 'rows' in _dict: - args['rows'] = [DocsResultRow.from_dict(v) for v in _dict.get('rows')] + if (rows := _dict.get('rows')) is not None: + args['rows'] = [DocsResultRow.from_dict(v) for v in rows] else: raise ValueError('Required property \'rows\' not present in AllDocsResult JSON') - if 'update_seq' in _dict: - args['update_seq'] = _dict.get('update_seq') + if (update_seq := _dict.get('update_seq')) is not None: + args['update_seq'] = update_seq return cls(**args) @classmethod @@ -9170,10 +9170,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Analyzer': """Initialize a Analyzer object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'stopwords' in _dict: - args['stopwords'] = _dict.get('stopwords') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (stopwords := _dict.get('stopwords')) is not None: + args['stopwords'] = stopwords return cls(**args) @classmethod @@ -9305,12 +9305,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'AnalyzerConfiguration': """Initialize a AnalyzerConfiguration object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'stopwords' in _dict: - args['stopwords'] = _dict.get('stopwords') - if 'fields' in _dict: - args['fields'] = {k: Analyzer.from_dict(v) for k, v in _dict.get('fields').items()} + if (name := _dict.get('name')) is not None: + args['name'] = name + if (stopwords := _dict.get('stopwords')) is not None: + args['stopwords'] = stopwords + if (fields := _dict.get('fields')) is not None: + args['fields'] = {k: Analyzer.from_dict(v) for k, v in fields.items()} return cls(**args) @classmethod @@ -9436,16 +9436,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ApiKeysResult': """Initialize a ApiKeysResult object from a json dictionary.""" args = {} - if 'ok' in _dict: - args['ok'] = _dict.get('ok') + if (ok := _dict.get('ok')) is not None: + args['ok'] = ok else: raise ValueError('Required property \'ok\' not present in ApiKeysResult JSON') - if 'key' in _dict: - args['key'] = _dict.get('key') + if (key := _dict.get('key')) is not None: + args['key'] = key else: raise ValueError('Required property \'key\' not present in ApiKeysResult JSON') - if 'password' in _dict: - args['password'] = _dict.get('password') + if (password := _dict.get('password')) is not None: + args['password'] = password else: raise ValueError('Required property \'password\' not present in ApiKeysResult JSON') return cls(**args) @@ -9569,24 +9569,24 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Attachment': """Initialize a Attachment object from a json dictionary.""" args = {} - if 'content_type' in _dict: - args['content_type'] = _dict.get('content_type') - if 'data' in _dict: - args['data'] = base64.b64decode(_dict.get('data')) - if 'digest' in _dict: - args['digest'] = _dict.get('digest') - if 'encoded_length' in _dict: - args['encoded_length'] = _dict.get('encoded_length') - if 'encoding' in _dict: - args['encoding'] = _dict.get('encoding') - if 'follows' in _dict: - args['follows'] = _dict.get('follows') - if 'length' in _dict: - args['length'] = _dict.get('length') - if 'revpos' in _dict: - args['revpos'] = _dict.get('revpos') - if 'stub' in _dict: - args['stub'] = _dict.get('stub') + if (content_type := _dict.get('content_type')) is not None: + args['content_type'] = content_type + if (data := _dict.get('data')) is not None: + args['data'] = base64.b64decode(data) + if (digest := _dict.get('digest')) is not None: + args['digest'] = digest + if (encoded_length := _dict.get('encoded_length')) is not None: + args['encoded_length'] = encoded_length + if (encoding := _dict.get('encoding')) is not None: + args['encoding'] = encoding + if (follows := _dict.get('follows')) is not None: + args['follows'] = follows + if (length := _dict.get('length')) is not None: + args['length'] = length + if (revpos := _dict.get('revpos')) is not None: + args['revpos'] = revpos + if (stub := _dict.get('stub')) is not None: + args['stub'] = stub return cls(**args) @classmethod @@ -9665,12 +9665,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'BulkDocs': """Initialize a BulkDocs object from a json dictionary.""" args = {} - if 'docs' in _dict: - args['docs'] = [Document.from_dict(v) for v in _dict.get('docs')] + if (docs := _dict.get('docs')) is not None: + args['docs'] = [Document.from_dict(v) for v in docs] else: raise ValueError('Required property \'docs\' not present in BulkDocs JSON') - if 'new_edits' in _dict: - args['new_edits'] = _dict.get('new_edits') + if (new_edits := _dict.get('new_edits')) is not None: + args['new_edits'] = new_edits return cls(**args) @classmethod @@ -9745,14 +9745,14 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'BulkGetQueryDocument': """Initialize a BulkGetQueryDocument object from a json dictionary.""" args = {} - if 'atts_since' in _dict: - args['atts_since'] = _dict.get('atts_since') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (atts_since := _dict.get('atts_since')) is not None: + args['atts_since'] = atts_since + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in BulkGetQueryDocument JSON') - if 'rev' in _dict: - args['rev'] = _dict.get('rev') + if (rev := _dict.get('rev')) is not None: + args['rev'] = rev return cls(**args) @classmethod @@ -9812,8 +9812,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'BulkGetResult': """Initialize a BulkGetResult object from a json dictionary.""" args = {} - if 'results' in _dict: - args['results'] = [BulkGetResultItem.from_dict(v) for v in _dict.get('results')] + if (results := _dict.get('results')) is not None: + args['results'] = [BulkGetResultItem.from_dict(v) for v in results] else: raise ValueError('Required property \'results\' not present in BulkGetResult JSON') return cls(**args) @@ -9885,10 +9885,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'BulkGetResultDocument': """Initialize a BulkGetResultDocument object from a json dictionary.""" args = {} - if 'error' in _dict: - args['error'] = DocumentResult.from_dict(_dict.get('error')) - if 'ok' in _dict: - args['ok'] = Document.from_dict(_dict.get('ok')) + if (error := _dict.get('error')) is not None: + args['error'] = DocumentResult.from_dict(error) + if (ok := _dict.get('ok')) is not None: + args['ok'] = Document.from_dict(ok) return cls(**args) @classmethod @@ -9958,12 +9958,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'BulkGetResultItem': """Initialize a BulkGetResultItem object from a json dictionary.""" args = {} - if 'docs' in _dict: - args['docs'] = [BulkGetResultDocument.from_dict(v) for v in _dict.get('docs')] + if (docs := _dict.get('docs')) is not None: + args['docs'] = [BulkGetResultDocument.from_dict(v) for v in docs] else: raise ValueError('Required property \'docs\' not present in BulkGetResultItem JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in BulkGetResultItem JSON') return cls(**args) @@ -10038,12 +10038,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'CapacityThroughputInformation': """Initialize a CapacityThroughputInformation object from a json dictionary.""" args = {} - if 'current' in _dict: - args['current'] = CapacityThroughputInformationCurrent.from_dict(_dict.get('current')) + if (current := _dict.get('current')) is not None: + args['current'] = CapacityThroughputInformationCurrent.from_dict(current) else: raise ValueError('Required property \'current\' not present in CapacityThroughputInformation JSON') - if 'target' in _dict: - args['target'] = CapacityThroughputInformationTarget.from_dict(_dict.get('target')) + if (target := _dict.get('target')) is not None: + args['target'] = CapacityThroughputInformationTarget.from_dict(target) return cls(**args) @classmethod @@ -10110,8 +10110,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'CapacityThroughputInformationCurrent': """Initialize a CapacityThroughputInformationCurrent object from a json dictionary.""" args = {} - if 'throughput' in _dict: - args['throughput'] = ThroughputInformation.from_dict(_dict.get('throughput')) + if (throughput := _dict.get('throughput')) is not None: + args['throughput'] = ThroughputInformation.from_dict(throughput) else: raise ValueError('Required property \'throughput\' not present in CapacityThroughputInformationCurrent JSON') return cls(**args) @@ -10175,8 +10175,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'CapacityThroughputInformationTarget': """Initialize a CapacityThroughputInformationTarget object from a json dictionary.""" args = {} - if 'throughput' in _dict: - args['throughput'] = ThroughputInformation.from_dict(_dict.get('throughput')) + if (throughput := _dict.get('throughput')) is not None: + args['throughput'] = ThroughputInformation.from_dict(throughput) else: raise ValueError('Required property \'throughput\' not present in CapacityThroughputInformationTarget JSON') return cls(**args) @@ -10237,8 +10237,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Change': """Initialize a Change object from a json dictionary.""" args = {} - if 'rev' in _dict: - args['rev'] = _dict.get('rev') + if (rev := _dict.get('rev')) is not None: + args['rev'] = rev else: raise ValueError('Required property \'rev\' not present in Change JSON') return cls(**args) @@ -10304,16 +10304,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ChangesResult': """Initialize a ChangesResult object from a json dictionary.""" args = {} - if 'last_seq' in _dict: - args['last_seq'] = _dict.get('last_seq') + if (last_seq := _dict.get('last_seq')) is not None: + args['last_seq'] = last_seq else: raise ValueError('Required property \'last_seq\' not present in ChangesResult JSON') - if 'pending' in _dict: - args['pending'] = _dict.get('pending') + if (pending := _dict.get('pending')) is not None: + args['pending'] = pending else: raise ValueError('Required property \'pending\' not present in ChangesResult JSON') - if 'results' in _dict: - args['results'] = [ChangesResultItem.from_dict(v) for v in _dict.get('results')] + if (results := _dict.get('results')) is not None: + args['results'] = [ChangesResultItem.from_dict(v) for v in results] else: raise ValueError('Required property \'results\' not present in ChangesResult JSON') return cls(**args) @@ -10399,20 +10399,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ChangesResultItem': """Initialize a ChangesResultItem object from a json dictionary.""" args = {} - if 'changes' in _dict: - args['changes'] = [Change.from_dict(v) for v in _dict.get('changes')] + if (changes := _dict.get('changes')) is not None: + args['changes'] = [Change.from_dict(v) for v in changes] else: raise ValueError('Required property \'changes\' not present in ChangesResultItem JSON') - if 'deleted' in _dict: - args['deleted'] = _dict.get('deleted') - if 'doc' in _dict: - args['doc'] = Document.from_dict(_dict.get('doc')) - if 'id' in _dict: - args['id'] = _dict.get('id') + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = deleted + if (doc := _dict.get('doc')) is not None: + args['doc'] = Document.from_dict(doc) + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in ChangesResultItem JSON') - if 'seq' in _dict: - args['seq'] = _dict.get('seq') + if (seq := _dict.get('seq')) is not None: + args['seq'] = seq else: raise ValueError('Required property \'seq\' not present in ChangesResultItem JSON') return cls(**args) @@ -10495,16 +10495,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ContentInformationSizes': """Initialize a ContentInformationSizes object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') + if (active := _dict.get('active')) is not None: + args['active'] = active else: raise ValueError('Required property \'active\' not present in ContentInformationSizes JSON') - if 'external' in _dict: - args['external'] = _dict.get('external') + if (external := _dict.get('external')) is not None: + args['external'] = external else: raise ValueError('Required property \'external\' not present in ContentInformationSizes JSON') - if 'file' in _dict: - args['file'] = _dict.get('file') + if (file := _dict.get('file')) is not None: + args['file'] = file else: raise ValueError('Required property \'file\' not present in ContentInformationSizes JSON') return cls(**args) @@ -10584,16 +10584,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'CorsInformation': """Initialize a CorsInformation object from a json dictionary.""" args = {} - if 'allow_credentials' in _dict: - args['allow_credentials'] = _dict.get('allow_credentials') + if (allow_credentials := _dict.get('allow_credentials')) is not None: + args['allow_credentials'] = allow_credentials else: raise ValueError('Required property \'allow_credentials\' not present in CorsInformation JSON') - if 'enable_cors' in _dict: - args['enable_cors'] = _dict.get('enable_cors') + if (enable_cors := _dict.get('enable_cors')) is not None: + args['enable_cors'] = enable_cors else: raise ValueError('Required property \'enable_cors\' not present in CorsInformation JSON') - if 'origins' in _dict: - args['origins'] = _dict.get('origins') + if (origins := _dict.get('origins')) is not None: + args['origins'] = origins else: raise ValueError('Required property \'origins\' not present in CorsInformation JSON') return cls(**args) @@ -10657,8 +10657,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'CurrentThroughputInformation': """Initialize a CurrentThroughputInformation object from a json dictionary.""" args = {} - if 'throughput' in _dict: - args['throughput'] = CurrentThroughputInformationThroughput.from_dict(_dict.get('throughput')) + if (throughput := _dict.get('throughput')) is not None: + args['throughput'] = CurrentThroughputInformationThroughput.from_dict(throughput) else: raise ValueError('Required property \'throughput\' not present in CurrentThroughputInformation JSON') return cls(**args) @@ -10733,16 +10733,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'CurrentThroughputInformationThroughput': """Initialize a CurrentThroughputInformationThroughput object from a json dictionary.""" args = {} - if 'query' in _dict: - args['query'] = _dict.get('query') + if (query := _dict.get('query')) is not None: + args['query'] = query else: raise ValueError('Required property \'query\' not present in CurrentThroughputInformationThroughput JSON') - if 'read' in _dict: - args['read'] = _dict.get('read') + if (read := _dict.get('read')) is not None: + args['read'] = read else: raise ValueError('Required property \'read\' not present in CurrentThroughputInformationThroughput JSON') - if 'write' in _dict: - args['write'] = _dict.get('write') + if (write := _dict.get('write')) is not None: + args['write'] = write else: raise ValueError('Required property \'write\' not present in CurrentThroughputInformationThroughput JSON') return cls(**args) @@ -10872,52 +10872,52 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': """Initialize a DatabaseInformation object from a json dictionary.""" args = {} - if 'cluster' in _dict: - args['cluster'] = DatabaseInformationCluster.from_dict(_dict.get('cluster')) + if (cluster := _dict.get('cluster')) is not None: + args['cluster'] = DatabaseInformationCluster.from_dict(cluster) else: raise ValueError('Required property \'cluster\' not present in DatabaseInformation JSON') - if 'committed_update_seq' in _dict: - args['committed_update_seq'] = _dict.get('committed_update_seq') - if 'compact_running' in _dict: - args['compact_running'] = _dict.get('compact_running') + if (committed_update_seq := _dict.get('committed_update_seq')) is not None: + args['committed_update_seq'] = committed_update_seq + if (compact_running := _dict.get('compact_running')) is not None: + args['compact_running'] = compact_running else: raise ValueError('Required property \'compact_running\' not present in DatabaseInformation JSON') - if 'compacted_seq' in _dict: - args['compacted_seq'] = _dict.get('compacted_seq') - if 'db_name' in _dict: - args['db_name'] = _dict.get('db_name') + if (compacted_seq := _dict.get('compacted_seq')) is not None: + args['compacted_seq'] = compacted_seq + if (db_name := _dict.get('db_name')) is not None: + args['db_name'] = db_name else: raise ValueError('Required property \'db_name\' not present in DatabaseInformation JSON') - if 'disk_format_version' in _dict: - args['disk_format_version'] = _dict.get('disk_format_version') + if (disk_format_version := _dict.get('disk_format_version')) is not None: + args['disk_format_version'] = disk_format_version else: raise ValueError('Required property \'disk_format_version\' not present in DatabaseInformation JSON') - if 'doc_count' in _dict: - args['doc_count'] = _dict.get('doc_count') + if (doc_count := _dict.get('doc_count')) is not None: + args['doc_count'] = doc_count else: raise ValueError('Required property \'doc_count\' not present in DatabaseInformation JSON') - if 'doc_del_count' in _dict: - args['doc_del_count'] = _dict.get('doc_del_count') + if (doc_del_count := _dict.get('doc_del_count')) is not None: + args['doc_del_count'] = doc_del_count else: raise ValueError('Required property \'doc_del_count\' not present in DatabaseInformation JSON') - if 'engine' in _dict: - args['engine'] = _dict.get('engine') - if 'props' in _dict: - args['props'] = DatabaseInformationProps.from_dict(_dict.get('props')) + if (engine := _dict.get('engine')) is not None: + args['engine'] = engine + if (props := _dict.get('props')) is not None: + args['props'] = DatabaseInformationProps.from_dict(props) else: raise ValueError('Required property \'props\' not present in DatabaseInformation JSON') - if 'sizes' in _dict: - args['sizes'] = ContentInformationSizes.from_dict(_dict.get('sizes')) + if (sizes := _dict.get('sizes')) is not None: + args['sizes'] = ContentInformationSizes.from_dict(sizes) else: raise ValueError('Required property \'sizes\' not present in DatabaseInformation JSON') - if 'update_seq' in _dict: - args['update_seq'] = _dict.get('update_seq') + if (update_seq := _dict.get('update_seq')) is not None: + args['update_seq'] = update_seq else: raise ValueError('Required property \'update_seq\' not present in DatabaseInformation JSON') - if 'uuid' in _dict: - args['uuid'] = _dict.get('uuid') - if 'partitioned_indexes' in _dict: - args['partitioned_indexes'] = PartitionedIndexesInformation.from_dict(_dict.get('partitioned_indexes')) + if (uuid := _dict.get('uuid')) is not None: + args['uuid'] = uuid + if (partitioned_indexes := _dict.get('partitioned_indexes')) is not None: + args['partitioned_indexes'] = PartitionedIndexesInformation.from_dict(partitioned_indexes) return cls(**args) @classmethod @@ -11032,20 +11032,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DatabaseInformationCluster': """Initialize a DatabaseInformationCluster object from a json dictionary.""" args = {} - if 'n' in _dict: - args['n'] = _dict.get('n') + if (n := _dict.get('n')) is not None: + args['n'] = n else: raise ValueError('Required property \'n\' not present in DatabaseInformationCluster JSON') - if 'q' in _dict: - args['q'] = _dict.get('q') + if (q := _dict.get('q')) is not None: + args['q'] = q else: raise ValueError('Required property \'q\' not present in DatabaseInformationCluster JSON') - if 'r' in _dict: - args['r'] = _dict.get('r') + if (r := _dict.get('r')) is not None: + args['r'] = r else: raise ValueError('Required property \'r\' not present in DatabaseInformationCluster JSON') - if 'w' in _dict: - args['w'] = _dict.get('w') + if (w := _dict.get('w')) is not None: + args['w'] = w else: raise ValueError('Required property \'w\' not present in DatabaseInformationCluster JSON') return cls(**args) @@ -11112,8 +11112,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DatabaseInformationProps': """Initialize a DatabaseInformationProps object from a json dictionary.""" args = {} - if 'partitioned' in _dict: - args['partitioned'] = _dict.get('partitioned') + if (partitioned := _dict.get('partitioned')) is not None: + args['partitioned'] = partitioned return cls(**args) @classmethod @@ -11177,16 +11177,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DbEvent': """Initialize a DbEvent object from a json dictionary.""" args = {} - if 'db_name' in _dict: - args['db_name'] = _dict.get('db_name') + if (db_name := _dict.get('db_name')) is not None: + args['db_name'] = db_name else: raise ValueError('Required property \'db_name\' not present in DbEvent JSON') - if 'seq' in _dict: - args['seq'] = _dict.get('seq') + if (seq := _dict.get('seq')) is not None: + args['seq'] = seq else: raise ValueError('Required property \'seq\' not present in DbEvent JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in DbEvent JSON') return cls(**args) @@ -11262,12 +11262,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DbUpdates': """Initialize a DbUpdates object from a json dictionary.""" args = {} - if 'last_seq' in _dict: - args['last_seq'] = _dict.get('last_seq') + if (last_seq := _dict.get('last_seq')) is not None: + args['last_seq'] = last_seq else: raise ValueError('Required property \'last_seq\' not present in DbUpdates JSON') - if 'results' in _dict: - args['results'] = [DbEvent.from_dict(v) for v in _dict.get('results')] + if (results := _dict.get('results')) is not None: + args['results'] = [DbEvent.from_dict(v) for v in results] else: raise ValueError('Required property \'results\' not present in DbUpdates JSON') return cls(**args) @@ -11344,12 +11344,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DbsInfoResult': """Initialize a DbsInfoResult object from a json dictionary.""" args = {} - if 'error' in _dict: - args['error'] = _dict.get('error') - if 'info' in _dict: - args['info'] = DatabaseInformation.from_dict(_dict.get('info')) - if 'key' in _dict: - args['key'] = _dict.get('key') + if (error := _dict.get('error')) is not None: + args['error'] = error + if (info := _dict.get('info')) is not None: + args['info'] = DatabaseInformation.from_dict(info) + if (key := _dict.get('key')) is not None: + args['key'] = key else: raise ValueError('Required property \'key\' not present in DbsInfoResult JSON') return cls(**args) @@ -11622,38 +11622,38 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DesignDocument': """Initialize a DesignDocument object from a json dictionary.""" args = {} - if '_attachments' in _dict: - args['attachments'] = {k: Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} - if '_conflicts' in _dict: - args['conflicts'] = _dict.get('_conflicts') - if '_deleted' in _dict: - args['deleted'] = _dict.get('_deleted') - if '_deleted_conflicts' in _dict: - args['deleted_conflicts'] = _dict.get('_deleted_conflicts') - if '_id' in _dict: - args['id'] = _dict.get('_id') - if '_local_seq' in _dict: - args['local_seq'] = _dict.get('_local_seq') - if '_rev' in _dict: - args['rev'] = _dict.get('_rev') - if '_revisions' in _dict: - args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) - if '_revs_info' in _dict: - args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] - if 'autoupdate' in _dict: - args['autoupdate'] = _dict.get('autoupdate') - if 'filters' in _dict: - args['filters'] = _dict.get('filters') - if 'indexes' in _dict: - args['indexes'] = {k: SearchIndexDefinition.from_dict(v) for k, v in _dict.get('indexes').items()} - if 'language' in _dict: - args['language'] = _dict.get('language') - if 'options' in _dict: - args['options'] = DesignDocumentOptions.from_dict(_dict.get('options')) - if 'validate_doc_update' in _dict: - args['validate_doc_update'] = _dict.get('validate_doc_update') - if 'views' in _dict: - args['views'] = {k: DesignDocumentViewsMapReduce.from_dict(v) for k, v in _dict.get('views').items()} + if (attachments := _dict.get('_attachments')) is not None: + args['attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} + if (conflicts := _dict.get('_conflicts')) is not None: + args['conflicts'] = conflicts + if (deleted := _dict.get('_deleted')) is not None: + args['deleted'] = deleted + if (deleted_conflicts := _dict.get('_deleted_conflicts')) is not None: + args['deleted_conflicts'] = deleted_conflicts + if (id := _dict.get('_id')) is not None: + args['id'] = id + if (local_seq := _dict.get('_local_seq')) is not None: + args['local_seq'] = local_seq + if (rev := _dict.get('_rev')) is not None: + args['rev'] = rev + if (revisions := _dict.get('_revisions')) is not None: + args['revisions'] = Revisions.from_dict(revisions) + if (revs_info := _dict.get('_revs_info')) is not None: + args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] + if (autoupdate := _dict.get('autoupdate')) is not None: + args['autoupdate'] = autoupdate + if (filters := _dict.get('filters')) is not None: + args['filters'] = filters + if (indexes := _dict.get('indexes')) is not None: + args['indexes'] = {k: SearchIndexDefinition.from_dict(v) for k, v in indexes.items()} + if (language := _dict.get('language')) is not None: + args['language'] = language + if (options := _dict.get('options')) is not None: + args['options'] = DesignDocumentOptions.from_dict(options) + if (validate_doc_update := _dict.get('validate_doc_update')) is not None: + args['validate_doc_update'] = validate_doc_update + if (views := _dict.get('views')) is not None: + args['views'] = {k: DesignDocumentViewsMapReduce.from_dict(v) for k, v in views.items()} args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -11793,12 +11793,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DesignDocumentInformation': """Initialize a DesignDocumentInformation object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in DesignDocumentInformation JSON') - if 'view_index' in _dict: - args['view_index'] = DesignDocumentViewIndex.from_dict(_dict.get('view_index')) + if (view_index := _dict.get('view_index')) is not None: + args['view_index'] = DesignDocumentViewIndex.from_dict(view_index) else: raise ValueError('Required property \'view_index\' not present in DesignDocumentInformation JSON') return cls(**args) @@ -11864,8 +11864,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DesignDocumentOptions': """Initialize a DesignDocumentOptions object from a json dictionary.""" args = {} - if 'partitioned' in _dict: - args['partitioned'] = _dict.get('partitioned') + if (partitioned := _dict.get('partitioned')) is not None: + args['partitioned'] = partitioned return cls(**args) @classmethod @@ -11967,40 +11967,40 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewIndex': """Initialize a DesignDocumentViewIndex object from a json dictionary.""" args = {} - if 'collator_versions' in _dict: - args['collator_versions'] = _dict.get('collator_versions') + if (collator_versions := _dict.get('collator_versions')) is not None: + args['collator_versions'] = collator_versions else: raise ValueError('Required property \'collator_versions\' not present in DesignDocumentViewIndex JSON') - if 'compact_running' in _dict: - args['compact_running'] = _dict.get('compact_running') + if (compact_running := _dict.get('compact_running')) is not None: + args['compact_running'] = compact_running else: raise ValueError('Required property \'compact_running\' not present in DesignDocumentViewIndex JSON') - if 'language' in _dict: - args['language'] = _dict.get('language') + if (language := _dict.get('language')) is not None: + args['language'] = language else: raise ValueError('Required property \'language\' not present in DesignDocumentViewIndex JSON') - if 'signature' in _dict: - args['signature'] = _dict.get('signature') + if (signature := _dict.get('signature')) is not None: + args['signature'] = signature else: raise ValueError('Required property \'signature\' not present in DesignDocumentViewIndex JSON') - if 'sizes' in _dict: - args['sizes'] = ContentInformationSizes.from_dict(_dict.get('sizes')) + if (sizes := _dict.get('sizes')) is not None: + args['sizes'] = ContentInformationSizes.from_dict(sizes) else: raise ValueError('Required property \'sizes\' not present in DesignDocumentViewIndex JSON') - if 'updater_running' in _dict: - args['updater_running'] = _dict.get('updater_running') + if (updater_running := _dict.get('updater_running')) is not None: + args['updater_running'] = updater_running else: raise ValueError('Required property \'updater_running\' not present in DesignDocumentViewIndex JSON') - if 'updates_pending' in _dict: - args['updates_pending'] = UpdatesPending.from_dict(_dict.get('updates_pending')) + if (updates_pending := _dict.get('updates_pending')) is not None: + args['updates_pending'] = UpdatesPending.from_dict(updates_pending) else: raise ValueError('Required property \'updates_pending\' not present in DesignDocumentViewIndex JSON') - if 'waiting_clients' in _dict: - args['waiting_clients'] = _dict.get('waiting_clients') + if (waiting_clients := _dict.get('waiting_clients')) is not None: + args['waiting_clients'] = waiting_clients else: raise ValueError('Required property \'waiting_clients\' not present in DesignDocumentViewIndex JSON') - if 'waiting_commit' in _dict: - args['waiting_commit'] = _dict.get('waiting_commit') + if (waiting_commit := _dict.get('waiting_commit')) is not None: + args['waiting_commit'] = waiting_commit else: raise ValueError('Required property \'waiting_commit\' not present in DesignDocumentViewIndex JSON') return cls(**args) @@ -12085,12 +12085,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduce': """Initialize a DesignDocumentViewsMapReduce object from a json dictionary.""" args = {} - if 'map' in _dict: - args['map'] = _dict.get('map') + if (map := _dict.get('map')) is not None: + args['map'] = map else: raise ValueError('Required property \'map\' not present in DesignDocumentViewsMapReduce JSON') - if 'reduce' in _dict: - args['reduce'] = _dict.get('reduce') + if (reduce := _dict.get('reduce')) is not None: + args['reduce'] = reduce return cls(**args) @classmethod @@ -12175,22 +12175,22 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DocsResultRow': """Initialize a DocsResultRow object from a json dictionary.""" args = {} - if 'caused_by' in _dict: - args['caused_by'] = _dict.get('caused_by') - if 'error' in _dict: - args['error'] = _dict.get('error') - if 'reason' in _dict: - args['reason'] = _dict.get('reason') - if 'doc' in _dict: - args['doc'] = Document.from_dict(_dict.get('doc')) - if 'id' in _dict: - args['id'] = _dict.get('id') - if 'key' in _dict: - args['key'] = _dict.get('key') + if (caused_by := _dict.get('caused_by')) is not None: + args['caused_by'] = caused_by + if (error := _dict.get('error')) is not None: + args['error'] = error + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason + if (doc := _dict.get('doc')) is not None: + args['doc'] = Document.from_dict(doc) + if (id := _dict.get('id')) is not None: + args['id'] = id + if (key := _dict.get('key')) is not None: + args['key'] = key else: raise ValueError('Required property \'key\' not present in DocsResultRow JSON') - if 'value' in _dict: - args['value'] = DocsResultRowValue.from_dict(_dict.get('value')) + if (value := _dict.get('value')) is not None: + args['value'] = DocsResultRowValue.from_dict(value) return cls(**args) @classmethod @@ -12271,10 +12271,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DocsResultRowValue': """Initialize a DocsResultRowValue object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = _dict.get('deleted') - if 'rev' in _dict: - args['rev'] = _dict.get('rev') + if (deleted := _dict.get('deleted')) is not None: + args['deleted'] = deleted + if (rev := _dict.get('rev')) is not None: + args['rev'] = rev else: raise ValueError('Required property \'rev\' not present in DocsResultRowValue JSON') return cls(**args) @@ -12387,24 +12387,24 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Document': """Initialize a Document object from a json dictionary.""" args = {} - if '_attachments' in _dict: - args['attachments'] = {k: Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} - if '_conflicts' in _dict: - args['conflicts'] = _dict.get('_conflicts') - if '_deleted' in _dict: - args['deleted'] = _dict.get('_deleted') - if '_deleted_conflicts' in _dict: - args['deleted_conflicts'] = _dict.get('_deleted_conflicts') - if '_id' in _dict: - args['id'] = _dict.get('_id') - if '_local_seq' in _dict: - args['local_seq'] = _dict.get('_local_seq') - if '_rev' in _dict: - args['rev'] = _dict.get('_rev') - if '_revisions' in _dict: - args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) - if '_revs_info' in _dict: - args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] + if (attachments := _dict.get('_attachments')) is not None: + args['attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} + if (conflicts := _dict.get('_conflicts')) is not None: + args['conflicts'] = conflicts + if (deleted := _dict.get('_deleted')) is not None: + args['deleted'] = deleted + if (deleted_conflicts := _dict.get('_deleted_conflicts')) is not None: + args['deleted_conflicts'] = deleted_conflicts + if (id := _dict.get('_id')) is not None: + args['id'] = id + if (local_seq := _dict.get('_local_seq')) is not None: + args['local_seq'] = local_seq + if (rev := _dict.get('_rev')) is not None: + args['rev'] = rev + if (revisions := _dict.get('_revisions')) is not None: + args['revisions'] = Revisions.from_dict(revisions) + if (revs_info := _dict.get('_revs_info')) is not None: + args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -12532,20 +12532,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DocumentResult': """Initialize a DocumentResult object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in DocumentResult JSON') - if 'rev' in _dict: - args['rev'] = _dict.get('rev') - if 'ok' in _dict: - args['ok'] = _dict.get('ok') - if 'caused_by' in _dict: - args['caused_by'] = _dict.get('caused_by') - if 'error' in _dict: - args['error'] = _dict.get('error') - if 'reason' in _dict: - args['reason'] = _dict.get('reason') + if (rev := _dict.get('rev')) is not None: + args['rev'] = rev + if (ok := _dict.get('ok')) is not None: + args['ok'] = ok + if (caused_by := _dict.get('caused_by')) is not None: + args['caused_by'] = caused_by + if (error := _dict.get('error')) is not None: + args['error'] = error + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason return cls(**args) @classmethod @@ -12620,12 +12620,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DocumentRevisionStatus': """Initialize a DocumentRevisionStatus object from a json dictionary.""" args = {} - if 'rev' in _dict: - args['rev'] = _dict.get('rev') + if (rev := _dict.get('rev')) is not None: + args['rev'] = rev else: raise ValueError('Required property \'rev\' not present in DocumentRevisionStatus JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in DocumentRevisionStatus JSON') return cls(**args) @@ -12701,12 +12701,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'DocumentShardInfo': """Initialize a DocumentShardInfo object from a json dictionary.""" args = {} - if 'nodes' in _dict: - args['nodes'] = _dict.get('nodes') + if (nodes := _dict.get('nodes')) is not None: + args['nodes'] = nodes else: raise ValueError('Required property \'nodes\' not present in DocumentShardInfo JSON') - if 'range' in _dict: - args['range'] = _dict.get('range') + if (range := _dict.get('range')) is not None: + args['range'] = range else: raise ValueError('Required property \'range\' not present in DocumentShardInfo JSON') return cls(**args) @@ -12784,24 +12784,24 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ExecutionStats': """Initialize a ExecutionStats object from a json dictionary.""" args = {} - if 'execution_time_ms' in _dict: - args['execution_time_ms'] = _dict.get('execution_time_ms') + if (execution_time_ms := _dict.get('execution_time_ms')) is not None: + args['execution_time_ms'] = execution_time_ms else: raise ValueError('Required property \'execution_time_ms\' not present in ExecutionStats JSON') - if 'results_returned' in _dict: - args['results_returned'] = _dict.get('results_returned') + if (results_returned := _dict.get('results_returned')) is not None: + args['results_returned'] = results_returned else: raise ValueError('Required property \'results_returned\' not present in ExecutionStats JSON') - if 'total_docs_examined' in _dict: - args['total_docs_examined'] = _dict.get('total_docs_examined') + if (total_docs_examined := _dict.get('total_docs_examined')) is not None: + args['total_docs_examined'] = total_docs_examined else: raise ValueError('Required property \'total_docs_examined\' not present in ExecutionStats JSON') - if 'total_keys_examined' in _dict: - args['total_keys_examined'] = _dict.get('total_keys_examined') + if (total_keys_examined := _dict.get('total_keys_examined')) is not None: + args['total_keys_examined'] = total_keys_examined else: raise ValueError('Required property \'total_keys_examined\' not present in ExecutionStats JSON') - if 'total_quorum_docs_examined' in _dict: - args['total_quorum_docs_examined'] = _dict.get('total_quorum_docs_examined') + if (total_quorum_docs_examined := _dict.get('total_quorum_docs_examined')) is not None: + args['total_quorum_docs_examined'] = total_quorum_docs_examined else: raise ValueError('Required property \'total_quorum_docs_examined\' not present in ExecutionStats JSON') return cls(**args) @@ -12971,40 +12971,40 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ExplainResult': """Initialize a ExplainResult object from a json dictionary.""" args = {} - if 'covering' in _dict: - args['covering'] = _dict.get('covering') + if (covering := _dict.get('covering')) is not None: + args['covering'] = covering else: raise ValueError('Required property \'covering\' not present in ExplainResult JSON') - if 'dbname' in _dict: - args['dbname'] = _dict.get('dbname') + if (dbname := _dict.get('dbname')) is not None: + args['dbname'] = dbname else: raise ValueError('Required property \'dbname\' not present in ExplainResult JSON') - if 'fields' in _dict: - args['fields'] = _dict.get('fields') + if (fields := _dict.get('fields')) is not None: + args['fields'] = fields else: raise ValueError('Required property \'fields\' not present in ExplainResult JSON') - if 'index' in _dict: - args['index'] = IndexInformation.from_dict(_dict.get('index')) + if (index := _dict.get('index')) is not None: + args['index'] = IndexInformation.from_dict(index) else: raise ValueError('Required property \'index\' not present in ExplainResult JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: raise ValueError('Required property \'limit\' not present in ExplainResult JSON') - if 'mrargs' in _dict: - args['mrargs'] = ExplainResultMrArgs.from_dict(_dict.get('mrargs')) - if 'opts' in _dict: - args['opts'] = ExplainResultOpts.from_dict(_dict.get('opts')) + if (mrargs := _dict.get('mrargs')) is not None: + args['mrargs'] = ExplainResultMrArgs.from_dict(mrargs) + if (opts := _dict.get('opts')) is not None: + args['opts'] = ExplainResultOpts.from_dict(opts) else: raise ValueError('Required property \'opts\' not present in ExplainResult JSON') - if 'partitioned' in _dict: - args['partitioned'] = _dict.get('partitioned') - if 'selector' in _dict: - args['selector'] = _dict.get('selector') + if (partitioned := _dict.get('partitioned')) is not None: + args['partitioned'] = partitioned + if (selector := _dict.get('selector')) is not None: + args['selector'] = selector else: raise ValueError('Required property \'selector\' not present in ExplainResult JSON') - if 'skip' in _dict: - args['skip'] = _dict.get('skip') + if (skip := _dict.get('skip')) is not None: + args['skip'] = skip else: raise ValueError('Required property \'skip\' not present in ExplainResult JSON') return cls(**args) @@ -13140,26 +13140,26 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': """Initialize a ExplainResultMrArgs object from a json dictionary.""" args = {} - if 'conflicts' in _dict: - args['conflicts'] = _dict.get('conflicts') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - if 'end_key' in _dict: - args['end_key'] = _dict.get('end_key') - if 'include_docs' in _dict: - args['include_docs'] = _dict.get('include_docs') - if 'partition' in _dict: - args['partition'] = _dict.get('partition') - if 'reduce' in _dict: - args['reduce'] = _dict.get('reduce') - if 'stable' in _dict: - args['stable'] = _dict.get('stable') - if 'start_key' in _dict: - args['start_key'] = _dict.get('start_key') - if 'update' in _dict: - args['update'] = _dict.get('update') - if 'view_type' in _dict: - args['view_type'] = _dict.get('view_type') + if (conflicts := _dict.get('conflicts')) is not None: + args['conflicts'] = conflicts + if (direction := _dict.get('direction')) is not None: + args['direction'] = direction + if (end_key := _dict.get('end_key')) is not None: + args['end_key'] = end_key + if (include_docs := _dict.get('include_docs')) is not None: + args['include_docs'] = include_docs + if (partition := _dict.get('partition')) is not None: + args['partition'] = partition + if (reduce := _dict.get('reduce')) is not None: + args['reduce'] = reduce + if (stable := _dict.get('stable')) is not None: + args['stable'] = stable + if (start_key := _dict.get('start_key')) is not None: + args['start_key'] = start_key + if (update := _dict.get('update')) is not None: + args['update'] = update + if (view_type := _dict.get('view_type')) is not None: + args['view_type'] = view_type return cls(**args) @classmethod @@ -13297,56 +13297,56 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ExplainResultOpts': """Initialize a ExplainResultOpts object from a json dictionary.""" args = {} - if 'bookmark' in _dict: - args['bookmark'] = _dict.get('bookmark') + if (bookmark := _dict.get('bookmark')) is not None: + args['bookmark'] = bookmark else: raise ValueError('Required property \'bookmark\' not present in ExplainResultOpts JSON') - if 'conflicts' in _dict: - args['conflicts'] = _dict.get('conflicts') + if (conflicts := _dict.get('conflicts')) is not None: + args['conflicts'] = conflicts else: raise ValueError('Required property \'conflicts\' not present in ExplainResultOpts JSON') - if 'execution_stats' in _dict: - args['execution_stats'] = _dict.get('execution_stats') + if (execution_stats := _dict.get('execution_stats')) is not None: + args['execution_stats'] = execution_stats else: raise ValueError('Required property \'execution_stats\' not present in ExplainResultOpts JSON') - if 'fields' in _dict: - args['fields'] = _dict.get('fields') + if (fields := _dict.get('fields')) is not None: + args['fields'] = fields else: raise ValueError('Required property \'fields\' not present in ExplainResultOpts JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit else: raise ValueError('Required property \'limit\' not present in ExplainResultOpts JSON') - if 'partition' in _dict: - args['partition'] = _dict.get('partition') + if (partition := _dict.get('partition')) is not None: + args['partition'] = partition else: raise ValueError('Required property \'partition\' not present in ExplainResultOpts JSON') - if 'r' in _dict: - args['r'] = _dict.get('r') + if (r := _dict.get('r')) is not None: + args['r'] = r else: raise ValueError('Required property \'r\' not present in ExplainResultOpts JSON') - if 'skip' in _dict: - args['skip'] = _dict.get('skip') + if (skip := _dict.get('skip')) is not None: + args['skip'] = skip else: raise ValueError('Required property \'skip\' not present in ExplainResultOpts JSON') - if 'sort' in _dict: - args['sort'] = _dict.get('sort') + if (sort := _dict.get('sort')) is not None: + args['sort'] = sort else: raise ValueError('Required property \'sort\' not present in ExplainResultOpts JSON') - if 'stable' in _dict: - args['stable'] = _dict.get('stable') + if (stable := _dict.get('stable')) is not None: + args['stable'] = stable else: raise ValueError('Required property \'stable\' not present in ExplainResultOpts JSON') - if 'stale' in _dict: - args['stale'] = _dict.get('stale') + if (stale := _dict.get('stale')) is not None: + args['stale'] = stale else: raise ValueError('Required property \'stale\' not present in ExplainResultOpts JSON') - if 'update' in _dict: - args['update'] = _dict.get('update') + if (update := _dict.get('update')) is not None: + args['update'] = update else: raise ValueError('Required property \'update\' not present in ExplainResultOpts JSON') - if 'use_index' in _dict: - args['use_index'] = _dict.get('use_index') + if (use_index := _dict.get('use_index')) is not None: + args['use_index'] = use_index else: raise ValueError('Required property \'use_index\' not present in ExplainResultOpts JSON') return cls(**args) @@ -13443,18 +13443,18 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'FindResult': """Initialize a FindResult object from a json dictionary.""" args = {} - if 'bookmark' in _dict: - args['bookmark'] = _dict.get('bookmark') + if (bookmark := _dict.get('bookmark')) is not None: + args['bookmark'] = bookmark else: raise ValueError('Required property \'bookmark\' not present in FindResult JSON') - if 'docs' in _dict: - args['docs'] = [Document.from_dict(v) for v in _dict.get('docs')] + if (docs := _dict.get('docs')) is not None: + args['docs'] = [Document.from_dict(v) for v in docs] else: raise ValueError('Required property \'docs\' not present in FindResult JSON') - if 'execution_stats' in _dict: - args['execution_stats'] = ExecutionStats.from_dict(_dict.get('execution_stats')) - if 'warning' in _dict: - args['warning'] = _dict.get('warning') + if (execution_stats := _dict.get('execution_stats')) is not None: + args['execution_stats'] = ExecutionStats.from_dict(execution_stats) + if (warning := _dict.get('warning')) is not None: + args['warning'] = warning return cls(**args) @classmethod @@ -13635,16 +13635,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'IndexDefinition': """Initialize a IndexDefinition object from a json dictionary.""" args = {} - if 'default_analyzer' in _dict: - args['default_analyzer'] = Analyzer.from_dict(_dict.get('default_analyzer')) - if 'default_field' in _dict: - args['default_field'] = IndexTextOperatorDefaultField.from_dict(_dict.get('default_field')) - if 'fields' in _dict: - args['fields'] = [IndexField.from_dict(v) for v in _dict.get('fields')] - if 'index_array_lengths' in _dict: - args['index_array_lengths'] = _dict.get('index_array_lengths') - if 'partial_filter_selector' in _dict: - args['partial_filter_selector'] = _dict.get('partial_filter_selector') + if (default_analyzer := _dict.get('default_analyzer')) is not None: + args['default_analyzer'] = Analyzer.from_dict(default_analyzer) + if (default_field := _dict.get('default_field')) is not None: + args['default_field'] = IndexTextOperatorDefaultField.from_dict(default_field) + if (fields := _dict.get('fields')) is not None: + args['fields'] = [IndexField.from_dict(v) for v in fields] + if (index_array_lengths := _dict.get('index_array_lengths')) is not None: + args['index_array_lengths'] = index_array_lengths + if (partial_filter_selector := _dict.get('partial_filter_selector')) is not None: + args['partial_filter_selector'] = partial_filter_selector return cls(**args) @classmethod @@ -13732,10 +13732,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'IndexField': """Initialize a IndexField object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (name := _dict.get('name')) is not None: + args['name'] = name + if (type := _dict.get('type')) is not None: + args['type'] = type args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -13850,22 +13850,22 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'IndexInformation': """Initialize a IndexInformation object from a json dictionary.""" args = {} - if 'ddoc' in _dict: - args['ddoc'] = _dict.get('ddoc') + if (ddoc := _dict.get('ddoc')) is not None: + args['ddoc'] = ddoc else: raise ValueError('Required property \'ddoc\' not present in IndexInformation JSON') - if 'def' in _dict: - args['def_'] = IndexDefinition.from_dict(_dict.get('def')) + if (def_ := _dict.get('def')) is not None: + args['def_'] = IndexDefinition.from_dict(def_) else: raise ValueError('Required property \'def\' not present in IndexInformation JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in IndexInformation JSON') - if 'partitioned' in _dict: - args['partitioned'] = _dict.get('partitioned') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (partitioned := _dict.get('partitioned')) is not None: + args['partitioned'] = partitioned + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in IndexInformation JSON') return cls(**args) @@ -13954,16 +13954,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'IndexResult': """Initialize a IndexResult object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in IndexResult JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in IndexResult JSON') - if 'result' in _dict: - args['result'] = _dict.get('result') + if (result := _dict.get('result')) is not None: + args['result'] = result else: raise ValueError('Required property \'result\' not present in IndexResult JSON') return cls(**args) @@ -14042,10 +14042,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'IndexTextOperatorDefaultField': """Initialize a IndexTextOperatorDefaultField object from a json dictionary.""" args = {} - if 'analyzer' in _dict: - args['analyzer'] = Analyzer.from_dict(_dict.get('analyzer')) - if 'enabled' in _dict: - args['enabled'] = _dict.get('enabled') + if (analyzer := _dict.get('analyzer')) is not None: + args['analyzer'] = Analyzer.from_dict(analyzer) + if (enabled := _dict.get('enabled')) is not None: + args['enabled'] = enabled return cls(**args) @classmethod @@ -14110,12 +14110,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'IndexesInformation': """Initialize a IndexesInformation object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows else: raise ValueError('Required property \'total_rows\' not present in IndexesInformation JSON') - if 'indexes' in _dict: - args['indexes'] = [IndexInformation.from_dict(v) for v in _dict.get('indexes')] + if (indexes := _dict.get('indexes')) is not None: + args['indexes'] = [IndexInformation.from_dict(v) for v in indexes] else: raise ValueError('Required property \'indexes\' not present in IndexesInformation JSON') return cls(**args) @@ -14187,12 +14187,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'MembershipInformation': """Initialize a MembershipInformation object from a json dictionary.""" args = {} - if 'all_nodes' in _dict: - args['all_nodes'] = _dict.get('all_nodes') + if (all_nodes := _dict.get('all_nodes')) is not None: + args['all_nodes'] = all_nodes else: raise ValueError('Required property \'all_nodes\' not present in MembershipInformation JSON') - if 'cluster_nodes' in _dict: - args['cluster_nodes'] = _dict.get('cluster_nodes') + if (cluster_nodes := _dict.get('cluster_nodes')) is not None: + args['cluster_nodes'] = cluster_nodes else: raise ValueError('Required property \'cluster_nodes\' not present in MembershipInformation JSON') return cls(**args) @@ -14253,8 +14253,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Ok': """Initialize a Ok object from a json dictionary.""" args = {} - if 'ok' in _dict: - args['ok'] = _dict.get('ok') + if (ok := _dict.get('ok')) is not None: + args['ok'] = ok return cls(**args) @classmethod @@ -14337,26 +14337,26 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PartitionInformation': """Initialize a PartitionInformation object from a json dictionary.""" args = {} - if 'db_name' in _dict: - args['db_name'] = _dict.get('db_name') + if (db_name := _dict.get('db_name')) is not None: + args['db_name'] = db_name else: raise ValueError('Required property \'db_name\' not present in PartitionInformation JSON') - if 'doc_count' in _dict: - args['doc_count'] = _dict.get('doc_count') + if (doc_count := _dict.get('doc_count')) is not None: + args['doc_count'] = doc_count else: raise ValueError('Required property \'doc_count\' not present in PartitionInformation JSON') - if 'doc_del_count' in _dict: - args['doc_del_count'] = _dict.get('doc_del_count') + if (doc_del_count := _dict.get('doc_del_count')) is not None: + args['doc_del_count'] = doc_del_count else: raise ValueError('Required property \'doc_del_count\' not present in PartitionInformation JSON') - if 'partition' in _dict: - args['partition'] = _dict.get('partition') + if (partition := _dict.get('partition')) is not None: + args['partition'] = partition else: raise ValueError('Required property \'partition\' not present in PartitionInformation JSON') - if 'partitioned_indexes' in _dict: - args['partitioned_indexes'] = PartitionInformationIndexes.from_dict(_dict.get('partitioned_indexes')) - if 'sizes' in _dict: - args['sizes'] = PartitionInformationSizes.from_dict(_dict.get('sizes')) + if (partitioned_indexes := _dict.get('partitioned_indexes')) is not None: + args['partitioned_indexes'] = PartitionInformationIndexes.from_dict(partitioned_indexes) + if (sizes := _dict.get('sizes')) is not None: + args['sizes'] = PartitionInformationSizes.from_dict(sizes) else: raise ValueError('Required property \'sizes\' not present in PartitionInformation JSON') return cls(**args) @@ -14441,12 +14441,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PartitionInformationIndexes': """Initialize a PartitionInformationIndexes object from a json dictionary.""" args = {} - if 'count' in _dict: - args['count'] = _dict.get('count') - if 'indexes' in _dict: - args['indexes'] = PartitionInformationIndexesIndexes.from_dict(_dict.get('indexes')) - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (count := _dict.get('count')) is not None: + args['count'] = count + if (indexes := _dict.get('indexes')) is not None: + args['indexes'] = PartitionInformationIndexesIndexes.from_dict(indexes) + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit return cls(**args) @classmethod @@ -14514,10 +14514,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PartitionInformationIndexesIndexes': """Initialize a PartitionInformationIndexesIndexes object from a json dictionary.""" args = {} - if 'search' in _dict: - args['search'] = _dict.get('search') - if 'view' in _dict: - args['view'] = _dict.get('view') + if (search := _dict.get('search')) is not None: + args['search'] = search + if (view := _dict.get('view')) is not None: + args['view'] = view return cls(**args) @classmethod @@ -14584,10 +14584,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PartitionInformationSizes': """Initialize a PartitionInformationSizes object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') - if 'external' in _dict: - args['external'] = _dict.get('external') + if (active := _dict.get('active')) is not None: + args['active'] = active + if (external := _dict.get('external')) is not None: + args['external'] = external return cls(**args) @classmethod @@ -14650,10 +14650,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PartitionedIndexesDetailedInformation': """Initialize a PartitionedIndexesDetailedInformation object from a json dictionary.""" args = {} - if 'search' in _dict: - args['search'] = _dict.get('search') - if 'view' in _dict: - args['view'] = _dict.get('view') + if (search := _dict.get('search')) is not None: + args['search'] = search + if (view := _dict.get('view')) is not None: + args['view'] = view return cls(**args) @classmethod @@ -14726,12 +14726,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'PartitionedIndexesInformation': """Initialize a PartitionedIndexesInformation object from a json dictionary.""" args = {} - if 'count' in _dict: - args['count'] = _dict.get('count') - if 'indexes' in _dict: - args['indexes'] = PartitionedIndexesDetailedInformation.from_dict(_dict.get('indexes')) - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if (count := _dict.get('count')) is not None: + args['count'] = count + if (indexes := _dict.get('indexes')) is not None: + args['indexes'] = PartitionedIndexesDetailedInformation.from_dict(indexes) + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit return cls(**args) @classmethod @@ -14811,12 +14811,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ReplicationCreateTargetParameters': """Initialize a ReplicationCreateTargetParameters object from a json dictionary.""" args = {} - if 'n' in _dict: - args['n'] = _dict.get('n') - if 'partitioned' in _dict: - args['partitioned'] = _dict.get('partitioned') - if 'q' in _dict: - args['q'] = _dict.get('q') + if (n := _dict.get('n')) is not None: + args['n'] = n + if (partitioned := _dict.get('partitioned')) is not None: + args['partitioned'] = partitioned + if (q := _dict.get('q')) is not None: + args['q'] = q return cls(**args) @classmethod @@ -14887,12 +14887,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ReplicationDatabase': """Initialize a ReplicationDatabase object from a json dictionary.""" args = {} - if 'auth' in _dict: - args['auth'] = ReplicationDatabaseAuth.from_dict(_dict.get('auth')) - if 'headers' in _dict: - args['headers_'] = _dict.get('headers') - if 'url' in _dict: - args['url'] = _dict.get('url') + if (auth := _dict.get('auth')) is not None: + args['auth'] = ReplicationDatabaseAuth.from_dict(auth) + if (headers_ := _dict.get('headers')) is not None: + args['headers_'] = headers_ + if (url := _dict.get('url')) is not None: + args['url'] = url else: raise ValueError('Required property \'url\' not present in ReplicationDatabase JSON') return cls(**args) @@ -14966,10 +14966,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ReplicationDatabaseAuth': """Initialize a ReplicationDatabaseAuth object from a json dictionary.""" args = {} - if 'basic' in _dict: - args['basic'] = ReplicationDatabaseAuthBasic.from_dict(_dict.get('basic')) - if 'iam' in _dict: - args['iam'] = ReplicationDatabaseAuthIam.from_dict(_dict.get('iam')) + if (basic := _dict.get('basic')) is not None: + args['basic'] = ReplicationDatabaseAuthBasic.from_dict(basic) + if (iam := _dict.get('iam')) is not None: + args['iam'] = ReplicationDatabaseAuthIam.from_dict(iam) return cls(**args) @classmethod @@ -15037,12 +15037,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ReplicationDatabaseAuthBasic': """Initialize a ReplicationDatabaseAuthBasic object from a json dictionary.""" args = {} - if 'password' in _dict: - args['password'] = _dict.get('password') + if (password := _dict.get('password')) is not None: + args['password'] = password else: raise ValueError('Required property \'password\' not present in ReplicationDatabaseAuthBasic JSON') - if 'username' in _dict: - args['username'] = _dict.get('username') + if (username := _dict.get('username')) is not None: + args['username'] = username else: raise ValueError('Required property \'username\' not present in ReplicationDatabaseAuthBasic JSON') return cls(**args) @@ -15102,8 +15102,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ReplicationDatabaseAuthIam': """Initialize a ReplicationDatabaseAuthIam object from a json dictionary.""" args = {} - if 'api_key' in _dict: - args['api_key'] = _dict.get('api_key') + if (api_key := _dict.get('api_key')) is not None: + args['api_key'] = api_key else: raise ValueError('Required property \'api_key\' not present in ReplicationDatabaseAuthIam JSON') return cls(**args) @@ -15446,76 +15446,76 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': """Initialize a ReplicationDocument object from a json dictionary.""" args = {} - if '_attachments' in _dict: - args['attachments'] = {k: Attachment.from_dict(v) for k, v in _dict.get('_attachments').items()} - if '_conflicts' in _dict: - args['conflicts'] = _dict.get('_conflicts') - if '_deleted' in _dict: - args['deleted'] = _dict.get('_deleted') - if '_deleted_conflicts' in _dict: - args['deleted_conflicts'] = _dict.get('_deleted_conflicts') - if '_id' in _dict: - args['id'] = _dict.get('_id') - if '_local_seq' in _dict: - args['local_seq'] = _dict.get('_local_seq') - if '_rev' in _dict: - args['rev'] = _dict.get('_rev') - if '_revisions' in _dict: - args['revisions'] = Revisions.from_dict(_dict.get('_revisions')) - if '_revs_info' in _dict: - args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in _dict.get('_revs_info')] - if 'cancel' in _dict: - args['cancel'] = _dict.get('cancel') - if 'checkpoint_interval' in _dict: - args['checkpoint_interval'] = _dict.get('checkpoint_interval') - if 'connection_timeout' in _dict: - args['connection_timeout'] = _dict.get('connection_timeout') - if 'continuous' in _dict: - args['continuous'] = _dict.get('continuous') - if 'create_target' in _dict: - args['create_target'] = _dict.get('create_target') - if 'create_target_params' in _dict: - args['create_target_params'] = ReplicationCreateTargetParameters.from_dict(_dict.get('create_target_params')) - if 'doc_ids' in _dict: - args['doc_ids'] = _dict.get('doc_ids') - if 'filter' in _dict: - args['filter'] = _dict.get('filter') - if 'http_connections' in _dict: - args['http_connections'] = _dict.get('http_connections') - if 'query_params' in _dict: - args['query_params'] = _dict.get('query_params') - if 'retries_per_request' in _dict: - args['retries_per_request'] = _dict.get('retries_per_request') - if 'selector' in _dict: - args['selector'] = _dict.get('selector') - if 'since_seq' in _dict: - args['since_seq'] = _dict.get('since_seq') - if 'socket_options' in _dict: - args['socket_options'] = _dict.get('socket_options') - if 'source' in _dict: - args['source'] = ReplicationDatabase.from_dict(_dict.get('source')) + if (attachments := _dict.get('_attachments')) is not None: + args['attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} + if (conflicts := _dict.get('_conflicts')) is not None: + args['conflicts'] = conflicts + if (deleted := _dict.get('_deleted')) is not None: + args['deleted'] = deleted + if (deleted_conflicts := _dict.get('_deleted_conflicts')) is not None: + args['deleted_conflicts'] = deleted_conflicts + if (id := _dict.get('_id')) is not None: + args['id'] = id + if (local_seq := _dict.get('_local_seq')) is not None: + args['local_seq'] = local_seq + if (rev := _dict.get('_rev')) is not None: + args['rev'] = rev + if (revisions := _dict.get('_revisions')) is not None: + args['revisions'] = Revisions.from_dict(revisions) + if (revs_info := _dict.get('_revs_info')) is not None: + args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] + if (cancel := _dict.get('cancel')) is not None: + args['cancel'] = cancel + if (checkpoint_interval := _dict.get('checkpoint_interval')) is not None: + args['checkpoint_interval'] = checkpoint_interval + if (connection_timeout := _dict.get('connection_timeout')) is not None: + args['connection_timeout'] = connection_timeout + if (continuous := _dict.get('continuous')) is not None: + args['continuous'] = continuous + if (create_target := _dict.get('create_target')) is not None: + args['create_target'] = create_target + if (create_target_params := _dict.get('create_target_params')) is not None: + args['create_target_params'] = ReplicationCreateTargetParameters.from_dict(create_target_params) + if (doc_ids := _dict.get('doc_ids')) is not None: + args['doc_ids'] = doc_ids + if (filter := _dict.get('filter')) is not None: + args['filter'] = filter + if (http_connections := _dict.get('http_connections')) is not None: + args['http_connections'] = http_connections + if (query_params := _dict.get('query_params')) is not None: + args['query_params'] = query_params + if (retries_per_request := _dict.get('retries_per_request')) is not None: + args['retries_per_request'] = retries_per_request + if (selector := _dict.get('selector')) is not None: + args['selector'] = selector + if (since_seq := _dict.get('since_seq')) is not None: + args['since_seq'] = since_seq + if (socket_options := _dict.get('socket_options')) is not None: + args['socket_options'] = socket_options + if (source := _dict.get('source')) is not None: + args['source'] = ReplicationDatabase.from_dict(source) else: raise ValueError('Required property \'source\' not present in ReplicationDocument JSON') - if 'source_proxy' in _dict: - args['source_proxy'] = _dict.get('source_proxy') - if 'target' in _dict: - args['target'] = ReplicationDatabase.from_dict(_dict.get('target')) + if (source_proxy := _dict.get('source_proxy')) is not None: + args['source_proxy'] = source_proxy + if (target := _dict.get('target')) is not None: + args['target'] = ReplicationDatabase.from_dict(target) else: raise ValueError('Required property \'target\' not present in ReplicationDocument JSON') - if 'target_proxy' in _dict: - args['target_proxy'] = _dict.get('target_proxy') - if 'use_bulk_get' in _dict: - args['use_bulk_get'] = _dict.get('use_bulk_get') - if 'use_checkpoints' in _dict: - args['use_checkpoints'] = _dict.get('use_checkpoints') - if 'user_ctx' in _dict: - args['user_ctx'] = UserContext.from_dict(_dict.get('user_ctx')) - if 'winning_revs_only' in _dict: - args['winning_revs_only'] = _dict.get('winning_revs_only') - if 'worker_batch_size' in _dict: - args['worker_batch_size'] = _dict.get('worker_batch_size') - if 'worker_processes' in _dict: - args['worker_processes'] = _dict.get('worker_processes') + if (target_proxy := _dict.get('target_proxy')) is not None: + args['target_proxy'] = target_proxy + if (use_bulk_get := _dict.get('use_bulk_get')) is not None: + args['use_bulk_get'] = use_bulk_get + if (use_checkpoints := _dict.get('use_checkpoints')) is not None: + args['use_checkpoints'] = use_checkpoints + if (user_ctx := _dict.get('user_ctx')) is not None: + args['user_ctx'] = UserContext.from_dict(user_ctx) + if (winning_revs_only := _dict.get('winning_revs_only')) is not None: + args['winning_revs_only'] = winning_revs_only + if (worker_batch_size := _dict.get('worker_batch_size')) is not None: + args['worker_batch_size'] = worker_batch_size + if (worker_processes := _dict.get('worker_processes')) is not None: + args['worker_processes'] = worker_processes args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -15688,12 +15688,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Revisions': """Initialize a Revisions object from a json dictionary.""" args = {} - if 'ids' in _dict: - args['ids'] = _dict.get('ids') + if (ids := _dict.get('ids')) is not None: + args['ids'] = ids else: raise ValueError('Required property \'ids\' not present in Revisions JSON') - if 'start' in _dict: - args['start'] = _dict.get('start') + if (start := _dict.get('start')) is not None: + args['start'] = start else: raise ValueError('Required property \'start\' not present in Revisions JSON') return cls(**args) @@ -15760,10 +15760,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'RevsDiff': """Initialize a RevsDiff object from a json dictionary.""" args = {} - if 'missing' in _dict: - args['missing'] = _dict.get('missing') - if 'possible_ancestors' in _dict: - args['possible_ancestors'] = _dict.get('possible_ancestors') + if (missing := _dict.get('missing')) is not None: + args['missing'] = missing + if (possible_ancestors := _dict.get('possible_ancestors')) is not None: + args['possible_ancestors'] = possible_ancestors return cls(**args) @classmethod @@ -15826,12 +15826,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SchedulerDocsResult': """Initialize a SchedulerDocsResult object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows else: raise ValueError('Required property \'total_rows\' not present in SchedulerDocsResult JSON') - if 'docs' in _dict: - args['docs'] = [SchedulerDocument.from_dict(v) for v in _dict.get('docs')] + if (docs := _dict.get('docs')) is not None: + args['docs'] = [SchedulerDocument.from_dict(v) for v in docs] else: raise ValueError('Required property \'docs\' not present in SchedulerDocsResult JSON') return cls(**args) @@ -15970,48 +15970,48 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SchedulerDocument': """Initialize a SchedulerDocument object from a json dictionary.""" args = {} - if 'database' in _dict: - args['database'] = _dict.get('database') + if (database := _dict.get('database')) is not None: + args['database'] = database else: raise ValueError('Required property \'database\' not present in SchedulerDocument JSON') - if 'doc_id' in _dict: - args['doc_id'] = _dict.get('doc_id') + if (doc_id := _dict.get('doc_id')) is not None: + args['doc_id'] = doc_id else: raise ValueError('Required property \'doc_id\' not present in SchedulerDocument JSON') - if 'error_count' in _dict: - args['error_count'] = _dict.get('error_count') + if (error_count := _dict.get('error_count')) is not None: + args['error_count'] = error_count else: raise ValueError('Required property \'error_count\' not present in SchedulerDocument JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in SchedulerDocument JSON') - if 'info' in _dict: - args['info'] = SchedulerInfo.from_dict(_dict.get('info')) + if (info := _dict.get('info')) is not None: + args['info'] = SchedulerInfo.from_dict(info) else: raise ValueError('Required property \'info\' not present in SchedulerDocument JSON') - if 'last_updated' in _dict: - args['last_updated'] = string_to_datetime(_dict.get('last_updated')) + if (last_updated := _dict.get('last_updated')) is not None: + args['last_updated'] = string_to_datetime(last_updated) else: raise ValueError('Required property \'last_updated\' not present in SchedulerDocument JSON') - if 'node' in _dict: - args['node'] = _dict.get('node') - if 'source' in _dict: - args['source'] = _dict.get('source') - if 'source_proxy' in _dict: - args['source_proxy'] = _dict.get('source_proxy') - if 'start_time' in _dict: - args['start_time'] = string_to_datetime(_dict.get('start_time')) + if (node := _dict.get('node')) is not None: + args['node'] = node + if (source := _dict.get('source')) is not None: + args['source'] = source + if (source_proxy := _dict.get('source_proxy')) is not None: + args['source_proxy'] = source_proxy + if (start_time := _dict.get('start_time')) is not None: + args['start_time'] = string_to_datetime(start_time) else: raise ValueError('Required property \'start_time\' not present in SchedulerDocument JSON') - if 'state' in _dict: - args['state'] = _dict.get('state') + if (state := _dict.get('state')) is not None: + args['state'] = state else: raise ValueError('Required property \'state\' not present in SchedulerDocument JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') - if 'target_proxy' in _dict: - args['target_proxy'] = _dict.get('target_proxy') + if (target := _dict.get('target')) is not None: + args['target'] = target + if (target_proxy := _dict.get('target_proxy')) is not None: + args['target_proxy'] = target_proxy return cls(**args) @classmethod @@ -16164,26 +16164,26 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SchedulerInfo': """Initialize a SchedulerInfo object from a json dictionary.""" args = {} - if 'changes_pending' in _dict: - args['changes_pending'] = _dict.get('changes_pending') - if 'checkpointed_source_seq' in _dict: - args['checkpointed_source_seq'] = _dict.get('checkpointed_source_seq') - if 'doc_write_failures' in _dict: - args['doc_write_failures'] = _dict.get('doc_write_failures') - if 'docs_read' in _dict: - args['docs_read'] = _dict.get('docs_read') - if 'docs_written' in _dict: - args['docs_written'] = _dict.get('docs_written') - if 'error' in _dict: - args['error'] = _dict.get('error') - if 'missing_revisions_found' in _dict: - args['missing_revisions_found'] = _dict.get('missing_revisions_found') - if 'revisions_checked' in _dict: - args['revisions_checked'] = _dict.get('revisions_checked') - if 'source_seq' in _dict: - args['source_seq'] = _dict.get('source_seq') - if 'through_seq' in _dict: - args['through_seq'] = _dict.get('through_seq') + if (changes_pending := _dict.get('changes_pending')) is not None: + args['changes_pending'] = changes_pending + if (checkpointed_source_seq := _dict.get('checkpointed_source_seq')) is not None: + args['checkpointed_source_seq'] = checkpointed_source_seq + if (doc_write_failures := _dict.get('doc_write_failures')) is not None: + args['doc_write_failures'] = doc_write_failures + if (docs_read := _dict.get('docs_read')) is not None: + args['docs_read'] = docs_read + if (docs_written := _dict.get('docs_written')) is not None: + args['docs_written'] = docs_written + if (error := _dict.get('error')) is not None: + args['error'] = error + if (missing_revisions_found := _dict.get('missing_revisions_found')) is not None: + args['missing_revisions_found'] = missing_revisions_found + if (revisions_checked := _dict.get('revisions_checked')) is not None: + args['revisions_checked'] = revisions_checked + if (source_seq := _dict.get('source_seq')) is not None: + args['source_seq'] = source_seq + if (through_seq := _dict.get('through_seq')) is not None: + args['through_seq'] = through_seq return cls(**args) @classmethod @@ -16303,48 +16303,48 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SchedulerJob': """Initialize a SchedulerJob object from a json dictionary.""" args = {} - if 'database' in _dict: - args['database'] = _dict.get('database') + if (database := _dict.get('database')) is not None: + args['database'] = database else: raise ValueError('Required property \'database\' not present in SchedulerJob JSON') - if 'doc_id' in _dict: - args['doc_id'] = _dict.get('doc_id') + if (doc_id := _dict.get('doc_id')) is not None: + args['doc_id'] = doc_id else: raise ValueError('Required property \'doc_id\' not present in SchedulerJob JSON') - if 'history' in _dict: - args['history'] = [SchedulerJobEvent.from_dict(v) for v in _dict.get('history')] + if (history := _dict.get('history')) is not None: + args['history'] = [SchedulerJobEvent.from_dict(v) for v in history] else: raise ValueError('Required property \'history\' not present in SchedulerJob JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in SchedulerJob JSON') - if 'info' in _dict: - args['info'] = SchedulerInfo.from_dict(_dict.get('info')) + if (info := _dict.get('info')) is not None: + args['info'] = SchedulerInfo.from_dict(info) else: raise ValueError('Required property \'info\' not present in SchedulerJob JSON') - if 'node' in _dict: - args['node'] = _dict.get('node') + if (node := _dict.get('node')) is not None: + args['node'] = node else: raise ValueError('Required property \'node\' not present in SchedulerJob JSON') - if 'pid' in _dict: - args['pid'] = _dict.get('pid') + if (pid := _dict.get('pid')) is not None: + args['pid'] = pid else: raise ValueError('Required property \'pid\' not present in SchedulerJob JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') + if (source := _dict.get('source')) is not None: + args['source'] = source else: raise ValueError('Required property \'source\' not present in SchedulerJob JSON') - if 'start_time' in _dict: - args['start_time'] = string_to_datetime(_dict.get('start_time')) + if (start_time := _dict.get('start_time')) is not None: + args['start_time'] = string_to_datetime(start_time) else: raise ValueError('Required property \'start_time\' not present in SchedulerJob JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + if (target := _dict.get('target')) is not None: + args['target'] = target else: raise ValueError('Required property \'target\' not present in SchedulerJob JSON') - if 'user' in _dict: - args['user'] = _dict.get('user') + if (user := _dict.get('user')) is not None: + args['user'] = user else: raise ValueError('Required property \'user\' not present in SchedulerJob JSON') return cls(**args) @@ -16440,14 +16440,14 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SchedulerJobEvent': """Initialize a SchedulerJobEvent object from a json dictionary.""" args = {} - if 'reason' in _dict: - args['reason'] = _dict.get('reason') - if 'timestamp' in _dict: - args['timestamp'] = string_to_datetime(_dict.get('timestamp')) + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason + if (timestamp := _dict.get('timestamp')) is not None: + args['timestamp'] = string_to_datetime(timestamp) else: raise ValueError('Required property \'timestamp\' not present in SchedulerJobEvent JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if (type := _dict.get('type')) is not None: + args['type'] = type else: raise ValueError('Required property \'type\' not present in SchedulerJobEvent JSON') return cls(**args) @@ -16513,12 +16513,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SchedulerJobsResult': """Initialize a SchedulerJobsResult object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows else: raise ValueError('Required property \'total_rows\' not present in SchedulerJobsResult JSON') - if 'jobs' in _dict: - args['jobs'] = [SchedulerJob.from_dict(v) for v in _dict.get('jobs')] + if (jobs := _dict.get('jobs')) is not None: + args['jobs'] = [SchedulerJob.from_dict(v) for v in jobs] else: raise ValueError('Required property \'jobs\' not present in SchedulerJobsResult JSON') return cls(**args) @@ -16584,8 +16584,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchAnalyzeResult': """Initialize a SearchAnalyzeResult object from a json dictionary.""" args = {} - if 'tokens' in _dict: - args['tokens'] = _dict.get('tokens') + if (tokens := _dict.get('tokens')) is not None: + args['tokens'] = tokens else: raise ValueError('Required property \'tokens\' not present in SearchAnalyzeResult JSON') return cls(**args) @@ -16685,10 +16685,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchIndexDefinition': """Initialize a SearchIndexDefinition object from a json dictionary.""" args = {} - if 'analyzer' in _dict: - args['analyzer'] = AnalyzerConfiguration.from_dict(_dict.get('analyzer')) - if 'index' in _dict: - args['index'] = _dict.get('index') + if (analyzer := _dict.get('analyzer')) is not None: + args['analyzer'] = AnalyzerConfiguration.from_dict(analyzer) + if (index := _dict.get('index')) is not None: + args['index'] = index else: raise ValueError('Required property \'index\' not present in SearchIndexDefinition JSON') return cls(**args) @@ -16771,28 +16771,28 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchIndexInfo': """Initialize a SearchIndexInfo object from a json dictionary.""" args = {} - if 'committed_seq' in _dict: - args['committed_seq'] = _dict.get('committed_seq') + if (committed_seq := _dict.get('committed_seq')) is not None: + args['committed_seq'] = committed_seq else: raise ValueError('Required property \'committed_seq\' not present in SearchIndexInfo JSON') - if 'disk_size' in _dict: - args['disk_size'] = _dict.get('disk_size') + if (disk_size := _dict.get('disk_size')) is not None: + args['disk_size'] = disk_size else: raise ValueError('Required property \'disk_size\' not present in SearchIndexInfo JSON') - if 'doc_count' in _dict: - args['doc_count'] = _dict.get('doc_count') + if (doc_count := _dict.get('doc_count')) is not None: + args['doc_count'] = doc_count else: raise ValueError('Required property \'doc_count\' not present in SearchIndexInfo JSON') - if 'doc_del_count' in _dict: - args['doc_del_count'] = _dict.get('doc_del_count') + if (doc_del_count := _dict.get('doc_del_count')) is not None: + args['doc_del_count'] = doc_del_count else: raise ValueError('Required property \'doc_del_count\' not present in SearchIndexInfo JSON') - if 'pending_seq' in _dict: - args['pending_seq'] = _dict.get('pending_seq') + if (pending_seq := _dict.get('pending_seq')) is not None: + args['pending_seq'] = pending_seq else: raise ValueError('Required property \'pending_seq\' not present in SearchIndexInfo JSON') - if 'signature' in _dict: - args['signature'] = _dict.get('signature') + if (signature := _dict.get('signature')) is not None: + args['signature'] = signature else: raise ValueError('Required property \'signature\' not present in SearchIndexInfo JSON') return cls(**args) @@ -16868,12 +16868,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchInfoResult': """Initialize a SearchInfoResult object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in SearchInfoResult JSON') - if 'search_index' in _dict: - args['search_index'] = SearchIndexInfo.from_dict(_dict.get('search_index')) + if (search_index := _dict.get('search_index')) is not None: + args['search_index'] = SearchIndexInfo.from_dict(search_index) else: raise ValueError('Required property \'search_index\' not present in SearchInfoResult JSON') return cls(**args) @@ -16971,22 +16971,22 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchResult': """Initialize a SearchResult object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows else: raise ValueError('Required property \'total_rows\' not present in SearchResult JSON') - if 'bookmark' in _dict: - args['bookmark'] = _dict.get('bookmark') - if 'by' in _dict: - args['by'] = _dict.get('by') - if 'counts' in _dict: - args['counts'] = _dict.get('counts') - if 'ranges' in _dict: - args['ranges'] = _dict.get('ranges') - if 'rows' in _dict: - args['rows'] = [SearchResultRow.from_dict(v) for v in _dict.get('rows')] - if 'groups' in _dict: - args['groups'] = [SearchResultProperties.from_dict(v) for v in _dict.get('groups')] + if (bookmark := _dict.get('bookmark')) is not None: + args['bookmark'] = bookmark + if (by := _dict.get('by')) is not None: + args['by'] = by + if (counts := _dict.get('counts')) is not None: + args['counts'] = counts + if (ranges := _dict.get('ranges')) is not None: + args['ranges'] = ranges + if (rows := _dict.get('rows')) is not None: + args['rows'] = [SearchResultRow.from_dict(v) for v in rows] + if (groups := _dict.get('groups')) is not None: + args['groups'] = [SearchResultProperties.from_dict(v) for v in groups] return cls(**args) @classmethod @@ -17095,20 +17095,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchResultProperties': """Initialize a SearchResultProperties object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows else: raise ValueError('Required property \'total_rows\' not present in SearchResultProperties JSON') - if 'bookmark' in _dict: - args['bookmark'] = _dict.get('bookmark') - if 'by' in _dict: - args['by'] = _dict.get('by') - if 'counts' in _dict: - args['counts'] = _dict.get('counts') - if 'ranges' in _dict: - args['ranges'] = _dict.get('ranges') - if 'rows' in _dict: - args['rows'] = [SearchResultRow.from_dict(v) for v in _dict.get('rows')] + if (bookmark := _dict.get('bookmark')) is not None: + args['bookmark'] = bookmark + if (by := _dict.get('by')) is not None: + args['by'] = by + if (counts := _dict.get('counts')) is not None: + args['counts'] = counts + if (ranges := _dict.get('ranges')) is not None: + args['ranges'] = ranges + if (rows := _dict.get('rows')) is not None: + args['rows'] = [SearchResultRow.from_dict(v) for v in rows] return cls(**args) @classmethod @@ -17198,16 +17198,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SearchResultRow': """Initialize a SearchResultRow object from a json dictionary.""" args = {} - if 'doc' in _dict: - args['doc'] = Document.from_dict(_dict.get('doc')) - if 'fields' in _dict: - args['fields'] = _dict.get('fields') + if (doc := _dict.get('doc')) is not None: + args['doc'] = Document.from_dict(doc) + if (fields := _dict.get('fields')) is not None: + args['fields'] = fields else: raise ValueError('Required property \'fields\' not present in SearchResultRow JSON') - if 'highlights' in _dict: - args['highlights'] = _dict.get('highlights') - if 'id' in _dict: - args['id'] = _dict.get('id') + if (highlights := _dict.get('highlights')) is not None: + args['highlights'] = highlights + if (id := _dict.get('id')) is not None: + args['id'] = id else: raise ValueError('Required property \'id\' not present in SearchResultRow JSON') return cls(**args) @@ -17295,14 +17295,14 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'Security': """Initialize a Security object from a json dictionary.""" args = {} - if 'admins' in _dict: - args['admins'] = SecurityObject.from_dict(_dict.get('admins')) - if 'members' in _dict: - args['members'] = SecurityObject.from_dict(_dict.get('members')) - if 'cloudant' in _dict: - args['cloudant'] = _dict.get('cloudant') - if 'couchdb_auth_only' in _dict: - args['couchdb_auth_only'] = _dict.get('couchdb_auth_only') + if (admins := _dict.get('admins')) is not None: + args['admins'] = SecurityObject.from_dict(admins) + if (members := _dict.get('members')) is not None: + args['members'] = SecurityObject.from_dict(members) + if (cloudant := _dict.get('cloudant')) is not None: + args['cloudant'] = cloudant + if (couchdb_auth_only := _dict.get('couchdb_auth_only')) is not None: + args['couchdb_auth_only'] = couchdb_auth_only return cls(**args) @classmethod @@ -17390,10 +17390,10 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SecurityObject': """Initialize a SecurityObject object from a json dictionary.""" args = {} - if 'names' in _dict: - args['names'] = _dict.get('names') - if 'roles' in _dict: - args['roles'] = _dict.get('roles') + if (names := _dict.get('names')) is not None: + args['names'] = names + if (roles := _dict.get('roles')) is not None: + args['roles'] = roles return cls(**args) @classmethod @@ -17467,24 +17467,24 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ServerInformation': """Initialize a ServerInformation object from a json dictionary.""" args = {} - if 'couchdb' in _dict: - args['couchdb'] = _dict.get('couchdb') + if (couchdb := _dict.get('couchdb')) is not None: + args['couchdb'] = couchdb else: raise ValueError('Required property \'couchdb\' not present in ServerInformation JSON') - if 'features' in _dict: - args['features'] = _dict.get('features') + if (features := _dict.get('features')) is not None: + args['features'] = features else: raise ValueError('Required property \'features\' not present in ServerInformation JSON') - if 'vendor' in _dict: - args['vendor'] = ServerVendor.from_dict(_dict.get('vendor')) + if (vendor := _dict.get('vendor')) is not None: + args['vendor'] = ServerVendor.from_dict(vendor) else: raise ValueError('Required property \'vendor\' not present in ServerInformation JSON') - if 'version' in _dict: - args['version'] = _dict.get('version') + if (version := _dict.get('version')) is not None: + args['version'] = version else: raise ValueError('Required property \'version\' not present in ServerInformation JSON') - if 'features_flags' in _dict: - args['features_flags'] = _dict.get('features_flags') + if (features_flags := _dict.get('features_flags')) is not None: + args['features_flags'] = features_flags else: raise ValueError('Required property \'features_flags\' not present in ServerInformation JSON') return cls(**args) @@ -17562,14 +17562,14 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ServerVendor': """Initialize a ServerVendor object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in ServerVendor JSON') - if 'variant' in _dict: - args['variant'] = _dict.get('variant') - if 'version' in _dict: - args['version'] = _dict.get('version') + if (variant := _dict.get('variant')) is not None: + args['variant'] = variant + if (version := _dict.get('version')) is not None: + args['version'] = version return cls(**args) @classmethod @@ -17638,12 +17638,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SessionAuthentication': """Initialize a SessionAuthentication object from a json dictionary.""" args = {} - if 'authenticated' in _dict: - args['authenticated'] = _dict.get('authenticated') - if 'authentication_db' in _dict: - args['authentication_db'] = _dict.get('authentication_db') - if 'authentication_handlers' in _dict: - args['authentication_handlers'] = _dict.get('authentication_handlers') + if (authenticated := _dict.get('authenticated')) is not None: + args['authenticated'] = authenticated + if (authentication_db := _dict.get('authentication_db')) is not None: + args['authentication_db'] = authentication_db + if (authentication_handlers := _dict.get('authentication_handlers')) is not None: + args['authentication_handlers'] = authentication_handlers else: raise ValueError('Required property \'authentication_handlers\' not present in SessionAuthentication JSON') return cls(**args) @@ -17715,16 +17715,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'SessionInformation': """Initialize a SessionInformation object from a json dictionary.""" args = {} - if 'ok' in _dict: - args['ok'] = _dict.get('ok') + if (ok := _dict.get('ok')) is not None: + args['ok'] = ok else: raise ValueError('Required property \'ok\' not present in SessionInformation JSON') - if 'info' in _dict: - args['info'] = SessionAuthentication.from_dict(_dict.get('info')) + if (info := _dict.get('info')) is not None: + args['info'] = SessionAuthentication.from_dict(info) else: raise ValueError('Required property \'info\' not present in SessionInformation JSON') - if 'userCtx' in _dict: - args['user_ctx'] = UserContext.from_dict(_dict.get('userCtx')) + if (user_ctx := _dict.get('userCtx')) is not None: + args['user_ctx'] = UserContext.from_dict(user_ctx) else: raise ValueError('Required property \'userCtx\' not present in SessionInformation JSON') return cls(**args) @@ -17793,8 +17793,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ShardsInformation': """Initialize a ShardsInformation object from a json dictionary.""" args = {} - if 'shards' in _dict: - args['shards'] = _dict.get('shards') + if (shards := _dict.get('shards')) is not None: + args['shards'] = shards else: raise ValueError('Required property \'shards\' not present in ShardsInformation JSON') return cls(**args) @@ -17870,20 +17870,20 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ThroughputInformation': """Initialize a ThroughputInformation object from a json dictionary.""" args = {} - if 'blocks' in _dict: - args['blocks'] = _dict.get('blocks') + if (blocks := _dict.get('blocks')) is not None: + args['blocks'] = blocks else: raise ValueError('Required property \'blocks\' not present in ThroughputInformation JSON') - if 'query' in _dict: - args['query'] = _dict.get('query') + if (query := _dict.get('query')) is not None: + args['query'] = query else: raise ValueError('Required property \'query\' not present in ThroughputInformation JSON') - if 'read' in _dict: - args['read'] = _dict.get('read') + if (read := _dict.get('read')) is not None: + args['read'] = read else: raise ValueError('Required property \'read\' not present in ThroughputInformation JSON') - if 'write' in _dict: - args['write'] = _dict.get('write') + if (write := _dict.get('write')) is not None: + args['write'] = write else: raise ValueError('Required property \'write\' not present in ThroughputInformation JSON') return cls(**args) @@ -17951,12 +17951,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'UpInformation': """Initialize a UpInformation object from a json dictionary.""" args = {} - if 'seeds' in _dict: - args['seeds'] = _dict.get('seeds') + if (seeds := _dict.get('seeds')) is not None: + args['seeds'] = seeds else: raise ValueError('Required property \'seeds\' not present in UpInformation JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + if (status := _dict.get('status')) is not None: + args['status'] = status else: raise ValueError('Required property \'status\' not present in UpInformation JSON') return cls(**args) @@ -18039,16 +18039,16 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'UpdatesPending': """Initialize a UpdatesPending object from a json dictionary.""" args = {} - if 'minimum' in _dict: - args['minimum'] = _dict.get('minimum') + if (minimum := _dict.get('minimum')) is not None: + args['minimum'] = minimum else: raise ValueError('Required property \'minimum\' not present in UpdatesPending JSON') - if 'preferred' in _dict: - args['preferred'] = _dict.get('preferred') + if (preferred := _dict.get('preferred')) is not None: + args['preferred'] = preferred else: raise ValueError('Required property \'preferred\' not present in UpdatesPending JSON') - if 'total' in _dict: - args['total'] = _dict.get('total') + if (total := _dict.get('total')) is not None: + args['total'] = total else: raise ValueError('Required property \'total\' not present in UpdatesPending JSON') return cls(**args) @@ -18121,14 +18121,14 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'UserContext': """Initialize a UserContext object from a json dictionary.""" args = {} - if 'db' in _dict: - args['db'] = _dict.get('db') - if 'name' in _dict: - args['name'] = _dict.get('name') + if (db := _dict.get('db')) is not None: + args['db'] = db + if (name := _dict.get('name')) is not None: + args['name'] = name else: raise ValueError('Required property \'name\' not present in UserContext JSON') - if 'roles' in _dict: - args['roles'] = _dict.get('roles') + if (roles := _dict.get('roles')) is not None: + args['roles'] = roles else: raise ValueError('Required property \'roles\' not present in UserContext JSON') return cls(**args) @@ -18205,8 +18205,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'UuidsResult': """Initialize a UuidsResult object from a json dictionary.""" args = {} - if 'uuids' in _dict: - args['uuids'] = _dict.get('uuids') + if (uuids := _dict.get('uuids')) is not None: + args['uuids'] = uuids else: raise ValueError('Required property \'uuids\' not present in UuidsResult JSON') return cls(**args) @@ -18268,8 +18268,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ViewQueriesResult': """Initialize a ViewQueriesResult object from a json dictionary.""" args = {} - if 'results' in _dict: - args['results'] = [ViewResult.from_dict(v) for v in _dict.get('results')] + if (results := _dict.get('results')) is not None: + args['results'] = [ViewResult.from_dict(v) for v in results] else: raise ValueError('Required property \'results\' not present in ViewQueriesResult JSON') return cls(**args) @@ -18482,46 +18482,46 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ViewQuery': """Initialize a ViewQuery object from a json dictionary.""" args = {} - if 'att_encoding_info' in _dict: - args['att_encoding_info'] = _dict.get('att_encoding_info') - if 'attachments' in _dict: - args['attachments'] = _dict.get('attachments') - if 'conflicts' in _dict: - args['conflicts'] = _dict.get('conflicts') - if 'descending' in _dict: - args['descending'] = _dict.get('descending') - if 'include_docs' in _dict: - args['include_docs'] = _dict.get('include_docs') - if 'inclusive_end' in _dict: - args['inclusive_end'] = _dict.get('inclusive_end') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - if 'skip' in _dict: - args['skip'] = _dict.get('skip') - if 'update_seq' in _dict: - args['update_seq'] = _dict.get('update_seq') - if 'end_key' in _dict: - args['end_key'] = _dict.get('end_key') - if 'end_key_doc_id' in _dict: - args['end_key_doc_id'] = _dict.get('end_key_doc_id') - if 'group' in _dict: - args['group'] = _dict.get('group') - if 'group_level' in _dict: - args['group_level'] = _dict.get('group_level') - if 'key' in _dict: - args['key'] = _dict.get('key') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'reduce' in _dict: - args['reduce'] = _dict.get('reduce') - if 'stable' in _dict: - args['stable'] = _dict.get('stable') - if 'start_key' in _dict: - args['start_key'] = _dict.get('start_key') - if 'start_key_doc_id' in _dict: - args['start_key_doc_id'] = _dict.get('start_key_doc_id') - if 'update' in _dict: - args['update'] = _dict.get('update') + if (att_encoding_info := _dict.get('att_encoding_info')) is not None: + args['att_encoding_info'] = att_encoding_info + if (attachments := _dict.get('attachments')) is not None: + args['attachments'] = attachments + if (conflicts := _dict.get('conflicts')) is not None: + args['conflicts'] = conflicts + if (descending := _dict.get('descending')) is not None: + args['descending'] = descending + if (include_docs := _dict.get('include_docs')) is not None: + args['include_docs'] = include_docs + if (inclusive_end := _dict.get('inclusive_end')) is not None: + args['inclusive_end'] = inclusive_end + if (limit := _dict.get('limit')) is not None: + args['limit'] = limit + if (skip := _dict.get('skip')) is not None: + args['skip'] = skip + if (update_seq := _dict.get('update_seq')) is not None: + args['update_seq'] = update_seq + if (end_key := _dict.get('end_key')) is not None: + args['end_key'] = end_key + if (end_key_doc_id := _dict.get('end_key_doc_id')) is not None: + args['end_key_doc_id'] = end_key_doc_id + if (group := _dict.get('group')) is not None: + args['group'] = group + if (group_level := _dict.get('group_level')) is not None: + args['group_level'] = group_level + if (key := _dict.get('key')) is not None: + args['key'] = key + if (keys := _dict.get('keys')) is not None: + args['keys'] = keys + if (reduce := _dict.get('reduce')) is not None: + args['reduce'] = reduce + if (stable := _dict.get('stable')) is not None: + args['stable'] = stable + if (start_key := _dict.get('start_key')) is not None: + args['start_key'] = start_key + if (start_key_doc_id := _dict.get('start_key_doc_id')) is not None: + args['start_key_doc_id'] = start_key_doc_id + if (update := _dict.get('update')) is not None: + args['update'] = update return cls(**args) @classmethod @@ -18639,12 +18639,12 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ViewResult': """Initialize a ViewResult object from a json dictionary.""" args = {} - if 'total_rows' in _dict: - args['total_rows'] = _dict.get('total_rows') - if 'update_seq' in _dict: - args['update_seq'] = _dict.get('update_seq') - if 'rows' in _dict: - args['rows'] = [ViewResultRow.from_dict(v) for v in _dict.get('rows')] + if (total_rows := _dict.get('total_rows')) is not None: + args['total_rows'] = total_rows + if (update_seq := _dict.get('update_seq')) is not None: + args['update_seq'] = update_seq + if (rows := _dict.get('rows')) is not None: + args['rows'] = [ViewResultRow.from_dict(v) for v in rows] else: raise ValueError('Required property \'rows\' not present in ViewResult JSON') return cls(**args) @@ -18737,22 +18737,22 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'ViewResultRow': """Initialize a ViewResultRow object from a json dictionary.""" args = {} - if 'caused_by' in _dict: - args['caused_by'] = _dict.get('caused_by') - if 'error' in _dict: - args['error'] = _dict.get('error') - if 'reason' in _dict: - args['reason'] = _dict.get('reason') - if 'doc' in _dict: - args['doc'] = Document.from_dict(_dict.get('doc')) - if 'id' in _dict: - args['id'] = _dict.get('id') - if 'key' in _dict: - args['key'] = _dict.get('key') + if (caused_by := _dict.get('caused_by')) is not None: + args['caused_by'] = caused_by + if (error := _dict.get('error')) is not None: + args['error'] = error + if (reason := _dict.get('reason')) is not None: + args['reason'] = reason + if (doc := _dict.get('doc')) is not None: + args['doc'] = Document.from_dict(doc) + if (id := _dict.get('id')) is not None: + args['id'] = id + if (key := _dict.get('key')) is not None: + args['key'] = key else: raise ValueError('Required property \'key\' not present in ViewResultRow JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if (value := _dict.get('value')) is not None: + args['value'] = value else: raise ValueError('Required property \'value\' not present in ViewResultRow JSON') return cls(**args) From b4851d4555db78a01b7209ef0ead96789ff4df62 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:04:54 +0000 Subject: [PATCH 258/669] feat(generated): consume openapi definition 1.0.0-dev0.1.6 Generated SDK source code using: - Generator version 3.85.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 649772b Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 8 ++++++++ test/integration/test_cloudant_v1.py | 2 ++ test/unit/test_cloudant_v1.py | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index e22d8a32..0ce4436c 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -306,8 +306,10 @@ def put_capacity_throughput_configuration( def get_db_updates( self, *, + descending: Optional[bool] = None, feed: Optional[str] = None, heartbeat: Optional[int] = None, + limit: Optional[int] = None, timeout: Optional[int] = None, since: Optional[str] = None, **kwargs, @@ -322,6 +324,8 @@ def get_db_updates( changes. Polling modes for this method work like polling modes for the changes feed. + :param bool descending: (optional) Query parameter to specify whether to + return the documents in descending by key order. :param str feed: (optional) Query parameter to specify the changes feed type. :param int heartbeat: (optional) Query parameter to specify the period in @@ -339,6 +343,8 @@ def get_db_updates( types (`normal` or `longpoll`). * Use TCP keepalive. + :param int limit: (optional) Query parameter to specify the number of + returned documents to limit the result to. :param int timeout: (optional) Query parameter to specify the maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for `longpoll` or @@ -366,8 +372,10 @@ def get_db_updates( headers.update(sdk_headers) params = { + 'descending': descending, 'feed': feed, 'heartbeat': heartbeat, + 'limit': limit, 'timeout': timeout, 'since': since, } diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 1c075eda..614b33c7 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -99,8 +99,10 @@ def test_put_capacity_throughput_configuration(self): @needscredentials def test_get_db_updates(self): response = self.cloudant_service.get_db_updates( + descending=False, feed='normal', heartbeat=0, + limit=0, timeout=60000, since='0', ) diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 620fc83b..bc296586 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -446,15 +446,19 @@ def test_get_db_updates_all_params(self): ) # Set up parameter values + descending = False feed = 'normal' heartbeat = 0 + limit = 0 timeout = 60000 since = '0' # Invoke method response = _service.get_db_updates( + descending=descending, feed=feed, heartbeat=heartbeat, + limit=limit, timeout=timeout, since=since, headers={}, @@ -466,8 +470,10 @@ def test_get_db_updates_all_params(self): # Validate query params query_string = responses.calls[0].request.url.split('?', 1)[1] query_string = urllib.parse.unquote_plus(query_string) + assert 'descending={}'.format('true' if descending else 'false') in query_string assert 'feed={}'.format(feed) in query_string assert 'heartbeat={}'.format(heartbeat) in query_string + assert 'limit={}'.format(limit) in query_string assert 'timeout={}'.format(timeout) in query_string assert 'since={}'.format(since) in query_string From e958196c7b181086da592b637e52b51f88731e37 Mon Sep 17 00:00:00 2001 From: Esteban Laver <10552966+emlaver@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:09:48 -0500 Subject: [PATCH 259/669] refactor: replace 'code' with 'status_code' in changes follower Signed-off-by: Esteban Laver <10552966+emlaver@users.noreply.github.com> --- ibmcloudant/features/changes_follower.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index cb238b7f..a1d89df1 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -197,7 +197,7 @@ def _request_callback(self): self._buffer.put(e) break if ( - type(e) is ApiException and e.code in [400, 401, 403, 404] + type(e) is ApiException and e.status_code in [400, 401, 403, 404] or type(e) is StopIteration ): self.logger.debug('Terminal error.') From 3f75a4acb25cbd47c7269871792f26db45d59185 Mon Sep 17 00:00:00 2001 From: Esteban Laver <10552966+emlaver@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:10:23 -0500 Subject: [PATCH 260/669] refactor: replace 'code' with 'status_code' in test examples Signed-off-by: Esteban Laver <10552966+emlaver@users.noreply.github.com> --- test/examples/src/create_db_and_doc.py | 2 +- test/examples/src/delete_doc.py | 2 +- test/examples/src/update_doc.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/examples/src/create_db_and_doc.py b/test/examples/src/create_db_and_doc.py index 8481784c..aceebf8e 100644 --- a/test/examples/src/create_db_and_doc.py +++ b/test/examples/src/create_db_and_doc.py @@ -31,7 +31,7 @@ if put_database_result["ok"]: print(f'"{example_db_name}" database created.') except ApiException as ae: - if ae.code == 412: + if ae.status_code == 412: print(f'Cannot create "{example_db_name}" database, ' + 'it already exists.') diff --git a/test/examples/src/delete_doc.py b/test/examples/src/delete_doc.py index b0d80467..993233a3 100644 --- a/test/examples/src/delete_doc.py +++ b/test/examples/src/delete_doc.py @@ -41,7 +41,7 @@ print('You have deleted the document.') except ApiException as ae: - if ae.code == 404: + if ae.status_code == 404: print('Cannot delete document because either ' + f'"{example_db_name}" database or "{example_doc_id}"' + 'document was not found.') diff --git a/test/examples/src/update_doc.py b/test/examples/src/update_doc.py index de680934..e66ae530 100644 --- a/test/examples/src/update_doc.py +++ b/test/examples/src/update_doc.py @@ -88,7 +88,7 @@ json.dumps(document, indent=2)) except ApiException as ae: - if ae.code == 404: + if ae.status_code == 404: print('Cannot delete document because either ' + f'"{example_db_name}" database or "{example_doc_id}" ' + 'document was not found.') From 936e028fe778e342eafd9461fbd634a042b25d84 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:37:18 +0000 Subject: [PATCH 261/669] feat(generated): replace code with status_code in changes follower and examples Generated SDK source code using: - Generator version 3.85.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 649772b Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ec8f272e..7bee56fa 100644 --- a/README.md +++ b/README.md @@ -318,7 +318,7 @@ try: if put_database_result["ok"]: print(f'"{example_db_name}" database created.') except ApiException as ae: - if ae.code == 412: + if ae.status_code == 412: print(f'Cannot create "{example_db_name}" database, ' + 'it already exists.') @@ -525,7 +525,7 @@ try: json.dumps(document, indent=2)) except ApiException as ae: - if ae.code == 404: + if ae.status_code == 404: print('Cannot delete document because either ' + f'"{example_db_name}" database or "{example_doc_id}" ' + 'document was not found.') @@ -585,7 +585,7 @@ try: print('You have deleted the document.') except ApiException as ae: - if ae.code == 404: + if ae.status_code == 404: print('Cannot delete document because either ' + f'"{example_db_name}" database or "{example_doc_id}"' + 'document was not found.') From 32298f0bbec1176f2c71cceb5122e249ded0ae8d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 13 Feb 2024 09:57:00 +0000 Subject: [PATCH 262/669] Update version 0.7.2 -> 0.7.3 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7b177d8a..2f1a95f3 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.2 +current_version = 0.7.3 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 7bee56fa..76ff425c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.7.2 +# IBM Cloudant Python SDK Version 0.7.3 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -122,13 +122,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.7.2" +pip install --upgrade "ibmcloudant>=0.7.3" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.7.2" +easy_install --upgrade "ibmcloudant>=0.7.3" ``` @@ -602,7 +602,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/examples#examples-for-python). ### Error handling @@ -796,7 +796,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/examples#postchanges) instead of the follower. #### Error suppression @@ -831,7 +831,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/examples#postchanges). #### Checkpointing @@ -1034,7 +1034,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1064,8 +1064,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.2/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index c6951295..25117f50 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.7.2' +__version__ = '0.7.3' diff --git a/pyproject.toml b/pyproject.toml index 47597c97..16363eb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.7.2" +version = "0.7.3" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.19.1", From 3cad85afd92c6db6f5fd23aa1d92048f85f990dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:36:51 +0000 Subject: [PATCH 263/669] build(deps-dev): Bump responses from 0.24.1 to 0.25.0 Bumps [responses](https://github.com/getsentry/responses) from 0.24.1 to 0.25.0. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.24.1...0.25.0) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3d8285ef..5b97a995 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==8.0.0 -responses==0.24.1 +responses==0.25.0 python_dotenv==1.0.1 pylint==3.0.3 # code coverage From 5883d032f261e2dd1c8f189689b5f2b89f641f5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:24:36 +0000 Subject: [PATCH 264/669] build(deps-dev): Bump pytest from 8.0.0 to 8.0.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.0.0...8.0.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5b97a995..92677855 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.0.0 +pytest==8.0.1 responses==0.25.0 python_dotenv==1.0.1 pylint==3.0.3 From ed37003f137941c4f23df7f32c677df4582de178 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:01:41 +0000 Subject: [PATCH 265/669] build(deps-dev): Bump coverage from 7.4.1 to 7.4.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.1 to 7.4.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.1...7.4.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 92677855..535580e6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.0.3 # code coverage -coverage==7.4.1 +coverage==7.4.2 pytest-cov==4.1.0 From d07c194d9f000654c90c998a1404e062589775c2 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:43:59 +0000 Subject: [PATCH 266/669] build(generated): update generator to 3.86.0 Generated SDK source code using: - Generator version 3.86.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 710f6c4 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- test/integration/test_cloudant_v1.py | 12 ++-- test/unit/test_cloudant_v1.py | 88 ++++++++++++++-------------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 614b33c7..3812fd1f 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -238,7 +238,7 @@ def test_post_document(self): # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', - 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', 'digest': 'testString', 'encoded_length': 0, 'encoding': 'testString', @@ -389,7 +389,7 @@ def test_post_bulk_docs(self): # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', - 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', 'digest': 'testString', 'encoded_length': 0, 'encoding': 'testString', @@ -617,7 +617,7 @@ def test_put_document(self): # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', - 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', 'digest': 'testString', 'encoded_length': 0, 'encoding': 'testString', @@ -702,7 +702,7 @@ def test_put_design_document(self): # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', - 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', 'digest': 'testString', 'encoded_length': 0, 'encoding': 'testString', @@ -1472,7 +1472,7 @@ def test_put_replication_document(self): # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', - 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', 'digest': 'testString', 'encoded_length': 0, 'encoding': 'testString', @@ -1779,7 +1779,7 @@ def test_put_local_document(self): # Construct a dict representation of a Attachment model attachment_model = { 'content_type': 'testString', - 'data': b'This is a mock byte array value.'.decode('utf-8'), + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', 'digest': 'testString', 'encoded_length': 0, 'encoding': 'testString', diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index bc296586..708e06b2 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -531,7 +531,7 @@ def test_post_changes_all_params(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -631,7 +631,7 @@ def test_post_changes_required_params(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -684,7 +684,7 @@ def test_post_changes_value_error(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -1939,7 +1939,7 @@ def test_post_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2022,7 +2022,7 @@ def test_post_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2223,7 +2223,7 @@ def test_post_all_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2286,7 +2286,7 @@ def test_post_all_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2649,7 +2649,7 @@ def test_post_bulk_get_all_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2717,7 +2717,7 @@ def test_post_bulk_get_required_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2770,7 +2770,7 @@ def test_post_bulk_get_value_error(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -3485,7 +3485,7 @@ def test_get_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' responses.add( responses.GET, url, @@ -3560,7 +3560,7 @@ def test_get_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' responses.add( responses.GET, url, @@ -3600,7 +3600,7 @@ def test_get_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' responses.add( responses.GET, url, @@ -4692,7 +4692,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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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": false, "_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"}}}' responses.add( responses.GET, url, @@ -4767,7 +4767,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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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": false, "_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"}}}' responses.add( responses.GET, url, @@ -4807,7 +4807,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": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_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": false, "_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"}}}' responses.add( responses.GET, url, @@ -5297,7 +5297,7 @@ def test_post_design_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5382,7 +5382,7 @@ def test_post_design_docs_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5465,7 +5465,7 @@ def test_post_design_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5521,7 +5521,7 @@ def test_post_design_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5586,7 +5586,7 @@ def test_post_design_docs_queries_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5649,7 +5649,7 @@ def test_post_design_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5749,7 +5749,7 @@ def test_post_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -5857,7 +5857,7 @@ def test_post_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -6105,7 +6105,7 @@ def test_post_view_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6179,7 +6179,7 @@ def test_post_view_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6527,7 +6527,7 @@ def test_post_partition_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6612,7 +6612,7 @@ def test_post_partition_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6819,7 +6819,7 @@ def test_post_partition_search_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -6905,7 +6905,7 @@ def test_post_partition_search_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -7121,7 +7121,7 @@ def test_post_partition_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7228,7 +7228,7 @@ def test_post_partition_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7613,7 +7613,7 @@ def test_post_partition_find_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -7692,7 +7692,7 @@ def test_post_partition_find_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -8066,7 +8066,7 @@ def test_post_find_all_params(self): """ # Set up mock url = preprocess_url('/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -8146,7 +8146,7 @@ def test_post_find_value_error(self): """ # Set up mock url = preprocess_url('/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -8806,7 +8806,7 @@ def test_post_search_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -8908,7 +8908,7 @@ def test_post_search_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -9668,7 +9668,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9741,7 +9741,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9779,7 +9779,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -12119,7 +12119,7 @@ def test_get_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' responses.add( responses.GET, url, @@ -12175,7 +12175,7 @@ def test_get_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' responses.add( responses.GET, url, @@ -12215,7 +12215,7 @@ def test_get_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' responses.add( responses.GET, url, From 09f88c9bb014bdf3acb7b1ff4c5ad1813b901c67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:49:37 +0000 Subject: [PATCH 267/669] build(deps-dev): Bump pylint from 3.0.3 to 3.1.0 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.3 to 3.1.0. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.3...v3.1.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 535580e6..add7ff04 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.0.1 responses==0.25.0 python_dotenv==1.0.1 -pylint==3.0.3 +pylint==3.1.0 # code coverage coverage==7.4.2 pytest-cov==4.1.0 From 2672619c0413159b4368cd773152ecca97424874 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 10:15:45 +0000 Subject: [PATCH 268/669] build(deps-dev): Bump pytest from 8.0.1 to 8.0.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.1 to 8.0.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.0.1...8.0.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index add7ff04..ae8a2dab 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.0.1 +pytest==8.0.2 responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 From b24c289d5b8b1abcc7e29fa7288275bf50c9979d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 10:57:02 +0000 Subject: [PATCH 269/669] build(deps-dev): Bump coverage from 7.4.2 to 7.4.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.2 to 7.4.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.2...7.4.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ae8a2dab..e6a87c97 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 # code coverage -coverage==7.4.2 +coverage==7.4.3 pytest-cov==4.1.0 From ceff3f31d7591dc0035388075d4b6c90981680f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:26:29 +0000 Subject: [PATCH 270/669] build(deps-dev): Bump ibm-cloud-sdk-core from 3.19.1 to 3.19.2 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.19.1 to 3.19.2. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.19.1...v3.19.2) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 16363eb1..4a5f686a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.7.3" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.19.1", + "ibm_cloud_sdk_core==3.19.2", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 35cf63c860bcc4cfe0dbbcf3ac9f10ba7feed9cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 17:13:00 +0000 Subject: [PATCH 271/669] build(deps-dev): Bump pytest from 8.0.2 to 8.1.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.2 to 8.1.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.0.2...8.1.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e6a87c97..52227236 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.0.2 +pytest==8.1.1 responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 From 79f82857ce2f13392cc820a614d14db29a6ae901 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:37:30 +0000 Subject: [PATCH 272/669] feat(generated): enable reserved field preservation Generated SDK source code using: - Generator version 3.86.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 40f6e39 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 408 +++++++++++++++++----------------- test/unit/test_cloudant_v1.py | 88 ++++---- 2 files changed, 248 insertions(+), 248 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 0ce4436c..5ff7e96d 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -11404,20 +11404,20 @@ class DesignDocument: """ Schema for a design document. - :param dict attachments: (optional) Schema for a map of attachment name to + :param dict _attachments: (optional) Schema for a map of attachment name to attachment metadata. - :param List[str] conflicts: (optional) Schema for a list of document revision + :param List[str] _conflicts: (optional) Schema for a list of document revision identifiers. - :param bool deleted: (optional) Deletion flag. Available if document was + :param bool _deleted: (optional) Deletion flag. Available if document was removed. - :param List[str] deleted_conflicts: (optional) Schema for a list of document + :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str id: (optional) Document ID. - :param str local_seq: (optional) Document's update sequence in current database. - Available if requested with local_seq=true query parameter. - :param str rev: (optional) Schema for a document revision identifier. - :param Revisions revisions: (optional) Schema for list of revision information. - :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of + :param str _id: (optional) Document ID. + :param str _local_seq: (optional) Document's update sequence in current + database. Available if requested with local_seq=true query parameter. + :param str _rev: (optional) Schema for a document revision identifier. + :param Revisions _revisions: (optional) Schema for list of revision information. + :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a list of objects with information about local revisions and their status. :param bool autoupdate: (optional) Indicates whether to automatically build indexes defined in this design document. @@ -11492,20 +11492,20 @@ class DesignDocument: """ # The set of defined properties for the class - _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'autoupdate', 'filters', 'indexes', 'language', 'options', 'validate_doc_update', 'views']) + _properties = frozenset(['_attachments', '_conflicts', '_deleted', '_deleted_conflicts', '_id', '_local_seq', '_rev', '_revisions', '_revs_info', 'autoupdate', 'filters', 'indexes', 'language', 'options', 'validate_doc_update', 'views']) def __init__( self, *, - attachments: Optional[dict] = None, - conflicts: Optional[List[str]] = None, - deleted: Optional[bool] = None, - deleted_conflicts: Optional[List[str]] = None, - id: Optional[str] = None, - local_seq: Optional[str] = None, - rev: Optional[str] = None, - revisions: Optional['Revisions'] = None, - revs_info: Optional[List['DocumentRevisionStatus']] = None, + _attachments: Optional[dict] = None, + _conflicts: Optional[List[str]] = None, + _deleted: Optional[bool] = None, + _deleted_conflicts: Optional[List[str]] = None, + _id: Optional[str] = None, + _local_seq: Optional[str] = None, + _rev: Optional[str] = None, + _revisions: Optional['Revisions'] = None, + _revs_info: Optional[List['DocumentRevisionStatus']] = None, autoupdate: Optional[bool] = None, filters: Optional[dict] = None, indexes: Optional[dict] = None, @@ -11518,22 +11518,22 @@ def __init__( """ Initialize a DesignDocument object. - :param dict attachments: (optional) Schema for a map of attachment name to + :param dict _attachments: (optional) Schema for a map of attachment name to attachment metadata. - :param List[str] conflicts: (optional) Schema for a list of document + :param List[str] _conflicts: (optional) Schema for a list of document revision identifiers. - :param bool deleted: (optional) Deletion flag. Available if document was + :param bool _deleted: (optional) Deletion flag. Available if document was removed. - :param List[str] deleted_conflicts: (optional) Schema for a list of + :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str id: (optional) Document ID. - :param str local_seq: (optional) Document's update sequence in current + :param str _id: (optional) Document ID. + :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. - :param str rev: (optional) Schema for a document revision identifier. - :param Revisions revisions: (optional) Schema for list of revision + :param str _rev: (optional) Schema for a document revision identifier. + :param Revisions _revisions: (optional) Schema for list of revision information. - :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list - of objects with information about local revisions and their status. + :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a + list of objects with information about local revisions and their status. :param bool autoupdate: (optional) Indicates whether to automatically build indexes defined in this design document. :param dict filters: (optional) Schema for filter functions definition. @@ -11607,15 +11607,15 @@ def __init__( :param dict views: (optional) Schema for design document views. :param **kwargs: (optional) Any additional properties. """ - self.attachments = attachments - self.conflicts = conflicts - self.deleted = deleted - self.deleted_conflicts = deleted_conflicts - self.id = id - self.local_seq = local_seq - self.rev = rev - self.revisions = revisions - self.revs_info = revs_info + self._attachments = _attachments + self._conflicts = _conflicts + self._deleted = _deleted + self._deleted_conflicts = _deleted_conflicts + self._id = _id + self._local_seq = _local_seq + self._rev = _rev + self._revisions = _revisions + self._revs_info = _revs_info self.autoupdate = autoupdate self.filters = filters self.indexes = indexes @@ -11631,23 +11631,23 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': """Initialize a DesignDocument object from a json dictionary.""" args = {} if (attachments := _dict.get('_attachments')) is not None: - args['attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} + args['_attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} if (conflicts := _dict.get('_conflicts')) is not None: - args['conflicts'] = conflicts + args['_conflicts'] = conflicts if (deleted := _dict.get('_deleted')) is not None: - args['deleted'] = deleted + args['_deleted'] = deleted if (deleted_conflicts := _dict.get('_deleted_conflicts')) is not None: - args['deleted_conflicts'] = deleted_conflicts + args['_deleted_conflicts'] = deleted_conflicts if (id := _dict.get('_id')) is not None: - args['id'] = id + args['_id'] = id if (local_seq := _dict.get('_local_seq')) is not None: - args['local_seq'] = local_seq + args['_local_seq'] = local_seq if (rev := _dict.get('_rev')) is not None: - args['rev'] = rev + args['_rev'] = rev if (revisions := _dict.get('_revisions')) is not None: - args['revisions'] = Revisions.from_dict(revisions) + args['_revisions'] = Revisions.from_dict(revisions) if (revs_info := _dict.get('_revs_info')) is not None: - args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] + args['_revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] if (autoupdate := _dict.get('autoupdate')) is not None: args['autoupdate'] = autoupdate if (filters := _dict.get('filters')) is not None: @@ -11673,34 +11673,34 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'attachments') and self.attachments is not None: + if hasattr(self, '_attachments') and self._attachments is not None: _attachments_map = {} - for k, v in self.attachments.items(): + for k, v in self._attachments.items(): if isinstance(v, dict): _attachments_map[k] = v else: _attachments_map[k] = v.to_dict() _dict['_attachments'] = _attachments_map - if hasattr(self, 'conflicts') and self.conflicts is not None: - _dict['_conflicts'] = self.conflicts - if hasattr(self, 'deleted') and self.deleted is not None: - _dict['_deleted'] = self.deleted - if hasattr(self, 'deleted_conflicts') and self.deleted_conflicts is not None: - _dict['_deleted_conflicts'] = self.deleted_conflicts - if hasattr(self, 'id') and self.id is not None: - _dict['_id'] = self.id - if hasattr(self, 'local_seq') and self.local_seq is not None: - _dict['_local_seq'] = self.local_seq - if hasattr(self, 'rev') and self.rev is not None: - _dict['_rev'] = self.rev - if hasattr(self, 'revisions') and self.revisions is not None: - if isinstance(self.revisions, dict): - _dict['_revisions'] = self.revisions + if hasattr(self, '_conflicts') and self._conflicts is not None: + _dict['_conflicts'] = self._conflicts + if hasattr(self, '_deleted') and self._deleted is not None: + _dict['_deleted'] = self._deleted + if hasattr(self, '_deleted_conflicts') and self._deleted_conflicts is not None: + _dict['_deleted_conflicts'] = self._deleted_conflicts + if hasattr(self, '_id') and self._id is not None: + _dict['_id'] = self._id + if hasattr(self, '_local_seq') and self._local_seq is not None: + _dict['_local_seq'] = self._local_seq + if hasattr(self, '_rev') and self._rev is not None: + _dict['_rev'] = self._rev + if hasattr(self, '_revisions') and self._revisions is not None: + if isinstance(self._revisions, dict): + _dict['_revisions'] = self._revisions else: - _dict['_revisions'] = self.revisions.to_dict() - if hasattr(self, 'revs_info') and self.revs_info is not None: + _dict['_revisions'] = self._revisions.to_dict() + if hasattr(self, '_revs_info') and self._revs_info is not None: _revs_info_list = [] - for v in self.revs_info: + for v in self._revs_info: if isinstance(v, dict): _revs_info_list.append(v) else: @@ -12324,70 +12324,70 @@ class Document: """ Schema for a document. - :param dict attachments: (optional) Schema for a map of attachment name to + :param dict _attachments: (optional) Schema for a map of attachment name to attachment metadata. - :param List[str] conflicts: (optional) Schema for a list of document revision + :param List[str] _conflicts: (optional) Schema for a list of document revision identifiers. - :param bool deleted: (optional) Deletion flag. Available if document was + :param bool _deleted: (optional) Deletion flag. Available if document was removed. - :param List[str] deleted_conflicts: (optional) Schema for a list of document + :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str id: (optional) Document ID. - :param str local_seq: (optional) Document's update sequence in current database. - Available if requested with local_seq=true query parameter. - :param str rev: (optional) Schema for a document revision identifier. - :param Revisions revisions: (optional) Schema for list of revision information. - :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of + :param str _id: (optional) Document ID. + :param str _local_seq: (optional) Document's update sequence in current + database. Available if requested with local_seq=true query parameter. + :param str _rev: (optional) Schema for a document revision identifier. + :param Revisions _revisions: (optional) Schema for list of revision information. + :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a list of objects with information about local revisions and their status. """ # The set of defined properties for the class - _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info']) + _properties = frozenset(['_attachments', '_conflicts', '_deleted', '_deleted_conflicts', '_id', '_local_seq', '_rev', '_revisions', '_revs_info']) def __init__( self, *, - attachments: Optional[dict] = None, - conflicts: Optional[List[str]] = None, - deleted: Optional[bool] = None, - deleted_conflicts: Optional[List[str]] = None, - id: Optional[str] = None, - local_seq: Optional[str] = None, - rev: Optional[str] = None, - revisions: Optional['Revisions'] = None, - revs_info: Optional[List['DocumentRevisionStatus']] = None, + _attachments: Optional[dict] = None, + _conflicts: Optional[List[str]] = None, + _deleted: Optional[bool] = None, + _deleted_conflicts: Optional[List[str]] = None, + _id: Optional[str] = None, + _local_seq: Optional[str] = None, + _rev: Optional[str] = None, + _revisions: Optional['Revisions'] = None, + _revs_info: Optional[List['DocumentRevisionStatus']] = None, **kwargs, ) -> None: """ Initialize a Document object. - :param dict attachments: (optional) Schema for a map of attachment name to + :param dict _attachments: (optional) Schema for a map of attachment name to attachment metadata. - :param List[str] conflicts: (optional) Schema for a list of document + :param List[str] _conflicts: (optional) Schema for a list of document revision identifiers. - :param bool deleted: (optional) Deletion flag. Available if document was + :param bool _deleted: (optional) Deletion flag. Available if document was removed. - :param List[str] deleted_conflicts: (optional) Schema for a list of + :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str id: (optional) Document ID. - :param str local_seq: (optional) Document's update sequence in current + :param str _id: (optional) Document ID. + :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. - :param str rev: (optional) Schema for a document revision identifier. - :param Revisions revisions: (optional) Schema for list of revision + :param str _rev: (optional) Schema for a document revision identifier. + :param Revisions _revisions: (optional) Schema for list of revision information. - :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list - of objects with information about local revisions and their status. + :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a + list of objects with information about local revisions and their status. :param **kwargs: (optional) Any additional properties. """ - self.attachments = attachments - self.conflicts = conflicts - self.deleted = deleted - self.deleted_conflicts = deleted_conflicts - self.id = id - self.local_seq = local_seq - self.rev = rev - self.revisions = revisions - self.revs_info = revs_info + self._attachments = _attachments + self._conflicts = _conflicts + self._deleted = _deleted + self._deleted_conflicts = _deleted_conflicts + self._id = _id + self._local_seq = _local_seq + self._rev = _rev + self._revisions = _revisions + self._revs_info = _revs_info for _key, _value in kwargs.items(): setattr(self, _key, _value) @@ -12396,23 +12396,23 @@ def from_dict(cls, _dict: Dict) -> 'Document': """Initialize a Document object from a json dictionary.""" args = {} if (attachments := _dict.get('_attachments')) is not None: - args['attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} + args['_attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} if (conflicts := _dict.get('_conflicts')) is not None: - args['conflicts'] = conflicts + args['_conflicts'] = conflicts if (deleted := _dict.get('_deleted')) is not None: - args['deleted'] = deleted + args['_deleted'] = deleted if (deleted_conflicts := _dict.get('_deleted_conflicts')) is not None: - args['deleted_conflicts'] = deleted_conflicts + args['_deleted_conflicts'] = deleted_conflicts if (id := _dict.get('_id')) is not None: - args['id'] = id + args['_id'] = id if (local_seq := _dict.get('_local_seq')) is not None: - args['local_seq'] = local_seq + args['_local_seq'] = local_seq if (rev := _dict.get('_rev')) is not None: - args['rev'] = rev + args['_rev'] = rev if (revisions := _dict.get('_revisions')) is not None: - args['revisions'] = Revisions.from_dict(revisions) + args['_revisions'] = Revisions.from_dict(revisions) if (revs_info := _dict.get('_revs_info')) is not None: - args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] + args['_revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @@ -12424,34 +12424,34 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'attachments') and self.attachments is not None: + if hasattr(self, '_attachments') and self._attachments is not None: _attachments_map = {} - for k, v in self.attachments.items(): + for k, v in self._attachments.items(): if isinstance(v, dict): _attachments_map[k] = v else: _attachments_map[k] = v.to_dict() _dict['_attachments'] = _attachments_map - if hasattr(self, 'conflicts') and self.conflicts is not None: - _dict['_conflicts'] = self.conflicts - if hasattr(self, 'deleted') and self.deleted is not None: - _dict['_deleted'] = self.deleted - if hasattr(self, 'deleted_conflicts') and self.deleted_conflicts is not None: - _dict['_deleted_conflicts'] = self.deleted_conflicts - if hasattr(self, 'id') and self.id is not None: - _dict['_id'] = self.id - if hasattr(self, 'local_seq') and self.local_seq is not None: - _dict['_local_seq'] = self.local_seq - if hasattr(self, 'rev') and self.rev is not None: - _dict['_rev'] = self.rev - if hasattr(self, 'revisions') and self.revisions is not None: - if isinstance(self.revisions, dict): - _dict['_revisions'] = self.revisions + if hasattr(self, '_conflicts') and self._conflicts is not None: + _dict['_conflicts'] = self._conflicts + if hasattr(self, '_deleted') and self._deleted is not None: + _dict['_deleted'] = self._deleted + if hasattr(self, '_deleted_conflicts') and self._deleted_conflicts is not None: + _dict['_deleted_conflicts'] = self._deleted_conflicts + if hasattr(self, '_id') and self._id is not None: + _dict['_id'] = self._id + if hasattr(self, '_local_seq') and self._local_seq is not None: + _dict['_local_seq'] = self._local_seq + if hasattr(self, '_rev') and self._rev is not None: + _dict['_rev'] = self._rev + if hasattr(self, '_revisions') and self._revisions is not None: + if isinstance(self._revisions, dict): + _dict['_revisions'] = self._revisions else: - _dict['_revisions'] = self.revisions.to_dict() - if hasattr(self, 'revs_info') and self.revs_info is not None: + _dict['_revisions'] = self._revisions.to_dict() + if hasattr(self, '_revs_info') and self._revs_info is not None: _revs_info_list = [] - for v in self.revs_info: + for v in self._revs_info: if isinstance(v, dict): _revs_info_list.append(v) else: @@ -15152,20 +15152,20 @@ class ReplicationDocument: Schema for a replication document. Note that `selector`, `doc_ids`, and `filter` are incompatible with each other. - :param dict attachments: (optional) Schema for a map of attachment name to + :param dict _attachments: (optional) Schema for a map of attachment name to attachment metadata. - :param List[str] conflicts: (optional) Schema for a list of document revision + :param List[str] _conflicts: (optional) Schema for a list of document revision identifiers. - :param bool deleted: (optional) Deletion flag. Available if document was + :param bool _deleted: (optional) Deletion flag. Available if document was removed. - :param List[str] deleted_conflicts: (optional) Schema for a list of document + :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str id: (optional) Document ID. - :param str local_seq: (optional) Document's update sequence in current database. - Available if requested with local_seq=true query parameter. - :param str rev: (optional) Schema for a document revision identifier. - :param Revisions revisions: (optional) Schema for list of revision information. - :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list of + :param str _id: (optional) Document ID. + :param str _local_seq: (optional) Document's update sequence in current + database. Available if requested with local_seq=true query parameter. + :param str _rev: (optional) Schema for a document revision identifier. + :param Revisions _revisions: (optional) Schema for list of revision information. + :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a list of objects with information about local revisions and their status. :param bool cancel: (optional) Cancels the replication. :param int checkpoint_interval: (optional) Defines replication checkpoint @@ -15260,22 +15260,22 @@ class ReplicationDocument: """ # The set of defined properties for the class - _properties = frozenset(['attachments', '_attachments', 'conflicts', '_conflicts', 'deleted', '_deleted', 'deleted_conflicts', '_deleted_conflicts', 'id', '_id', 'local_seq', '_local_seq', 'rev', '_rev', 'revisions', '_revisions', 'revs_info', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_bulk_get', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) + _properties = frozenset(['_attachments', '_conflicts', '_deleted', '_deleted_conflicts', '_id', '_local_seq', '_rev', '_revisions', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_bulk_get', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) def __init__( self, source: 'ReplicationDatabase', target: 'ReplicationDatabase', *, - attachments: Optional[dict] = None, - conflicts: Optional[List[str]] = None, - deleted: Optional[bool] = None, - deleted_conflicts: Optional[List[str]] = None, - id: Optional[str] = None, - local_seq: Optional[str] = None, - rev: Optional[str] = None, - revisions: Optional['Revisions'] = None, - revs_info: Optional[List['DocumentRevisionStatus']] = None, + _attachments: Optional[dict] = None, + _conflicts: Optional[List[str]] = None, + _deleted: Optional[bool] = None, + _deleted_conflicts: Optional[List[str]] = None, + _id: Optional[str] = None, + _local_seq: Optional[str] = None, + _rev: Optional[str] = None, + _revisions: Optional['Revisions'] = None, + _revs_info: Optional[List['DocumentRevisionStatus']] = None, cancel: Optional[bool] = None, checkpoint_interval: Optional[int] = None, connection_timeout: Optional[int] = None, @@ -15307,22 +15307,22 @@ def __init__( target database. :param ReplicationDatabase target: Schema for a replication source or target database. - :param dict attachments: (optional) Schema for a map of attachment name to + :param dict _attachments: (optional) Schema for a map of attachment name to attachment metadata. - :param List[str] conflicts: (optional) Schema for a list of document + :param List[str] _conflicts: (optional) Schema for a list of document revision identifiers. - :param bool deleted: (optional) Deletion flag. Available if document was + :param bool _deleted: (optional) Deletion flag. Available if document was removed. - :param List[str] deleted_conflicts: (optional) Schema for a list of + :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str id: (optional) Document ID. - :param str local_seq: (optional) Document's update sequence in current + :param str _id: (optional) Document ID. + :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. - :param str rev: (optional) Schema for a document revision identifier. - :param Revisions revisions: (optional) Schema for list of revision + :param str _rev: (optional) Schema for a document revision identifier. + :param Revisions _revisions: (optional) Schema for list of revision information. - :param List[DocumentRevisionStatus] revs_info: (optional) Schema for a list - of objects with information about local revisions and their status. + :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a + list of objects with information about local revisions and their status. :param bool cancel: (optional) Cancels the replication. :param int checkpoint_interval: (optional) Defines replication checkpoint interval in milliseconds. @@ -15414,15 +15414,15 @@ def __init__( higher number can improve throughput. :param **kwargs: (optional) Any additional properties. """ - self.attachments = attachments - self.conflicts = conflicts - self.deleted = deleted - self.deleted_conflicts = deleted_conflicts - self.id = id - self.local_seq = local_seq - self.rev = rev - self.revisions = revisions - self.revs_info = revs_info + self._attachments = _attachments + self._conflicts = _conflicts + self._deleted = _deleted + self._deleted_conflicts = _deleted_conflicts + self._id = _id + self._local_seq = _local_seq + self._rev = _rev + self._revisions = _revisions + self._revs_info = _revs_info self.cancel = cancel self.checkpoint_interval = checkpoint_interval self.connection_timeout = connection_timeout @@ -15455,23 +15455,23 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': """Initialize a ReplicationDocument object from a json dictionary.""" args = {} if (attachments := _dict.get('_attachments')) is not None: - args['attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} + args['_attachments'] = {k: Attachment.from_dict(v) for k, v in attachments.items()} if (conflicts := _dict.get('_conflicts')) is not None: - args['conflicts'] = conflicts + args['_conflicts'] = conflicts if (deleted := _dict.get('_deleted')) is not None: - args['deleted'] = deleted + args['_deleted'] = deleted if (deleted_conflicts := _dict.get('_deleted_conflicts')) is not None: - args['deleted_conflicts'] = deleted_conflicts + args['_deleted_conflicts'] = deleted_conflicts if (id := _dict.get('_id')) is not None: - args['id'] = id + args['_id'] = id if (local_seq := _dict.get('_local_seq')) is not None: - args['local_seq'] = local_seq + args['_local_seq'] = local_seq if (rev := _dict.get('_rev')) is not None: - args['rev'] = rev + args['_rev'] = rev if (revisions := _dict.get('_revisions')) is not None: - args['revisions'] = Revisions.from_dict(revisions) + args['_revisions'] = Revisions.from_dict(revisions) if (revs_info := _dict.get('_revs_info')) is not None: - args['revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] + args['_revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] if (cancel := _dict.get('cancel')) is not None: args['cancel'] = cancel if (checkpoint_interval := _dict.get('checkpoint_interval')) is not None: @@ -15535,34 +15535,34 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'attachments') and self.attachments is not None: + if hasattr(self, '_attachments') and self._attachments is not None: _attachments_map = {} - for k, v in self.attachments.items(): + for k, v in self._attachments.items(): if isinstance(v, dict): _attachments_map[k] = v else: _attachments_map[k] = v.to_dict() _dict['_attachments'] = _attachments_map - if hasattr(self, 'conflicts') and self.conflicts is not None: - _dict['_conflicts'] = self.conflicts - if hasattr(self, 'deleted') and self.deleted is not None: - _dict['_deleted'] = self.deleted - if hasattr(self, 'deleted_conflicts') and self.deleted_conflicts is not None: - _dict['_deleted_conflicts'] = self.deleted_conflicts - if hasattr(self, 'id') and self.id is not None: - _dict['_id'] = self.id - if hasattr(self, 'local_seq') and self.local_seq is not None: - _dict['_local_seq'] = self.local_seq - if hasattr(self, 'rev') and self.rev is not None: - _dict['_rev'] = self.rev - if hasattr(self, 'revisions') and self.revisions is not None: - if isinstance(self.revisions, dict): - _dict['_revisions'] = self.revisions + if hasattr(self, '_conflicts') and self._conflicts is not None: + _dict['_conflicts'] = self._conflicts + if hasattr(self, '_deleted') and self._deleted is not None: + _dict['_deleted'] = self._deleted + if hasattr(self, '_deleted_conflicts') and self._deleted_conflicts is not None: + _dict['_deleted_conflicts'] = self._deleted_conflicts + if hasattr(self, '_id') and self._id is not None: + _dict['_id'] = self._id + if hasattr(self, '_local_seq') and self._local_seq is not None: + _dict['_local_seq'] = self._local_seq + if hasattr(self, '_rev') and self._rev is not None: + _dict['_rev'] = self._rev + if hasattr(self, '_revisions') and self._revisions is not None: + if isinstance(self._revisions, dict): + _dict['_revisions'] = self._revisions else: - _dict['_revisions'] = self.revisions.to_dict() - if hasattr(self, 'revs_info') and self.revs_info is not None: + _dict['_revisions'] = self._revisions.to_dict() + if hasattr(self, '_revs_info') and self._revs_info is not None: _revs_info_list = [] - for v in self.revs_info: + for v in self._revs_info: if isinstance(v, dict): _revs_info_list.append(v) else: diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 708e06b2..44a0bdc4 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -531,7 +531,7 @@ def test_post_changes_all_params(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -631,7 +631,7 @@ def test_post_changes_required_params(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -684,7 +684,7 @@ def test_post_changes_value_error(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -1939,7 +1939,7 @@ def test_post_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2022,7 +2022,7 @@ def test_post_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2223,7 +2223,7 @@ def test_post_all_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2286,7 +2286,7 @@ def test_post_all_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2649,7 +2649,7 @@ def test_post_bulk_get_all_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2717,7 +2717,7 @@ def test_post_bulk_get_required_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2770,7 +2770,7 @@ def test_post_bulk_get_value_error(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -3485,7 +3485,7 @@ def test_get_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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"}]}' responses.add( responses.GET, url, @@ -3560,7 +3560,7 @@ def test_get_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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"}]}' responses.add( responses.GET, url, @@ -3600,7 +3600,7 @@ def test_get_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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"}]}' responses.add( responses.GET, url, @@ -4692,7 +4692,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": false, "_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"], "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, @@ -4767,7 +4767,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": false, "_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"], "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, @@ -4807,7 +4807,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": false, "_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"], "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, @@ -5297,7 +5297,7 @@ def test_post_design_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5382,7 +5382,7 @@ def test_post_design_docs_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5465,7 +5465,7 @@ def test_post_design_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5521,7 +5521,7 @@ def test_post_design_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5586,7 +5586,7 @@ def test_post_design_docs_queries_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5649,7 +5649,7 @@ def test_post_design_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5749,7 +5749,7 @@ def test_post_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -5857,7 +5857,7 @@ def test_post_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -6105,7 +6105,7 @@ def test_post_view_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6179,7 +6179,7 @@ def test_post_view_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6527,7 +6527,7 @@ def test_post_partition_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6612,7 +6612,7 @@ def test_post_partition_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6819,7 +6819,7 @@ def test_post_partition_search_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -6905,7 +6905,7 @@ def test_post_partition_search_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -7121,7 +7121,7 @@ def test_post_partition_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7228,7 +7228,7 @@ def test_post_partition_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7613,7 +7613,7 @@ def test_post_partition_find_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -7692,7 +7692,7 @@ def test_post_partition_find_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -8066,7 +8066,7 @@ def test_post_find_all_params(self): """ # Set up mock url = preprocess_url('/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -8146,7 +8146,7 @@ def test_post_find_value_error(self): """ # Set up mock url = preprocess_url('/testString/_find') - mock_response = '{"bookmark": "bookmark", "docs": [{"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' + mock_response = '{"bookmark": "bookmark", "docs": [{"_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"}]}], "execution_stats": {"execution_time_ms": 17, "results_returned": 0, "total_docs_examined": 0, "total_keys_examined": 0, "total_quorum_docs_examined": 0}, "warning": "warning"}' responses.add( responses.POST, url, @@ -8806,7 +8806,7 @@ def test_post_search_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -8908,7 +8908,7 @@ def test_post_search_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search/testString') - mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' + mock_response = '{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}], "groups": [{"total_rows": 0, "bookmark": "bookmark", "by": "by", "counts": {"mapKey": {"mapKey": 0}}, "ranges": {"mapKey": {"mapKey": 0}}, "rows": [{"doc": {"_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"}]}, "fields": {"anyKey": "anyValue"}, "highlights": {"mapKey": ["inner"]}, "id": "id"}]}]}' responses.add( responses.POST, url, @@ -9668,7 +9668,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9741,7 +9741,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9779,7 +9779,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -12119,7 +12119,7 @@ def test_get_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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"}]}' responses.add( responses.GET, url, @@ -12175,7 +12175,7 @@ def test_get_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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"}]}' responses.add( responses.GET, url, @@ -12215,7 +12215,7 @@ def test_get_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/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": false, "_deleted_conflicts": ["deleted_conflicts"], "_id": "id", "_local_seq": "local_seq", "_rev": "rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}]}' + 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"}]}' responses.add( responses.GET, url, From 3425044587eb128d924f254dd1e44d01d73d259a Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 6 Mar 2024 12:29:16 +0000 Subject: [PATCH 273/669] docs: 0.8.0 API changes migration guide Signed-off-by: Esteban Laver <10552966+emlaver@users.noreply.github.com> --- api-changes.md | 186 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 api-changes.md diff --git a/api-changes.md b/api-changes.md new file mode 100644 index 00000000..906e42ed --- /dev/null +++ b/api-changes.md @@ -0,0 +1,186 @@ +# `0.8.0` + +For versions earlier than `0.8.0` the model classes for document types: +* `Document` +* `DesignDocument` +* `ReplicationDocument` + +were generated with standard Python convention names for all fields. +By convention a leading `_` in Python implies internal use so leading `_` were +not used for the reserved CouchDB names in the Python model classes and +were added during serialization. + +This representation of the `Document` model did not allow for members with the +same names as the reserved (`_` prefixed) document metadata members. + +This meant that members named any of the following were removed by the `Document` +`from_dict` and `to_dict` functions: +* `attachments` +* `conflicts` +* `deleted` +* `deleted_conflicts` +* `id` +* `local_seq` +* `rev` +* `revisions` +* `revs_info` + +as described in [issue #490](https://github.com/IBM/cloudant-python-sdk/issues/490). + +To resolve this problem, starting from version `0.8.0` model classes that accept +user defined properties use the leading `_` CouchDB convention for +CouchDB metadata property names instead of using the Python convention. +This introduces breaking changes that require code updates for usages +of the model types `Document`, `DesignDocument` and `ReplicationDocument`. + +## Breaking changes + +The kwarg or attribute names that changed are: +| kwarg/attribute name (<`0.8.0`) | kwarg/attribute name (>=`0.8.0`) | +| --- | --- | +| `attachments`| `_attachments` | +| `conflicts`| `_conflicts` | +| `deleted`| `_deleted` | +| `deleted_conflicts`| `_deleted_conflicts` | +| `id`| `_id` | +| `local_seq`| `_local_seq` | +| `rev`| `_rev` | +| `revisions`| `_revisions` | +| `revs_info`| `_revs_info` | + +_Note:_ Dictionary literals always used the `_` prefixed form of the +name so there are no code changes in those cases. + +### Writing + +In the case of writing to the server the names are +kwarg parameters used to initialize these classes: +* `Document` +* `DesignDocument` +* `ReplicationDocument` + +The functions that impacted by these changes are: +1. Functions that accept `Document` in the `document` kwarg: + * `post_document` + * `put_document` + * `put_local_document` +1. Functions that accept `DesignDocument` in the `design_document` kwarg: + * `put_design_document` +1. Functions that accept `ReplicationDocument` in the `replication_document` kwarg: + * `put_replication_document` +1. Functions that accept `BulkDocs` in the `bulk_docs` kwarg. In this case the +changes are in the elements of the `List[Document]` in the `docs` kwarg: + * `post_bulk_docs` + +#### Example class initialization + +Before: +```python +# id is used in Document initializer +my_doc = Document( + id="small-appliances:1000042", + type="product", + productid="1000042", + name="Fidget toy") + +result = service.post_document(db='products', document=my_doc).get_result() +``` + +After: +```python +# Now _id is used in Document initializer +my_doc = Document( + _id="small-appliances:1000042", + type="product", + productid="1000042", + name="Fidget toy") + +result = service.post_document(db='products', document=my_doc).get_result() +``` + +#### Example dict literal + +Before & After (no changes): +```python +# _id is used in dict literal +my_doc = { + '_id': 'small-appliances:1000042', + 'type': 'product', + 'productid': '1000042', + 'name': 'Fidget toy' +} + +result = service.post_document(db='products', document=my_doc).get_result() +``` + +### Reading + +In the case of reading from the server the `_` prefixed names were always used in the raw +dictionaries returned from the `get_result` function. As such **no changes** are necessary +to the key names to read the values from these result dicts. However, renames are necessary +if the calling code uses the `from_dict` function to convert the result dict to a model class. + +The functions impacted in that case are: +1. Functions returning a `dict` that represents a `Document`: + * `get_document` + * `get_local_document` +1. Functions returning a `dict` that represents a `DesignDocument`: + * `get_design_document` +1. Functions returning a `dict` that represents a `ReplicationDocument`: + * `get_replication_document` +1. Functions returning a `dict` containing a `Document` representation: + * `post_bulk_get` (via `BulkGetResult` `results` > `BulkGetResultItem` `docs` >`BulkGetResultDocument` `ok`) +1. Functions returning a `dict` potentially containing a `Document` representation (for example if using `include_docs`): + * `post_all_docs` (via `AllDocsResult` `rows` > `DocsResultRow` `doc`) + * `post_changes` (via `ChangesResult` `results` > `ChangesResultItem` `doc`) + * `post_find` (via `FindResult` `docs`) + * `post_partition_find`(via `FindResult` `docs`) + * `post_search` (via `SearchResult` `rows` > `SearchResultRow` `doc` or `SearchResult` `groups` > `SearchResultProperties` `rows` > `SearchResultRow` `doc`) + * `post_partition_search` (via `SearchResult` `rows` > `SearchResultRow` `doc` or `SearchResult` `groups` > `SearchResultProperties` `rows` > `SearchResultRow` `doc`) + * `post_view` (via `ViewResult` `rows` > `ViewResultRow` `doc`) + * `post_partition_view` (via `ViewResult` `rows` > `ViewResultRow` `doc`) + +#### Example result + +Before & after (no changes): +```python +result = service.get_document( + db='products', + doc_id='small-appliances:1000042' +).get_result() + +# _id is used to access document id in result dict +print(result._id) +# prints: +# small-appliances:1000042 +``` + +#### Example `from_dict` + +Before: +```python +result = service.get_document( + db='products', + doc_id='small-appliances:1000042' +).get_result() + +doc = Document.from_dict(result) +# id is used to access document id in Document class +print(doc.id) +# prints: +# small-appliances:1000042 +``` + +After: +```python +result = service.get_document( + db='products', + doc_id='small-appliances:1000042' +).get_result() + +doc = Document.from_dict(result) +# Now _id is used to access document id in Document class +print(doc._id) +# prints: +# small-appliances:1000042 +``` From b0c345155e6c55fb5bcbc91c61f1b52658de8a5f Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 6 Mar 2024 12:29:10 +0000 Subject: [PATCH 274/669] chore: update secrets baseline Signed-off-by: Esteban Laver <10552966+emlaver@users.noreply.github.com> --- .secrets.baseline | 52 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index c65a6514..7b09c496 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "stubs/.+\\.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2023-07-21T09:25:51Z", + "generated_at": "2024-03-12T17:52:40Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -82,7 +82,14 @@ "hashed_secret": "dd7c0356e7bfc571546237209d7fa15319e25cfa", "is_secret": false, "is_verified": false, - "line_number": 32, + "line_number": 33, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "bb589d0621e5472f470fa3425a234c74b1e202e8", + "is_verified": false, + "line_number": 304, "type": "Secret Keyword", "verified_result": null } @@ -92,27 +99,39 @@ "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed", "is_secret": false, "is_verified": false, - "line_number": 165, + "line_number": 214, "type": "Secret Keyword", "verified_result": null } ], - "examples/putReplicationDocument/example_request.py": [ + "examples/README.md": [ { "hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd", - "is_secret": false, "is_verified": false, - "line_number": 11, + "line_number": 337, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "68416db59b46c60492505e00404d757825cd918f", + "is_verified": false, + "line_number": 339, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "665f9d90d71be71ec9a1f352f320e93136770392", + "is_verified": false, + "line_number": 343, "type": "Secret Keyword", "verified_result": null } ], - "ibmcloudant/cloudant_v1.py": [ + "examples/snippets/putReplicationDocument/example_request.py": [ { - "hashed_secret": "5788c5ac01fd15d76b11bacbb480f7bc9f38bee3", - "is_secret": false, + "hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd", "is_verified": false, - "line_number": 13963, + "line_number": 11, "type": "Secret Keyword", "verified_result": null } @@ -127,18 +146,27 @@ "verified_result": null } ], + "test/integration/test_cloudant_v1.py": [ + { + "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", + "is_verified": false, + "line_number": 1507, + "type": "Secret Keyword", + "verified_result": null + } + ], "test/unit/test_cloudant_v1.py": [ { "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 16137, + "line_number": 16178, "type": "Secret Keyword", "verified_result": null } ] }, - "version": "0.13.1+ibm.61.dss", + "version": "0.13.1+ibm.62.dss", "word_list": { "file": null, "hash": null From e2053d4a0a268d695fc0b0cec3b33a572122eec3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:49:08 +0000 Subject: [PATCH 275/669] docs(generated): update examples for serde changes Generated SDK source code using: - Generator version 3.86.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 67e7ce7 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- examples/README.md | 20 +++++++++---------- .../example_request_create_documents.py | 4 ++-- .../example_request_delete_documents.py | 12 +++++------ .../snippets/postDocument/example_request.py | 2 +- .../putReplicationDocument/example_request.py | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/README.md b/examples/README.md index 148c492f..60cfbaff 100644 --- a/examples/README.md +++ b/examples/README.md @@ -345,7 +345,7 @@ target_db = ReplicationDatabase( ) replication_document = ReplicationDocument( - id='repldoc-example', + _id='repldoc-example', create_target=True, source=source_db, target=target_db @@ -576,7 +576,7 @@ from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() products_doc = Document( - id="small-appliances:1000042", + _id="small-appliances:1000042", type="product", productid="1000042", brand="Salter", @@ -686,7 +686,7 @@ from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() event_doc_1 = Document( - id="0007241142412418284", + _id="0007241142412418284", type="event", userid="abc123", eventType="addedToBasket", @@ -694,7 +694,7 @@ event_doc_1 = Document( date="2019-01-28T10:44:22.000Z" ) event_doc_2 = Document( - id="0007241142412418285", + _id="0007241142412418285", type="event", userid="abc234", eventType="addedToBasket", @@ -720,14 +720,14 @@ from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() event_doc_1 = Document( - id="0007241142412418284", - rev="1-5005d65514fe9e90f8eccf174af5dd64", - deleted=True, + _id="0007241142412418284", + _rev="1-5005d65514fe9e90f8eccf174af5dd64", + _deleted=True, ) event_doc_2 = Document( - id="0007241142412418285", - rev="1-2d7810b054babeda4812b3924428d6d6", - deleted=True, + _id="0007241142412418285", + _rev="1-2d7810b054babeda4812b3924428d6d6", + _deleted=True, ) bulk_docs = BulkDocs(docs=[event_doc_1, event_doc_2]) diff --git a/examples/snippets/postBulkDocs/example_request_create_documents.py b/examples/snippets/postBulkDocs/example_request_create_documents.py index 2151bedf..d231369f 100644 --- a/examples/snippets/postBulkDocs/example_request_create_documents.py +++ b/examples/snippets/postBulkDocs/example_request_create_documents.py @@ -4,7 +4,7 @@ service = CloudantV1.new_instance() event_doc_1 = Document( - id="0007241142412418284", + _id="0007241142412418284", type="event", userid="abc123", eventType="addedToBasket", @@ -12,7 +12,7 @@ date="2019-01-28T10:44:22.000Z" ) event_doc_2 = Document( - id="0007241142412418285", + _id="0007241142412418285", type="event", userid="abc234", eventType="addedToBasket", diff --git a/examples/snippets/postBulkDocs/example_request_delete_documents.py b/examples/snippets/postBulkDocs/example_request_delete_documents.py index bc1a23df..64beca90 100644 --- a/examples/snippets/postBulkDocs/example_request_delete_documents.py +++ b/examples/snippets/postBulkDocs/example_request_delete_documents.py @@ -4,14 +4,14 @@ service = CloudantV1.new_instance() event_doc_1 = Document( - id="0007241142412418284", - rev="1-5005d65514fe9e90f8eccf174af5dd64", - deleted=True, + _id="0007241142412418284", + _rev="1-5005d65514fe9e90f8eccf174af5dd64", + _deleted=True, ) event_doc_2 = Document( - id="0007241142412418285", - rev="1-2d7810b054babeda4812b3924428d6d6", - deleted=True, + _id="0007241142412418285", + _rev="1-2d7810b054babeda4812b3924428d6d6", + _deleted=True, ) bulk_docs = BulkDocs(docs=[event_doc_1, event_doc_2]) diff --git a/examples/snippets/postDocument/example_request.py b/examples/snippets/postDocument/example_request.py index d2eb426c..79653966 100644 --- a/examples/snippets/postDocument/example_request.py +++ b/examples/snippets/postDocument/example_request.py @@ -4,7 +4,7 @@ service = CloudantV1.new_instance() products_doc = Document( - id="small-appliances:1000042", + _id="small-appliances:1000042", type="product", productid="1000042", brand="Salter", diff --git a/examples/snippets/putReplicationDocument/example_request.py b/examples/snippets/putReplicationDocument/example_request.py index da020e3f..0083d909 100644 --- a/examples/snippets/putReplicationDocument/example_request.py +++ b/examples/snippets/putReplicationDocument/example_request.py @@ -19,7 +19,7 @@ ) replication_document = ReplicationDocument( - id='repldoc-example', + _id='repldoc-example', create_target=True, source=source_db, target=target_db From 952d563ea148d4d8824dc85dba744403eed010a8 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:33:28 +0000 Subject: [PATCH 276/669] docs(generated): resolve metadata collision known issue Generated SDK source code using: - Generator version 3.86.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 78ad448 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- KNOWN_ISSUES.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 01c7c8fd..afec4185 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -132,34 +132,6 @@ The example above represents this JSON body: } ``` -### Documents - -#### Name collisions with reserved metadata fields - -The cloudant-python-sdk internal representation of the `Document` model in a Python dict -currently does not allow for members with the same names as the reserved (`_` prefixed) -document metadata members. - -This means that members named any of the following will be removed by the `Document` -`from_dict` and `to_dict` functions: -* `attachments` -* `conflicts` -* `deleted` -* `deleted_conflicts` -* `id` -* `local_seq` -* `rev` -* `revisions` -* `revs_info` - -Potential workarounds are: -* use [Raw IO](/#raw-io) functions to serialize/deserialize -documents into a custom dict or class. -* use a different member name -* nest the members inside another object member - -See [issue #490](https://github.com/IBM/cloudant-python-sdk/issues/490). - ### Disabling request body compression Some issues with older server versions can be worked around by disabling From ae70cab979aabda840ac24b41a4ee1943c3d510d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:53:41 +0000 Subject: [PATCH 277/669] Update version 0.7.3 -> 0.8.0 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2f1a95f3..d68b9b95 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.3 +current_version = 0.8.0 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 76ff425c..ca8df068 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.7.3 +# IBM Cloudant Python SDK Version 0.8.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -122,13 +122,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.7.3" +pip install --upgrade "ibmcloudant>=0.8.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.7.3" +easy_install --upgrade "ibmcloudant>=0.8.0" ``` @@ -602,7 +602,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/examples#examples-for-python). ### Error handling @@ -796,7 +796,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/examples#postchanges) instead of the follower. #### Error suppression @@ -831,7 +831,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/examples#postchanges). #### Checkpointing @@ -1034,7 +1034,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1064,8 +1064,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.7.3/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 25117f50..be7a7aa6 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.7.3' +__version__ = '0.8.0' diff --git a/pyproject.toml b/pyproject.toml index 4a5f686a..6192e6b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.7.3" +version = "0.8.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.19.2", From cfd1f49331937092dc6407c50e2774c20d784a78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:25:46 +0000 Subject: [PATCH 278/669] build(deps-dev): Bump coverage from 7.4.3 to 7.4.4 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.3 to 7.4.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.3...7.4.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 52227236..d0bcf089 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 # code coverage -coverage==7.4.3 +coverage==7.4.4 pytest-cov==4.1.0 From 09d65fbe7b4fefc6341fb5721d553a3e6362ea7a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:40:22 +0000 Subject: [PATCH 279/669] build(generated): update generator to 3.86.2 Generated SDK source code using: - Generator version 3.86.2 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version f3079b3 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- stubs/gen-its-mappings.json | 76 +-- test/integration/test_cloudant_v1.py | 243 ++++++---- test/unit/test_cloudant_v1.py | 691 +++++++++++++++------------ 3 files changed, 567 insertions(+), 443 deletions(-) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 04fed043..6559c367 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -121,7 +121,7 @@ "bodyPatterns": [ { "matchesJsonPath": "$.[?(@.cloudant == null || @.cloudant.key1 != null)]", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -185,7 +185,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"types\": [\"management\"]}", + "equalToJson": "{\"types\": [\"management\", \"data\"]}", "ignoreArrayOrder": true, "ignoreExtraElements": true } @@ -222,7 +222,7 @@ "bodyPatterns": [ { "matchesJsonPath": "$.blocks", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -286,7 +286,7 @@ "method": "PUT", "bodyPatterns": [ { - "equalToJson": "{\"allow_credentials\": true, \"enable_cors\": true, \"origins\": [\"testString\"]}", + "equalToJson": "{\"allow_credentials\": true, \"enable_cors\": true, \"origins\": [ \"https://example.com\", \"https://www.example.com\" ]}", "ignoreArrayOrder": false, "ignoreExtraElements": false } @@ -421,8 +421,8 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"keys\": [\"testString\"]}", - "ignoreArrayOrder": true, + "equalToJson": "{\"keys\": [\"products\", \"users\", \"orders\"]}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -558,8 +558,8 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"source\": {\"url\": \"testString\"}, \"target\": {\"url\": \"testString\"}}", - "ignoreArrayOrder": true, + "equalToJson": "{\"source\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}, \"target\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -878,8 +878,8 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"analyzer\": \"arabic\", \"text\": \"testString\"}", - "ignoreArrayOrder": true, + "equalToJson": "{\"analyzer\": \"english\", \"text\": \"running is fun\"}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1051,7 +1051,7 @@ "bodyPatterns": [ { "equalToJson": "{\"queries\": [{}]}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1087,7 +1087,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1122,7 +1122,7 @@ "bodyPatterns": [ { "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1168,15 +1168,15 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"docs\": [{\"atts_since\": [\"1-99b02e08da151943c2dcb40090160bb8\"], \"id\": \"testString\"}]}", - "ignoreArrayOrder": true, + "equalToJson": "{\"docs\": [{\"atts_since\": [\"1-99b02e08da151943c2dcb40090160bb8\"], \"id\": \"order00067\", \"rev\": \"3-917fa2381192822767f010b95b45325b\"}]}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] }, "response": { "status": 200, - "body": "{\"results\": [{\"id\": \"testString\", \"docs\": [{\"error\":{\"id\":\"testString\",\"rev\":\"undefined\",\"error\":\"not_found\",\"reason\":\"missing\"}}]}]}", + "body": "{\"results\": [{\"id\": \"order00067\", \"docs\": [{\"error\":{\"id\":\"order00067\",\"rev\":\"3-917fa2381192822767f010b95b45325b\",\"error\":\"not_found\",\"reason\":\"missing\"}}]}]}", "headers": { "Cache-Control": "must-revalidate", "Content-Type": "application/json", @@ -1296,7 +1296,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1450,7 +1450,7 @@ "bodyPatterns": [ { "equalToJson": "{\"query\": \"testString\"}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1513,7 +1513,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1548,7 +1548,7 @@ "bodyPatterns": [ { "equalToJson": "{\"queries\": [{}]}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1620,7 +1620,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1655,7 +1655,7 @@ "bodyPatterns": [ { "equalToJson": "{\"queries\": [{}]}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1690,8 +1690,8 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"r\" : 1, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": true, + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"_id\", \"type\", \"name\", \"email\" ], \"limit\" : 3, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1725,8 +1725,8 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"r\" : 1, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": true, + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"_id\", \"type\", \"name\", \"email\" ], \"limit\" : 3, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1817,7 +1817,7 @@ "bodyPatterns": [ { "equalToJson": "{\"index\": {}}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -1857,7 +1857,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2024,7 +2024,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2059,7 +2059,7 @@ "bodyPatterns": [ { "equalToJson": "{\"query\": \"testString\"}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2094,7 +2094,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2128,8 +2128,8 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": true, + "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2163,8 +2163,8 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"testString\" ], \"limit\" : 25, \"selector\" : { \"anyKey\" : \"anyValue\" }, \"skip\" : 0, \"sort\" : [ { } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": true, + "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2199,7 +2199,7 @@ "bodyPatterns": [ { "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2262,7 +2262,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] @@ -2745,7 +2745,7 @@ "bodyPatterns": [ { "equalToJson": "{}", - "ignoreArrayOrder": true, + "ignoreArrayOrder": false, "ignoreExtraElements": true } ] diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 3812fd1f..f7a72681 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -89,7 +89,7 @@ def test_get_capacity_throughput_information(self): @needscredentials def test_put_capacity_throughput_configuration(self): response = self.cloudant_service.put_capacity_throughput_configuration( - blocks=0, + blocks=10, ) assert response.get_status_code() == 200 @@ -115,7 +115,7 @@ def test_get_db_updates(self): def test_post_changes(self): response = self.cloudant_service.post_changes( db='testString', - doc_ids=['testString'], + doc_ids=['0007741142412418284'], fields=['testString'], selector={'anyKey': 'anyValue'}, last_event_id='testString', @@ -143,7 +143,7 @@ def test_post_changes(self): def test_post_changes_as_stream(self): response = self.cloudant_service.post_changes_as_stream( db='testString', - doc_ids=['testString'], + doc_ids=['0007741142412418284'], fields=['testString'], selector={'anyKey': 'anyValue'}, last_event_id='testString', @@ -192,7 +192,7 @@ def test_get_all_dbs(self): @needscredentials def test_post_dbs_info(self): response = self.cloudant_service.post_dbs_info( - keys=['testString'], + keys=['products', 'users', 'orders'], ) assert response.get_status_code() == 200 @@ -263,12 +263,21 @@ def test_post_document(self): '_conflicts': ['testString'], '_deleted': True, '_deleted_conflicts': ['testString'], - '_id': 'testString', + '_id': 'exampleid', '_local_seq': 'testString', '_rev': 'testString', '_revisions': revisions_model, '_revs_info': [document_revision_status_model], - 'foo': 'testString', + 'brand': 'Foo', + 'colours': '["red","green","black","blue"]', + 'description': 'Slim Colourful Design Electronic Cooking Appliance for ...', + 'image': 'assets/img/0gmsnghhew.jpg', + 'keywords': '["Foo","Scales","Weight","Digital","Kitchen"]', + 'name': 'Digital Kitchen Scales', + 'price': '14.99', + 'productid': '1000042', + 'taxonomy': '["Home","Kitchen","Small Appliances"]', + 'type': 'product', } response = self.cloudant_service.post_document( @@ -292,13 +301,13 @@ def test_post_all_docs(self): descending=False, include_docs=False, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', key='testString', keys=['testString'], - start_key='testString', + start_key='0007741142412418284', ) assert response.get_status_code() == 200 @@ -315,13 +324,13 @@ def test_post_all_docs_as_stream(self): descending=False, include_docs=False, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', key='testString', keys=['testString'], - start_key='testString', + start_key='0007741142412418284', ) assert response.get_status_code() == 200 @@ -343,7 +352,7 @@ def test_post_all_docs_queries(self): 'update_seq': False, 'end_key': 'testString', 'key': 'testString', - 'keys': ['testString'], + 'keys': ['small-appliances:1000042', 'small-appliances:1000043'], 'start_key': 'testString', } @@ -371,7 +380,7 @@ def test_post_all_docs_queries_as_stream(self): 'update_seq': False, 'end_key': 'testString', 'key': 'testString', - 'keys': ['testString'], + 'keys': ['small-appliances:1000042', 'small-appliances:1000043'], 'start_key': 'testString', } @@ -414,12 +423,16 @@ def test_post_bulk_docs(self): '_conflicts': ['testString'], '_deleted': True, '_deleted_conflicts': ['testString'], - '_id': 'testString', + '_id': '0007241142412418284', '_local_seq': 'testString', '_rev': 'testString', '_revisions': revisions_model, '_revs_info': [document_revision_status_model], - 'foo': 'testString', + 'date': '2019-01-28T10:44:22.000Z', + 'eventType': 'addedToBasket', + 'productId': '1000042', + 'type': 'event', + 'userid': 'abc123', } # Construct a dict representation of a BulkDocs model bulk_docs_model = { @@ -441,8 +454,8 @@ def test_post_bulk_get(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], - 'id': 'testString', - 'rev': 'testString', + 'id': 'order00067', + 'rev': '3-917fa2381192822767f010b95b45325b', } response = self.cloudant_service.post_bulk_get( @@ -463,8 +476,8 @@ def test_post_bulk_get_as_mixed(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], - 'id': 'testString', - 'rev': 'testString', + 'id': 'order00067', + 'rev': '3-917fa2381192822767f010b95b45325b', } response = self.cloudant_service.post_bulk_get_as_mixed( @@ -485,8 +498,8 @@ def test_post_bulk_get_as_related(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], - 'id': 'testString', - 'rev': 'testString', + 'id': 'order00067', + 'rev': '3-917fa2381192822767f010b95b45325b', } response = self.cloudant_service.post_bulk_get_as_related( @@ -507,8 +520,8 @@ def test_post_bulk_get_as_stream(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = { 'atts_since': ['1-99b02e08da151943c2dcb40090160bb8'], - 'id': 'testString', - 'rev': 'testString', + 'id': 'order00067', + 'rev': '3-917fa2381192822767f010b95b45325b', } response = self.cloudant_service.post_bulk_get_as_stream( @@ -642,12 +655,21 @@ def test_put_document(self): '_conflicts': ['testString'], '_deleted': True, '_deleted_conflicts': ['testString'], - '_id': 'testString', + '_id': 'exampleid', '_local_seq': 'testString', '_rev': 'testString', '_revisions': revisions_model, '_revs_info': [document_revision_status_model], - 'foo': 'testString', + 'brand': 'Foo', + 'colours': '["red","green","black","blue"]', + 'description': 'Slim Colourful Design Electronic Cooking Appliance for ...', + 'image': 'assets/img/0gmsnghhew.jpg', + 'keywords': '["Foo","Scales","Weight","Digital","Kitchen"]', + 'name': 'Digital Kitchen Scales', + 'price': '14.99', + 'productid': '1000042', + 'taxonomy': '["Home","Kitchen","Small Appliances"]', + 'type': 'product', } response = self.cloudant_service.put_document( @@ -728,14 +750,14 @@ def test_put_design_document(self): } # Construct a dict representation of a AnalyzerConfiguration model analyzer_configuration_model = { - 'name': 'classic', + 'name': 'standard', 'stopwords': ['testString'], 'fields': {'key1': analyzer_model}, } # Construct a dict representation of a SearchIndexDefinition model search_index_definition_model = { 'analyzer': analyzer_configuration_model, - 'index': 'testString', + 'index': 'function (doc) {\n index("price", doc.price);\n}', } # Construct a dict representation of a DesignDocumentOptions model design_document_options_model = { @@ -743,7 +765,7 @@ def test_put_design_document(self): } # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = { - 'map': 'testString', + 'map': 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}', 'reduce': 'testString', } # Construct a dict representation of a DesignDocument model @@ -752,18 +774,22 @@ def test_put_design_document(self): '_conflicts': ['testString'], '_deleted': True, '_deleted_conflicts': ['testString'], - '_id': 'testString', + '_id': '_design/appliances', '_local_seq': 'testString', - '_rev': 'testString', + '_rev': '8-7e2537e5989294471061e0cfd7292725', '_revisions': revisions_model, '_revs_info': [document_revision_status_model], 'autoupdate': True, 'filters': {'key1': 'testString'}, - 'indexes': {'key1': search_index_definition_model}, + 'indexes': {'findByPrice': search_index_definition_model }, + + 'language': 'javascript', 'options': design_document_options_model, 'validate_doc_update': 'testString', - 'views': {'key1': design_document_views_map_reduce_model}, + 'views': {'byApplianceProdId': design_document_views_map_reduce_model }, + + 'foo': 'testString', } @@ -802,13 +828,13 @@ def test_post_design_docs(self): descending=False, include_docs=False, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', key='testString', keys=['testString'], - start_key='testString', + start_key='0007741142412418284', accept='application/json', ) @@ -831,7 +857,7 @@ def test_post_design_docs_queries(self): 'update_seq': False, 'end_key': 'testString', 'key': 'testString', - 'keys': ['testString'], + 'keys': ['small-appliances:1000042', 'small-appliances:1000043'], 'start_key': 'testString', } @@ -855,9 +881,9 @@ def test_post_view(self): attachments=False, conflicts=False, descending=False, - include_docs=False, + include_docs=True, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', @@ -865,7 +891,7 @@ def test_post_view(self): group=False, group_level=1, key='testString', - keys=['testString'], + keys=['examplekey'], reduce=True, stable=False, start_key='testString', @@ -887,9 +913,9 @@ def test_post_view_as_stream(self): attachments=False, conflicts=False, descending=False, - include_docs=False, + include_docs=True, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', @@ -897,7 +923,7 @@ def test_post_view_as_stream(self): group=False, group_level=1, key='testString', - keys=['testString'], + keys=['examplekey'], reduce=True, stable=False, start_key='testString', @@ -917,9 +943,9 @@ def test_post_view_queries(self): 'attachments': False, 'conflicts': False, 'descending': False, - 'include_docs': False, + 'include_docs': True, 'inclusive_end': True, - 'limit': 0, + 'limit': 5, 'skip': 0, 'update_seq': False, 'end_key': 'testString', @@ -954,9 +980,9 @@ def test_post_view_queries_as_stream(self): 'attachments': False, 'conflicts': False, 'descending': False, - 'include_docs': False, + 'include_docs': True, 'inclusive_end': True, - 'limit': 0, + 'limit': 5, 'skip': 0, 'update_seq': False, 'end_key': 'testString', @@ -1005,13 +1031,13 @@ def test_post_partition_all_docs(self): descending=False, include_docs=False, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', key='testString', keys=['testString'], - start_key='testString', + start_key='0007741142412418284', ) assert response.get_status_code() == 200 @@ -1029,13 +1055,13 @@ def test_post_partition_all_docs_as_stream(self): descending=False, include_docs=False, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', key='testString', keys=['testString'], - start_key='testString', + start_key='0007741142412418284', ) assert response.get_status_code() == 200 @@ -1058,7 +1084,7 @@ def test_post_partition_search(self): highlight_size=100, include_docs=False, include_fields=['testString'], - limit=0, + limit=3, sort=['testString'], stale='ok', ) @@ -1083,7 +1109,7 @@ def test_post_partition_search_as_stream(self): highlight_size=100, include_docs=False, include_fields=['testString'], - limit=0, + limit=3, sort=['testString'], stale='ok', ) @@ -1103,9 +1129,9 @@ def test_post_partition_view(self): attachments=False, conflicts=False, descending=False, - include_docs=False, + include_docs=True, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', @@ -1113,7 +1139,7 @@ def test_post_partition_view(self): group=False, group_level=1, key='testString', - keys=['testString'], + keys=['examplekey'], reduce=True, start_key='testString', start_key_doc_id='testString', @@ -1135,9 +1161,9 @@ def test_post_partition_view_as_stream(self): attachments=False, conflicts=False, descending=False, - include_docs=False, + include_docs=True, inclusive_end=True, - limit=0, + limit=10, skip=0, update_seq=False, end_key='testString', @@ -1145,7 +1171,7 @@ def test_post_partition_view_as_stream(self): group=False, group_level=1, key='testString', - keys=['testString'], + keys=['examplekey'], reduce=True, start_key='testString', start_key_doc_id='testString', @@ -1161,11 +1187,11 @@ def test_post_partition_explain(self): response = self.cloudant_service.post_partition_explain( db='testString', partition_key='testString', - selector={'anyKey': 'anyValue'}, + selector={'type': {'$eq': 'product'}}, bookmark='testString', conflicts=True, execution_stats=True, - fields=['testString'], + fields=['productid', 'name', 'description'], limit=25, skip=0, sort=[{'key1': 'asc'}], @@ -1183,11 +1209,11 @@ def test_post_partition_find(self): response = self.cloudant_service.post_partition_find( db='testString', partition_key='testString', - selector={'anyKey': 'anyValue'}, + selector={'type': {'$eq': 'product'}}, bookmark='testString', conflicts=True, execution_stats=True, - fields=['testString'], + fields=['productid', 'name', 'description'], limit=25, skip=0, sort=[{'key1': 'asc'}], @@ -1205,11 +1231,11 @@ def test_post_partition_find_as_stream(self): response = self.cloudant_service.post_partition_find_as_stream( db='testString', partition_key='testString', - selector={'anyKey': 'anyValue'}, + selector={'type': {'$eq': 'product'}}, bookmark='testString', conflicts=True, execution_stats=True, - fields=['testString'], + fields=['productid', 'name', 'description'], limit=25, skip=0, sort=[{'key1': 'asc'}], @@ -1226,12 +1252,12 @@ def test_post_partition_find_as_stream(self): def test_post_explain(self): response = self.cloudant_service.post_explain( db='testString', - selector={'anyKey': 'anyValue'}, + selector={'email_verified': {'$eq': True}}, bookmark='testString', conflicts=True, execution_stats=True, - fields=['testString'], - limit=25, + fields=['_id', 'type', 'name', 'email'], + limit=3, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1248,12 +1274,12 @@ def test_post_explain(self): def test_post_find(self): response = self.cloudant_service.post_find( db='testString', - selector={'anyKey': 'anyValue'}, + selector={'email_verified': {'$eq': True}}, bookmark='testString', conflicts=True, execution_stats=True, - fields=['testString'], - limit=25, + fields=['_id', 'type', 'name', 'email'], + limit=3, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1270,12 +1296,12 @@ def test_post_find(self): def test_post_find_as_stream(self): response = self.cloudant_service.post_find_as_stream( db='testString', - selector={'anyKey': 'anyValue'}, + selector={'email_verified': {'$eq': True}}, bookmark='testString', conflicts=True, execution_stats=True, - fields=['testString'], - limit=25, + fields=['_id', 'type', 'name', 'email'], + limit=3, skip=0, sort=[{'key1': 'asc'}], stable=True, @@ -1312,7 +1338,7 @@ def test_post_index(self): } # Construct a dict representation of a IndexField model index_field_model = { - 'name': 'testString', + 'name': 'asc', 'type': 'boolean', 'foo': 'asc', } @@ -1328,8 +1354,8 @@ def test_post_index(self): response = self.cloudant_service.post_index( db='testString', index=index_definition_model, - ddoc='testString', - name='testString', + ddoc='json-index', + name='getUserByName', partitioned=True, type='json', ) @@ -1341,8 +1367,8 @@ def test_post_index(self): @needscredentials def test_post_search_analyze(self): response = self.cloudant_service.post_search_analyze( - analyzer='arabic', - text='testString', + analyzer='english', + text='running is fun', ) assert response.get_status_code() == 200 @@ -1364,7 +1390,7 @@ def test_post_search(self): highlight_size=100, include_docs=False, include_fields=['testString'], - limit=0, + limit=3, sort=['testString'], stale='ok', counts=['testString'], @@ -1394,7 +1420,7 @@ def test_post_search_as_stream(self): highlight_size=100, include_docs=False, include_fields=['testString'], - limit=0, + limit=3, sort=['testString'], stale='ok', counts=['testString'], @@ -1495,7 +1521,7 @@ def test_put_replication_document(self): replication_create_target_parameters_model = { 'n': 3, 'partitioned': False, - 'q': 26, + 'q': 1, } # Construct a dict representation of a ReplicationDatabaseAuthBasic model replication_database_auth_basic_model = { @@ -1515,13 +1541,13 @@ def test_put_replication_document(self): replication_database_model = { 'auth': replication_database_auth_model, 'headers': {'key1': 'testString'}, - 'url': 'testString', + 'url': 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb', } # Construct a dict representation of a UserContext model user_context_model = { 'db': 'testString', - 'name': 'testString', - 'roles': ['_reader'], + 'name': 'john', + 'roles': ['researcher'], } # Construct a dict representation of a ReplicationDocument model replication_document_model = { @@ -1534,30 +1560,30 @@ def test_put_replication_document(self): '_rev': 'testString', '_revisions': revisions_model, '_revs_info': [document_revision_status_model], - 'cancel': True, - 'checkpoint_interval': 30000, - 'connection_timeout': 30000, - 'continuous': False, - 'create_target': False, + 'cancel': False, + 'checkpoint_interval': 4500, + 'connection_timeout': 15000, + 'continuous': True, + 'create_target': True, 'create_target_params': replication_create_target_parameters_model, - 'doc_ids': ['testString'], - 'filter': 'testString', - 'http_connections': 20, + 'doc_ids': ['badger', 'lemur', 'llama'], + 'filter': 'ddoc/my_filter', + 'http_connections': 10, 'query_params': {'key1': 'testString'}, - 'retries_per_request': 5, - 'selector': {'anyKey': 'anyValue'}, - 'since_seq': 'testString', - 'socket_options': 'testString', + 'retries_per_request': 3, + 'selector': {'_id': {'$regex': 'docid'}}, + 'since_seq': '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU', + 'socket_options': '[{keepalive, true}, {nodelay, false}]', 'source': replication_database_model, 'source_proxy': 'testString', 'target': replication_database_model, 'target_proxy': 'testString', 'use_bulk_get': True, - 'use_checkpoints': True, + 'use_checkpoints': False, 'user_ctx': user_context_model, 'winning_revs_only': False, - 'worker_batch_size': 500, - 'worker_processes': 4, + 'worker_batch_size': 400, + 'worker_processes': 3, 'foo': 'testString', } @@ -1639,8 +1665,8 @@ def test_get_security(self): def test_put_security(self): # Construct a dict representation of a SecurityObject model security_object_model = { - 'names': ['testString'], - 'roles': ['testString'], + 'names': ['superuser'], + 'roles': ['admins'], } response = self.cloudant_service.put_security( @@ -1673,7 +1699,7 @@ def test_put_cloudant_security_configuration(self): response = self.cloudant_service.put_cloudant_security_configuration( db='testString', - cloudant={'key1': ['_reader']}, + cloudant={'antsellseadespecteposene': ['_reader', '_writer', '_admin'], 'garbados': ['_reader', '_writer'], 'nobody': ['_reader']}, admins=security_object_model, members=security_object_model, couchdb_auth_only=True, @@ -1694,7 +1720,7 @@ def test_get_cors_information(self): @needscredentials def test_put_cors_configuration(self): response = self.cloudant_service.put_cors_configuration( - origins=['testString'], + origins=['https://example.com', 'https://www.example.com'], allow_credentials=True, enable_cors=True, ) @@ -1804,12 +1830,21 @@ def test_put_local_document(self): '_conflicts': ['testString'], '_deleted': True, '_deleted_conflicts': ['testString'], - '_id': 'testString', + '_id': 'exampleid', '_local_seq': 'testString', '_rev': 'testString', '_revisions': revisions_model, '_revs_info': [document_revision_status_model], - 'foo': 'testString', + 'brand': 'Foo', + 'colours': '["red","green","black","blue"]', + 'description': 'Slim Colourful Design Electronic Cooking Appliance for ...', + 'image': 'assets/img/0gmsnghhew.jpg', + 'keywords': '["Foo","Scales","Weight","Digital","Kitchen"]', + 'name': 'Digital Kitchen Scales', + 'price': '14.99', + 'productid': '1000042', + 'taxonomy': '["Home","Kitchen","Small Appliances"]', + 'type': 'product', } response = self.cloudant_service.put_local_document( @@ -1889,7 +1924,7 @@ def test_get_activity_tracker_events(self): @needscredentials def test_post_activity_tracker_events(self): response = self.cloudant_service.post_activity_tracker_events( - types=['management'], + types=['management', 'data'], ) assert response.get_status_code() == 200 diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 44a0bdc4..70c56ce6 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -64,7 +64,7 @@ def preprocess_url(operation_path: str): # If the request url does NOT end with a /, then just return it as-is. # Otherwise, return a regular expression that matches one or more trailing /. - if re.fullmatch('.*/+', request_url) is None: + if not request_url.endswith('/'): return request_url return re.compile(request_url.rstrip('/') + '/+') @@ -319,7 +319,7 @@ def test_put_capacity_throughput_configuration_all_params(self): ) # Set up parameter values - blocks = 0 + blocks = 10 # Invoke method response = _service.put_capacity_throughput_configuration( @@ -336,7 +336,7 @@ def test_put_capacity_throughput_configuration_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['blocks'] == 0 + assert req_body['blocks'] == 10 def test_put_capacity_throughput_configuration_all_params_with_retries(self): # Enable retries and run test_put_capacity_throughput_configuration_all_params. @@ -364,7 +364,7 @@ def test_put_capacity_throughput_configuration_value_error(self): ) # Set up parameter values - blocks = 0 + blocks = 10 # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -542,7 +542,7 @@ def test_post_changes_all_params(self): # Set up parameter values db = 'testString' - doc_ids = ['testString'] + doc_ids = ['0007741142412418284'] fields = ['testString'] selector = {'anyKey': 'anyValue'} last_event_id = 'testString' @@ -611,7 +611,7 @@ def test_post_changes_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['doc_ids'] == ['testString'] + assert req_body['doc_ids'] == ['0007741142412418284'] assert req_body['fields'] == ['testString'] assert req_body['selector'] == {'anyKey': 'anyValue'} @@ -642,7 +642,7 @@ def test_post_changes_required_params(self): # Set up parameter values db = 'testString' - doc_ids = ['testString'] + doc_ids = ['0007741142412418284'] fields = ['testString'] selector = {'anyKey': 'anyValue'} @@ -664,7 +664,7 @@ def test_post_changes_required_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['doc_ids'] == ['testString'] + assert req_body['doc_ids'] == ['0007741142412418284'] assert req_body['fields'] == ['testString'] assert req_body['selector'] == {'anyKey': 'anyValue'} @@ -695,7 +695,7 @@ def test_post_changes_value_error(self): # Set up parameter values db = 'testString' - doc_ids = ['testString'] + doc_ids = ['0007741142412418284'] fields = ['testString'] selector = {'anyKey': 'anyValue'} @@ -741,7 +741,7 @@ def test_post_changes_as_stream_all_params(self): # Set up parameter values db = 'testString' - doc_ids = ['testString'] + doc_ids = ['0007741142412418284'] fields = ['testString'] selector = {'anyKey': 'anyValue'} last_event_id = 'testString' @@ -810,7 +810,7 @@ def test_post_changes_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['doc_ids'] == ['testString'] + assert req_body['doc_ids'] == ['0007741142412418284'] assert req_body['fields'] == ['testString'] assert req_body['selector'] == {'anyKey': 'anyValue'} @@ -847,7 +847,7 @@ def test_post_changes_as_stream_required_params(self): # Set up parameter values db = 'testString' - doc_ids = ['testString'] + doc_ids = ['0007741142412418284'] fields = ['testString'] selector = {'anyKey': 'anyValue'} @@ -869,7 +869,7 @@ def test_post_changes_as_stream_required_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['doc_ids'] == ['testString'] + assert req_body['doc_ids'] == ['0007741142412418284'] assert req_body['fields'] == ['testString'] assert req_body['selector'] == {'anyKey': 'anyValue'} @@ -906,7 +906,7 @@ def test_post_changes_as_stream_value_error(self): # Set up parameter values db = 'testString' - doc_ids = ['testString'] + doc_ids = ['0007741142412418284'] fields = ['testString'] selector = {'anyKey': 'anyValue'} @@ -1157,7 +1157,7 @@ def test_post_dbs_info_all_params(self): ) # Set up parameter values - keys = ['testString'] + keys = ['products', 'users', 'orders'] # Invoke method response = _service.post_dbs_info( @@ -1174,7 +1174,7 @@ def test_post_dbs_info_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['keys'] == ['testString'] + assert req_body['keys'] == ['products', 'users', 'orders'] def test_post_dbs_info_all_params_with_retries(self): # Enable retries and run test_post_dbs_info_all_params. @@ -1202,7 +1202,7 @@ def test_post_dbs_info_value_error(self): ) # Set up parameter values - keys = ['testString'] + keys = ['products', 'users', 'orders'] # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -1728,12 +1728,21 @@ def test_post_document_all_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -1816,12 +1825,21 @@ def test_post_document_required_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -1896,12 +1914,21 @@ def test_post_document_value_error(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -1956,13 +1983,13 @@ def test_post_all_docs_all_params(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Invoke method response = _service.post_all_docs( @@ -1998,13 +2025,13 @@ def test_post_all_docs_all_params(self): assert req_body['descending'] == False assert req_body['include_docs'] == False assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == 'testString' + assert req_body['start_key'] == '0007741142412418284' def test_post_all_docs_all_params_with_retries(self): # Enable retries and run test_post_all_docs_all_params. @@ -2039,13 +2066,13 @@ def test_post_all_docs_value_error(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -2095,13 +2122,13 @@ def test_post_all_docs_as_stream_all_params(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Invoke method response = _service.post_all_docs_as_stream( @@ -2137,13 +2164,13 @@ def test_post_all_docs_as_stream_all_params(self): assert req_body['descending'] == False assert req_body['include_docs'] == False assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == 'testString' + assert req_body['start_key'] == '0007741142412418284' # Verify streamed JSON response result = response.get_result() @@ -2184,13 +2211,13 @@ def test_post_all_docs_as_stream_value_error(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -2245,7 +2272,7 @@ def test_post_all_docs_queries_all_params(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -2308,7 +2335,7 @@ def test_post_all_docs_queries_value_error(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -2369,7 +2396,7 @@ def test_post_all_docs_queries_as_stream_all_params(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -2438,7 +2465,7 @@ def test_post_all_docs_queries_as_stream_value_error(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -2514,12 +2541,16 @@ def test_post_bulk_docs_all_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = '0007241142412418284' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['date'] = '2019-01-28T10:44:22.000Z' + document_model['eventType'] = 'addedToBasket' + document_model['productId'] = '1000042' + document_model['type'] = 'event' + document_model['userid'] = 'abc123' # Construct a dict representation of a BulkDocs model bulk_docs_model = {} @@ -2601,12 +2632,16 @@ def test_post_bulk_docs_value_error(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = '0007241142412418284' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['date'] = '2019-01-28T10:44:22.000Z' + document_model['eventType'] = 'addedToBasket' + document_model['productId'] = '1000042' + document_model['type'] = 'event' + document_model['userid'] = 'abc123' # Construct a dict representation of a BulkDocs model bulk_docs_model = {} @@ -2661,8 +2696,8 @@ def test_post_bulk_get_all_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -2729,8 +2764,8 @@ def test_post_bulk_get_required_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -2782,8 +2817,8 @@ def test_post_bulk_get_value_error(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -2833,8 +2868,8 @@ def test_post_bulk_get_as_mixed_all_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -2901,8 +2936,8 @@ def test_post_bulk_get_as_mixed_required_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -2954,8 +2989,8 @@ def test_post_bulk_get_as_mixed_value_error(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -3005,8 +3040,8 @@ def test_post_bulk_get_as_related_all_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -3073,8 +3108,8 @@ def test_post_bulk_get_as_related_required_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -3126,8 +3161,8 @@ def test_post_bulk_get_as_related_value_error(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -3177,8 +3212,8 @@ def test_post_bulk_get_as_stream_all_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -3251,8 +3286,8 @@ def test_post_bulk_get_as_stream_required_params(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -3310,8 +3345,8 @@ def test_post_bulk_get_as_stream_value_error(self): # Construct a dict representation of a BulkGetQueryDocument model bulk_get_query_document_model = {} bulk_get_query_document_model['atts_since'] = ['1-99b02e08da151943c2dcb40090160bb8'] - bulk_get_query_document_model['id'] = 'testString' - bulk_get_query_document_model['rev'] = 'testString' + bulk_get_query_document_model['id'] = 'order00067' + bulk_get_query_document_model['rev'] = '3-917fa2381192822767f010b95b45325b' # Set up parameter values db = 'testString' @@ -4174,12 +4209,21 @@ def test_put_document_all_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -4272,12 +4316,21 @@ def test_put_document_required_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -4354,12 +4407,21 @@ def test_put_document_value_error(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -4890,14 +4952,14 @@ def test_put_design_document_all_params(self): # Construct a dict representation of a AnalyzerConfiguration model analyzer_configuration_model = {} - analyzer_configuration_model['name'] = 'classic' + analyzer_configuration_model['name'] = 'standard' analyzer_configuration_model['stopwords'] = ['testString'] analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a dict representation of a SearchIndexDefinition model search_index_definition_model = {} search_index_definition_model['analyzer'] = analyzer_configuration_model - search_index_definition_model['index'] = 'testString' + search_index_definition_model['index'] = 'function (doc) {\n index("price", doc.price);\n}' # Construct a dict representation of a DesignDocumentOptions model design_document_options_model = {} @@ -4905,7 +4967,7 @@ def test_put_design_document_all_params(self): # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} - design_document_views_map_reduce_model['map'] = 'testString' + design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -4914,9 +4976,9 @@ def test_put_design_document_all_params(self): design_document_model['_conflicts'] = ['testString'] design_document_model['_deleted'] = True design_document_model['_deleted_conflicts'] = ['testString'] - design_document_model['_id'] = 'testString' + design_document_model['_id'] = '_design/appliances' design_document_model['_local_seq'] = 'testString' - design_document_model['_rev'] = 'testString' + design_document_model['_rev'] = '8-7e2537e5989294471061e0cfd7292725' design_document_model['_revisions'] = revisions_model design_document_model['_revs_info'] = [document_revision_status_model] design_document_model['autoupdate'] = True @@ -5020,14 +5082,14 @@ def test_put_design_document_required_params(self): # Construct a dict representation of a AnalyzerConfiguration model analyzer_configuration_model = {} - analyzer_configuration_model['name'] = 'classic' + analyzer_configuration_model['name'] = 'standard' analyzer_configuration_model['stopwords'] = ['testString'] analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a dict representation of a SearchIndexDefinition model search_index_definition_model = {} search_index_definition_model['analyzer'] = analyzer_configuration_model - search_index_definition_model['index'] = 'testString' + search_index_definition_model['index'] = 'function (doc) {\n index("price", doc.price);\n}' # Construct a dict representation of a DesignDocumentOptions model design_document_options_model = {} @@ -5035,7 +5097,7 @@ def test_put_design_document_required_params(self): # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} - design_document_views_map_reduce_model['map'] = 'testString' + design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5044,9 +5106,9 @@ def test_put_design_document_required_params(self): design_document_model['_conflicts'] = ['testString'] design_document_model['_deleted'] = True design_document_model['_deleted_conflicts'] = ['testString'] - design_document_model['_id'] = 'testString' + design_document_model['_id'] = '_design/appliances' design_document_model['_local_seq'] = 'testString' - design_document_model['_rev'] = 'testString' + design_document_model['_rev'] = '8-7e2537e5989294471061e0cfd7292725' design_document_model['_revisions'] = revisions_model design_document_model['_revs_info'] = [document_revision_status_model] design_document_model['autoupdate'] = True @@ -5136,14 +5198,14 @@ def test_put_design_document_value_error(self): # Construct a dict representation of a AnalyzerConfiguration model analyzer_configuration_model = {} - analyzer_configuration_model['name'] = 'classic' + analyzer_configuration_model['name'] = 'standard' analyzer_configuration_model['stopwords'] = ['testString'] analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a dict representation of a SearchIndexDefinition model search_index_definition_model = {} search_index_definition_model['analyzer'] = analyzer_configuration_model - search_index_definition_model['index'] = 'testString' + search_index_definition_model['index'] = 'function (doc) {\n index("price", doc.price);\n}' # Construct a dict representation of a DesignDocumentOptions model design_document_options_model = {} @@ -5151,7 +5213,7 @@ def test_put_design_document_value_error(self): # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} - design_document_views_map_reduce_model['map'] = 'testString' + design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5160,9 +5222,9 @@ def test_put_design_document_value_error(self): design_document_model['_conflicts'] = ['testString'] design_document_model['_deleted'] = True design_document_model['_deleted_conflicts'] = ['testString'] - design_document_model['_id'] = 'testString' + design_document_model['_id'] = '_design/appliances' design_document_model['_local_seq'] = 'testString' - design_document_model['_rev'] = 'testString' + design_document_model['_rev'] = '8-7e2537e5989294471061e0cfd7292725' design_document_model['_revisions'] = revisions_model design_document_model['_revs_info'] = [document_revision_status_model] design_document_model['autoupdate'] = True @@ -5314,13 +5376,13 @@ def test_post_design_docs_all_params(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' accept = 'application/json' # Invoke method @@ -5358,13 +5420,13 @@ def test_post_design_docs_all_params(self): assert req_body['descending'] == False assert req_body['include_docs'] == False assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == 'testString' + assert req_body['start_key'] == '0007741142412418284' def test_post_design_docs_all_params_with_retries(self): # Enable retries and run test_post_design_docs_all_params. @@ -5399,13 +5461,13 @@ def test_post_design_docs_required_params(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Invoke method response = _service.post_design_docs( @@ -5441,13 +5503,13 @@ def test_post_design_docs_required_params(self): assert req_body['descending'] == False assert req_body['include_docs'] == False assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == 'testString' + assert req_body['start_key'] == '0007741142412418284' def test_post_design_docs_required_params_with_retries(self): # Enable retries and run test_post_design_docs_required_params. @@ -5482,13 +5544,13 @@ def test_post_design_docs_value_error(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -5543,7 +5605,7 @@ def test_post_design_docs_queries_all_params(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -5608,7 +5670,7 @@ def test_post_design_docs_queries_required_params(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -5671,7 +5733,7 @@ def test_post_design_docs_queries_value_error(self): all_docs_query_model['update_seq'] = False all_docs_query_model['end_key'] = 'testString' all_docs_query_model['key'] = 'testString' - all_docs_query_model['keys'] = ['testString'] + all_docs_query_model['keys'] = ['small-appliances:1000042', 'small-appliances:1000043'] all_docs_query_model['start_key'] = 'testString' # Set up parameter values @@ -5766,9 +5828,9 @@ def test_post_view_all_params(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -5776,7 +5838,7 @@ def test_post_view_all_params(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True stable = False start_key = 'testString' @@ -5824,9 +5886,9 @@ def test_post_view_all_params(self): assert req_body['attachments'] == False assert req_body['conflicts'] == False assert req_body['descending'] == False - assert req_body['include_docs'] == False + assert req_body['include_docs'] == True assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' @@ -5834,7 +5896,7 @@ def test_post_view_all_params(self): assert req_body['group'] == False assert req_body['group_level'] == 1 assert req_body['key'] == 'testString' - assert req_body['keys'] == ['testString'] + assert req_body['keys'] == ['examplekey'] assert req_body['reduce'] == True assert req_body['stable'] == False assert req_body['start_key'] == 'testString' @@ -5874,9 +5936,9 @@ def test_post_view_value_error(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -5884,7 +5946,7 @@ def test_post_view_value_error(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True stable = False start_key = 'testString' @@ -5941,9 +6003,9 @@ def test_post_view_as_stream_all_params(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -5951,7 +6013,7 @@ def test_post_view_as_stream_all_params(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True stable = False start_key = 'testString' @@ -5999,9 +6061,9 @@ def test_post_view_as_stream_all_params(self): assert req_body['attachments'] == False assert req_body['conflicts'] == False assert req_body['descending'] == False - assert req_body['include_docs'] == False + assert req_body['include_docs'] == True assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' @@ -6009,7 +6071,7 @@ def test_post_view_as_stream_all_params(self): assert req_body['group'] == False assert req_body['group_level'] == 1 assert req_body['key'] == 'testString' - assert req_body['keys'] == ['testString'] + assert req_body['keys'] == ['examplekey'] assert req_body['reduce'] == True assert req_body['stable'] == False assert req_body['start_key'] == 'testString' @@ -6055,9 +6117,9 @@ def test_post_view_as_stream_value_error(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -6065,7 +6127,7 @@ def test_post_view_as_stream_value_error(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True stable = False start_key = 'testString' @@ -6120,9 +6182,9 @@ def test_post_view_queries_all_params(self): view_query_model['attachments'] = False view_query_model['conflicts'] = False view_query_model['descending'] = False - view_query_model['include_docs'] = False + view_query_model['include_docs'] = True view_query_model['inclusive_end'] = True - view_query_model['limit'] = 0 + view_query_model['limit'] = 5 view_query_model['skip'] = 0 view_query_model['update_seq'] = False view_query_model['end_key'] = 'testString' @@ -6194,9 +6256,9 @@ def test_post_view_queries_value_error(self): view_query_model['attachments'] = False view_query_model['conflicts'] = False view_query_model['descending'] = False - view_query_model['include_docs'] = False + view_query_model['include_docs'] = True view_query_model['inclusive_end'] = True - view_query_model['limit'] = 0 + view_query_model['limit'] = 5 view_query_model['skip'] = 0 view_query_model['update_seq'] = False view_query_model['end_key'] = 'testString' @@ -6266,9 +6328,9 @@ def test_post_view_queries_as_stream_all_params(self): view_query_model['attachments'] = False view_query_model['conflicts'] = False view_query_model['descending'] = False - view_query_model['include_docs'] = False + view_query_model['include_docs'] = True view_query_model['inclusive_end'] = True - view_query_model['limit'] = 0 + view_query_model['limit'] = 5 view_query_model['skip'] = 0 view_query_model['update_seq'] = False view_query_model['end_key'] = 'testString' @@ -6346,9 +6408,9 @@ def test_post_view_queries_as_stream_value_error(self): view_query_model['attachments'] = False view_query_model['conflicts'] = False view_query_model['descending'] = False - view_query_model['include_docs'] = False + view_query_model['include_docs'] = True view_query_model['inclusive_end'] = True - view_query_model['limit'] = 0 + view_query_model['limit'] = 5 view_query_model['skip'] = 0 view_query_model['update_seq'] = False view_query_model['end_key'] = 'testString' @@ -6545,13 +6607,13 @@ def test_post_partition_all_docs_all_params(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Invoke method response = _service.post_partition_all_docs( @@ -6588,13 +6650,13 @@ def test_post_partition_all_docs_all_params(self): assert req_body['descending'] == False assert req_body['include_docs'] == False assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == 'testString' + assert req_body['start_key'] == '0007741142412418284' def test_post_partition_all_docs_all_params_with_retries(self): # Enable retries and run test_post_partition_all_docs_all_params. @@ -6630,13 +6692,13 @@ def test_post_partition_all_docs_value_error(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -6688,13 +6750,13 @@ def test_post_partition_all_docs_as_stream_all_params(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Invoke method response = _service.post_partition_all_docs_as_stream( @@ -6731,13 +6793,13 @@ def test_post_partition_all_docs_as_stream_all_params(self): assert req_body['descending'] == False assert req_body['include_docs'] == False assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' assert req_body['key'] == 'testString' assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == 'testString' + assert req_body['start_key'] == '0007741142412418284' # Verify streamed JSON response result = response.get_result() @@ -6779,13 +6841,13 @@ def test_post_partition_all_docs_as_stream_value_error(self): descending = False include_docs = False inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' key = 'testString' keys = ['testString'] - start_key = 'testString' + start_key = '0007741142412418284' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -6842,7 +6904,7 @@ def test_post_partition_search_all_params(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' @@ -6885,7 +6947,7 @@ def test_post_partition_search_all_params(self): assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 3 assert req_body['sort'] == ['testString'] assert req_body['stale'] == 'ok' @@ -6928,7 +6990,7 @@ def test_post_partition_search_value_error(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' @@ -6990,7 +7052,7 @@ def test_post_partition_search_as_stream_all_params(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' @@ -7033,7 +7095,7 @@ def test_post_partition_search_as_stream_all_params(self): assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 3 assert req_body['sort'] == ['testString'] assert req_body['stale'] == 'ok' @@ -7082,7 +7144,7 @@ def test_post_partition_search_as_stream_value_error(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' @@ -7139,9 +7201,9 @@ def test_post_partition_view_all_params(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -7149,7 +7211,7 @@ def test_post_partition_view_all_params(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True start_key = 'testString' start_key_doc_id = 'testString' @@ -7196,9 +7258,9 @@ def test_post_partition_view_all_params(self): assert req_body['attachments'] == False assert req_body['conflicts'] == False assert req_body['descending'] == False - assert req_body['include_docs'] == False + assert req_body['include_docs'] == True assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' @@ -7206,7 +7268,7 @@ def test_post_partition_view_all_params(self): assert req_body['group'] == False assert req_body['group_level'] == 1 assert req_body['key'] == 'testString' - assert req_body['keys'] == ['testString'] + assert req_body['keys'] == ['examplekey'] assert req_body['reduce'] == True assert req_body['start_key'] == 'testString' assert req_body['start_key_doc_id'] == 'testString' @@ -7246,9 +7308,9 @@ def test_post_partition_view_value_error(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -7256,7 +7318,7 @@ def test_post_partition_view_value_error(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True start_key = 'testString' start_key_doc_id = 'testString' @@ -7314,9 +7376,9 @@ def test_post_partition_view_as_stream_all_params(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -7324,7 +7386,7 @@ def test_post_partition_view_as_stream_all_params(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True start_key = 'testString' start_key_doc_id = 'testString' @@ -7371,9 +7433,9 @@ def test_post_partition_view_as_stream_all_params(self): assert req_body['attachments'] == False assert req_body['conflicts'] == False assert req_body['descending'] == False - assert req_body['include_docs'] == False + assert req_body['include_docs'] == True assert req_body['inclusive_end'] == True - assert req_body['limit'] == 0 + assert req_body['limit'] == 10 assert req_body['skip'] == 0 assert req_body['update_seq'] == False assert req_body['end_key'] == 'testString' @@ -7381,7 +7443,7 @@ def test_post_partition_view_as_stream_all_params(self): assert req_body['group'] == False assert req_body['group_level'] == 1 assert req_body['key'] == 'testString' - assert req_body['keys'] == ['testString'] + assert req_body['keys'] == ['examplekey'] assert req_body['reduce'] == True assert req_body['start_key'] == 'testString' assert req_body['start_key_doc_id'] == 'testString' @@ -7427,9 +7489,9 @@ def test_post_partition_view_as_stream_value_error(self): attachments = False conflicts = False descending = False - include_docs = False + include_docs = True inclusive_end = True - limit = 0 + limit = 10 skip = 0 update_seq = False end_key = 'testString' @@ -7437,7 +7499,7 @@ def test_post_partition_view_as_stream_value_error(self): group = False group_level = 1 key = 'testString' - keys = ['testString'] + keys = ['examplekey'] reduce = True start_key = 'testString' start_key_doc_id = 'testString' @@ -7489,11 +7551,11 @@ def test_post_partition_explain_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'type': {'$eq': 'product'}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] + fields = ['productid', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7528,11 +7590,11 @@ def test_post_partition_explain_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['selector'] == {'type': {'$eq': 'product'}} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['testString'] + assert req_body['fields'] == ['productid', 'name', 'description'] assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] @@ -7568,11 +7630,11 @@ def test_post_partition_explain_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'type': {'$eq': 'product'}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] + fields = ['productid', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7625,11 +7687,11 @@ def test_post_partition_find_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'type': {'$eq': 'product'}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] + fields = ['productid', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7664,11 +7726,11 @@ def test_post_partition_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['selector'] == {'type': {'$eq': 'product'}} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['testString'] + assert req_body['fields'] == ['productid', 'name', 'description'] assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] @@ -7704,11 +7766,11 @@ def test_post_partition_find_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'type': {'$eq': 'product'}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] + fields = ['productid', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7761,11 +7823,11 @@ def test_post_partition_find_as_stream_all_params(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'type': {'$eq': 'product'}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] + fields = ['productid', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7800,11 +7862,11 @@ def test_post_partition_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['selector'] == {'type': {'$eq': 'product'}} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['testString'] + assert req_body['fields'] == ['productid', 'name', 'description'] assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] @@ -7846,11 +7908,11 @@ def test_post_partition_find_as_stream_value_error(self): # Set up parameter values db = 'testString' partition_key = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'type': {'$eq': 'product'}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] + fields = ['productid', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7941,12 +8003,12 @@ def test_post_explain_all_params(self): # Set up parameter values db = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'email_verified': {'$eq': True}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] - limit = 25 + fields = ['_id', 'type', 'name', 'email'] + limit = 3 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -7981,12 +8043,12 @@ def test_post_explain_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['selector'] == {'email_verified': {'$eq': True}} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 25 + assert req_body['fields'] == ['_id', 'type', 'name', 'email'] + assert req_body['limit'] == 3 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -8021,12 +8083,12 @@ def test_post_explain_value_error(self): # Set up parameter values db = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'email_verified': {'$eq': True}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] - limit = 25 + fields = ['_id', 'type', 'name', 'email'] + limit = 3 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8077,12 +8139,12 @@ def test_post_find_all_params(self): # Set up parameter values db = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'email_verified': {'$eq': True}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] - limit = 25 + fields = ['_id', 'type', 'name', 'email'] + limit = 3 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8117,12 +8179,12 @@ def test_post_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['selector'] == {'email_verified': {'$eq': True}} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 25 + assert req_body['fields'] == ['_id', 'type', 'name', 'email'] + assert req_body['limit'] == 3 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -8157,12 +8219,12 @@ def test_post_find_value_error(self): # Set up parameter values db = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'email_verified': {'$eq': True}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] - limit = 25 + fields = ['_id', 'type', 'name', 'email'] + limit = 3 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8213,12 +8275,12 @@ def test_post_find_as_stream_all_params(self): # Set up parameter values db = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'email_verified': {'$eq': True}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] - limit = 25 + fields = ['_id', 'type', 'name', 'email'] + limit = 3 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8253,12 +8315,12 @@ def test_post_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['selector'] == {'anyKey': 'anyValue'} + assert req_body['selector'] == {'email_verified': {'$eq': True}} assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['testString'] - assert req_body['limit'] == 25 + assert req_body['fields'] == ['_id', 'type', 'name', 'email'] + assert req_body['limit'] == 3 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] assert req_body['stable'] == True @@ -8299,12 +8361,12 @@ def test_post_find_as_stream_value_error(self): # Set up parameter values db = 'testString' - selector = {'anyKey': 'anyValue'} + selector = {'email_verified': {'$eq': True}} bookmark = 'testString' conflicts = True execution_stats = True - fields = ['testString'] - limit = 25 + fields = ['_id', 'type', 'name', 'email'] + limit = 3 skip = 0 sort = [{'key1': 'asc'}] stable = True @@ -8446,7 +8508,7 @@ def test_post_index_all_params(self): # Construct a dict representation of a IndexField model index_field_model = {} - index_field_model['name'] = 'testString' + index_field_model['name'] = 'asc' index_field_model['type'] = 'boolean' index_field_model['foo'] = 'asc' @@ -8461,8 +8523,8 @@ def test_post_index_all_params(self): # Set up parameter values db = 'testString' index = index_definition_model - ddoc = 'testString' - name = 'testString' + ddoc = 'json-index' + name = 'getUserByName' partitioned = True type = 'json' @@ -8487,8 +8549,8 @@ def test_post_index_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['index'] == index_definition_model - assert req_body['ddoc'] == 'testString' - assert req_body['name'] == 'testString' + assert req_body['ddoc'] == 'json-index' + assert req_body['name'] == 'getUserByName' assert req_body['partitioned'] == True assert req_body['type'] == 'json' @@ -8529,7 +8591,7 @@ def test_post_index_value_error(self): # Construct a dict representation of a IndexField model index_field_model = {} - index_field_model['name'] = 'testString' + index_field_model['name'] = 'asc' index_field_model['type'] = 'boolean' index_field_model['foo'] = 'asc' @@ -8544,8 +8606,8 @@ def test_post_index_value_error(self): # Set up parameter values db = 'testString' index = index_definition_model - ddoc = 'testString' - name = 'testString' + ddoc = 'json-index' + name = 'getUserByName' partitioned = True type = 'json' @@ -8723,8 +8785,8 @@ def test_post_search_analyze_all_params(self): ) # Set up parameter values - analyzer = 'arabic' - text = 'testString' + analyzer = 'english' + text = 'running is fun' # Invoke method response = _service.post_search_analyze( @@ -8742,8 +8804,8 @@ def test_post_search_analyze_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['analyzer'] == 'arabic' - assert req_body['text'] == 'testString' + assert req_body['analyzer'] == 'english' + assert req_body['text'] == 'running is fun' def test_post_search_analyze_all_params_with_retries(self): # Enable retries and run test_post_search_analyze_all_params. @@ -8771,8 +8833,8 @@ def test_post_search_analyze_value_error(self): ) # Set up parameter values - analyzer = 'arabic' - text = 'testString' + analyzer = 'english' + text = 'running is fun' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -8828,7 +8890,7 @@ def test_post_search_all_params(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' counts = ['testString'] @@ -8882,7 +8944,7 @@ def test_post_search_all_params(self): assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 3 assert req_body['sort'] == ['testString'] assert req_body['stale'] == 'ok' assert req_body['counts'] == ['testString'] @@ -8930,7 +8992,7 @@ def test_post_search_value_error(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' counts = ['testString'] @@ -8996,7 +9058,7 @@ def test_post_search_as_stream_all_params(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' counts = ['testString'] @@ -9050,7 +9112,7 @@ def test_post_search_as_stream_all_params(self): assert req_body['highlight_size'] == 100 assert req_body['include_docs'] == False assert req_body['include_fields'] == ['testString'] - assert req_body['limit'] == 0 + assert req_body['limit'] == 3 assert req_body['sort'] == ['testString'] assert req_body['stale'] == 'ok' assert req_body['counts'] == ['testString'] @@ -9104,7 +9166,7 @@ def test_post_search_as_stream_value_error(self): highlight_size = 100 include_docs = False include_fields = ['testString'] - limit = 0 + limit = 3 sort = ['testString'] stale = 'ok' counts = ['testString'] @@ -9857,7 +9919,7 @@ def test_put_replication_document_all_params(self): replication_create_target_parameters_model = {} replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False - replication_create_target_parameters_model['q'] = 26 + replication_create_target_parameters_model['q'] = 1 # Construct a dict representation of a ReplicationDatabaseAuthBasic model replication_database_auth_basic_model = {} @@ -9877,13 +9939,13 @@ def test_put_replication_document_all_params(self): replication_database_model = {} replication_database_model['auth'] = replication_database_auth_model replication_database_model['headers'] = {'key1': 'testString'} - replication_database_model['url'] = 'testString' + replication_database_model['url'] = 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb' # Construct a dict representation of a UserContext model user_context_model = {} user_context_model['db'] = 'testString' - user_context_model['name'] = 'testString' - user_context_model['roles'] = ['_reader'] + user_context_model['name'] = 'john' + user_context_model['roles'] = ['researcher'] # Construct a dict representation of a ReplicationDocument model replication_document_model = {} @@ -9896,30 +9958,30 @@ def test_put_replication_document_all_params(self): replication_document_model['_rev'] = 'testString' replication_document_model['_revisions'] = revisions_model replication_document_model['_revs_info'] = [document_revision_status_model] - replication_document_model['cancel'] = True - replication_document_model['checkpoint_interval'] = 30000 - replication_document_model['connection_timeout'] = 30000 - replication_document_model['continuous'] = False - replication_document_model['create_target'] = False + replication_document_model['cancel'] = False + replication_document_model['checkpoint_interval'] = 4500 + replication_document_model['connection_timeout'] = 15000 + replication_document_model['continuous'] = True + replication_document_model['create_target'] = True replication_document_model['create_target_params'] = replication_create_target_parameters_model - replication_document_model['doc_ids'] = ['testString'] - replication_document_model['filter'] = 'testString' - replication_document_model['http_connections'] = 20 + replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] + replication_document_model['filter'] = 'ddoc/my_filter' + replication_document_model['http_connections'] = 10 replication_document_model['query_params'] = {'key1': 'testString'} - replication_document_model['retries_per_request'] = 5 - replication_document_model['selector'] = {'anyKey': 'anyValue'} - replication_document_model['since_seq'] = 'testString' - replication_document_model['socket_options'] = 'testString' + replication_document_model['retries_per_request'] = 3 + replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} + replication_document_model['since_seq'] = '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU' + replication_document_model['socket_options'] = '[{keepalive, true}, {nodelay, false}]' replication_document_model['source'] = replication_database_model replication_document_model['source_proxy'] = 'testString' replication_document_model['target'] = replication_database_model replication_document_model['target_proxy'] = 'testString' replication_document_model['use_bulk_get'] = True - replication_document_model['use_checkpoints'] = True + replication_document_model['use_checkpoints'] = False replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False - replication_document_model['worker_batch_size'] = 500 - replication_document_model['worker_processes'] = 4 + replication_document_model['worker_batch_size'] = 400 + replication_document_model['worker_processes'] = 3 replication_document_model['foo'] = 'testString' # Set up parameter values @@ -10009,7 +10071,7 @@ def test_put_replication_document_required_params(self): replication_create_target_parameters_model = {} replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False - replication_create_target_parameters_model['q'] = 26 + replication_create_target_parameters_model['q'] = 1 # Construct a dict representation of a ReplicationDatabaseAuthBasic model replication_database_auth_basic_model = {} @@ -10029,13 +10091,13 @@ def test_put_replication_document_required_params(self): replication_database_model = {} replication_database_model['auth'] = replication_database_auth_model replication_database_model['headers'] = {'key1': 'testString'} - replication_database_model['url'] = 'testString' + replication_database_model['url'] = 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb' # Construct a dict representation of a UserContext model user_context_model = {} user_context_model['db'] = 'testString' - user_context_model['name'] = 'testString' - user_context_model['roles'] = ['_reader'] + user_context_model['name'] = 'john' + user_context_model['roles'] = ['researcher'] # Construct a dict representation of a ReplicationDocument model replication_document_model = {} @@ -10048,30 +10110,30 @@ def test_put_replication_document_required_params(self): replication_document_model['_rev'] = 'testString' replication_document_model['_revisions'] = revisions_model replication_document_model['_revs_info'] = [document_revision_status_model] - replication_document_model['cancel'] = True - replication_document_model['checkpoint_interval'] = 30000 - replication_document_model['connection_timeout'] = 30000 - replication_document_model['continuous'] = False - replication_document_model['create_target'] = False + replication_document_model['cancel'] = False + replication_document_model['checkpoint_interval'] = 4500 + replication_document_model['connection_timeout'] = 15000 + replication_document_model['continuous'] = True + replication_document_model['create_target'] = True replication_document_model['create_target_params'] = replication_create_target_parameters_model - replication_document_model['doc_ids'] = ['testString'] - replication_document_model['filter'] = 'testString' - replication_document_model['http_connections'] = 20 + replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] + replication_document_model['filter'] = 'ddoc/my_filter' + replication_document_model['http_connections'] = 10 replication_document_model['query_params'] = {'key1': 'testString'} - replication_document_model['retries_per_request'] = 5 - replication_document_model['selector'] = {'anyKey': 'anyValue'} - replication_document_model['since_seq'] = 'testString' - replication_document_model['socket_options'] = 'testString' + replication_document_model['retries_per_request'] = 3 + replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} + replication_document_model['since_seq'] = '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU' + replication_document_model['socket_options'] = '[{keepalive, true}, {nodelay, false}]' replication_document_model['source'] = replication_database_model replication_document_model['source_proxy'] = 'testString' replication_document_model['target'] = replication_database_model replication_document_model['target_proxy'] = 'testString' replication_document_model['use_bulk_get'] = True - replication_document_model['use_checkpoints'] = True + replication_document_model['use_checkpoints'] = False replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False - replication_document_model['worker_batch_size'] = 500 - replication_document_model['worker_processes'] = 4 + replication_document_model['worker_batch_size'] = 400 + replication_document_model['worker_processes'] = 3 replication_document_model['foo'] = 'testString' # Set up parameter values @@ -10147,7 +10209,7 @@ def test_put_replication_document_value_error(self): replication_create_target_parameters_model = {} replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False - replication_create_target_parameters_model['q'] = 26 + replication_create_target_parameters_model['q'] = 1 # Construct a dict representation of a ReplicationDatabaseAuthBasic model replication_database_auth_basic_model = {} @@ -10167,13 +10229,13 @@ def test_put_replication_document_value_error(self): replication_database_model = {} replication_database_model['auth'] = replication_database_auth_model replication_database_model['headers'] = {'key1': 'testString'} - replication_database_model['url'] = 'testString' + replication_database_model['url'] = 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb' # Construct a dict representation of a UserContext model user_context_model = {} user_context_model['db'] = 'testString' - user_context_model['name'] = 'testString' - user_context_model['roles'] = ['_reader'] + user_context_model['name'] = 'john' + user_context_model['roles'] = ['researcher'] # Construct a dict representation of a ReplicationDocument model replication_document_model = {} @@ -10186,30 +10248,30 @@ def test_put_replication_document_value_error(self): replication_document_model['_rev'] = 'testString' replication_document_model['_revisions'] = revisions_model replication_document_model['_revs_info'] = [document_revision_status_model] - replication_document_model['cancel'] = True - replication_document_model['checkpoint_interval'] = 30000 - replication_document_model['connection_timeout'] = 30000 - replication_document_model['continuous'] = False - replication_document_model['create_target'] = False + replication_document_model['cancel'] = False + replication_document_model['checkpoint_interval'] = 4500 + replication_document_model['connection_timeout'] = 15000 + replication_document_model['continuous'] = True + replication_document_model['create_target'] = True replication_document_model['create_target_params'] = replication_create_target_parameters_model - replication_document_model['doc_ids'] = ['testString'] - replication_document_model['filter'] = 'testString' - replication_document_model['http_connections'] = 20 + replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] + replication_document_model['filter'] = 'ddoc/my_filter' + replication_document_model['http_connections'] = 10 replication_document_model['query_params'] = {'key1': 'testString'} - replication_document_model['retries_per_request'] = 5 - replication_document_model['selector'] = {'anyKey': 'anyValue'} - replication_document_model['since_seq'] = 'testString' - replication_document_model['socket_options'] = 'testString' + replication_document_model['retries_per_request'] = 3 + replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} + replication_document_model['since_seq'] = '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU' + replication_document_model['socket_options'] = '[{keepalive, true}, {nodelay, false}]' replication_document_model['source'] = replication_database_model replication_document_model['source_proxy'] = 'testString' replication_document_model['target'] = replication_database_model replication_document_model['target_proxy'] = 'testString' replication_document_model['use_bulk_get'] = True - replication_document_model['use_checkpoints'] = True + replication_document_model['use_checkpoints'] = False replication_document_model['user_ctx'] = user_context_model replication_document_model['winning_revs_only'] = False - replication_document_model['worker_batch_size'] = 500 - replication_document_model['worker_processes'] = 4 + replication_document_model['worker_batch_size'] = 400 + replication_document_model['worker_processes'] = 3 replication_document_model['foo'] = 'testString' # Set up parameter values @@ -10787,8 +10849,8 @@ def test_put_security_all_params(self): # Construct a dict representation of a SecurityObject model security_object_model = {} - security_object_model['names'] = ['testString'] - security_object_model['roles'] = ['testString'] + security_object_model['names'] = ['superuser'] + security_object_model['roles'] = ['admins'] # Set up parameter values db = 'testString' @@ -10848,8 +10910,8 @@ def test_put_security_value_error(self): # Construct a dict representation of a SecurityObject model security_object_model = {} - security_object_model['names'] = ['testString'] - security_object_model['roles'] = ['testString'] + security_object_model['names'] = ['superuser'] + security_object_model['roles'] = ['admins'] # Set up parameter values db = 'testString' @@ -11128,7 +11190,7 @@ def test_put_cors_configuration_all_params(self): ) # Set up parameter values - origins = ['testString'] + origins = ['https://example.com', 'https://www.example.com'] allow_credentials = True enable_cors = True @@ -11149,7 +11211,7 @@ def test_put_cors_configuration_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['origins'] == ['testString'] + assert req_body['origins'] == ['https://example.com', 'https://www.example.com'] assert req_body['allow_credentials'] == True assert req_body['enable_cors'] == True @@ -11179,7 +11241,7 @@ def test_put_cors_configuration_value_error(self): ) # Set up parameter values - origins = ['testString'] + origins = ['https://example.com', 'https://www.example.com'] allow_credentials = True enable_cors = True @@ -12297,12 +12359,21 @@ def test_put_local_document_all_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -12387,12 +12458,21 @@ def test_put_local_document_required_params(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -12469,12 +12549,21 @@ def test_put_local_document_value_error(self): document_model['_conflicts'] = ['testString'] document_model['_deleted'] = True document_model['_deleted_conflicts'] = ['testString'] - document_model['_id'] = 'testString' + document_model['_id'] = 'exampleid' document_model['_local_seq'] = 'testString' document_model['_rev'] = 'testString' document_model['_revisions'] = revisions_model document_model['_revs_info'] = [document_revision_status_model] - document_model['foo'] = 'testString' + document_model['brand'] = 'Foo' + document_model['colours'] = '["red","green","black","blue"]' + document_model['description'] = 'Slim Colourful Design Electronic Cooking Appliance for ...' + document_model['image'] = 'assets/img/0gmsnghhew.jpg' + document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' + document_model['name'] = 'Digital Kitchen Scales' + document_model['price'] = '14.99' + document_model['productid'] = '1000042' + document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' + document_model['type'] = 'product' # Set up parameter values db = 'testString' @@ -13009,7 +13098,7 @@ def test_post_activity_tracker_events_all_params(self): ) # Set up parameter values - types = ['management'] + types = ['management', 'data'] # Invoke method response = _service.post_activity_tracker_events( @@ -13026,7 +13115,7 @@ def test_post_activity_tracker_events_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['types'] == ['management'] + assert req_body['types'] == ['management', 'data'] def test_post_activity_tracker_events_all_params_with_retries(self): # Enable retries and run test_post_activity_tracker_events_all_params. @@ -13054,7 +13143,7 @@ def test_post_activity_tracker_events_value_error(self): ) # Set up parameter values - types = ['management'] + types = ['management', 'data'] # Pass in all but one required param and check for a ValueError req_param_dict = { From d8f14e834f4d90eebdf451ff5f96cd56f2b73ce2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:37:22 +0000 Subject: [PATCH 280/669] build(deps-dev): Bump pytest-cov from 4.1.0 to 5.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 4.1.0 to 5.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v4.1.0...v5.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d0bcf089..605ada69 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.0.1 pylint==3.1.0 # code coverage coverage==7.4.4 -pytest-cov==4.1.0 +pytest-cov==5.0.0 From 52ee5b317beff6b10eee027d93079fae4eba40e4 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:46:37 +0000 Subject: [PATCH 281/669] ci(generated): disable SQ debug Generated SDK source code using: - Generator version 3.87.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 6f89527 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 411546eb..3be2ed16 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -264,7 +264,7 @@ void defaultInit() { scanCode = { withSonarQubeEnv(installationName: 'SonarQubeServer') { - sh "${scannerHome}/bin/sonar-scanner -X -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.exclusions=examples/**" + sh "${scannerHome}/bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.exclusions=examples/**" } } } From 0cb21f7513f8ef635d6e0105f8a032767e1e0f64 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:16:14 +0000 Subject: [PATCH 282/669] build(generated): update generator to 3.88.0 Generated SDK source code using: - Generator version 3.88.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version 5ed1456 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- test/integration/test_cloudant_v1.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index f7a72681..01b129e1 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -782,14 +782,10 @@ def test_put_design_document(self): 'autoupdate': True, 'filters': {'key1': 'testString'}, 'indexes': {'findByPrice': search_index_definition_model }, - - 'language': 'javascript', 'options': design_document_options_model, 'validate_doc_update': 'testString', 'views': {'byApplianceProdId': design_document_views_map_reduce_model }, - - 'foo': 'testString', } From 6cd84fb5ac5dc2af0f5d73de161819ed8142c849 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:13:11 +0000 Subject: [PATCH 283/669] test(generated): revert workaround multiline example values Generated SDK source code using: - Generator version 3.88.0 - Specification version 1.0.0-dev0.1.6 - Automation (cloudant-sdks) version c73cf45 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- test/integration/test_cloudant_v1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 01b129e1..cd0a961e 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -781,11 +781,11 @@ def test_put_design_document(self): '_revs_info': [document_revision_status_model], 'autoupdate': True, 'filters': {'key1': 'testString'}, - 'indexes': {'findByPrice': search_index_definition_model }, + 'indexes': {'findByPrice': search_index_definition_model}, 'language': 'javascript', 'options': design_document_options_model, 'validate_doc_update': 'testString', - 'views': {'byApplianceProdId': design_document_views_map_reduce_model }, + 'views': {'byApplianceProdId': design_document_views_map_reduce_model}, 'foo': 'testString', } From 7c3f9cc934467d612eb44584e87629ff39c01bfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:18:07 +0000 Subject: [PATCH 284/669] build(deps): Bump sphinx from 7.2.6 to 7.3.5 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.2.6 to 7.3.5. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.2.6...v7.3.5) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index c458b803..2ddb0ab9 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.2.6 +Sphinx==7.3.5 sphinx-autodoc2==0.5.0 myst-parser==2.0.0 sphinx-rtd-theme==2.0.0 From 70100f8d20d6b4b856506a2d3272f5a38bd1e8e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:09:12 +0000 Subject: [PATCH 285/669] build(deps): Bump ibm-cloud-sdk-core from 3.19.2 to 3.20.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.19.2 to 3.20.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.19.2...v3.20.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6192e6b8..fb4a3be4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.8.0" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.19.2", + "ibm_cloud_sdk_core==3.20.0", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 24d38b96a922b716a1228302bed888861fa0c417 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:17:49 +0000 Subject: [PATCH 286/669] build(deps): Bump sphinx from 7.3.5 to 7.3.6 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.3.5 to 7.3.6. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.3.5...v7.3.6) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 2ddb0ab9..1656eac2 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.3.5 +Sphinx==7.3.6 sphinx-autodoc2==0.5.0 myst-parser==2.0.0 sphinx-rtd-theme==2.0.0 From 20551516cf5be2cff3bbf8216e94016c6f6bacc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 17:51:54 +0000 Subject: [PATCH 287/669] build(deps): Bump sphinx from 7.3.6 to 7.3.7 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.3.6 to 7.3.7. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.3.6...v7.3.7) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 1656eac2..e43f6859 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.3.6 +Sphinx==7.3.7 sphinx-autodoc2==0.5.0 myst-parser==2.0.0 sphinx-rtd-theme==2.0.0 From 034fabb1a4e228e34cd85837b8fefd5f90099660 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:05:28 +0000 Subject: [PATCH 288/669] feat(generated): update API definition to 1.0.0-dev0.1.8 Generated SDK source code using: - Generator version 3.89.1 - Specification version 1.0.0-dev0.1.8 - Automation (cloudant-sdks) version 4c7af91 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 543 ++++++++++++++++++++++++++++++++-- test/unit/test_cloudant_v1.py | 197 +++++++++++- 2 files changed, 704 insertions(+), 36 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 5ff7e96d..89366a39 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -427,9 +427,13 @@ def post_changes( It is widely used with the `filter` query parameter because it allows one to pass more information to the filter. ### Note - Before using the changes feed we recommend reading the + Before using the changes feed read the [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and appropriate use cases. + If you need to pass parameters to dynamically change the filtered content use the + `_selector` filter type for better performance and compatibility. The SDKs have + full support for change requests using selector filters, but don't support passing + parameters to design document filters. :param str db: Path parameter to specify the database name. :param List[str] doc_ids: (optional) Schema for a list of document IDs. @@ -482,19 +486,24 @@ def post_changes( return the documents in descending by key order. :param str feed: (optional) Query parameter to specify the changes feed type. - :param str filter: (optional) Query parameter to specify a filter function - from a design document that will filter the changes stream emitting only - filtered events. For example: `design_doc/filtername`. - Additionally, some keywords are reserved for built-in filters: + :param str filter: (optional) Query parameter to specify a filter to emit + only specific events from the changes stream. + The built-in filter types are: * `_design` - Returns only changes to design documents. * `_doc_ids` - Returns changes for documents with an ID matching one specified in - `doc_ids` request body parameter. + `doc_ids` request body parameter. (`POST` only) * `_selector` - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same as used for - `_find`. + `_find`. (`POST` only) * `_view` - Returns changes for documents that match an existing map function in the view specified by the query parameter `view`. + Additionally, the value can be the name of a JS filter function from a + design document. For example: `design_doc/filtername`. + **Note:** For better performance use the built-in `_selector`, `_design` or + `_doc_ids` filters rather than JS based `_view` or design document filters. + If you need to pass values to change the filtered content use the + `_selector` filter type. :param int heartbeat: (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for @@ -631,9 +640,13 @@ def post_changes_as_stream( It is widely used with the `filter` query parameter because it allows one to pass more information to the filter. ### Note - Before using the changes feed we recommend reading the + Before using the changes feed read the [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and appropriate use cases. + If you need to pass parameters to dynamically change the filtered content use the + `_selector` filter type for better performance and compatibility. The SDKs have + full support for change requests using selector filters, but don't support passing + parameters to design document filters. :param str db: Path parameter to specify the database name. :param List[str] doc_ids: (optional) Schema for a list of document IDs. @@ -686,19 +699,24 @@ def post_changes_as_stream( return the documents in descending by key order. :param str feed: (optional) Query parameter to specify the changes feed type. - :param str filter: (optional) Query parameter to specify a filter function - from a design document that will filter the changes stream emitting only - filtered events. For example: `design_doc/filtername`. - Additionally, some keywords are reserved for built-in filters: + :param str filter: (optional) Query parameter to specify a filter to emit + only specific events from the changes stream. + The built-in filter types are: * `_design` - Returns only changes to design documents. * `_doc_ids` - Returns changes for documents with an ID matching one specified in - `doc_ids` request body parameter. + `doc_ids` request body parameter. (`POST` only) * `_selector` - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same as used for - `_find`. + `_find`. (`POST` only) * `_view` - Returns changes for documents that match an existing map function in the view specified by the query parameter `view`. + Additionally, the value can be the name of a JS filter function from a + design document. For example: `design_doc/filtername`. + **Note:** For better performance use the built-in `_selector`, `_design` or + `_doc_ids` filters rather than JS based `_view` or design document filters. + If you need to pass values to change the filtered content use the + `_selector` filter type. :param int heartbeat: (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by default and only applicable for @@ -4559,8 +4577,12 @@ def post_partition_explain( :param str update: (optional) Whether to update the index prior to returning the result. :param List[str] use_index: (optional) Use this option to identify a - specific index for query to run against, rather than by using the IBM - Cloudant Query algorithm to find the best index. + specific index to answer the query, rather than letting the IBM Cloudant + query planner choose an index. Specified as a two element array of design + document id followed by index name, for example `["my_design_doc", + "my_index"]`. + It’s recommended to specify indexes explicitly in your queries to prevent + existing queries being affected by new indexes that might get added later. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ExplainResult` object @@ -4711,8 +4733,12 @@ def post_partition_find( :param str update: (optional) Whether to update the index prior to returning the result. :param List[str] use_index: (optional) Use this option to identify a - specific index for query to run against, rather than by using the IBM - Cloudant Query algorithm to find the best index. + specific index to answer the query, rather than letting the IBM Cloudant + query planner choose an index. Specified as a two element array of design + document id followed by index name, for example `["my_design_doc", + "my_index"]`. + It’s recommended to specify indexes explicitly in your queries to prevent + existing queries being affected by new indexes that might get added later. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `FindResult` object @@ -4863,8 +4889,12 @@ def post_partition_find_as_stream( :param str update: (optional) Whether to update the index prior to returning the result. :param List[str] use_index: (optional) Use this option to identify a - specific index for query to run against, rather than by using the IBM - Cloudant Query algorithm to find the best index. + specific index to answer the query, rather than letting the IBM Cloudant + query planner choose an index. Specified as a two element array of design + document id followed by index name, for example `["my_design_doc", + "my_index"]`. + It’s recommended to specify indexes explicitly in your queries to prevent + existing queries being affected by new indexes that might get added later. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result @@ -5012,8 +5042,12 @@ def post_explain( :param str update: (optional) Whether to update the index prior to returning the result. :param List[str] use_index: (optional) Use this option to identify a - specific index for query to run against, rather than by using the IBM - Cloudant Query algorithm to find the best index. + specific index to answer the query, rather than letting the IBM Cloudant + query planner choose an index. Specified as a two element array of design + document id followed by index name, for example `["my_design_doc", + "my_index"]`. + It’s recommended to specify indexes explicitly in your queries to prevent + existing queries being affected by new indexes that might get added later. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5168,8 +5202,12 @@ def post_find( :param str update: (optional) Whether to update the index prior to returning the result. :param List[str] use_index: (optional) Use this option to identify a - specific index for query to run against, rather than by using the IBM - Cloudant Query algorithm to find the best index. + specific index to answer the query, rather than letting the IBM Cloudant + query planner choose an index. Specified as a two element array of design + document id followed by index name, for example `["my_design_doc", + "my_index"]`. + It’s recommended to specify indexes explicitly in your queries to prevent + existing queries being affected by new indexes that might get added later. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5324,8 +5362,12 @@ def post_find_as_stream( :param str update: (optional) Whether to update the index prior to returning the result. :param List[str] use_index: (optional) Use this option to identify a - specific index for query to run against, rather than by using the IBM - Cloudant Query algorithm to find the best index. + specific index to answer the query, rather than letting the IBM Cloudant + query planner choose an index. Specified as a two element array of design + document id followed by index name, for example `["my_design_doc", + "my_index"]`. + It’s recommended to specify indexes explicitly in your queries to prevent + existing queries being affected by new indexes that might get added later. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -11412,7 +11454,7 @@ class DesignDocument: removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Document ID. + :param str _id: (optional) Schema for a design document ID. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -11526,7 +11568,7 @@ def __init__( removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Document ID. + :param str _id: (optional) Schema for a design document ID. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -12332,7 +12374,7 @@ class Document: removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Document ID. + :param str _id: (optional) Schema for a document ID. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -12369,7 +12411,7 @@ def __init__( removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Document ID. + :param str _id: (optional) Schema for a document ID. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -12864,6 +12906,8 @@ class ExplainResult: document. If no fields were requested to be projected this will be empty and all fields will be returned. :param IndexInformation index: Schema for information about an index. + :param List[IndexCandidate] index_candidates: (optional) Schema for the list of + all the other indexes that were not chosen for serving the query. :param int limit: The used maximum number of results returned. :param ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying view. @@ -12899,6 +12943,9 @@ class ExplainResult: For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param List[SelectorHint] selector_hints: (optional) Schema for a list of + objects with extra information on the selector to provide insights about its + usability. :param int skip: Skip parameter used. """ @@ -12913,8 +12960,10 @@ def __init__( selector: dict, skip: int, *, + index_candidates: Optional[List['IndexCandidate']] = None, mrargs: Optional['ExplainResultMrArgs'] = None, partitioned: Optional[object] = None, + selector_hints: Optional[List['SelectorHint']] = None, ) -> None: """ Initialize a ExplainResult object. @@ -12960,19 +13009,26 @@ def __init__( [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param int skip: Skip parameter used. + :param List[IndexCandidate] index_candidates: (optional) Schema for the + list of all the other indexes that were not chosen for serving the query. :param ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying view. :param object partitioned: (optional) Schema for any JSON type. + :param List[SelectorHint] selector_hints: (optional) Schema for a list of + objects with extra information on the selector to provide insights about + its usability. """ self.covering = covering self.dbname = dbname self.fields = fields self.index = index + self.index_candidates = index_candidates self.limit = limit self.mrargs = mrargs self.opts = opts self.partitioned = partitioned self.selector = selector + self.selector_hints = selector_hints self.skip = skip @classmethod @@ -12995,6 +13051,8 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResult': args['index'] = IndexInformation.from_dict(index) else: raise ValueError('Required property \'index\' not present in ExplainResult JSON') + if (index_candidates := _dict.get('index_candidates')) is not None: + args['index_candidates'] = [IndexCandidate.from_dict(v) for v in index_candidates] if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: @@ -13011,6 +13069,8 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResult': args['selector'] = selector else: raise ValueError('Required property \'selector\' not present in ExplainResult JSON') + if (selector_hints := _dict.get('selector_hints')) is not None: + args['selector_hints'] = [SelectorHint.from_dict(v) for v in selector_hints] if (skip := _dict.get('skip')) is not None: args['skip'] = skip else: @@ -13036,6 +13096,14 @@ def to_dict(self) -> Dict: _dict['index'] = self.index else: _dict['index'] = self.index.to_dict() + if hasattr(self, 'index_candidates') and self.index_candidates is not None: + index_candidates_list = [] + for v in self.index_candidates: + if isinstance(v, dict): + index_candidates_list.append(v) + else: + index_candidates_list.append(v.to_dict()) + _dict['index_candidates'] = index_candidates_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'mrargs') and self.mrargs is not None: @@ -13052,6 +13120,14 @@ def to_dict(self) -> Dict: _dict['partitioned'] = self.partitioned if hasattr(self, 'selector') and self.selector is not None: _dict['selector'] = self.selector + if hasattr(self, 'selector_hints') and self.selector_hints is not None: + selector_hints_list = [] + for v in self.selector_hints: + if isinstance(v, dict): + selector_hints_list.append(v) + else: + selector_hints_list.append(v.to_dict()) + _dict['selector_hints'] = selector_hints_list if hasattr(self, 'skip') and self.skip is not None: _dict['skip'] = self.skip return _dict @@ -13511,6 +13587,317 @@ def __ne__(self, other: 'FindResult') -> bool: return not self == other +class IndexAnalysis: + """ + Schema for detailed explanation of why the specific index was excluded by the query + planner. + + :param bool covering: When `true`, the query is answered using the index only + and no documents are fetched. + :param int ranking: A position of the unused index based on its potential + relevance to the query. + :param List[IndexAnalysisExclusionReason] reasons: A list of reasons explaining + why index was not chosen for the query. + :param bool usable: Indicates whether an index can still be used for the query. + """ + + def __init__( + self, + covering: bool, + ranking: int, + reasons: List['IndexAnalysisExclusionReason'], + usable: bool, + ) -> None: + """ + Initialize a IndexAnalysis object. + + :param bool covering: When `true`, the query is answered using the index + only and no documents are fetched. + :param int ranking: A position of the unused index based on its potential + relevance to the query. + :param List[IndexAnalysisExclusionReason] reasons: A list of reasons + explaining why index was not chosen for the query. + :param bool usable: Indicates whether an index can still be used for the + query. + """ + self.covering = covering + self.ranking = ranking + self.reasons = reasons + self.usable = usable + + @classmethod + def from_dict(cls, _dict: Dict) -> 'IndexAnalysis': + """Initialize a IndexAnalysis object from a json dictionary.""" + args = {} + if (covering := _dict.get('covering')) is not None: + args['covering'] = covering + else: + raise ValueError('Required property \'covering\' not present in IndexAnalysis JSON') + if (ranking := _dict.get('ranking')) is not None: + args['ranking'] = ranking + else: + raise ValueError('Required property \'ranking\' not present in IndexAnalysis JSON') + if (reasons := _dict.get('reasons')) is not None: + args['reasons'] = [IndexAnalysisExclusionReason.from_dict(v) for v in reasons] + else: + raise ValueError('Required property \'reasons\' not present in IndexAnalysis JSON') + if (usable := _dict.get('usable')) is not None: + args['usable'] = usable + else: + raise ValueError('Required property \'usable\' not present in IndexAnalysis JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a IndexAnalysis object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'covering') and self.covering is not None: + _dict['covering'] = self.covering + if hasattr(self, 'ranking') and self.ranking is not None: + _dict['ranking'] = self.ranking + if hasattr(self, 'reasons') and self.reasons is not None: + reasons_list = [] + for v in self.reasons: + if isinstance(v, dict): + reasons_list.append(v) + else: + reasons_list.append(v.to_dict()) + _dict['reasons'] = reasons_list + if hasattr(self, 'usable') and self.usable is not None: + _dict['usable'] = self.usable + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this IndexAnalysis object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'IndexAnalysis') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'IndexAnalysis') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class IndexAnalysisExclusionReason: + """ + A reason for index's exclusion. + + :param str name: (optional) A reason code for index's exclusion. + The full list of possible reason codes is following: + * alphabetically_comes_after: json + There is another suitable index whose name comes before that of this index. + * empty_selector: text + "text" indexes do not support queries with empty selectors. + * excluded_by_user: any use_index was used to manually specify the index. + * field_mismatch: any Fields in "selector" of the query do match with the fields + available in the index. + * is_partial: json, text Partial indexes can be selected only manually. + * less_overlap: json There is a better match of fields available within the + indexes for the query. + * needs_text_search: json The use of the $text operator requires a "text" index. + * scope_mismatch: json The scope of the query and the index is not the same. + * sort_order_mismatch: json, special Fields in "sort" of the query do not match + with the fields available in the index. + * too_many_fields: json The index has more fields than the chosen one. + * unfavored_type: any The type of the index is not preferred. + """ + + def __init__( + self, + *, + name: Optional[str] = None, + ) -> None: + """ + Initialize a IndexAnalysisExclusionReason object. + + :param str name: (optional) A reason code for index's exclusion. + The full list of possible reason codes is following: + * alphabetically_comes_after: json + There is another suitable index whose name comes before that of this + index. + * empty_selector: text + "text" indexes do not support queries with empty selectors. + * excluded_by_user: any use_index was used to manually specify the index. + * field_mismatch: any Fields in "selector" of the query do match with the + fields available in the index. + * is_partial: json, text Partial indexes can be selected only manually. + * less_overlap: json There is a better match of fields available within the + indexes for the query. + * needs_text_search: json The use of the $text operator requires a "text" + index. + * scope_mismatch: json The scope of the query and the index is not the + same. + * sort_order_mismatch: json, special Fields in "sort" of the query do not + match with the fields available in the index. + * too_many_fields: json The index has more fields than the chosen one. + * unfavored_type: any The type of the index is not preferred. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'IndexAnalysisExclusionReason': + """Initialize a IndexAnalysisExclusionReason object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a IndexAnalysisExclusionReason object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this IndexAnalysisExclusionReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'IndexAnalysisExclusionReason') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'IndexAnalysisExclusionReason') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class NameEnum(str, Enum): + """ + A reason code for index's exclusion. + The full list of possible reason codes is following: + * alphabetically_comes_after: json + There is another suitable index whose name comes before that of this index. + * empty_selector: text + "text" indexes do not support queries with empty selectors. + * excluded_by_user: any use_index was used to manually specify the index. + * field_mismatch: any Fields in "selector" of the query do match with the fields + available in the index. + * is_partial: json, text Partial indexes can be selected only manually. + * less_overlap: json There is a better match of fields available within the + indexes for the query. + * needs_text_search: json The use of the $text operator requires a "text" index. + * scope_mismatch: json The scope of the query and the index is not the same. + * sort_order_mismatch: json, special Fields in "sort" of the query do not match + with the fields available in the index. + * too_many_fields: json The index has more fields than the chosen one. + * unfavored_type: any The type of the index is not preferred. + """ + + ALPHABETICALLY_COMES_AFTER = 'alphabetically_comes_after' + EMPTY_SELECTOR = 'empty_selector' + EXCLUDED_BY_USER = 'excluded_by_user' + FIELD_MISMATCH = 'field_mismatch' + IS_PARTIAL = 'is_partial' + LESS_OVERLAP = 'less_overlap' + NEEDS_TEXT_SEARCH = 'needs_text_search' + SCOPE_MISMATCH = 'scope_mismatch' + SORT_ORDER_MISMATCH = 'sort_order_mismatch' + TOO_MANY_FIELDS = 'too_many_fields' + UNFAVORED_TYPE = 'unfavored_type' + + + +class IndexCandidate: + """ + Schema for an index that was not chosen for serving the query with the reason for the + exclusion. + + :param IndexAnalysis analysis: Schema for detailed explanation of why the + specific index was excluded by the query planner. + :param IndexInformation index: Schema for information about an index. + """ + + def __init__( + self, + analysis: 'IndexAnalysis', + index: 'IndexInformation', + ) -> None: + """ + Initialize a IndexCandidate object. + + :param IndexAnalysis analysis: Schema for detailed explanation of why the + specific index was excluded by the query planner. + :param IndexInformation index: Schema for information about an index. + """ + self.analysis = analysis + self.index = index + + @classmethod + def from_dict(cls, _dict: Dict) -> 'IndexCandidate': + """Initialize a IndexCandidate object from a json dictionary.""" + args = {} + if (analysis := _dict.get('analysis')) is not None: + args['analysis'] = IndexAnalysis.from_dict(analysis) + else: + raise ValueError('Required property \'analysis\' not present in IndexCandidate JSON') + if (index := _dict.get('index')) is not None: + args['index'] = IndexInformation.from_dict(index) + else: + raise ValueError('Required property \'index\' not present in IndexCandidate JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a IndexCandidate object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'analysis') and self.analysis is not None: + if isinstance(self.analysis, dict): + _dict['analysis'] = self.analysis + else: + _dict['analysis'] = self.analysis.to_dict() + if hasattr(self, 'index') and self.index is not None: + if isinstance(self.index, dict): + _dict['index'] = self.index + else: + _dict['index'] = self.index.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this IndexCandidate object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'IndexCandidate') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'IndexCandidate') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class IndexDefinition: """ Schema for a `json` or `text` query index definition. Indexes of type `text` have @@ -15160,7 +15547,7 @@ class ReplicationDocument: removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Document ID. + :param str _id: (optional) Schema for a document ID. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -15315,7 +15702,7 @@ def __init__( removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Document ID. + :param str _id: (optional) Schema for a document ID. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -17437,6 +17824,98 @@ def __ne__(self, other: 'SecurityObject') -> bool: return not self == other +class SelectorHint: + """ + Schema for extra information on the selector. + + :param List[str] indexable_fields: A list of fields in the given selector that + can be used to restrict the query. + :param str type: A type of the index. + :param List[str] unindexable_fields: A list of fields in the given selector that + can't be used to restrict the query. + """ + + def __init__( + self, + indexable_fields: List[str], + type: str, + unindexable_fields: List[str], + ) -> None: + """ + Initialize a SelectorHint object. + + :param List[str] indexable_fields: A list of fields in the given selector + that can be used to restrict the query. + :param str type: A type of the index. + :param List[str] unindexable_fields: A list of fields in the given selector + that can't be used to restrict the query. + """ + self.indexable_fields = indexable_fields + self.type = type + self.unindexable_fields = unindexable_fields + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SelectorHint': + """Initialize a SelectorHint object from a json dictionary.""" + args = {} + if (indexable_fields := _dict.get('indexable_fields')) is not None: + args['indexable_fields'] = indexable_fields + else: + raise ValueError('Required property \'indexable_fields\' not present in SelectorHint JSON') + if (type := _dict.get('type')) is not None: + args['type'] = type + else: + raise ValueError('Required property \'type\' not present in SelectorHint JSON') + if (unindexable_fields := _dict.get('unindexable_fields')) is not None: + args['unindexable_fields'] = unindexable_fields + else: + raise ValueError('Required property \'unindexable_fields\' not present in SelectorHint JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SelectorHint object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'indexable_fields') and self.indexable_fields is not None: + _dict['indexable_fields'] = self.indexable_fields + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'unindexable_fields') and self.unindexable_fields is not None: + _dict['unindexable_fields'] = self.unindexable_fields + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SelectorHint object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SelectorHint') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SelectorHint') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + A type of the index. + """ + + JSON = 'json' + TEXT = 'text' + + + class ServerInformation: """ Schema for information about the server instance. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 70c56ce6..4dbb8434 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -7539,7 +7539,7 @@ def test_post_partition_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7618,7 +7618,7 @@ def test_post_partition_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7992,7 +7992,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -8072,7 +8072,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -15279,6 +15279,19 @@ def test_explain_result_serialization(self): index_information_model['partitioned'] = True index_information_model['type'] = 'json' + index_analysis_exclusion_reason_model = {} # IndexAnalysisExclusionReason + index_analysis_exclusion_reason_model['name'] = 'alphabetically_comes_after' + + index_analysis_model = {} # IndexAnalysis + index_analysis_model['covering'] = True + index_analysis_model['ranking'] = 1 + index_analysis_model['reasons'] = [index_analysis_exclusion_reason_model] + index_analysis_model['usable'] = True + + index_candidate_model = {} # IndexCandidate + index_candidate_model['analysis'] = index_analysis_model + index_candidate_model['index'] = index_information_model + explain_result_mr_args_model = {} # ExplainResultMrArgs explain_result_mr_args_model['conflicts'] = 'testString' explain_result_mr_args_model['direction'] = 'testString' @@ -15306,17 +15319,24 @@ def test_explain_result_serialization(self): explain_result_opts_model['update'] = True explain_result_opts_model['use_index'] = ['testString'] + selector_hint_model = {} # SelectorHint + selector_hint_model['indexable_fields'] = ['testString'] + selector_hint_model['type'] = 'json' + selector_hint_model['unindexable_fields'] = ['testString'] + # Construct a json representation of a ExplainResult model explain_result_model_json = {} explain_result_model_json['covering'] = True explain_result_model_json['dbname'] = 'testString' explain_result_model_json['fields'] = ['testString'] explain_result_model_json['index'] = index_information_model + explain_result_model_json['index_candidates'] = [index_candidate_model] explain_result_model_json['limit'] = 25 explain_result_model_json['mrargs'] = explain_result_mr_args_model explain_result_model_json['opts'] = explain_result_opts_model explain_result_model_json['partitioned'] = 'testString' explain_result_model_json['selector'] = {'anyKey': 'anyValue'} + explain_result_model_json['selector_hints'] = [selector_hint_model] explain_result_model_json['skip'] = 0 # Construct a model instance of ExplainResult by calling from_dict on the json representation @@ -15489,6 +15509,143 @@ def test_find_result_serialization(self): assert find_result_model_json2 == find_result_model_json +class TestModel_IndexAnalysis: + """ + Test Class for IndexAnalysis + """ + + def test_index_analysis_serialization(self): + """ + Test serialization/deserialization for IndexAnalysis + """ + + # Construct dict forms of any model objects needed in order to build this model. + + index_analysis_exclusion_reason_model = {} # IndexAnalysisExclusionReason + index_analysis_exclusion_reason_model['name'] = 'alphabetically_comes_after' + + # Construct a json representation of a IndexAnalysis model + index_analysis_model_json = {} + index_analysis_model_json['covering'] = True + index_analysis_model_json['ranking'] = 1 + index_analysis_model_json['reasons'] = [index_analysis_exclusion_reason_model] + index_analysis_model_json['usable'] = True + + # Construct a model instance of IndexAnalysis by calling from_dict on the json representation + index_analysis_model = IndexAnalysis.from_dict(index_analysis_model_json) + assert index_analysis_model != False + + # Construct a model instance of IndexAnalysis by calling from_dict on the json representation + index_analysis_model_dict = IndexAnalysis.from_dict(index_analysis_model_json).__dict__ + index_analysis_model2 = IndexAnalysis(**index_analysis_model_dict) + + # Verify the model instances are equivalent + assert index_analysis_model == index_analysis_model2 + + # Convert model instance back to dict and verify no loss of data + index_analysis_model_json2 = index_analysis_model.to_dict() + assert index_analysis_model_json2 == index_analysis_model_json + + +class TestModel_IndexAnalysisExclusionReason: + """ + Test Class for IndexAnalysisExclusionReason + """ + + def test_index_analysis_exclusion_reason_serialization(self): + """ + Test serialization/deserialization for IndexAnalysisExclusionReason + """ + + # Construct a json representation of a IndexAnalysisExclusionReason model + index_analysis_exclusion_reason_model_json = {} + index_analysis_exclusion_reason_model_json['name'] = 'alphabetically_comes_after' + + # Construct a model instance of IndexAnalysisExclusionReason by calling from_dict on the json representation + index_analysis_exclusion_reason_model = IndexAnalysisExclusionReason.from_dict(index_analysis_exclusion_reason_model_json) + assert index_analysis_exclusion_reason_model != False + + # Construct a model instance of IndexAnalysisExclusionReason by calling from_dict on the json representation + index_analysis_exclusion_reason_model_dict = IndexAnalysisExclusionReason.from_dict(index_analysis_exclusion_reason_model_json).__dict__ + index_analysis_exclusion_reason_model2 = IndexAnalysisExclusionReason(**index_analysis_exclusion_reason_model_dict) + + # Verify the model instances are equivalent + assert index_analysis_exclusion_reason_model == index_analysis_exclusion_reason_model2 + + # Convert model instance back to dict and verify no loss of data + index_analysis_exclusion_reason_model_json2 = index_analysis_exclusion_reason_model.to_dict() + assert index_analysis_exclusion_reason_model_json2 == index_analysis_exclusion_reason_model_json + + +class TestModel_IndexCandidate: + """ + Test Class for IndexCandidate + """ + + def test_index_candidate_serialization(self): + """ + Test serialization/deserialization for IndexCandidate + """ + + # Construct dict forms of any model objects needed in order to build this model. + + index_analysis_exclusion_reason_model = {} # IndexAnalysisExclusionReason + index_analysis_exclusion_reason_model['name'] = 'alphabetically_comes_after' + + index_analysis_model = {} # IndexAnalysis + index_analysis_model['covering'] = True + index_analysis_model['ranking'] = 1 + index_analysis_model['reasons'] = [index_analysis_exclusion_reason_model] + index_analysis_model['usable'] = True + + analyzer_model = {} # Analyzer + analyzer_model['name'] = 'classic' + analyzer_model['stopwords'] = ['testString'] + + index_text_operator_default_field_model = {} # IndexTextOperatorDefaultField + index_text_operator_default_field_model['analyzer'] = analyzer_model + index_text_operator_default_field_model['enabled'] = True + + index_field_model = {} # IndexField + index_field_model['name'] = 'testString' + index_field_model['type'] = 'boolean' + index_field_model['foo'] = 'asc' + + index_definition_model = {} # IndexDefinition + index_definition_model['default_analyzer'] = analyzer_model + index_definition_model['default_field'] = index_text_operator_default_field_model + index_definition_model['fields'] = [index_field_model] + index_definition_model['index_array_lengths'] = True + index_definition_model['partial_filter_selector'] = {'anyKey': 'anyValue'} + + index_information_model = {} # IndexInformation + index_information_model['ddoc'] = 'testString' + index_information_model['def'] = index_definition_model + index_information_model['name'] = 'testString' + index_information_model['partitioned'] = True + index_information_model['type'] = 'json' + + # Construct a json representation of a IndexCandidate model + index_candidate_model_json = {} + index_candidate_model_json['analysis'] = index_analysis_model + index_candidate_model_json['index'] = index_information_model + + # Construct a model instance of IndexCandidate by calling from_dict on the json representation + index_candidate_model = IndexCandidate.from_dict(index_candidate_model_json) + assert index_candidate_model != False + + # Construct a model instance of IndexCandidate by calling from_dict on the json representation + index_candidate_model_dict = IndexCandidate.from_dict(index_candidate_model_json).__dict__ + index_candidate_model2 = IndexCandidate(**index_candidate_model_dict) + + # Verify the model instances are equivalent + assert index_candidate_model == index_candidate_model2 + + # Convert model instance back to dict and verify no loss of data + index_candidate_model_json2 = index_candidate_model.to_dict() + assert index_candidate_model_json2 == index_candidate_model_json + + class TestModel_IndexDefinition: """ Test Class for IndexDefinition @@ -17155,6 +17312,38 @@ def test_security_object_serialization(self): assert security_object_model_json2 == security_object_model_json +class TestModel_SelectorHint: + """ + Test Class for SelectorHint + """ + + def test_selector_hint_serialization(self): + """ + Test serialization/deserialization for SelectorHint + """ + + # Construct a json representation of a SelectorHint model + selector_hint_model_json = {} + selector_hint_model_json['indexable_fields'] = ['testString'] + selector_hint_model_json['type'] = 'json' + selector_hint_model_json['unindexable_fields'] = ['testString'] + + # Construct a model instance of SelectorHint by calling from_dict on the json representation + selector_hint_model = SelectorHint.from_dict(selector_hint_model_json) + assert selector_hint_model != False + + # Construct a model instance of SelectorHint by calling from_dict on the json representation + selector_hint_model_dict = SelectorHint.from_dict(selector_hint_model_json).__dict__ + selector_hint_model2 = SelectorHint(**selector_hint_model_dict) + + # Verify the model instances are equivalent + assert selector_hint_model == selector_hint_model2 + + # Convert model instance back to dict and verify no loss of data + selector_hint_model_json2 = selector_hint_model.to_dict() + assert selector_hint_model_json2 == selector_hint_model_json + + class TestModel_ServerInformation: """ Test Class for ServerInformation From c0a339b89eae9023205184760a82ed19e5c73b01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:13:13 +0000 Subject: [PATCH 289/669] build(deps): Bump myst-parser from 2.0.0 to 3.0.0 Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/executablebooks/MyST-Parser/compare/v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index e43f6859..d8fc2a07 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 Sphinx==7.3.7 sphinx-autodoc2==0.5.0 -myst-parser==2.0.0 +myst-parser==3.0.0 sphinx-rtd-theme==2.0.0 From 8907ab486b723d593dc73c451c72da1d34bf6e67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:32:44 +0000 Subject: [PATCH 290/669] build(deps-dev): Bump coverage from 7.4.4 to 7.5.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.4 to 7.5.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.4...7.5.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 605ada69..c905c9c4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 # code coverage -coverage==7.4.4 +coverage==7.5.0 pytest-cov==5.0.0 From 20a75ea16e7ee2381263da4e5e4d5541a8ac2aad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:52:17 +0000 Subject: [PATCH 291/669] build(deps-dev): Bump pytest from 8.1.1 to 8.2.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c905c9c4..84e0e818 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.1.1 +pytest==8.2.0 responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 From abb8803e8ee12fee15defd0f2e43553d397e774f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:13:46 +0000 Subject: [PATCH 292/669] build(deps): Bump myst-parser from 3.0.0 to 3.0.1 Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/executablebooks/MyST-Parser/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index d8fc2a07..5a7f4097 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 Sphinx==7.3.7 sphinx-autodoc2==0.5.0 -myst-parser==3.0.0 +myst-parser==3.0.1 sphinx-rtd-theme==2.0.0 From ec4e799c1657fedab6340136bb69bd4444b90f9e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 1 May 2024 11:51:39 +0000 Subject: [PATCH 293/669] build(generated): switch to new exemplum's embedmd command for READMEs transform Generated SDK source code using: - Generator version 3.89.1 - Specification version 1.0.0-dev0.1.8 - Automation (cloudant-sdks) version 1b24c25 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- examples/README.md | 587 +++++++++++++++++++++++++++++---------------- 1 file changed, 377 insertions(+), 210 deletions(-) diff --git a/examples/README.md b/examples/README.md index 60cfbaff..d1f43e5a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,9 +4,11 @@ _GET `/`_ -### [Example request](./snippets/getServerInformation/example_request.py) +### [Example request](snippets/getServerInformation/example_request.py) -```python +[embedmd]:# (snippets/getServerInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -20,9 +22,11 @@ print(response) _GET `/_active_tasks`_ -### [Example request](./snippets/getActiveTasks/example_request.py) +### [Example request](snippets/getActiveTasks/example_request.py) -```python +[embedmd]:# (snippets/getActiveTasks/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -36,9 +40,11 @@ print(response) _GET `/_all_dbs`_ -### [Example request](./snippets/getAllDbs/example_request.py) +### [Example request](snippets/getAllDbs/example_request.py) -```python +[embedmd]:# (snippets/getAllDbs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -52,9 +58,11 @@ print(response) _POST `/_api/v2/api_keys`_ -### [Example request](./snippets/postApiKeys/example_request.py) +### [Example request](snippets/postApiKeys/example_request.py) -```python +[embedmd]:# (snippets/postApiKeys/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -68,9 +76,11 @@ print(response) _PUT `/_api/v2/db/{db}/_security`_ -### [Example request](./snippets/putCloudantSecurity/example_request.py) +### [Example request](snippets/putCloudantSecurity/example_request.py) -```python +[embedmd]:# (snippets/putCloudantSecurity/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -82,19 +92,21 @@ response = service.put_cloudant_security_configuration( ).get_result() print(response) +# section: markdown +# The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if the `nobody` user has the role `_reader`. +# section: markdown +# If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB `_users` database (that is using legacy credentials _and_ the `couchdb_auth_only:true` option) then be aware that the user must already exist in `_users` database before adding permissions. For information on the `_users` database, see Using the `_users` database with Cloudant. ``` -The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if the `nobody` user has the role `_reader`. - -If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB `_users` database (that is using legacy credentials _and_ the `couchdb_auth_only:true` option) then be aware that the user must already exist in `_users` database before adding permissions. For information on the `_users` database, see Using the `_users` database with Cloudant. - ## getActivityTrackerEvents _GET `/_api/v2/user/activity_tracker/events`_ -### [Example request](./snippets/getActivityTrackerEvents/example_request.py) +### [Example request](snippets/getActivityTrackerEvents/example_request.py) -```python +[embedmd]:# (snippets/getActivityTrackerEvents/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -108,9 +120,11 @@ print(response) _POST `/_api/v2/user/activity_tracker/events`_ -### [Example request](./snippets/postActivityTrackerEvents/example_request.py) +### [Example request](snippets/postActivityTrackerEvents/example_request.py) -```python +[embedmd]:# (snippets/postActivityTrackerEvents/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -126,9 +140,11 @@ print(response) _GET `/_api/v2/user/capacity/throughput`_ -### [Example request](./snippets/getCapacityThroughputInformation/example_request.py) +### [Example request](snippets/getCapacityThroughputInformation/example_request.py) -```python +[embedmd]:# (snippets/getCapacityThroughputInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -142,9 +158,11 @@ print(response) _PUT `/_api/v2/user/capacity/throughput`_ -### [Example request](./snippets/putCapacityThroughputConfiguration/example_request.py) +### [Example request](snippets/putCapacityThroughputConfiguration/example_request.py) -```python +[embedmd]:# (snippets/putCapacityThroughputConfiguration/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -160,9 +178,11 @@ print(response) _GET `/_api/v2/user/config/cors`_ -### [Example request](./snippets/getCorsInformation/example_request.py) +### [Example request](snippets/getCorsInformation/example_request.py) -```python +[embedmd]:# (snippets/getCorsInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -176,9 +196,11 @@ print(response) _PUT `/_api/v2/user/config/cors`_ -### [Example request](./snippets/putCorsConfiguration/example_request.py) +### [Example request](snippets/putCorsConfiguration/example_request.py) -```python +[embedmd]:# (snippets/putCorsConfiguration/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -195,9 +217,11 @@ print(response) _GET `/_api/v2/user/current/throughput`_ -### [Example request](./snippets/getCurrentThroughputInformation/example_request.py) +### [Example request](snippets/getCurrentThroughputInformation/example_request.py) -```python +[embedmd]:# (snippets/getCurrentThroughputInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -211,9 +235,11 @@ print(response) _GET `/_db_updates`_ -### [Example request](./snippets/getDbUpdates/example_request.py) +### [Example request](snippets/getDbUpdates/example_request.py) -```python +[embedmd]:# (snippets/getDbUpdates/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -225,17 +251,19 @@ response = service.get_db_updates( ).get_result() print(response) +# section: markdown +# This request requires `server_admin` access. ``` -This request requires `server_admin` access. - ## postDbsInfo _POST `/_dbs_info`_ -### [Example request](./snippets/postDbsInfo/example_request.py) +### [Example request](snippets/postDbsInfo/example_request.py) -```python +[embedmd]:# (snippets/postDbsInfo/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -251,9 +279,11 @@ print(response) _GET `/_membership`_ -### [Example request](./snippets/getMembershipInformation/example_request.py) +### [Example request](snippets/getMembershipInformation/example_request.py) -```python +[embedmd]:# (snippets/getMembershipInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -267,9 +297,11 @@ print(response) _DELETE `/_replicator/{doc_id}`_ -### [Example request](./snippets/deleteReplicationDocument/example_request.py) +### [Example request](snippets/deleteReplicationDocument/example_request.py) -```python +[embedmd]:# (snippets/deleteReplicationDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -286,9 +318,11 @@ print(response) _GET `/_replicator/{doc_id}`_ -### [Example request](./snippets/getReplicationDocument/example_request.py) +### [Example request](snippets/getReplicationDocument/example_request.py) -```python +[embedmd]:# (snippets/getReplicationDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -304,9 +338,11 @@ print(response) _HEAD `/_replicator/{doc_id}`_ -### [Example request](./snippets/headReplicationDocument/example_request.py) +### [Example request](snippets/headReplicationDocument/example_request.py) -```python +[embedmd]:# (snippets/headReplicationDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -322,9 +358,11 @@ print(response.get_headers()['ETag']) _PUT `/_replicator/{doc_id}`_ -### [Example request](./snippets/putReplicationDocument/example_request.py) +### [Example request](snippets/putReplicationDocument/example_request.py) -```python +[embedmd]:# (snippets/putReplicationDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1, ReplicationDocument, ReplicationDatabase, ReplicationDatabaseAuthIam, ReplicationDatabaseAuth service = CloudantV1.new_instance() @@ -363,9 +401,11 @@ print(response) _GET `/_scheduler/docs`_ -### [Example request](./snippets/getSchedulerDocs/example_request.py) +### [Example request](snippets/getSchedulerDocs/example_request.py) -```python +[embedmd]:# (snippets/getSchedulerDocs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -382,9 +422,11 @@ print(response) _GET `/_scheduler/docs/_replicator/{doc_id}`_ -### [Example request](./snippets/getSchedulerDocument/example_request.py) +### [Example request](snippets/getSchedulerDocument/example_request.py) -```python +[embedmd]:# (snippets/getSchedulerDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -398,9 +440,11 @@ print(response) _GET `/_scheduler/jobs`_ -### [Example request](./snippets/getSchedulerJobs/example_request.py) +### [Example request](snippets/getSchedulerJobs/example_request.py) -```python +[embedmd]:# (snippets/getSchedulerJobs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -416,9 +460,11 @@ print(response) _GET `/_scheduler/jobs/{job_id}`_ -### [Example request](./snippets/getSchedulerJob/example_request.py) +### [Example request](snippets/getSchedulerJob/example_request.py) -```python +[embedmd]:# (snippets/getSchedulerJob/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -434,9 +480,11 @@ print(response) _HEAD `/_scheduler/jobs/{job_id}`_ -### [Example request](./snippets/headSchedulerJob/example_request.py) +### [Example request](snippets/headSchedulerJob/example_request.py) -```python +[embedmd]:# (snippets/headSchedulerJob/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -452,9 +500,11 @@ print(response.get_status_code()) _POST `/_search_analyze`_ -### [Example request](./snippets/postSearchAnalyze/example_request.py) +### [Example request](snippets/postSearchAnalyze/example_request.py) -```python +[embedmd]:# (snippets/postSearchAnalyze/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -471,9 +521,11 @@ print(response) _GET `/_session`_ -### [Example request](./snippets/getSessionInformation/example_request.py) +### [Example request](snippets/getSessionInformation/example_request.py) -```python +[embedmd]:# (snippets/getSessionInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -481,17 +533,19 @@ service = CloudantV1.new_instance() response = service.get_session_information().get_result() print(response) +# section: markdown +# For more details on Session Authentication, see [Authentication.](#authentication) ``` -For more details on Session Authentication, see [Authentication.](#authentication) - ## getUpInformation _GET `/_up`_ -### [Example request](./snippets/getUpInformation/example_request.py) +### [Example request](snippets/getUpInformation/example_request.py) -```python +[embedmd]:# (snippets/getUpInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -505,9 +559,11 @@ print(response) _GET `/_uuids`_ -### [Example request](./snippets/getUuids/example_request.py) +### [Example request](snippets/getUuids/example_request.py) -```python +[embedmd]:# (snippets/getUuids/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -521,9 +577,11 @@ print(response) _DELETE `/{db}`_ -### [Example request](./snippets/deleteDatabase/example_request.py) +### [Example request](snippets/deleteDatabase/example_request.py) -```python +[embedmd]:# (snippets/deleteDatabase/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -537,9 +595,11 @@ print(response) _GET `/{db}`_ -### [Example request](./snippets/getDatabaseInformation/example_request.py) +### [Example request](snippets/getDatabaseInformation/example_request.py) -```python +[embedmd]:# (snippets/getDatabaseInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -553,9 +613,11 @@ print(response) _HEAD `/{db}`_ -### [Example request](./snippets/headDatabase/example_request.py) +### [Example request](snippets/headDatabase/example_request.py) -```python +[embedmd]:# (snippets/headDatabase/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -568,9 +630,11 @@ print(response.get_status_code()) _POST `/{db}`_ -### [Example request](./snippets/postDocument/example_request.py) +### [Example request](snippets/postDocument/example_request.py) -```python +[embedmd]:# (snippets/postDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() @@ -594,9 +658,11 @@ print(response) _PUT `/{db}`_ -### [Example request](./snippets/putDatabase/example_request.py) +### [Example request](snippets/putDatabase/example_request.py) -```python +[embedmd]:# (snippets/putDatabase/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -610,9 +676,11 @@ print(response) _POST `/{db}/_all_docs`_ -### [Example request](./snippets/postAllDocs/example_request.py) +### [Example request](snippets/postAllDocs/example_request.py) -```python +[embedmd]:# (snippets/postAllDocs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -627,9 +695,11 @@ response = service.post_all_docs( print(response) ``` -### [Example request as a stream](./snippets/postAllDocs/example_request_as_a_stream.py) +### [Example request as a stream](snippets/postAllDocs/example_request_as_a_stream.py) -```python +[embedmd]:# (snippets/postAllDocs/example_request_as_a_stream.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -650,9 +720,11 @@ with open('result.json', 'wb') as f: _POST `/{db}/_all_docs/queries`_ -### [Example request](./snippets/postAllDocsQueries/example_request.py) +### [Example request](snippets/postAllDocsQueries/example_request.py) -```python +[embedmd]:# (snippets/postAllDocsQueries/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 service = CloudantV1.new_instance() @@ -678,9 +750,11 @@ print(response) _POST `/{db}/_bulk_docs`_ -### [Example request: create documents](./snippets/postBulkDocs/example_request_create_documents.py) +### [Example request: create documents](snippets/postBulkDocs/example_request_create_documents.py) -```python +[embedmd]:# (snippets/postBulkDocs/example_request_create_documents.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() @@ -712,9 +786,11 @@ response = service.post_bulk_docs( print(response) ``` -### [Example request: delete documents](./snippets/postBulkDocs/example_request_delete_documents.py) +### [Example request: delete documents](snippets/postBulkDocs/example_request_delete_documents.py) -```python +[embedmd]:# (snippets/postBulkDocs/example_request_delete_documents.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() @@ -740,9 +816,11 @@ response = service.post_bulk_docs( print(response) ``` -### [Example request as a stream](./snippets/postBulkDocs/example_request_as_a_stream.py) +### [Example request as a stream](snippets/postBulkDocs/example_request_as_a_stream.py) -```python +[embedmd]:# (snippets/postBulkDocs/example_request_as_a_stream.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() @@ -754,10 +832,9 @@ with open('upload.json', 'rb') as f: ).get_result() print(response) -``` - -Content of upload.json -```python +# section: markdown +# Content of upload.json +# section: code { "docs": [ { @@ -784,9 +861,11 @@ Content of upload.json _POST `/{db}/_bulk_get`_ -### [Example request](./snippets/postBulkGet/example_request.py) +### [Example request](snippets/postBulkGet/example_request.py) -```python +[embedmd]:# (snippets/postBulkGet/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 service = CloudantV1.new_instance() @@ -807,9 +886,11 @@ response = service.post_bulk_get( print(response) ``` -### [Alternative example request for `open_revs=all`](./snippets/postBulkGet/alternative_example_request_for_open_revs_all.py) +### [Alternative example request for `open_revs=all`](snippets/postBulkGet/alternative_example_request_for_open_revs_all.py) -```python +[embedmd]:# (snippets/postBulkGet/alternative_example_request_for_open_revs_all.py) +```py +# section: code from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 service = CloudantV1.new_instance() @@ -823,9 +904,11 @@ response = service.post_bulk_get( print(response) ``` -### [Alternative example request for `atts_since`](./snippets/postBulkGet/alternative_example_request_for_atts_since.py) +### [Alternative example request for `atts_since`](snippets/postBulkGet/alternative_example_request_for_atts_since.py) -```python +[embedmd]:# (snippets/postBulkGet/alternative_example_request_for_atts_since.py) +```py +# section: code from ibmcloudant.cloudant_v1 import BulkGetQueryDocument, CloudantV1 service = CloudantV1.new_instance() @@ -845,9 +928,11 @@ print(response) _POST `/{db}/_changes`_ -### [Example request](./snippets/postChanges/example_request.py) +### [Example request](snippets/postChanges/example_request.py) -```python +[embedmd]:# (snippets/postChanges/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -858,9 +943,11 @@ response = service.post_changes( print(response) ``` -### [Example request as a stream](./snippets/postChanges/example_request_as_a_stream.py) +### [Example request as a stream](snippets/postChanges/example_request_as_a_stream.py) -```python +[embedmd]:# (snippets/postChanges/example_request_as_a_stream.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -878,9 +965,11 @@ with open('result.json', 'wb') as f: _DELETE `/{db}/_design/{ddoc}`_ -### [Example request](./snippets/deleteDesignDocument/example_request.py) +### [Example request](snippets/deleteDesignDocument/example_request.py) -```python +[embedmd]:# (snippets/deleteDesignDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -898,9 +987,11 @@ print(response) _GET `/{db}/_design/{ddoc}`_ -### [Example request](./snippets/getDesignDocument/example_request.py) +### [Example request](snippets/getDesignDocument/example_request.py) -```python +[embedmd]:# (snippets/getDesignDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -918,9 +1009,11 @@ print(response) _HEAD `/{db}/_design/{ddoc}`_ -### [Example request](./snippets/headDesignDocument/example_request.py) +### [Example request](snippets/headDesignDocument/example_request.py) -```python +[embedmd]:# (snippets/headDesignDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -937,9 +1030,11 @@ print(response.get_headers()['ETag']) _PUT `/{db}/_design/{ddoc}`_ -### [Example request](./snippets/putDesignDocument/example_request.py) +### [Example request](snippets/putDesignDocument/example_request.py) -```python +[embedmd]:# (snippets/putDesignDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Analyzer, AnalyzerConfiguration, CloudantV1, DesignDocument, DesignDocumentOptions, DesignDocumentViewsMapReduce, SearchIndexDefinition service = CloudantV1.new_instance() @@ -993,17 +1088,19 @@ response = service.put_design_document( ).get_result() print(response) +# section: markdown +# This example creates `allusers` design document in the `users` database and `appliances` design document in the partitioned `products` database. ``` -This example creates `allusers` design document in the `users` database and `appliances` design document in the partitioned `products` database. - ## getDesignDocumentInformation _GET `/{db}/_design/{ddoc}/_info`_ -### [Example request](./snippets/getDesignDocumentInformation/example_request.py) +### [Example request](snippets/getDesignDocumentInformation/example_request.py) -```python +[embedmd]:# (snippets/getDesignDocumentInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1020,9 +1117,11 @@ print(response) _POST `/{db}/_design/{ddoc}/_search/{index}`_ -### [Example request](./snippets/postSearch/example_request.py) +### [Example request](snippets/postSearch/example_request.py) -```python +[embedmd]:# (snippets/postSearch/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1035,17 +1134,19 @@ response = service.post_search( ).get_result() print(response) +# section: markdown +# This example requires the `activeUsers` Cloudant Search index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ``` -This example requires the `activeUsers` Cloudant Search index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) - ## getSearchInfo _GET `/{db}/_design/{ddoc}/_search_info/{index}`_ -### [Example request](./snippets/getSearchInfo/example_request.py) +### [Example request](snippets/getSearchInfo/example_request.py) -```python +[embedmd]:# (snippets/getSearchInfo/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1057,17 +1158,19 @@ response = service.get_search_info( ).get_result() print(response) +# section: markdown +# This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ``` -This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) - ## postView _POST `/{db}/_design/{ddoc}/_view/{view}`_ -### [Example request](./snippets/postView/example_request.py) +### [Example request](snippets/postView/example_request.py) -```python +[embedmd]:# (snippets/postView/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1079,17 +1182,19 @@ response = service.post_view( ).get_result() print(response) +# section: markdown +# This example requires the `getVerifiedEmails` view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) ``` -This example requires the `getVerifiedEmails` view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) - ## postViewQueries _POST `/{db}/_design/{ddoc}/_view/{view}/queries`_ -### [Example request](./snippets/postViewQueries/example_request.py) +### [Example request](snippets/postViewQueries/example_request.py) -```python +[embedmd]:# (snippets/postViewQueries/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1, ViewQuery service = CloudantV1.new_instance() @@ -1111,17 +1216,19 @@ response = service.post_view_queries( ).get_result() print(response) +# section: markdown +# This example requires the `getVerifiedEmails` view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) ``` -This example requires the `getVerifiedEmails` view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) - ## postDesignDocs _POST `/{db}/_design_docs`_ -### [Example request](./snippets/postDesignDocs/example_request.py) +### [Example request](snippets/postDesignDocs/example_request.py) -```python +[embedmd]:# (snippets/postDesignDocs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1138,9 +1245,11 @@ print(response) _POST `/{db}/_design_docs/queries`_ -### [Example request](./snippets/postDesignDocsQueries/example_request.py) +### [Example request](snippets/postDesignDocsQueries/example_request.py) -```python +[embedmd]:# (snippets/postDesignDocsQueries/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 service = CloudantV1.new_instance() @@ -1168,9 +1277,11 @@ print(response) _POST `/{db}/_explain`_ -### [Example request](./snippets/postExplain/example_request.py) +### [Example request](snippets/postExplain/example_request.py) -```python +[embedmd]:# (snippets/postExplain/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1189,9 +1300,11 @@ print(response) _POST `/{db}/_find`_ -### [Example request for "json" index type](./snippets/postFind/example_request_for_json_index_type.py) +### [Example request for "json" index type](snippets/postFind/example_request_for_json_index_type.py) -```python +[embedmd]:# (snippets/postFind/example_request_for_json_index_type.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1204,13 +1317,15 @@ response = service.post_find( limit=3 ).get_result() print(response) +# section: markdown +# This example requires the `getUserByAddress` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) ``` -This example requires the `getUserByAddress` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) +### [Example request for "text" index type](snippets/postFind/example_request_for_text_index_type.py) -### [Example request for "text" index type](./snippets/postFind/example_request_for_text_index_type.py) - -```python +[embedmd]:# (snippets/postFind/example_request_for_text_index_type.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1222,17 +1337,19 @@ response = service.post_find( limit=3 ).get_result() print(response) +# section: markdown +# This example requires the `getUserByVerifiedEmail` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) ``` -This example requires the `getUserByVerifiedEmail` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) - ## getIndexesInformation _GET `/{db}/_index`_ -### [Example request](./snippets/getIndexesInformation/example_request.py) +### [Example request](snippets/getIndexesInformation/example_request.py) -```python +[embedmd]:# (snippets/getIndexesInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1248,9 +1365,11 @@ print(response) _POST `/{db}/_index`_ -### [Example request using "json" type index](./snippets/postIndex/example_request_using_json_type_index.py) +### [Example request using "json" type index](snippets/postIndex/example_request_using_json_type_index.py) -```python +[embedmd]:# (snippets/postIndex/example_request_using_json_type_index.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1, IndexDefinition, IndexField service = CloudantV1.new_instance() @@ -1274,9 +1393,11 @@ response = service.post_index( print(response) ``` -### [Example request using "text" type index](./snippets/postIndex/example_request_using_text_type_index.py) +### [Example request using "text" type index](snippets/postIndex/example_request_using_text_type_index.py) -```python +[embedmd]:# (snippets/postIndex/example_request_using_text_type_index.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1, IndexDefinition, IndexField service = CloudantV1.new_instance() @@ -1305,9 +1426,11 @@ print(response) _DELETE `/{db}/_index/_design/{ddoc}/{type}/{index}`_ -### [Example request](./snippets/deleteIndex/example_request.py) +### [Example request](snippets/deleteIndex/example_request.py) -```python +[embedmd]:# (snippets/deleteIndex/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1320,17 +1443,19 @@ response = service.delete_index( ).get_result() print(response) +# section: markdown +# This example will fail if `getUserByName` index doesn't exist. To create the index, see [Create a new index on a database.](#postindex) ``` -This example will fail if `getUserByName` index doesn't exist. To create the index, see [Create a new index on a database.](#postindex) - ## deleteLocalDocument _DELETE `/{db}/_local/{doc_id}`_ -### [Example request](./snippets/deleteLocalDocument/example_request.py) +### [Example request](snippets/deleteLocalDocument/example_request.py) -```python +[embedmd]:# (snippets/deleteLocalDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1347,9 +1472,11 @@ print(response) _GET `/{db}/_local/{doc_id}`_ -### [Example request](./snippets/getLocalDocument/example_request.py) +### [Example request](snippets/getLocalDocument/example_request.py) -```python +[embedmd]:# (snippets/getLocalDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1366,9 +1493,11 @@ print(response) _PUT `/{db}/_local/{doc_id}`_ -### [Example request](./snippets/putLocalDocument/example_request.py) +### [Example request](snippets/putLocalDocument/example_request.py) -```python +[embedmd]:# (snippets/putLocalDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() @@ -1399,9 +1528,11 @@ print(response) _POST `/{db}/_missing_revs`_ -### [Example request](./snippets/postMissingRevs/example_request.py) +### [Example request](snippets/postMissingRevs/example_request.py) -```python +[embedmd]:# (snippets/postMissingRevs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 service = CloudantV1.new_instance() @@ -1419,9 +1550,11 @@ print(response) _GET `/{db}/_partition/{partition_key}`_ -### [Example request](./snippets/getPartitionInformation/example_request.py) +### [Example request](snippets/getPartitionInformation/example_request.py) -```python +[embedmd]:# (snippets/getPartitionInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1438,9 +1571,11 @@ print(response) _POST `/{db}/_partition/{partition_key}/_all_docs`_ -### [Example request](./snippets/postPartitionAllDocs/example_request.py) +### [Example request](snippets/postPartitionAllDocs/example_request.py) -```python +[embedmd]:# (snippets/postPartitionAllDocs/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1458,9 +1593,11 @@ print(response) _POST `/{db}/_partition/{partition_key}/_design/{ddoc}/_search/{index}`_ -### [Example request](./snippets/postPartitionSearch/example_request.py) +### [Example request](snippets/postPartitionSearch/example_request.py) -```python +[embedmd]:# (snippets/postPartitionSearch/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1474,17 +1611,19 @@ response = service.post_partition_search( ).get_result() print(response) +# section: markdown +# This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ``` -This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) - ## postPartitionView _POST `/{db}/_partition/{partition_key}/_design/{ddoc}/_view/{view}`_ -### [Example request](./snippets/postPartitionView/example_request.py) +### [Example request](snippets/postPartitionView/example_request.py) -```python +[embedmd]:# (snippets/postPartitionView/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1498,17 +1637,19 @@ response = service.post_partition_view( ).get_result() print(response) +# section: markdown +# This example requires the `byApplianceProdId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) ``` -This example requires the `byApplianceProdId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) - ## postPartitionFind _POST `/{db}/_partition/{partition_key}/_find`_ -### [Example request](./snippets/postPartitionFind/example_request.py) +### [Example request](snippets/postPartitionFind/example_request.py) -```python +[embedmd]:# (snippets/postPartitionFind/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1527,9 +1668,11 @@ print(response) _POST `/{db}/_revs_diff`_ -### [Example request](./snippets/postRevsDiff/example_request.py) +### [Example request](snippets/postRevsDiff/example_request.py) -```python +[embedmd]:# (snippets/postRevsDiff/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 service = CloudantV1.new_instance() @@ -1554,9 +1697,11 @@ print(response) _GET `/{db}/_security`_ -### [Example request](./snippets/getSecurity/example_request.py) +### [Example request](snippets/getSecurity/example_request.py) -```python +[embedmd]:# (snippets/getSecurity/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1572,9 +1717,11 @@ print(response) _PUT `/{db}/_security`_ -### [Example request](./snippets/putSecurity/example_request.py) +### [Example request](snippets/putSecurity/example_request.py) -```python +[embedmd]:# (snippets/putSecurity/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1, SecurityObject service = CloudantV1.new_instance() @@ -1590,19 +1737,21 @@ response = service.put_security( ).get_result() print(response) +# section: markdown +# The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if the `nobody` user has the role `_reader`. +# section: markdown +# If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB `_users` database (that is using legacy credentials _and_ the `couchdb_auth_only:true` option) then be aware that the user must already exist in `_users` database before adding permissions. For information on the `_users` database, see Using the `_users` database with Cloudant. ``` -The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but didn't identify itself, the task can continue only if the `nobody` user has the role `_reader`. - -If instead of using Cloudant's security model for managing permissions you opt to use the Apache CouchDB `_users` database (that is using legacy credentials _and_ the `couchdb_auth_only:true` option) then be aware that the user must already exist in `_users` database before adding permissions. For information on the `_users` database, see Using the `_users` database with Cloudant. - ## getShardsInformation _GET `/{db}/_shards`_ -### [Example request](./snippets/getShardsInformation/example_request.py) +### [Example request](snippets/getShardsInformation/example_request.py) -```python +[embedmd]:# (snippets/getShardsInformation/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1618,9 +1767,11 @@ print(response) _GET `/{db}/_shards/{doc_id}`_ -### [Example request](./snippets/getDocumentShardsInfo/example_request.py) +### [Example request](snippets/getDocumentShardsInfo/example_request.py) -```python +[embedmd]:# (snippets/getDocumentShardsInfo/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1637,9 +1788,11 @@ print(response) _DELETE `/{db}/{doc_id}`_ -### [Example request](./snippets/deleteDocument/example_request.py) +### [Example request](snippets/deleteDocument/example_request.py) -```python +[embedmd]:# (snippets/deleteDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1657,9 +1810,11 @@ print(response) _GET `/{db}/{doc_id}`_ -### [Example request](./snippets/getDocument/example_request.py) +### [Example request](snippets/getDocument/example_request.py) -```python +[embedmd]:# (snippets/getDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1676,9 +1831,11 @@ print(response) _HEAD `/{db}/{doc_id}`_ -### [Example request](./snippets/headDocument/example_request.py) +### [Example request](snippets/headDocument/example_request.py) -```python +[embedmd]:# (snippets/headDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1695,9 +1852,11 @@ print(response.get_headers()['ETag']) _PUT `/{db}/{doc_id}`_ -### [Example request](./snippets/putDocument/example_request.py) +### [Example request](snippets/putDocument/example_request.py) -```python +[embedmd]:# (snippets/putDocument/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() @@ -1722,9 +1881,11 @@ print(response) _DELETE `/{db}/{doc_id}/{attachment_name}`_ -### [Example request](./snippets/deleteAttachment/example_request.py) +### [Example request](snippets/deleteAttachment/example_request.py) -```python +[embedmd]:# (snippets/deleteAttachment/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1737,17 +1898,19 @@ response = service.delete_attachment( ).get_result() print(response) +# section: markdown +# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ``` -This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) - ## getAttachment _GET `/{db}/{doc_id}/{attachment_name}`_ -### [Example request](./snippets/getAttachment/example_request.py) +### [Example request](snippets/getAttachment/example_request.py) -```python +[embedmd]:# (snippets/getAttachment/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1759,17 +1922,19 @@ response_attachment = service.get_attachment( ).get_result().content print(response_attachment) +# section: markdown +# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ``` -This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) - ## headAttachment _HEAD `/{db}/{doc_id}/{attachment_name}`_ -### [Example request](./snippets/headAttachment/example_request.py) +### [Example request](snippets/headAttachment/example_request.py) -```python +[embedmd]:# (snippets/headAttachment/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() @@ -1782,17 +1947,19 @@ response = service.head_attachment( print(response.get_status_code()) print(response.get_headers()['Content-Length']) print(response.get_headers()['Content-Type']) +# section: markdown +# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ``` -This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) - ## putAttachment _PUT `/{db}/{doc_id}/{attachment_name}`_ -### [Example request](./snippets/putAttachment/example_request.py) +### [Example request](snippets/putAttachment/example_request.py) -```python +[embedmd]:# (snippets/putAttachment/example_request.py) +```py +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() From 51b62347509b8865f14b4728758fefed6f8b286a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 1 May 2024 15:55:22 +0000 Subject: [PATCH 294/669] fix(generated): correct link to request timeouts section Generated SDK source code using: - Generator version 3.89.1 - Specification version 1.0.0-dev0.1.8 - Automation (cloudant-sdks) version 7b66bb0 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca8df068..c0a2eac0 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ to avoid surprises. - [Session cookie authentication](#session-cookie-authentication) + [Authentication with external configuration](#authentication-with-external-configuration) + [Programmatic authentication](#programmatic-authentication) + * [Automatic retries](#automatic-retries) * [Request timeout configuration](#request-timeout-configuration) * [Code examples](#code-examples) + [1. Create a database and add a document](#1-create-a-database-and-add-a-document) @@ -269,10 +270,16 @@ documentation in the or in the [Python SDK Core document](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md) about authentication. +### Automatic retries + +The SDK supports a generalized retry feature that can automatically retry on common errors. + +The [automatic retries](https://github.com/IBM/ibm-cloud-sdk-common#automatic-retries) section has details on how to enable the retries with default values and customize the retries programmatically or with external configuration. + ### Request timeout configuration No request timeout is defined, but a 2.5m read and a 60s connect timeout are set by default. Be sure to set a request timeout appropriate to your application usage and environment. -The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) section contains details on how to change the value. +The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common#configuring-request-timeouts) section contains details on how to change the value. **Note:** System settings may take precedence over configured timeout values. From c15a443468ef83bc04d8d985d3b62c11ae890592 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 3 May 2024 14:07:41 +0000 Subject: [PATCH 295/669] feat(generated): update API definition to 1.0.0-dev0.1.9 Generated SDK source code using: - Generator version 3.89.1 - Specification version 1.0.0-dev0.1.9 - Automation (cloudant-sdks) version 6e30cd3 Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- ibmcloudant/cloudant_v1.py | 155 ++++++++++-------- stubs/gen-its-mappings.json | 4 +- test/integration/test_cloudant_v1.py | 11 +- test/unit/test_cloudant_v1.py | 235 +++++++++------------------ 4 files changed, 171 insertions(+), 234 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 89366a39..8607de00 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -884,6 +884,8 @@ def get_all_dbs( """ Query a list of all database names in the instance. + Query to retrieve a list of database names from the instance. + :param bool descending: (optional) Query parameter to specify whether to return the documents in descending by key order. :param str end_key: (optional) Query parameter to specify to stop returning @@ -1040,6 +1042,8 @@ def get_database_information( """ Retrieve information about a database. + Retrieve detailed information about the database. + :param str db: Path parameter to specify the database name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -1085,6 +1089,8 @@ def put_database( """ Create a database. + Create a new database with the requested properties. + :param str db: Path parameter to specify the database name. :param bool partitioned: (optional) Query parameter to specify whether to enable database partitions when creating a database. @@ -1159,8 +1165,8 @@ def head_document( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool latest: (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested. :param str rev: (optional) Query parameter to specify a document revision. @@ -2036,8 +2042,8 @@ def delete_document( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. @@ -2112,8 +2118,8 @@ def get_document( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -2215,8 +2221,8 @@ def get_document_as_mixed( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -2318,8 +2324,8 @@ def get_document_as_related( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -2421,8 +2427,8 @@ def get_document_as_stream( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -2522,8 +2528,8 @@ def put_document( :param str doc_id: Path parameter to specify the document ID. :param Document document: HTTP request body for Document operations. :param str content_type: (optional) The type of the input. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. @@ -2618,8 +2624,8 @@ def head_design_document( :param str ddoc: Path parameter to specify the design document name. The design document name is the design document ID excluding the `_design/` prefix. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -2679,8 +2685,8 @@ def delete_design_document( :param str ddoc: Path parameter to specify the design document name. The design document name is the design document ID excluding the `_design/` prefix. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. @@ -2757,8 +2763,8 @@ def get_design_document( :param str ddoc: Path parameter to specify the design document name. The design document name is the design document ID excluding the `_design/` prefix. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -2857,8 +2863,8 @@ def put_design_document( prefix. :param DesignDocument design_document: HTTP request body for DesignDocument operations. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. @@ -2989,7 +2995,6 @@ def post_design_docs( key: Optional[str] = None, keys: Optional[List[str]] = None, start_key: Optional[str] = None, - accept: Optional[str] = None, **kwargs, ) -> DetailedResponse: """ @@ -3028,8 +3033,6 @@ def post_design_docs( :param str key: (optional) Schema for a document ID. :param List[str] keys: (optional) Schema for a list of document IDs. :param str start_key: (optional) Schema for a document ID. - :param str accept: (optional) The type of the response: application/json or - application/octet-stream. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AllDocsResult` object @@ -3037,9 +3040,7 @@ def post_design_docs( if not db: raise ValueError('db must be provided') - headers = { - 'Accept': accept, - } + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -3069,6 +3070,7 @@ def post_design_docs( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' path_param_keys = ['db'] path_param_values = self.encode_path_vars(db) @@ -5566,6 +5568,8 @@ def delete_index( """ Delete an index. + Delete the index functions from the design document and index files on the server. + :param str db: Path parameter to specify the database name. :param str ddoc: Path parameter to specify the design document name. The design document name is the design document ID excluding the `_design/` @@ -6085,8 +6089,8 @@ def head_replication_document( only headers like content length and the revision (ETag header) are returned. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -6227,8 +6231,8 @@ def delete_replication_document( `_replicator` database. :param str doc_id: Path parameter to specify the document ID. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. @@ -6299,8 +6303,8 @@ def get_replication_document( recorded in the document but can be checked via the replication scheduler. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -6393,8 +6397,8 @@ def put_replication_document( :param str doc_id: Path parameter to specify the document ID. :param ReplicationDocument replication_document: HTTP request body for replication operations. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code immediately. @@ -7081,10 +7085,10 @@ def head_attachment( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. :param str attachment_name: Path parameter to specify the attachment name. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param str rev: (optional) Query parameter to specify a document revision. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -7151,8 +7155,8 @@ def delete_attachment( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. :param str attachment_name: Path parameter to specify the attachment name. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str rev: (optional) Query parameter to specify a document revision. :param str batch: (optional) Query parameter to specify whether to store in batch mode. The server will respond with a HTTP 202 Accepted response code @@ -7225,10 +7229,10 @@ def get_attachment( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. :param str attachment_name: Path parameter to specify the attachment name. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param str range: (optional) Header parameter to specify the byte range for a request. This allows the implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB. @@ -7309,8 +7313,8 @@ def put_attachment( :param str attachment_name: Path parameter to specify the attachment name. :param BinaryIO attachment: HTTP request body for attachment operations. :param str content_type: Content-Type of the attachment. - :param str if_match: (optional) Header parameter to specify the document - revision. Alternative to rev query parameter. + :param str if_match: (optional) Header parameter for a conditional HTTP + request matching an ETag. :param str rev: (optional) Query parameter to specify a document revision. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -7385,8 +7389,8 @@ def head_local_document( :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -7506,8 +7510,8 @@ def get_local_document( :param str doc_id: Path parameter to specify the document ID. :param str accept: (optional) The type of the response: application/json, multipart/mixed, multipart/related, or application/octet-stream. - :param str if_none_match: (optional) Header parameter to specify a double - quoted document revision token for cache control. + :param str if_none_match: (optional) Header parameter for a conditional + HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to include attachments bodies in a response. :param bool att_encoding_info: (optional) Query parameter to specify @@ -8176,20 +8180,6 @@ class Batch(str, Enum): OK = 'ok' -class PostDesignDocsEnums: - """ - Enums for post_design_docs parameters. - """ - - class Accept(str, Enum): - """ - The type of the response: application/json or application/octet-stream. - """ - - APPLICATION_JSON = 'application/json' - APPLICATION_OCTET_STREAM = 'application/octet-stream' - - class PostDesignDocsQueriesEnums: """ Enums for post_design_docs_queries parameters. @@ -12183,6 +12173,7 @@ class DocsResultRow: :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). + :param int ref: (optional) An internal error reference (if available). :param Document doc: (optional) Schema for a document. :param str id: (optional) id. :param str key: Document ID. @@ -12197,6 +12188,7 @@ def __init__( caused_by: Optional[str] = None, error: Optional[str] = None, reason: Optional[str] = None, + ref: Optional[int] = None, doc: Optional['Document'] = None, id: Optional[str] = None, value: Optional['DocsResultRowValue'] = None, @@ -12208,6 +12200,7 @@ def __init__( :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). + :param int ref: (optional) An internal error reference (if available). :param Document doc: (optional) Schema for a document. :param str id: (optional) id. :param DocsResultRowValue value: (optional) Value of built-in `/_all_docs` @@ -12216,6 +12209,7 @@ def __init__( self.caused_by = caused_by self.error = error self.reason = reason + self.ref = ref self.doc = doc self.id = id self.key = key @@ -12231,6 +12225,8 @@ def from_dict(cls, _dict: Dict) -> 'DocsResultRow': args['error'] = error if (reason := _dict.get('reason')) is not None: args['reason'] = reason + if (ref := _dict.get('ref')) is not None: + args['ref'] = ref if (doc := _dict.get('doc')) is not None: args['doc'] = Document.from_dict(doc) if (id := _dict.get('id')) is not None: @@ -12257,6 +12253,8 @@ def to_dict(self) -> Dict: _dict['error'] = self.error if hasattr(self, 'reason') and self.reason is not None: _dict['reason'] = self.reason + if hasattr(self, 'ref') and self.ref is not None: + _dict['ref'] = self.ref if hasattr(self, 'doc') and self.doc is not None: if isinstance(self.doc, dict): _dict['doc'] = self.doc @@ -12549,6 +12547,7 @@ class DocumentResult: :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). + :param int ref: (optional) An internal error reference (if available). """ def __init__( @@ -12560,6 +12559,7 @@ def __init__( caused_by: Optional[str] = None, error: Optional[str] = None, reason: Optional[str] = None, + ref: Optional[int] = None, ) -> None: """ Initialize a DocumentResult object. @@ -12570,6 +12570,7 @@ def __init__( :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). + :param int ref: (optional) An internal error reference (if available). """ self.id = id self.rev = rev @@ -12577,6 +12578,7 @@ def __init__( self.caused_by = caused_by self.error = error self.reason = reason + self.ref = ref @classmethod def from_dict(cls, _dict: Dict) -> 'DocumentResult': @@ -12596,6 +12598,8 @@ def from_dict(cls, _dict: Dict) -> 'DocumentResult': args['error'] = error if (reason := _dict.get('reason')) is not None: args['reason'] = reason + if (ref := _dict.get('ref')) is not None: + args['ref'] = ref return cls(**args) @classmethod @@ -12618,6 +12622,8 @@ def to_dict(self) -> Dict: _dict['error'] = self.error if hasattr(self, 'reason') and self.reason is not None: _dict['reason'] = self.reason + if hasattr(self, 'ref') and self.ref is not None: + _dict['ref'] = self.ref return _dict def _to_dict(self): @@ -18416,20 +18422,21 @@ class UpInformation: """ Schema for information about the up state of the server. - :param dict seeds: seeds. + :param dict seeds: (optional) seeds. :param str status: status. """ def __init__( self, - seeds: dict, status: str, + *, + seeds: Optional[dict] = None, ) -> None: """ Initialize a UpInformation object. - :param dict seeds: seeds. :param str status: status. + :param dict seeds: (optional) seeds. """ self.seeds = seeds self.status = status @@ -18440,8 +18447,6 @@ def from_dict(cls, _dict: Dict) -> 'UpInformation': args = {} if (seeds := _dict.get('seeds')) is not None: args['seeds'] = seeds - else: - raise ValueError('Required property \'seeds\' not present in UpInformation JSON') if (status := _dict.get('status')) is not None: args['status'] = status else: @@ -19184,6 +19189,7 @@ class ViewResultRow: :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). + :param int ref: (optional) An internal error reference (if available). :param Document doc: (optional) Schema for a document. :param str id: (optional) Schema for a document ID. :param object key: Schema for any JSON type. @@ -19198,6 +19204,7 @@ def __init__( caused_by: Optional[str] = None, error: Optional[str] = None, reason: Optional[str] = None, + ref: Optional[int] = None, doc: Optional['Document'] = None, id: Optional[str] = None, ) -> None: @@ -19209,12 +19216,14 @@ def __init__( :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). + :param int ref: (optional) An internal error reference (if available). :param Document doc: (optional) Schema for a document. :param str id: (optional) Schema for a document ID. """ self.caused_by = caused_by self.error = error self.reason = reason + self.ref = ref self.doc = doc self.id = id self.key = key @@ -19230,6 +19239,8 @@ def from_dict(cls, _dict: Dict) -> 'ViewResultRow': args['error'] = error if (reason := _dict.get('reason')) is not None: args['reason'] = reason + if (ref := _dict.get('ref')) is not None: + args['ref'] = ref if (doc := _dict.get('doc')) is not None: args['doc'] = Document.from_dict(doc) if (id := _dict.get('id')) is not None: @@ -19258,6 +19269,8 @@ def to_dict(self) -> Dict: _dict['error'] = self.error if hasattr(self, 'reason') and self.reason is not None: _dict['reason'] = self.reason + if hasattr(self, 'ref') and self.ref is not None: + _dict['ref'] = self.ref if hasattr(self, 'doc') and self.doc is not None: if isinstance(self.doc, dict): _dict['doc'] = self.doc diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 6559c367..981ed646 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -1449,7 +1449,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"query\": \"testString\"}", + "equalToJson": "{\"query\": \"name:Jane* AND active:True\"}", "ignoreArrayOrder": false, "ignoreExtraElements": true } @@ -2058,7 +2058,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"query\": \"testString\"}", + "equalToJson": "{\"query\": \"name:Jane* AND active:True\"}", "ignoreArrayOrder": false, "ignoreExtraElements": true } diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index cd0a961e..982eab4a 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -831,7 +831,6 @@ def test_post_design_docs(self): key='testString', keys=['testString'], start_key='0007741142412418284', - accept='application/json', ) assert response.get_status_code() == 200 @@ -1071,7 +1070,7 @@ def test_post_partition_search(self): partition_key='testString', ddoc='testString', index='testString', - query='testString', + query='name:Jane* AND active:True', bookmark='testString', highlight_fields=['testString'], highlight_number=1, @@ -1096,7 +1095,7 @@ def test_post_partition_search_as_stream(self): partition_key='testString', ddoc='testString', index='testString', - query='testString', + query='name:Jane* AND active:True', bookmark='testString', highlight_fields=['testString'], highlight_number=1, @@ -1377,7 +1376,7 @@ def test_post_search(self): db='testString', ddoc='testString', index='testString', - query='testString', + query='name:Jane* AND active:True', bookmark='testString', highlight_fields=['testString'], highlight_number=1, @@ -1407,7 +1406,7 @@ def test_post_search_as_stream(self): db='testString', ddoc='testString', index='testString', - query='testString', + query='name:Jane* AND active:True', bookmark='testString', highlight_fields=['testString'], highlight_number=1, @@ -1543,7 +1542,7 @@ def test_put_replication_document(self): user_context_model = { 'db': 'testString', 'name': 'john', - 'roles': ['researcher'], + 'roles': ['_replicator'], } # Construct a dict representation of a ReplicationDocument model replication_document_model = { diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 4dbb8434..159fc7dd 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1691,7 +1691,7 @@ def test_post_document_all_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.POST, url, @@ -1788,7 +1788,7 @@ def test_post_document_required_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.POST, url, @@ -1877,7 +1877,7 @@ def test_post_document_value_error(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.POST, url, @@ -1966,7 +1966,7 @@ def test_post_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2049,7 +2049,7 @@ def test_post_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2250,7 +2250,7 @@ def test_post_all_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2313,7 +2313,7 @@ def test_post_all_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2504,7 +2504,7 @@ def test_post_bulk_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_docs') - mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}]' + mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}]' responses.add( responses.POST, url, @@ -2595,7 +2595,7 @@ def test_post_bulk_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_bulk_docs') - mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}]' + mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}]' responses.add( responses.POST, url, @@ -2684,7 +2684,7 @@ def test_post_bulk_get_all_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2752,7 +2752,7 @@ def test_post_bulk_get_required_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2805,7 +2805,7 @@ def test_post_bulk_get_value_error(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}, "ok": {"_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"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -3384,7 +3384,7 @@ def test_delete_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -3435,7 +3435,7 @@ def test_delete_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -3475,7 +3475,7 @@ def test_delete_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -4172,7 +4172,7 @@ def test_put_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -4279,7 +4279,7 @@ def test_put_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -4370,7 +4370,7 @@ def test_put_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -4618,7 +4618,7 @@ def test_delete_design_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -4669,7 +4669,7 @@ def test_delete_design_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -4709,7 +4709,7 @@ def test_delete_design_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -4914,7 +4914,7 @@ def test_put_design_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -5044,7 +5044,7 @@ def test_put_design_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -5160,7 +5160,7 @@ def test_put_design_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -5359,7 +5359,7 @@ def test_post_design_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5383,7 +5383,6 @@ def test_post_design_docs_all_params(self): key = 'testString' keys = ['testString'] start_key = '0007741142412418284' - accept = 'application/json' # Invoke method response = _service.post_design_docs( @@ -5401,7 +5400,6 @@ def test_post_design_docs_all_params(self): key=key, keys=keys, start_key=start_key, - accept=accept, headers={}, ) @@ -5437,89 +5435,6 @@ def test_post_design_docs_all_params_with_retries(self): _service.disable_retries() self.test_post_design_docs_all_params() - @responses.activate - def test_post_design_docs_required_params(self): - """ - test_post_design_docs_required_params() - """ - # Set up mock - url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' - responses.add( - responses.POST, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - db = 'testString' - att_encoding_info = False - attachments = False - conflicts = False - descending = False - include_docs = False - inclusive_end = True - limit = 10 - skip = 0 - update_seq = False - end_key = 'testString' - key = 'testString' - keys = ['testString'] - start_key = '0007741142412418284' - - # Invoke method - response = _service.post_design_docs( - db, - att_encoding_info=att_encoding_info, - attachments=attachments, - conflicts=conflicts, - descending=descending, - include_docs=include_docs, - inclusive_end=inclusive_end, - limit=limit, - skip=skip, - update_seq=update_seq, - end_key=end_key, - key=key, - keys=keys, - start_key=start_key, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Decompress gzip compressed request body. - raw_body = responses.calls[0].request.body - responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) - - # Validate body params - req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['att_encoding_info'] == False - assert req_body['attachments'] == False - assert req_body['conflicts'] == False - assert req_body['descending'] == False - assert req_body['include_docs'] == False - assert req_body['inclusive_end'] == True - assert req_body['limit'] == 10 - assert req_body['skip'] == 0 - assert req_body['update_seq'] == False - assert req_body['end_key'] == 'testString' - assert req_body['key'] == 'testString' - assert req_body['keys'] == ['testString'] - assert req_body['start_key'] == '0007741142412418284' - - def test_post_design_docs_required_params_with_retries(self): - # Enable retries and run test_post_design_docs_required_params. - _service.enable_retries() - self.test_post_design_docs_required_params() - - # Disable retries and run test_post_design_docs_required_params. - _service.disable_retries() - self.test_post_design_docs_required_params() - @responses.activate def test_post_design_docs_value_error(self): """ @@ -5527,7 +5442,7 @@ def test_post_design_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5583,7 +5498,7 @@ def test_post_design_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5648,7 +5563,7 @@ def test_post_design_docs_queries_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5711,7 +5626,7 @@ def test_post_design_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5811,7 +5726,7 @@ def test_post_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -5919,7 +5834,7 @@ def test_post_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -6167,7 +6082,7 @@ def test_post_view_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6241,7 +6156,7 @@ def test_post_view_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6589,7 +6504,7 @@ def test_post_partition_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6674,7 +6589,7 @@ def test_post_partition_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6895,7 +6810,7 @@ def test_post_partition_search_all_params(self): partition_key = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -6938,7 +6853,7 @@ def test_post_partition_search_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['query'] == 'testString' + assert req_body['query'] == 'name:Jane* AND active:True' assert req_body['bookmark'] == 'testString' assert req_body['highlight_fields'] == ['testString'] assert req_body['highlight_number'] == 1 @@ -6981,7 +6896,7 @@ def test_post_partition_search_value_error(self): partition_key = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -7043,7 +6958,7 @@ def test_post_partition_search_as_stream_all_params(self): partition_key = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -7086,7 +7001,7 @@ def test_post_partition_search_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['query'] == 'testString' + assert req_body['query'] == 'name:Jane* AND active:True' assert req_body['bookmark'] == 'testString' assert req_body['highlight_fields'] == ['testString'] assert req_body['highlight_number'] == 1 @@ -7135,7 +7050,7 @@ def test_post_partition_search_as_stream_value_error(self): partition_key = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -7183,7 +7098,7 @@ def test_post_partition_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7290,7 +7205,7 @@ def test_post_partition_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -8881,7 +8796,7 @@ def test_post_search_all_params(self): db = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -8935,7 +8850,7 @@ def test_post_search_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['query'] == 'testString' + assert req_body['query'] == 'name:Jane* AND active:True' assert req_body['bookmark'] == 'testString' assert req_body['highlight_fields'] == ['testString'] assert req_body['highlight_number'] == 1 @@ -8983,7 +8898,7 @@ def test_post_search_value_error(self): db = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -9049,7 +8964,7 @@ def test_post_search_as_stream_all_params(self): db = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -9103,7 +9018,7 @@ def test_post_search_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['query'] == 'testString' + assert req_body['query'] == 'name:Jane* AND active:True' assert req_body['bookmark'] == 'testString' assert req_body['highlight_fields'] == ['testString'] assert req_body['highlight_number'] == 1 @@ -9157,7 +9072,7 @@ def test_post_search_as_stream_value_error(self): db = 'testString' ddoc = 'testString' index = 'testString' - query = 'testString' + query = 'name:Jane* AND active:True' bookmark = 'testString' highlight_fields = ['testString'] highlight_number = 1 @@ -9600,7 +9515,7 @@ def test_delete_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -9649,7 +9564,7 @@ def test_delete_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -9687,7 +9602,7 @@ def test_delete_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -9884,7 +9799,7 @@ def test_put_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -9945,7 +9860,7 @@ def test_put_replication_document_all_params(self): user_context_model = {} user_context_model['db'] = 'testString' user_context_model['name'] = 'john' - user_context_model['roles'] = ['researcher'] + user_context_model['roles'] = ['_replicator'] # Construct a dict representation of a ReplicationDocument model replication_document_model = {} @@ -10036,7 +9951,7 @@ def test_put_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -10097,7 +10012,7 @@ def test_put_replication_document_required_params(self): user_context_model = {} user_context_model['db'] = 'testString' user_context_model['name'] = 'john' - user_context_model['roles'] = ['researcher'] + user_context_model['roles'] = ['_replicator'] # Construct a dict representation of a ReplicationDocument model replication_document_model = {} @@ -10174,7 +10089,7 @@ def test_put_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -10235,7 +10150,7 @@ def test_put_replication_document_value_error(self): user_context_model = {} user_context_model['db'] = 'testString' user_context_model['name'] = 'john' - user_context_model['roles'] = ['researcher'] + user_context_model['roles'] = ['_replicator'] # Construct a dict representation of a ReplicationDocument model replication_document_model = {} @@ -11447,7 +11362,7 @@ def test_delete_attachment_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -11500,7 +11415,7 @@ def test_delete_attachment_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -11542,7 +11457,7 @@ def test_delete_attachment_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -11732,7 +11647,7 @@ def test_put_attachment_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -11791,7 +11706,7 @@ def test_put_attachment_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -11842,7 +11757,7 @@ def test_put_attachment_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -12050,7 +11965,7 @@ def test_delete_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -12096,7 +12011,7 @@ def test_delete_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -12136,7 +12051,7 @@ def test_delete_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.DELETE, url, @@ -12322,7 +12237,7 @@ def test_put_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -12421,7 +12336,7 @@ def test_put_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -12512,7 +12427,7 @@ def test_put_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason"}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' responses.add( responses.PUT, url, @@ -13358,6 +13273,7 @@ def test_all_docs_queries_result_serialization(self): docs_result_row_model['caused_by'] = 'testString' docs_result_row_model['error'] = 'testString' docs_result_row_model['reason'] = 'testString' + docs_result_row_model['ref'] = 26 docs_result_row_model['doc'] = document_model docs_result_row_model['id'] = 'testString' docs_result_row_model['key'] = 'testString' @@ -13481,6 +13397,7 @@ def test_all_docs_result_serialization(self): docs_result_row_model['caused_by'] = 'testString' docs_result_row_model['error'] = 'testString' docs_result_row_model['reason'] = 'testString' + docs_result_row_model['ref'] = 26 docs_result_row_model['doc'] = document_model docs_result_row_model['id'] = 'testString' docs_result_row_model['key'] = 'testString' @@ -13762,6 +13679,7 @@ def test_bulk_get_result_serialization(self): document_result_model['caused_by'] = 'testString' document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' + document_result_model['ref'] = 26 attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' @@ -13841,6 +13759,7 @@ def test_bulk_get_result_document_serialization(self): document_result_model['caused_by'] = 'testString' document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' + document_result_model['ref'] = 26 attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' @@ -13913,6 +13832,7 @@ def test_bulk_get_result_item_serialization(self): document_result_model['caused_by'] = 'testString' document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' + document_result_model['ref'] = 26 attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' @@ -14987,6 +14907,7 @@ def test_docs_result_row_serialization(self): docs_result_row_model_json['caused_by'] = 'testString' docs_result_row_model_json['error'] = 'testString' docs_result_row_model_json['reason'] = 'testString' + docs_result_row_model_json['ref'] = 26 docs_result_row_model_json['doc'] = document_model docs_result_row_model_json['id'] = 'testString' docs_result_row_model_json['key'] = 'testString' @@ -15127,6 +15048,7 @@ def test_document_result_serialization(self): document_result_model_json['caused_by'] = 'testString' document_result_model_json['error'] = 'testString' document_result_model_json['reason'] = 'testString' + document_result_model_json['ref'] = 26 # Construct a model instance of DocumentResult by calling from_dict on the json representation document_result_model = DocumentResult.from_dict(document_result_model_json) @@ -17728,6 +17650,7 @@ def test_view_queries_result_serialization(self): view_result_row_model['caused_by'] = 'testString' view_result_row_model['error'] = 'testString' view_result_row_model['reason'] = 'testString' + view_result_row_model['ref'] = 26 view_result_row_model['doc'] = document_model view_result_row_model['id'] = 'testString' view_result_row_model['key'] = 'testString' @@ -17854,6 +17777,7 @@ def test_view_result_serialization(self): view_result_row_model['caused_by'] = 'testString' view_result_row_model['error'] = 'testString' view_result_row_model['reason'] = 'testString' + view_result_row_model['ref'] = 26 view_result_row_model['doc'] = document_model view_result_row_model['id'] = 'testString' view_result_row_model['key'] = 'testString' @@ -17929,6 +17853,7 @@ def test_view_result_row_serialization(self): view_result_row_model_json['caused_by'] = 'testString' view_result_row_model_json['error'] = 'testString' view_result_row_model_json['reason'] = 'testString' + view_result_row_model_json['ref'] = 26 view_result_row_model_json['doc'] = document_model view_result_row_model_json['id'] = 'testString' view_result_row_model_json['key'] = 'testString' From e2053ab12a5351ba30d04e0710544a5d09976fe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 17:38:25 +0000 Subject: [PATCH 296/669] build(deps-dev): Bump coverage from 7.5.0 to 7.5.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.0 to 7.5.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.0...7.5.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 84e0e818..7512c826 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.1.0 # code coverage -coverage==7.5.0 +coverage==7.5.1 pytest-cov==5.0.0 From 24e36d1b147550b6f52bb6ca6174acd91a33dc55 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 7 May 2024 09:48:08 +0000 Subject: [PATCH 297/669] build(generated): update metadata format Generated SDK source code using: - Generator version 3.90.0 - Specification version 1.0.0-dev0.1.9 - Automation (cloudant-sdks) version 1c32f6a Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3be2ed16..bfe45a9f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -192,7 +192,7 @@ def scanCode void defaultInit() { // Default to using bump2version bumpVersion = { isDevRelease -> - newVersion = getNewVersion(isDevRelease, true) + newVersion = getNewVersion(isDevRelease) // Set an env var with the new version env.NEW_SDK_VERSION = newVersion doVersionBump(isDevRelease, newVersion) @@ -202,9 +202,9 @@ void defaultInit() { sh "bump2version --new-version ${newVersion} ${allowDirty ? '--allow-dirty': ''} ${isDevRelease ? '--no-commit' : '--tag --tag-message "Release {new_version}"'} patch" } - getNewVersion = { isDevRelease, includeBuildMeta -> + getNewVersion = { isDevRelease -> // Get a staging or target version and customize with lang specific requirements - return customizeVersion(isDevRelease ? getDevVersion(includeBuildMeta) : getTargetVersion()) + return customizeVersion(isDevRelease ? getDevVersion() : getTargetVersion()) } getTargetVersion = { @@ -218,19 +218,20 @@ void defaultInit() { return version.trim() } - getDevVersion = { includeBuildMeta -> + getDevVersion = { devVersion = getTargetVersion() if (devVersion ==~ /${env.SVRE_RELEASE}/) { - // For a release (e.g. 1.0.0) make a -dev pre-release (e.g. 1.0.0-devTS) - devVersion += "-dev${currentBuild.startTimeInMillis}" + // For a release (e.g. 1.0.0) use a hyphen separator (e.g. 1.0.0-dev) + devVersion += "-" } else if (devVersion ==~ /${env.SVRE_PRE_RELEASE}/) { - // For a pre-release (e.g. 1.0.0-b7), add .dev identifier (e.g. 1.0.0-b7.devTS) - devVersion += ".dev${currentBuild.startTimeInMillis}" - } - if (includeBuildMeta) { - // Add uniqueness and build metadata when requested to dev build versions - devVersion += "+${commitHash}.${currentBuild.number}" + // For a pre-release (e.g. 1.0.0-b7), add dot separator (e.g. 1.0.0-b7.dev) + devVersion += "." } + // Now add dev identifier (a number is required by some package managers) + devVersion += "dev0" + // Add uniqueness with build metadata to dev build versions + devVersion += "+git${commitHash}.${currentBuild.startTimeInMillis}.${currentBuild.number}" + return devVersion } From fa933bd24a11a488a3333ffb97caa70d61bfcc13 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 7 May 2024 10:39:58 +0000 Subject: [PATCH 298/669] Update version 0.8.0 -> 0.8.1 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d68b9b95..cce58dad 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.8.0 +current_version = 0.8.1 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index c0a2eac0..8c2e50fa 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.8.0 +# IBM Cloudant Python SDK Version 0.8.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -123,13 +123,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.8.0" +pip install --upgrade "ibmcloudant>=0.8.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.8.0" +easy_install --upgrade "ibmcloudant>=0.8.1" ``` @@ -609,7 +609,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/examples#examples-for-python). ### Error handling @@ -803,7 +803,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/examples#postchanges) instead of the follower. #### Error suppression @@ -838,7 +838,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/examples#postchanges). #### Checkpointing @@ -1041,7 +1041,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1071,8 +1071,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index be7a7aa6..14616605 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.8.0' +__version__ = '0.8.1' diff --git a/pyproject.toml b/pyproject.toml index fb4a3be4..ac7a52fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.8.0" +version = "0.8.1" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.20.0", From 3a8d248733bcd566bd9eb474ec0aa0afcd24d231 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:27:48 +0000 Subject: [PATCH 299/669] build(deps-dev): Bump pylint from 3.1.0 to 3.1.1 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7512c826..c36c5f83 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.0 responses==0.25.0 python_dotenv==1.0.1 -pylint==3.1.0 +pylint==3.1.1 # code coverage coverage==7.5.1 pytest-cov==5.0.0 From f7c4364ce0bfd9a1347311b9670e208773d5ae18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 17:30:05 +0000 Subject: [PATCH 300/669] build(deps-dev): Bump pylint from 3.1.1 to 3.2.0 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.1.1...v3.2.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c36c5f83..e9077c3e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.0 responses==0.25.0 python_dotenv==1.0.1 -pylint==3.1.1 +pylint==3.2.0 # code coverage coverage==7.5.1 pytest-cov==5.0.0 From d99a853596393f9d37f22939c29dbb06b82f950e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 16 May 2024 16:02:34 +0000 Subject: [PATCH 301/669] refactor(generated): adjust how sdk version constructed for gauge Generated SDK source code using: - Generator version 3.90.1 - Specification version 1.0.0-dev0.1.9 - Automation (cloudant-sdks) version 36fa6dd Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bfe45a9f..f5d69592 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,7 +106,6 @@ pipeline { steps { script { buildResults = null - prefixedSdkVersion = "${testVersionPrefix}${env.NEW_SDK_VERSION}" // For standard builds attempt to run on a matching env.BRANCH_NAME branch first and if it doesn't exist // then fallback to TARGET_GAUGE_RELEASE_BRANCH_NAME if set or env.TARGET_GAUGE_DEFAULT_BRANCH_NAME. @@ -122,14 +121,14 @@ pipeline { try { buildResults = build job: "/${env.SDKS_GAUGE_PIPELINE_PROJECT}/${gaugeBranchName}", parameters: [ string(name: 'SDK_RUN_LANG', value: "$libName"), - string(name: "SDK_VERSION_${libName.toUpperCase()}", value: "$prefixedSdkVersion")] + string(name: "SDK_VERSION_${libName.toUpperCase()}", value: "${env.NEW_SDK_VERSION}")] } catch (hudson.AbortException ae) { // only run build in sdks-gauge default branch if BRANCH_NAME doesn't exist if (ae.getMessage().contains("No item named /${env.SDKS_GAUGE_PIPELINE_PROJECT}/${gaugeBranchName} found")) { echo "No matching branch named '${gaugeBranchName}' in sdks-gauge, building ${fallbackBranchName} branch" build job: "/${env.SDKS_GAUGE_PIPELINE_PROJECT}/${fallbackBranchName}", parameters: [ string(name: 'SDK_RUN_LANG', value: "$libName"), - string(name: "SDK_VERSION_${libName.toUpperCase()}", value: "$prefixedSdkVersion")] + string(name: "SDK_VERSION_${libName.toUpperCase()}", value: "${env.NEW_SDK_VERSION}")] } else { throw ae } @@ -279,7 +278,6 @@ void defaultInit() { // + other customizations void applyCustomizations() { libName = 'python' - testVersionPrefix = '==' customizeVersion = { semverFormatVersion -> // Use a python format version semverFormatVersion.replace('-a','a').replace('-b','b').replace('-rc', 'rc').replace('-','.') From 7f73293e677f403698349cbad882f1ad0fabc13a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 17 May 2024 13:47:42 +0000 Subject: [PATCH 302/669] ci(generated): sign commits and tags Generated SDK source code using: - Generator version 3.90.1 - Specification version 1.0.0-dev0.1.9 - Automation (cloudant-sdks) version 70d619b --- Jenkinsfile | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f5d69592..b5b0af57 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,6 @@ pipeline { regex: /NONE|${globals.SVRE_PRE_RELEASE}/) } environment { - GH_CREDS = credentials('gh-sdks-automation') ARTIFACTORY_CREDS = credentials('artifactory') ARTIFACTORY_URL_UP = "${Artifactory.server('taas-artifactory-upload').getUrl()}" ARTIFACTORY_URL_DOWN = "${Artifactory.server('taas-artifactory').getUrl()}" @@ -26,12 +25,6 @@ pipeline { defaultInit() applyCustomizations() commitHash = "${env.GIT_COMMIT.take(7)}" - sh ''' - git config --global user.email $GH_SDKS_AUTOMATION_MAIL - git config --global user.name $GH_CREDS_USR - git config --global credential.username $GH_CREDS_USR - git config --global credential.helper '!f() { echo password=\$GH_CREDS_PSW; echo; }; f' - ''' } } } @@ -148,10 +141,12 @@ pipeline { } } steps { - // bump the version - bumpVersion(false) - // Push the version bump and release tag - sh 'git push --tags origin HEAD:main' + gitsh('github.com') { + // bump the version + bumpVersion(false) + // Push the version bump and release tag + sh 'git push --tags origin HEAD:main' + } } } stage('Publish[repository]') { From f9b0e2d1a29255685aa3abd262c58615d6948c82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 17:57:37 +0000 Subject: [PATCH 303/669] build(deps-dev): Bump pytest from 8.2.0 to 8.2.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.0 to 8.2.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.0...8.2.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e9077c3e..939e86a2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.2.0 +pytest==8.2.1 responses==0.25.0 python_dotenv==1.0.1 pylint==3.2.0 From 33160e390b080318dd0b4a801cd06b5c1846334d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 20:22:44 +0000 Subject: [PATCH 304/669] build(deps-dev): Bump pylint from 3.2.0 to 3.2.2 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.0 to 3.2.2. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.0...v3.2.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 939e86a2..31059eff 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.1 responses==0.25.0 python_dotenv==1.0.1 -pylint==3.2.0 +pylint==3.2.2 # code coverage coverage==7.5.1 pytest-cov==5.0.0 From 94624545e8573106997756b6f7baec1b1fc521d3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 22 May 2024 15:39:52 +0000 Subject: [PATCH 305/669] feat(generated): update API definition to 1.0.0-dev0.1.11 Generated SDK source code using: - Generator version 3.90.1 - Specification version 1.0.0-dev0.1.11 - Automation (cloudant-sdks) version c3257f9 --- ibmcloudant/cloudant_v1.py | 16 ++++++++++++++++ test/unit/test_cloudant_v1.py | 10 ++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 8607de00..63943f91 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -10840,6 +10840,10 @@ class DatabaseInformation: :param int doc_count: A count of the documents in the specified database. :param int doc_del_count: Number of deleted documents. :param str engine: (optional) The engine used for the database. + :param str instance_start_time: An opaque string to detect whether a database + has been recreated. The field name is for compatibility with old replicator + versions. Do not use the value to infer timing infromation. Typically only used + by replicators. :param DatabaseInformationProps props: Schema for database properties. :param ContentInformationSizes sizes: Schema for size information of content. :param str update_seq: An opaque string that describes the state of the @@ -10857,6 +10861,7 @@ def __init__( disk_format_version: int, doc_count: int, doc_del_count: int, + instance_start_time: str, props: 'DatabaseInformationProps', sizes: 'ContentInformationSizes', update_seq: str, @@ -10879,6 +10884,10 @@ def __init__( the data when it is stored on disk. :param int doc_count: A count of the documents in the specified database. :param int doc_del_count: Number of deleted documents. + :param str instance_start_time: An opaque string to detect whether a + database has been recreated. The field name is for compatibility with old + replicator versions. Do not use the value to infer timing infromation. + Typically only used by replicators. :param DatabaseInformationProps props: Schema for database properties. :param ContentInformationSizes sizes: Schema for size information of content. @@ -10902,6 +10911,7 @@ def __init__( self.doc_count = doc_count self.doc_del_count = doc_del_count self.engine = engine + self.instance_start_time = instance_start_time self.props = props self.sizes = sizes self.update_seq = update_seq @@ -10942,6 +10952,10 @@ def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': raise ValueError('Required property \'doc_del_count\' not present in DatabaseInformation JSON') if (engine := _dict.get('engine')) is not None: args['engine'] = engine + if (instance_start_time := _dict.get('instance_start_time')) is not None: + args['instance_start_time'] = instance_start_time + else: + raise ValueError('Required property \'instance_start_time\' not present in DatabaseInformation JSON') if (props := _dict.get('props')) is not None: args['props'] = DatabaseInformationProps.from_dict(props) else: @@ -10989,6 +11003,8 @@ def to_dict(self) -> Dict: _dict['doc_del_count'] = self.doc_del_count if hasattr(self, 'engine') and self.engine is not None: _dict['engine'] = self.engine + if hasattr(self, 'instance_start_time') and self.instance_start_time is not None: + _dict['instance_start_time'] = self.instance_start_time if hasattr(self, 'props') and self.props is not None: if isinstance(self.props, dict): _dict['props'] = self.props diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 159fc7dd..78ffcf1a 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1147,7 +1147,7 @@ def test_post_dbs_info_all_params(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' responses.add( responses.POST, url, @@ -1192,7 +1192,7 @@ def test_post_dbs_info_value_error(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' responses.add( responses.POST, url, @@ -1316,7 +1316,7 @@ def test_get_database_information_all_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' + mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' responses.add( responses.GET, url, @@ -1354,7 +1354,7 @@ def test_get_database_information_value_error(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' + mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' responses.add( responses.GET, url, @@ -14365,6 +14365,7 @@ def test_database_information_serialization(self): database_information_model_json['doc_count'] = 0 database_information_model_json['doc_del_count'] = 0 database_information_model_json['engine'] = 'testString' + database_information_model_json['instance_start_time'] = 'testString' database_information_model_json['props'] = database_information_props_model database_information_model_json['sizes'] = content_information_sizes_model database_information_model_json['update_seq'] = 'testString' @@ -14565,6 +14566,7 @@ def test_dbs_info_result_serialization(self): database_information_model['doc_count'] = 0 database_information_model['doc_del_count'] = 0 database_information_model['engine'] = 'testString' + database_information_model['instance_start_time'] = 'testString' database_information_model['props'] = database_information_props_model database_information_model['sizes'] = content_information_sizes_model database_information_model['update_seq'] = 'testString' From d548757dd7ea83cc27ebe5fecaa04da677452355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 17:36:43 +0000 Subject: [PATCH 306/669] build(deps-dev): Bump coverage from 7.5.1 to 7.5.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.1 to 7.5.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.1...7.5.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 31059eff..d288f09f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.2.2 # code coverage -coverage==7.5.1 +coverage==7.5.2 pytest-cov==5.0.0 From 23a95af297260128276d526e0a802575b022cfa8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 17:52:35 +0000 Subject: [PATCH 307/669] build(deps-dev): Bump coverage from 7.5.2 to 7.5.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.2 to 7.5.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.2...7.5.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d288f09f..8e8e8818 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.0 python_dotenv==1.0.1 pylint==3.2.2 # code coverage -coverage==7.5.2 +coverage==7.5.3 pytest-cov==5.0.0 From c585281f0b5b67ea37e5ca406d4e531c76912a0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:25:05 +0000 Subject: [PATCH 308/669] build(deps): Bump ibm-cloud-sdk-core from 3.20.0 to 3.20.1 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.20.0 to 3.20.1. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.20.0...v3.20.1) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ac7a52fe..a67d0f8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.8.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.20.0", + "ibm_cloud_sdk_core==3.20.1", "requests>=2.20,<3.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 73c11a6360f67dac815cbbe3539362cb14ac7c3e Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 4 Jun 2024 09:23:55 +0100 Subject: [PATCH 309/669] build(deps): requests between >=2.32.0,<2.32.3 >=2.32.0 for n CVE-2024-35195 fix. <2.32.3 to avoid default certificate loading regression. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a67d0f8e..323ad602 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "0.8.1" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.20.1", - "requests>=2.20,<3.0", + "requests>=2.32.0,<2.32.3", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", ] From 9d49d4aa30230b8e8fbc8d7f02f6b9ad1dafa75b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:24:33 +0000 Subject: [PATCH 310/669] Update version 0.8.1 -> 0.8.2 --- .bumpversion.cfg | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index cce58dad..6202d15e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.8.1 +current_version = 0.8.2 commit = True message = Update version {current_version} -> {new_version} parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ diff --git a/README.md b/README.md index 8c2e50fa..3b7a9aab 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.8.1 +# IBM Cloudant Python SDK Version 0.8.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -123,13 +123,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.8.1" +pip install --upgrade "ibmcloudant>=0.8.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.8.1" +easy_install --upgrade "ibmcloudant>=0.8.2" ``` @@ -609,7 +609,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/examples#examples-for-python). ### Error handling @@ -803,7 +803,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/examples#postchanges) instead of the follower. #### Error suppression @@ -838,7 +838,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/examples#postchanges). #### Checkpointing @@ -1041,7 +1041,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1071,8 +1071,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.1/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 14616605..7306c686 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.8.1' +__version__ = '0.8.2' diff --git a/pyproject.toml b/pyproject.toml index 323ad602..b252172c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.8.1" +version = "0.8.2" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.20.1", From 1395c1453b825f32cb856887c16551afebd22ea7 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:37:22 +0000 Subject: [PATCH 311/669] ci(generated): sign doc pages commits Generated SDK source code using: - Generator version 3.90.1 - Specification version 1.0.0-dev0.1.11 - Automation (cloudant-sdks) version 9bc028c --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5b0af57..1527bafe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -162,7 +162,9 @@ pipeline { } steps { publishPublic() - publishDocs() + gitsh('github.com') { + publishDocs() + } } } } From 73c26ec7c58336c36e1d68caa2f22826e119e023 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:05:23 -0300 Subject: [PATCH 312/669] build(deps-dev): Bump pytest from 8.2.1 to 8.2.2 (#662) Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.2.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8e8e8818..bfd2e0a5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.2.1 +pytest==8.2.2 responses==0.25.0 python_dotenv==1.0.1 pylint==3.2.2 From cec10151230f05424062c617ad9bdf2de2079077 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 5 Jun 2024 13:43:33 +0000 Subject: [PATCH 313/669] ci(generated): switch from markdown-toc to exemplum Generated SDK source code using: - Generator version 3.90.1 - Specification version 1.0.0-dev0.1.11 - Automation (cloudant-sdks) version 873334c --- README.md | 122 +++++++++++++++--------------------------------------- 1 file changed, 34 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 3b7a9aab..8b2f7377 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,7 @@ to avoid surprises.
Table of Contents - - - - [Overview](#overview) - [Features](#features) - [Prerequisites](#prerequisites) @@ -76,8 +67,6 @@ to avoid surprises. - [Contributing](#contributing) - [License](#license) - -
## Overview @@ -98,8 +87,8 @@ project: - Supported by IBM Cloudant. - Server compatibility with: - - IBM Cloudant. - - [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. + - IBM Cloudant. + - [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. - Includes all the most popular and latest supported endpoints for applications. - Handles the authentication. @@ -117,7 +106,6 @@ project: server. - Python 3.8 or above. - ## Installation To install, use `pip` or `easy_install`: @@ -132,50 +120,35 @@ or easy_install --upgrade "ibmcloudant>=0.8.2" ``` - ## Using the SDK For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) documentation. This library requires configuration with a service URL and -[Cloudant service credentials][service-credentials] to authenticate with your +[Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) to authenticate with your account. There are several ways to **set** these authentication properties: 1. As [environment variables](#authentication-with-environment-variables) -1. The [programmatic approach](#programmatic-authentication) -1. With an [external credentials file](#authentication-with-external-configuration) +2. The [programmatic approach](#programmatic-authentication) +3. With an [external credentials file](#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -[service-credentials]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials -[cloud-IAM-mgmt]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai -[couch-cookie-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication -[cloudant-cookie-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication -[couch-basic-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication -[couch-jwt-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication -[cloudant-basic-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication -[cloudant-legacy-api-keys]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys -[core-container-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication -[core-vpc-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication -[core-iam-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication -[core-bearer-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication -[core-basic-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication -[core-no-auth]: https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication This library requires credentials to authenticate with IBM Cloudant. These credentials may be: * IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`) - * [IBM Cloud account][cloud-IAM-mgmt] user, service ID or trusted profile credentials - that have been granted access to the IBM Cloud Cloudant resource instance. - * [IBM Cloudant service credentials][service-credentials] generated by the IBM Cloud Cloudant resource instance. + * [IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai) user, service ID or trusted profile credentials + that have been granted access to the IBM Cloud Cloudant resource instance. + * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance. * Username and password credentials (can be used with authentication types `COUCHDB_SESSION` and `BASIC`) - * [IBM Cloudant service credentials][service-credentials] generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`. - * IBM Cloudant [legacy credentials][cloudant-basic-auth] (i.e. username and password) for instances not in IBM Cloud. - * IBM Cloudant [legacy API keys][cloudant-legacy-api-keys]. + * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`. + * IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (i.e. username and password) for instances not in IBM Cloud. + * IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys). For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types must be used. @@ -186,13 +159,13 @@ from the first row in the table that is compatible with your environment. | Authentication type | Recommended for | `AUTH_TYPE` | Description | | --- | --- | --- | --- | -| IAM Trusted Profiles compute resource ([container][core-container-auth]) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| IAM Trusted Profiles compute resource ([VPC][core-vpc-auth]) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| [IAM API key][core-iam-auth] | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| [Session cookie](#session-cookie-authentication) | [Cloudant][cloudant-cookie-auth]
(legacy credentials & instances without IAM)

[Apache CouchDB][couch-cookie-auth] | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | -| [Bearer token][core-bearer-auth] | [Apache CouchDB][couch-jwt-auth]
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | -| [Basic][core-basic-auth] | [Apache CouchDB][couch-basic-auth]
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | -| [None][core-no-auth] | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | +| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| [Session cookie](#session-cookie-authentication) | [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication)
(legacy credentials & instances without IAM)

[Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication) | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | +| [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication)
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | +| [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication)
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | +| [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`. @@ -207,7 +180,7 @@ and the same prefix is used for all configuration options. For Cloudant *IAM API key authentication*, set the following environmental variables by replacing the `` and `` with your proper -[service credentials][service-credentials]. There is no need to set +[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set `CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when an `APIKEY` is set. ```bash @@ -245,7 +218,7 @@ Alternatively a profile CRN may be used instead of an ID by replacing `CLOUDANT_ For `COUCHDB_SESSION` authentication, set the following environmental variables by replacing the ``, `` and `` with your proper -[service credentials][service-credentials]. +[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). ```bash CLOUDANT_AUTH_TYPE=COUCHDB_SESSION @@ -306,7 +279,6 @@ you must use your defined service name as the prefix for all Cloudant related en Once the environment variables are set, you can try out the code examples. -[embedmd]:# (test/examples/src/create_db_and_doc.py /from ibm_cloud_sdk_core import/ $) ```py from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1, Document @@ -367,7 +339,6 @@ print(f'You have created the document:\n{example_document}') When you run the code, you see a result similar to the following output. -[embedmd]:# (test/examples/output/create_db_and_doc.txt) ```txt "orders" database created. You have created the document: @@ -390,7 +361,6 @@ database or 'example' document was not found."
Gather database information example -[embedmd]:# (test/examples/src/get_info_from_existing_database.py /import/ $) ```py import json @@ -428,11 +398,9 @@ print(f'Document retrieved from database:\n' f'{json.dumps(document_example, indent=2)}') ``` -
When you run the code, you see a result similar to the following output. -[embedmd]:# (test/examples/output/get_info_from_existing_database.txt) ```txt Server Version: 2.1.1 Document count in "orders" database is 1. @@ -456,7 +424,6 @@ database or 'example' document was not found."
Update code example -[embedmd]:# (test/examples/src/update_doc.py /import/ $) ```py import json @@ -538,11 +505,9 @@ except ApiException as ae: 'document was not found.') ``` -
When you run the code, you see a result similar to the following output. -[embedmd]:# (test/examples/output/update_doc.txt) ```txt { "_id": "example", @@ -563,7 +528,6 @@ database or 'example' document was not found."
Delete code example -[embedmd]:# (test/examples/src/delete_doc.py /from ibm_cloud_sdk_core import/ $) ```py from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1 @@ -598,11 +562,9 @@ except ApiException as ae: 'document was not found.') ``` -
When you run the code, you see the following output. -[embedmd]:# (test/examples/output/delete_doc.txt) ```txt You have deleted the document. ``` @@ -653,7 +615,6 @@ This SDK supports two possible formats to define an HTTP request. One approach u
Example using model class structure -[embedmd]:# (test/examples/src/model_vs_dict/put_ddoc_class.py /from/ $) ```py from ibmcloudant.cloudant_v1 import DesignDocument, CloudantV1, DesignDocumentOptions, SearchIndexDefinition @@ -686,7 +647,6 @@ print(response)
Same example using dictionary structure -[embedmd]:# (test/examples/src/model_vs_dict/put_ddoc_dict.py /from/ $) ```py from ibmcloudant.cloudant_v1 import CloudantV1 @@ -717,7 +677,6 @@ Since model classes and dicts are different data structures, they cannot be comb
This solution will be invalid -[embedmd]:# (test/examples/src/model_vs_dict/put_ddoc_invalid.py /from/ $) ```py from ibmcloudant.cloudant_v1 import CloudantV1, DesignDocument @@ -743,7 +702,6 @@ print(response)
- ### Further resources - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): @@ -773,13 +731,13 @@ to get a better understanding of the limitations and suitable use-cases before u There are two modes of operation: * Start mode - * Fetches the changes from the supplied `since` sequence (by default the feed will start from `now`). - * Fetches all available changes and then continues listening for new changes indefinitely unless encountering an end condition. - * An example use case for this mode is event driven workloads. + * Fetches the changes from the supplied `since` sequence (by default the feed will start from `now`). + * Fetches all available changes and then continues listening for new changes indefinitely unless encountering an end condition. + * An example use case for this mode is event driven workloads. * Start one-off mode - * Fetches the changes from the supplied `since` sequence (by default the feed will start from the beginning). - * Fetches all available changes and then stops when either there are no further changes pending or encountering an end condition. - * An example use case for this mode is ETL style workloads. + * Fetches the changes from the supplied `since` sequence (by default the feed will start from the beginning). + * Fetches all available changes and then stops when either there are no further changes pending or encountering an end condition. + * An example use case for this mode is ETL style workloads. #### Configuring the changes follower @@ -824,12 +782,12 @@ There are some additional points to consider for error suppression: For both modes: * The end conditions are: - * A terminal error (HTTP codes `400`, `401`, `403` `404`). - * Transient errors occur for longer than the error tolerance duration. Transient errors are all other HTTP status codes and connection errors. - * The number of changes received reaches the configured `limit`. - * The feed is terminated early by calling stop. + * A terminal error (HTTP codes `400`, `401`, `403` `404`). + * Transient errors occur for longer than the error tolerance duration. Transient errors are all other HTTP status codes and connection errors. + * The number of changes received reaches the configured `limit`. + * The feed is terminated early by calling stop. -As is true for the `_changes` endpoint change items have _at least once_ delivery and an individual item +As is true for the `_changes` endpoint change items have *at least once* delivery and an individual item may be received multiple times. When using the follower change items may be repeated even within a limited number of changes (i.e. using the `limit` option) this is a minor difference from using `limit` on the HTTP native API. @@ -850,9 +808,9 @@ to store the sequence IDs to have appropriate checkpoints and to re-initialize t The frequency and conditions for checkpointing are application specific and some applications may be tolerant of dropped changes. This section is intended only to provide general guidance on how to avoid missing changes. -To guarantee processing of all changes the sequence ID from a change item must not be persisted until _after_ +To guarantee processing of all changes the sequence ID from a change item must not be persisted until *after* the processing of the change item by the application has completed. As indicated previously change items are -delivered _at least once_ so application code must be able to handle repeated changes already and it is +delivered *at least once* so application code must be able to handle repeated changes already and it is preferable to restart from an older `since` value and receive changes again than risk missing them. The sequence IDs are available on each change item by default, but may be omitted from some change items when @@ -866,7 +824,6 @@ is a considerable risk of missing changes on a restart if the sequence is record #### Code examples ##### Initializing a changes follower -[embedmd]:# (test/examples/src/features/initialize.py /import/ $) ```py import ChangesFollower from ibmcloudant.cloudant_v1 import CloudantV1 @@ -886,11 +843,9 @@ changes_follower = ChangesFollower( ) ``` - ##### Starting the changes follower ###### Start mode for continuous listening -[embedmd]:# (test/examples/src/features/start.py /import/ $) ```py import Iterable @@ -909,9 +864,7 @@ changes_items: Iterable[ChangesResultItem] = changes_follower.start() # for changes_item in changes_items: ... ``` - ###### Start mode for one-off fetching -[embedmd]:# (test/examples/src/features/start_one_off.py /import/ $) ```py import Iterable @@ -930,11 +883,9 @@ changes_items: Iterable[ChangesResultItem] = changes_follower.start_one_off() # for changes_item in changes_items: ... ``` - ##### Processing changes ###### Process continuous changes -[embedmd]:# (test/examples/src/features/start_and_process.py /import/ $) ```py import ChangesFollower from ibmcloudant.cloudant_v1 import CloudantV1 @@ -966,9 +917,7 @@ for changes_item in changes_items: # For long running followers careful consideration should be made of where to call stop on the iterator. ``` - ###### Process one-off changes -[embedmd]:# (test/examples/src/features/start_one_off_and_process.py /import/ $) ```py import ChangesFollower from ibmcloudant.cloudant_v1 import CloudantV1 @@ -998,9 +947,7 @@ for changes_item in changes_items: # until all changes are processed (or another stop condition is reached). ``` - ##### Stopping the changes follower -[embedmd]:# (test/examples/src/features/stop.py /import/ $) ```py import ChangesFollower from ibmcloudant.cloudant_v1 import CloudantV1 @@ -1027,7 +974,6 @@ for changes_item in changes_items: changes_follower.stop() ``` - ## Questions If you are having difficulties using this SDK or have a question about the @@ -1063,7 +1009,7 @@ When language LTS versions move out of support the following will happen: * Existing SDK releases will continue to run on obsolete language versions, but will no longer be supported. * The minimum language version supported by the SDK will be updated to the next available LTS. * New language features may be added in subsequent SDK releases that will cause breaking changes - if the new releases of the SDK are used with older, now unsupported, language levels. + if the new releases of the SDK are used with older, now unsupported, language levels. ## Open source at IBM From 46500be0f1818c657682355902fe1dc0ada94d34 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:17:00 +0000 Subject: [PATCH 314/669] feat(generated): update generator to 3.91.0 Generated SDK source code using: - Generator version 3.91.0 - Specification version 1.0.0-dev0.1.11 - Automation (cloudant-sdks) version 28a2f78 --- test/unit/test_cloudant_v1.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 78ffcf1a..493aae19 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -51,15 +51,8 @@ def preprocess_url(operation_path: str): The returned request URL is used to register the mock response so it needs to match the request URL that is formed by the requests library. """ - # First, unquote the path since it might have some quoted/escaped characters in it - # due to how the generator inserts the operation paths into the unit test code. - operation_path = urllib.parse.unquote(operation_path) - # Next, quote the path using urllib so that we approximate what will - # happen during request processing. - operation_path = urllib.parse.quote(operation_path, safe='/') - - # Finally, form the request URL from the base URL and operation path. + # Form the request URL from the base URL and operation path. request_url = _base_url + operation_path # If the request url does NOT end with a /, then just return it as-is. From 3a32ddff513e2b1c906120960bf78275976b48e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:37:13 +0000 Subject: [PATCH 315/669] build(deps-dev): Bump responses from 0.25.0 to 0.25.2 Bumps [responses](https://github.com/getsentry/responses) from 0.25.0 to 0.25.2. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.0...0.25.2) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bfd2e0a5..e42db63a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==8.2.2 -responses==0.25.0 +responses==0.25.2 python_dotenv==1.0.1 pylint==3.2.2 # code coverage From f4fb1c5b0ed463f903d2198d15e57b3ac8a3f1d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 18:01:48 +0000 Subject: [PATCH 316/669] build(deps-dev): Bump pylint from 3.2.2 to 3.2.3 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.2 to 3.2.3. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.2...v3.2.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e42db63a..f22acfc8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.2 responses==0.25.2 python_dotenv==1.0.1 -pylint==3.2.2 +pylint==3.2.3 # code coverage coverage==7.5.3 pytest-cov==5.0.0 From e6ea23e508a31e119e36839a731112fdd8f4be43 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:04:01 +0000 Subject: [PATCH 317/669] feat(generated): update API definition to 1.0.0-dev0.1.13 Generated SDK source code using: - Generator version 3.91.0 - Specification version 1.0.0-dev0.1.13 - Automation (cloudant-sdks) version e3e0f78 --- ibmcloudant/cloudant_v1.py | 2 +- test/unit/test_cloudant_v1.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 63943f91..38e7e9fc 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -42,7 +42,7 @@ class CloudantV1(BaseService): """The Cloudant V1 service.""" - DEFAULT_SERVICE_URL = 'http://localhost:5984' + DEFAULT_SERVICE_URL = 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud' DEFAULT_SERVICE_NAME = 'cloudant' @classmethod diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 493aae19..fed2994f 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -40,7 +40,7 @@ authenticator=NoAuthAuthenticator() ) -_base_url = 'http://localhost:5984' +_base_url = 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud' _service.set_service_url(_base_url) From af14aa01c5e1af6bce6ec641c3e9e2c5993382d4 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 12 Jun 2024 09:29:13 +0100 Subject: [PATCH 318/669] test: fix follower UT config --- test/unit/features/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index b52e71cf..f3a9a595 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -111,7 +111,9 @@ def limits(request): class ChangesFollowerBaseCase(unittest.TestCase): @classmethod def setUpClass(cls): + # Setup client env config os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + os.environ['TEST_SERVICE_URL'] = 'http://localhost:5984' cls.client = CloudantV1.new_instance( service_name='TEST_SERVICE', ) @@ -175,7 +177,7 @@ def __call__(self, request): json.dumps(resp), ) - _base_url = 'http://localhost:5984' + _base_url = os.environ.get('TEST_SERVER_URL', 'http://localhost:5984') url = _base_url + '/db' responses.get( url, @@ -196,7 +198,7 @@ def __call__(self, request): ) def prepare_mock_with_error(self, error: str): - _base_url = 'http://localhost:5984' + _base_url = os.environ.get('TEST_SERVER_URL', 'http://localhost:5984') url = _base_url + '/db/_changes' if error == 'bad_io': return responses.post(url, body=ConnectionError('peer reset')) From ec2dd6ba8f343d330209982d6f941c7b8d980d31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:41:21 +0000 Subject: [PATCH 319/669] build(deps-dev): Bump responses from 0.25.2 to 0.25.3 Bumps [responses](https://github.com/getsentry/responses) from 0.25.2 to 0.25.3. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.2...0.25.3) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f22acfc8..9da2c498 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.9.0 # test dependencies pytest==8.2.2 -responses==0.25.2 +responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.3 # code coverage From ada02ea3f0b2bf7afe6e1e6cbcad404f7e1c6f92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:13:42 +0000 Subject: [PATCH 320/669] build(deps-dev): Bump coverage from 7.5.3 to 7.5.4 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.3 to 7.5.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.3...7.5.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9da2c498..4346fee9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.3 # code coverage -coverage==7.5.3 +coverage==7.5.4 pytest-cov==5.0.0 From e7fca41569d884fdae412ee4a7d19271909921cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:25:38 +0000 Subject: [PATCH 321/669] build(deps-dev): Bump pylint from 3.2.3 to 3.2.4 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.3 to 3.2.4. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.3...v3.2.4) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4346fee9..8f295253 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.2 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.2.3 +pylint==3.2.4 # code coverage coverage==7.5.4 pytest-cov==5.0.0 From b06279713d43e5acb538a26e2261268984949ad9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:11:46 +0000 Subject: [PATCH 322/669] build(deps-dev): Bump pylint from 3.2.4 to 3.2.5 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.4...v3.2.5) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8f295253..bc8e64b7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.2 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.2.4 +pylint==3.2.5 # code coverage coverage==7.5.4 pytest-cov==5.0.0 From 904faba5a5945d872499fff904a44255a5fe223e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:33:25 +0000 Subject: [PATCH 323/669] feat(generated): update API definition to 1.0.0-dev0.1.14 Generated SDK source code using: - Generator version 3.92.1 - Specification version 1.0.0-dev0.1.14 - Automation (cloudant-sdks) version d4a8723 --- ibmcloudant/cloudant_v1.py | 67 +++++++++++++++++++++++----- test/integration/test_cloudant_v1.py | 1 + test/unit/test_cloudant_v1.py | 22 +++++++-- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 38e7e9fc..501b7b37 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -5438,10 +5438,10 @@ def get_indexes_information( """ Retrieve information about all indexes. - When you make a GET request to `/db/_index`, you get a list of all indexes used by - Cloudant Query in the database, including the primary index. In addition to the - information available through this API, indexes are also stored in the `indexes` - property of design documents. + When you make a GET request to `/db/_index`, you get a list of all the indexes + using `"language":"query"` in the database and the primary index. In addition to + the information available through this API, the indexes are stored in the + `indexes` property of their respective design documents. :param str db: Path parameter to specify the database name. :param dict headers: A `dict` containing the request headers @@ -15595,6 +15595,9 @@ class ReplicationDocument: selector option when possible. :param int http_connections: (optional) Maximum number of HTTP connections per replication. + :param str owner: (optional) The replication document owner. The server sets an + appropriate value if the field is unset when writing a replication document. + Only administrators can modify the value to an owner other than themselves. :param dict query_params: (optional) Schema for a map of string key value pairs, such as query parameters. :param int retries_per_request: (optional) Number of times a replication request @@ -15669,7 +15672,7 @@ class ReplicationDocument: """ # The set of defined properties for the class - _properties = frozenset(['_attachments', '_conflicts', '_deleted', '_deleted_conflicts', '_id', '_local_seq', '_rev', '_revisions', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_bulk_get', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) + _properties = frozenset(['_attachments', '_conflicts', '_deleted', '_deleted_conflicts', '_id', '_local_seq', '_rev', '_revisions', '_revs_info', 'cancel', 'checkpoint_interval', 'connection_timeout', 'continuous', 'create_target', 'create_target_params', 'doc_ids', 'filter', 'http_connections', 'owner', 'query_params', 'retries_per_request', 'selector', 'since_seq', 'socket_options', 'source', 'source_proxy', 'target', 'target_proxy', 'use_bulk_get', 'use_checkpoints', 'user_ctx', 'winning_revs_only', 'worker_batch_size', 'worker_processes']) def __init__( self, @@ -15694,6 +15697,7 @@ def __init__( doc_ids: Optional[List[str]] = None, filter: Optional[str] = None, http_connections: Optional[int] = None, + owner: Optional[str] = None, query_params: Optional[dict] = None, retries_per_request: Optional[int] = None, selector: Optional[dict] = None, @@ -15752,6 +15756,10 @@ def __init__( option. Use the selector option when possible. :param int http_connections: (optional) Maximum number of HTTP connections per replication. + :param str owner: (optional) The replication document owner. The server + sets an appropriate value if the field is unset when writing a replication + document. Only administrators can modify the value to an owner other than + themselves. :param dict query_params: (optional) Schema for a map of string key value pairs, such as query parameters. :param int retries_per_request: (optional) Number of times a replication @@ -15841,6 +15849,7 @@ def __init__( self.doc_ids = doc_ids self.filter = filter self.http_connections = http_connections + self.owner = owner self.query_params = query_params self.retries_per_request = retries_per_request self.selector = selector @@ -15899,6 +15908,8 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': args['filter'] = filter if (http_connections := _dict.get('http_connections')) is not None: args['http_connections'] = http_connections + if (owner := _dict.get('owner')) is not None: + args['owner'] = owner if (query_params := _dict.get('query_params')) is not None: args['query_params'] = query_params if (retries_per_request := _dict.get('retries_per_request')) is not None: @@ -15998,6 +16009,8 @@ def to_dict(self) -> Dict: _dict['filter'] = self.filter if hasattr(self, 'http_connections') and self.http_connections is not None: _dict['http_connections'] = self.http_connections + if hasattr(self, 'owner') and self.owner is not None: + _dict['owner'] = self.owner if hasattr(self, 'query_params') and self.query_params is not None: _dict['query_params'] = self.query_params if hasattr(self, 'retries_per_request') and self.retries_per_request is not None: @@ -18045,27 +18058,33 @@ class ServerVendor: Schema for server vendor information. :param str name: Vendor name. - :param str variant: (optional) Vendor variant. - :param str version: (optional) Vendor version. + :param str variant: Vendor variant. + :param str version: Vendor version. """ + # The set of defined properties for the class + _properties = frozenset(['name', 'variant', 'version']) + def __init__( self, name: str, - *, - variant: Optional[str] = None, - version: Optional[str] = None, + variant: str, + version: str, + **kwargs, ) -> None: """ Initialize a ServerVendor object. :param str name: Vendor name. - :param str variant: (optional) Vendor variant. - :param str version: (optional) Vendor version. + :param str variant: Vendor variant. + :param str version: Vendor version. + :param **kwargs: (optional) Any additional properties. """ self.name = name self.variant = variant self.version = version + for _key, _value in kwargs.items(): + setattr(self, _key, _value) @classmethod def from_dict(cls, _dict: Dict) -> 'ServerVendor': @@ -18077,8 +18096,13 @@ def from_dict(cls, _dict: Dict) -> 'ServerVendor': raise ValueError('Required property \'name\' not present in ServerVendor JSON') if (variant := _dict.get('variant')) is not None: args['variant'] = variant + else: + raise ValueError('Required property \'variant\' not present in ServerVendor JSON') if (version := _dict.get('version')) is not None: args['version'] = version + else: + raise ValueError('Required property \'version\' not present in ServerVendor JSON') + args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) return cls(**args) @classmethod @@ -18095,12 +18119,31 @@ def to_dict(self) -> Dict: _dict['variant'] = self.variant if hasattr(self, 'version') and self.version is not None: _dict['version'] = self.version + for _key in [k for k in vars(self).keys() if k not in ServerVendor._properties]: + _dict[_key] = getattr(self, _key) return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() + def get_properties(self) -> Dict: + """Return a dictionary of arbitrary properties from this instance of ServerVendor""" + _dict = {} + + for _key in [k for k in vars(self).keys() if k not in ServerVendor._properties]: + _dict[_key] = getattr(self, _key) + return _dict + + def set_properties(self, _dict: dict): + """Set a dictionary of arbitrary properties to this instance of ServerVendor""" + for _key in [k for k in vars(self).keys() if k not in ServerVendor._properties]: + delattr(self, _key) + + for _key, _value in _dict.items(): + if _key not in ServerVendor._properties: + setattr(self, _key, _value) + def __str__(self) -> str: """Return a `str` version of this ServerVendor object.""" return json.dumps(self.to_dict(), indent=2) diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 982eab4a..a88ad507 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1564,6 +1564,7 @@ def test_put_replication_document(self): 'doc_ids': ['badger', 'lemur', 'llama'], 'filter': 'ddoc/my_filter', 'http_connections': 10, + 'owner': 'testString', 'query_params': {'key1': 'testString'}, 'retries_per_request': 3, 'selector': {'_id': {'$regex': 'docid'}}, diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index fed2994f..249684fa 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -9638,7 +9638,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9711,7 +9711,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9749,7 +9749,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9875,6 +9875,7 @@ def test_put_replication_document_all_params(self): replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] replication_document_model['filter'] = 'ddoc/my_filter' replication_document_model['http_connections'] = 10 + replication_document_model['owner'] = 'testString' replication_document_model['query_params'] = {'key1': 'testString'} replication_document_model['retries_per_request'] = 3 replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} @@ -10027,6 +10028,7 @@ def test_put_replication_document_required_params(self): replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] replication_document_model['filter'] = 'ddoc/my_filter' replication_document_model['http_connections'] = 10 + replication_document_model['owner'] = 'testString' replication_document_model['query_params'] = {'key1': 'testString'} replication_document_model['retries_per_request'] = 3 replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} @@ -10165,6 +10167,7 @@ def test_put_replication_document_value_error(self): replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] replication_document_model['filter'] = 'ddoc/my_filter' replication_document_model['http_connections'] = 10 + replication_document_model['owner'] = 'testString' replication_document_model['query_params'] = {'key1': 'testString'} replication_document_model['retries_per_request'] = 3 replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} @@ -16374,6 +16377,7 @@ def test_replication_document_serialization(self): replication_document_model_json['doc_ids'] = ['testString'] replication_document_model_json['filter'] = 'testString' replication_document_model_json['http_connections'] = 20 + replication_document_model_json['owner'] = 'testString' replication_document_model_json['query_params'] = {'key1': 'testString'} replication_document_model_json['retries_per_request'] = 5 replication_document_model_json['selector'] = {'anyKey': 'anyValue'} @@ -17277,6 +17281,7 @@ def test_server_information_serialization(self): server_vendor_model['name'] = 'testString' server_vendor_model['variant'] = 'testString' server_vendor_model['version'] = 'testString' + server_vendor_model['foo'] = 'testString' # Construct a json representation of a ServerInformation model server_information_model_json = {} @@ -17317,6 +17322,7 @@ def test_server_vendor_serialization(self): server_vendor_model_json['name'] = 'testString' server_vendor_model_json['variant'] = 'testString' server_vendor_model_json['version'] = 'testString' + server_vendor_model_json['foo'] = 'testString' # Construct a model instance of ServerVendor by calling from_dict on the json representation server_vendor_model = ServerVendor.from_dict(server_vendor_model_json) @@ -17333,6 +17339,16 @@ def test_server_vendor_serialization(self): server_vendor_model_json2 = server_vendor_model.to_dict() assert server_vendor_model_json2 == server_vendor_model_json + # Test get_properties and set_properties methods. + server_vendor_model.set_properties({}) + actual_dict = server_vendor_model.get_properties() + assert actual_dict == {} + + expected_dict = {'foo': 'testString'} + server_vendor_model.set_properties(expected_dict) + actual_dict = server_vendor_model.get_properties() + assert actual_dict == expected_dict + class TestModel_SessionAuthentication: """ From 8f301e0998ffd55646e6cf87883f7df07288f752 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:35:18 +0000 Subject: [PATCH 324/669] fix(generated): bit smarter getTargetVersion Generated SDK source code using: - Generator version 3.92.1 - Specification version 1.0.0-dev0.1.14 - Automation (cloudant-sdks) version 68bb41b --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1527bafe..18dd8571 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -186,7 +186,7 @@ def buildType def scanCode void defaultInit() { - // Default to using bump2version + // Default to using bump-my-version bumpVersion = { isDevRelease -> newVersion = getNewVersion(isDevRelease) // Set an env var with the new version @@ -195,7 +195,7 @@ void defaultInit() { } doVersionBump = { isDevRelease, newVersion, allowDirty -> - sh "bump2version --new-version ${newVersion} ${allowDirty ? '--allow-dirty': ''} ${isDevRelease ? '--no-commit' : '--tag --tag-message "Release {new_version}"'} patch" + sh "bump-my-version bump patch --new-version ${newVersion} ${allowDirty ? '--allow-dirty': ''} ${isDevRelease ? '--no-commit' : '--tag --tag-message "Release {new_version}"'}" } getNewVersion = { isDevRelease -> @@ -209,7 +209,7 @@ void defaultInit() { version = params.TARGET_VERSION } else { // If a target version is not provided default to a patch bump - version = sh returnStdout: true, script: 'bump2version --list --dry-run patch | grep new_version=.* | cut -f2 -d=' + version = sh returnStdout: true, script: 'bump-my-version show-bump --ascii | grep patch | rev | cut -f1 -d " " | rev' } return version.trim() } From baea1293a1542e822563c87ce3a3bb132ac5b78c Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 4 Jul 2024 11:49:28 -0300 Subject: [PATCH 325/669] fix: port bump-my-version config --- .bumpversion.cfg | 26 -------------------------- .bumpversion.toml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) delete mode 100644 .bumpversion.cfg create mode 100644 .bumpversion.toml diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 6202d15e..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,26 +0,0 @@ -[bumpversion] -current_version = 0.8.2 -commit = True -message = Update version {current_version} -> {new_version} -parse = ^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?P[a|b|rc](?:0|[1-9]\d*))?(?P(?:\.dev)(?:0|[1-9]\d*))?(?P\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$ -serialize = - {major}.{minor}.{patch}{prerelease}{devrelease}{buildmetadata} - {major}.{minor}.{patch}{prerelease}{devrelease} - {major}.{minor}.{patch}{prerelease}{buildmetadata} - {major}.{minor}.{patch}{prerelease} - {major}.{minor}.{patch}{devrelease}{buildmetadata} - {major}.{minor}.{patch}{devrelease} - {major}.{minor}.{patch}{buildmetadata} - {major}.{minor}.{patch} - -[bumpversion:file:ibmcloudant/version.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bumpversion:file:pyproject.toml] -search = version = "{current_version}" -replace = version = "{new_version}" - -[bumpversion:file:README.md] -search = {current_version} -replace = {new_version} diff --git a/.bumpversion.toml b/.bumpversion.toml new file mode 100644 index 00000000..695a3900 --- /dev/null +++ b/.bumpversion.toml @@ -0,0 +1,30 @@ +[tool.bumpversion] +current_version = "0.8.2" +commit = true +message = "Update version {current_version} -> {new_version}" +parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" +serialize = [ + "{major}.{minor}.{patch}{prerelease}{devrelease}{buildmetadata}", + "{major}.{minor}.{patch}{prerelease}{devrelease}", + "{major}.{minor}.{patch}{prerelease}{buildmetadata}", + "{major}.{minor}.{patch}{prerelease}", + "{major}.{minor}.{patch}{devrelease}{buildmetadata}", + "{major}.{minor}.{patch}{devrelease}", + "{major}.{minor}.{patch}{buildmetadata}", + "{major}.{minor}.{patch}", +] + +[[tool.bumpversion.files]] +filename = "ibmcloudant/version.py" +search = "__version__ = '{current_version}'" +replace = "__version__ = '{new_version}'" + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = "version = \"{current_version}\"" +replace = "version = \"{new_version}\"" + +[[tool.bumpversion.files]] +filename = "README.md" +search = "{current_version}" +replace = "{new_version}" From 59f9e71591268124055e9d0886a98d702d7902eb Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 4 Jul 2024 11:54:23 -0300 Subject: [PATCH 326/669] fix(test): increase timeout for follower suppression tests --- test/unit/features/test_changes_follower.py | 306 +++++++++----------- 1 file changed, 138 insertions(+), 168 deletions(-) diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index 09ca0f6c..31005bab 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -18,132 +18,126 @@ Test methods in the changes follower module """ -import pytest -import responses import sys import timeit -from requests.exceptions import ConnectionError - +import pytest +import responses +from conftest import ChangesFollowerBaseCase from ibm_cloud_sdk_core import ApiException +from requests.exceptions import ConnectionError from ibmcloudant.cloudant_v1 import PostChangesEnums - from ibmcloudant.features.changes_follower import ( - ChangesFollower, + _BATCH_SIZE, _FOREVER, _LONGPOLL_TIMEOUT, - _BATCH_SIZE, + ChangesFollower, _Mode, ) - -from conftest import ChangesFollowerBaseCase - # the largest positive integer supported by the platform MAX_BATCHES = sys.maxsize / _BATCH_SIZE -@pytest.mark.usefixtures('timeouts') +@pytest.mark.usefixtures("timeouts") class TestChangesFollowerInitialization(ChangesFollowerBaseCase): def test_minimal_initialization(self): try: - ChangesFollower(self.client, db='db') + ChangesFollower(self.client, db="db") except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") def test_validate_missing_database_name(self): - regx = 'The option db must be provided when using ChangesFollower.' + regx = "The option db must be provided when using ChangesFollower." with self.assertRaisesRegex(ValueError, regx): ChangesFollower(self.client) def test_validate_overflow_tolerance(self): - regx = 'Error tolerance duration must not be larger than' + regx = "Error tolerance duration must not be larger than" with self.assertRaisesRegex(ValueError, regx): - ChangesFollower(self.client, db='db', error_tolerance=_FOREVER + 1) + ChangesFollower(self.client, db="db", error_tolerance=_FOREVER + 1) def test_validate_negative_tolerance(self): - regx = 'Error tolerance duration must not be negative.' + regx = "Error tolerance duration must not be negative." with self.assertRaisesRegex(ValueError, regx): - ChangesFollower(self.client, db='db', error_tolerance=-1) + ChangesFollower(self.client, db="db", error_tolerance=-1) def test_initialization_with_valid_client_timeout(self): for timeout in self.timeouts_valid: try: - self.client.set_http_config({'timeout': timeout}) - ChangesFollower(self.client, db='db') + self.client.set_http_config({"timeout": timeout}) + ChangesFollower(self.client, db="db") except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") def test_initialization_with_invalid_client_timeout(self): for timeout in self.timeouts_invalid: - self.client.set_http_config({'timeout': timeout}) - regx = 'timeouts must be at least' + self.client.set_http_config({"timeout": timeout}) + regx = "timeouts must be at least" with self.assertRaisesRegex(ValueError, regx): - ChangesFollower(self.client, db='db') + ChangesFollower(self.client, db="db") -@pytest.mark.usefixtures('kwargs') +@pytest.mark.usefixtures("kwargs") class TestChangesFollowerOptions(ChangesFollowerBaseCase): def test_validate_options_valid_cases(self): try: - ChangesFollower(self.client, db='db', **self.kwarg_valid) + ChangesFollower(self.client, db="db", **self.kwarg_valid) except BaseException: - self.fail('There should be no illegal argument exception.') + self.fail("There should be no illegal argument exception.") def test_validate_options_invalid_cases(self): for opt, val in self.kwarg_invalid.items(): - if opt == 'filter': + if opt == "filter": error_opt = f"filter={val}" else: error_opt = opt regx = f"The option '{error_opt}' is invalid when using ChangesFollower." with self.assertRaisesRegex(ValueError, regx): - ChangesFollower(self.client, db='db', **{opt: val}) + ChangesFollower(self.client, db="db", **{opt: val}) def test_validate_options_multiple_invalid_cases(self): - error_opts = '' + error_opts = "" for opt, val in self.kwarg_invalid.items(): - if opt == 'filter': - error_opts += f'filter={val}, ' + if opt == "filter": + error_opts += f"filter={val}, " else: - error_opts += f'{opt}, ' - if error_opts.endswith(', '): - error_opts = error_opts[:-len(', ')] - regx = ( - f'The options {error_opts} are invalid when using ChangesFollower.' - ) + error_opts += f"{opt}, " + if error_opts.endswith(", "): + error_opts = error_opts[: -len(", ")] + regx = f"The options {error_opts} are invalid when using ChangesFollower." with self.assertRaisesRegex(ValueError, regx): - ChangesFollower(self.client, db='db', **self.kwarg_invalid) + ChangesFollower(self.client, db="db", **self.kwarg_invalid) def test_set_defaults(self): - follower = ChangesFollower(self.client, db='db', **self.kwarg_valid) + follower = ChangesFollower(self.client, db="db", **self.kwarg_valid) expected = { - 'feed': PostChangesEnums.Feed.LONGPOLL, - 'timeout': _LONGPOLL_TIMEOUT, + "feed": PostChangesEnums.Feed.LONGPOLL, + "timeout": _LONGPOLL_TIMEOUT, } for opt, val in expected.items(): self.assertEqual(follower.options.get(opt), val) def test_set_defaults_with_limit(self): - follower = ChangesFollower(self.client, db='db', **self.kwarg_valid) + follower = ChangesFollower(self.client, db="db", **self.kwarg_valid) follower._set_defaults(limit=12) expected = { - 'feed': PostChangesEnums.Feed.LONGPOLL, - 'timeout': _LONGPOLL_TIMEOUT, - 'limit': 12, + "feed": PostChangesEnums.Feed.LONGPOLL, + "timeout": _LONGPOLL_TIMEOUT, + "limit": 12, } for opt, val in expected.items(): self.assertEqual(follower.options.get(opt), val) def test_set_defaults_with_kwarg_limit(self): - kwarg = {**self.kwarg_valid, **{'limit': 24}} - follower = ChangesFollower(self.client, db='db', **kwarg) + kwarg = {**self.kwarg_valid, **{"limit": 24}} + follower = ChangesFollower(self.client, db="db", **kwarg) follower._set_defaults(limit=12) - self.assertEqual(follower.options.get('limit'), 12) + self.assertEqual(follower.options.get("limit"), 12) -@pytest.mark.usefixtures('limits', 'errors') +@pytest.mark.usefixtures("limits", "errors") class TestChangesFollowerFinite(ChangesFollowerBaseCase): @responses.activate def test_start_one_off(self): @@ -153,13 +147,13 @@ def test_start_one_off(self): """ batches = 6 self.prepare_mock_changes(batches=batches) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") changes = follower.start_one_off() count = sum(1 for _ in changes) self.assertEqual( count, batches * _BATCH_SIZE, - 'There should be the expected number of changes.', + "There should be the expected number of changes.", ) @responses.activate @@ -169,7 +163,7 @@ def test_start_one_off_terminal_errors(self): """ for error in self.terminal_errors: self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") changes = follower.start_one_off() with self.assertRaisesRegex(ApiException, error): next(changes) @@ -182,22 +176,22 @@ def test_start_one_off_transient_errors_no_suppression(self): """ for error in self.transient_errors: self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db', error_tolerance=0) + follower = ChangesFollower(self.client, db="db", error_tolerance=0) start = timeit.default_timer() changes = follower.start_one_off() - if error == 'bad_io': + if error == "bad_io": with self.assertRaises(ConnectionError): next(changes) else: - if error == 'bad_json': - error = 'Error processing the HTTP response' + if error == "bad_json": + error = "Error processing the HTTP response" with self.assertRaisesRegex(ApiException, error): next(changes) stop = timeit.default_timer() - start self.assertLess( stop, 0.300, - 'There should be no exception delay.', + "There should be no exception delay.", ) @responses.activate @@ -208,24 +202,22 @@ def test_start_one_off_transient_errors_with_suppression_duration(self): """ for error in self.transient_errors: self.prepare_mock_with_error(error) - follower = ChangesFollower( - self.client, db='db', error_tolerance=100 - ) + follower = ChangesFollower(self.client, db="db", error_tolerance=100) start = timeit.default_timer() changes = follower.start_one_off() - if error == 'bad_io': + if error == "bad_io": with self.assertRaises(ConnectionError): next(changes) else: - if error == 'bad_json': - error = 'Error processing the HTTP response' + if error == "bad_json": + error = "Error processing the HTTP response" with self.assertRaisesRegex(ApiException, error): next(changes) stop = timeit.default_timer() - start self.assertGreaterEqual( stop, 0.100, - 'The exception delay should be longer error_tolerance.', + "The exception delay should be longer error_tolerance.", ) @responses.activate @@ -241,13 +233,13 @@ def test_start_one_off_transient_errors_with_suppression_does_complete( batches=batches, errors=self.transient_errors, ) - follower = ChangesFollower(self.client, db='db', error_tolerance=300) + follower = ChangesFollower(self.client, db="db", error_tolerance=300) changes = follower.start_one_off() count = sum(1 for _ in changes) self.assertEqual( count, batches * _BATCH_SIZE, - 'There should be the expected number of changes.', + "There should be the expected number of changes.", ) @responses.activate @@ -261,11 +253,11 @@ def test_start_one_off_transient_errors_max_suppression_does_not_complete( for error in self.transient_errors: try: self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") count = self.runner(follower, _Mode.FINITE, timeout=0.5) except BaseException: - self.fail('There should be no exception.') - self.assertEqual(count, 0, 'There should be no changes.') + self.fail("There should be no exception.") + self.assertEqual(count, 0, "There should be no changes.") @responses.activate def test_start_one_off_transient_errors_with_max_suppression_does_complete( @@ -276,16 +268,14 @@ def test_start_one_off_transient_errors_with_max_suppression_does_complete( will complete successfully with max suppression. """ batches = 4 - self.prepare_mock_changes( - batches=batches, errors=self.transient_errors - ) - follower = ChangesFollower(self.client, db='db') + self.prepare_mock_changes(batches=batches, errors=self.transient_errors) + follower = ChangesFollower(self.client, db="db") changes = follower.start_one_off() count = sum(1 for _ in changes) self.assertEqual( count, batches * _BATCH_SIZE, - 'There should be the expected number of changes.', + "There should be the expected number of changes.", ) @responses.activate @@ -295,18 +285,14 @@ def test_stop(self): """ try: self.prepare_mock_changes(batches=MAX_BATCHES) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") start = timeit.default_timer() - count = self.runner( - follower, _Mode.FINITE, timeout=5, stop_after=1000 - ) + count = self.runner(follower, _Mode.FINITE, timeout=5, stop_after=1000) stop = timeit.default_timer() - start except BaseException: - self.fail('There should be no exception.') - self.assertGreaterEqual(count, 1000, 'There should be some changes.') - self.assertLess( - stop, 5, 'The thread should have stopped before the wait time.' - ) + self.fail("There should be no exception.") + self.assertGreaterEqual(count, 1000, "There should be some changes.") + self.assertLess(stop, 5, "The thread should have stopped before the wait time.") @responses.activate def test_state_error(self): @@ -315,18 +301,18 @@ def test_state_error(self): """ try: self.prepare_mock_changes(batches=MAX_BATCHES) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") self.runner(follower, _Mode.FINITE, timeout=1, stop_after=1000) with self.assertRaisesRegex( - RuntimeError, 'Cannot start a feed that has already started.' + RuntimeError, "Cannot start a feed that has already started." ): follower.start_one_off() with self.assertRaisesRegex( - RuntimeError, 'Cannot start a feed that has already started.' + RuntimeError, "Cannot start a feed that has already started." ): follower.start() except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") @responses.activate def test_limit(self): @@ -337,14 +323,14 @@ def test_limit(self): for limit in self.limits: try: self.prepare_mock_changes(batches=MAX_BATCHES) - follower = ChangesFollower(self.client, db='db', limit=limit) + follower = ChangesFollower(self.client, db="db", limit=limit) count = self.runner(follower, _Mode.FINITE, timeout=3600) except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") self.assertEqual( count, limit, - 'There should be the correct number of changes.', + "There should be the correct number of changes.", ) @responses.activate @@ -367,14 +353,12 @@ def test_retry_delay(self): try: error = self.transient_errors[0] resp = self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") count = self.runner(follower, _Mode.FINITE, timeout=0.6) except BaseException: - self.fail('There should be no exception.') - self.assertEqual(count, 0, 'There should be no changes.') - self.assertLessEqual( - resp.call_count, 15, 'Call count should not exceed limit.' - ) + self.fail("There should be no exception.") + self.assertEqual(count, 0, "There should be no changes.") + self.assertLessEqual(resp.call_count, 15, "Call count should not exceed limit.") @responses.activate def test_batch_size(self): @@ -390,15 +374,15 @@ def test_batch_size(self): """ self.prepare_mock_changes(batches=1) follower = ChangesFollower( - self.client, db='db', error_tolerance=0, include_docs=True + self.client, db="db", error_tolerance=0, include_docs=True ) changes = follower.start_one_off() next(changes) params = responses.calls[1].request.params self.assertEqual( - params['limit'], - '5125', - 'Limit should be set to the expected value.', + params["limit"], + "5125", + "Limit should be set to the expected value.", ) @responses.activate @@ -412,17 +396,19 @@ def test_batch_size_minimum(self): Checks that the minimum batch_size of 1 is set. """ - self.prepare_mock_changes(batches=1, db_info_doc_count=1, db_info_doc_size=(5 * 1024 * 1024 - 1)) + self.prepare_mock_changes( + batches=1, db_info_doc_count=1, db_info_doc_size=(5 * 1024 * 1024 - 1) + ) follower = ChangesFollower( - self.client, db='db', error_tolerance=0, include_docs=True + self.client, db="db", error_tolerance=0, include_docs=True ) changes = follower.start_one_off() next(changes) params = responses.calls[1].request.params self.assertEqual( - params['limit'], - '1', - 'Limit should be set to the expected value.', + params["limit"], + "1", + "Limit should be set to the expected value.", ) @responses.activate @@ -434,7 +420,7 @@ def test_batch_size_with_limit(self): self.prepare_mock_changes(batches=1) follower = ChangesFollower( self.client, - db='db', + db="db", error_tolerance=0, limit=1000, include_docs=True, @@ -443,13 +429,13 @@ def test_batch_size_with_limit(self): next(changes) params = responses.calls[1].request.params self.assertEqual( - params['limit'], - '1000', - 'Limit should be set to the expected value.', + params["limit"], + "1000", + "Limit should be set to the expected value.", ) -@pytest.mark.usefixtures('limits', 'errors') +@pytest.mark.usefixtures("limits", "errors") class TestChangesFollowerListen(ChangesFollowerBaseCase): @responses.activate def test_start(self): @@ -459,13 +445,11 @@ def test_start(self): """ try: self.prepare_mock_changes(batches=3) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") count = self.runner(follower, _Mode.LISTEN, timeout=5) except BaseException: - self.fail('There should be no exception.') - self.assertGreater( - count, 2 * _BATCH_SIZE + 1, 'There should be some changes.' - ) + self.fail("There should be no exception.") + self.assertGreater(count, 2 * _BATCH_SIZE + 1, "There should be some changes.") @responses.activate def test_start_terminal_errors(self): @@ -474,7 +458,7 @@ def test_start_terminal_errors(self): """ for error in self.terminal_errors: self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") with self.assertRaisesRegex(ApiException, error): self.runner(follower, _Mode.LISTEN, timeout=1) @@ -486,13 +470,13 @@ def test_start_transient_errors_no_suppression(self): """ for error in self.transient_errors: self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db', error_tolerance=0) - if error == 'bad_io': + follower = ChangesFollower(self.client, db="db", error_tolerance=0) + if error == "bad_io": with self.assertRaises(ConnectionError): self.runner(follower, _Mode.LISTEN, timeout=1) else: - if error == 'bad_json': - error = 'Error processing the HTTP response' + if error == "bad_json": + error = "Error processing the HTTP response" with self.assertRaisesRegex(ApiException, error): self.runner(follower, _Mode.LISTEN, timeout=1) @@ -504,20 +488,16 @@ def test_start_transient_errors_with_suppression_error_termination(self): """ for error in self.transient_errors: resp = self.prepare_mock_with_error(error) - follower = ChangesFollower( - self.client, db='db', error_tolerance=100 - ) - if error == 'bad_io': + follower = ChangesFollower(self.client, db="db", error_tolerance=100) + if error == "bad_io": with self.assertRaises(ConnectionError): self.runner(follower, _Mode.LISTEN, timeout=1) else: - if error == 'bad_json': - error = 'Error processing the HTTP response' + if error == "bad_json": + error = "Error processing the HTTP response" with self.assertRaisesRegex(ApiException, error): self.runner(follower, _Mode.LISTEN, timeout=1) - self.assertGreater( - resp.call_count, 1, 'Mock server should receive calls.' - ) + self.assertGreater(resp.call_count, 1, "Mock server should receive calls.") @responses.activate def test_start_transient_errors_with_suppression_all_changes(self): @@ -531,16 +511,14 @@ def test_start_transient_errors_with_suppression_all_changes(self): errors=self.transient_errors, ) try: - follower = ChangesFollower( - self.client, db='db', error_tolerance=300 - ) - count = self.runner(follower, _Mode.LISTEN, timeout=1) + follower = ChangesFollower(self.client, db="db", error_tolerance=300) + count = self.runner(follower, _Mode.LISTEN, timeout=3) except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") self.assertEqual( count, batches * _BATCH_SIZE, - 'There should be the correct number of changes.', + "There should be the correct number of changes.", ) @responses.activate @@ -552,14 +530,12 @@ def test_start_transient_errors_with_max_suppression(self): for error in self.transient_errors: try: resp = self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") count = self.runner(follower, _Mode.LISTEN, timeout=1) except BaseException: - self.fail('There should be no exception.') - self.assertEqual(count, 0, 'There should be no changes.') - self.assertGreater( - resp.call_count, 1, 'Mock server should receive calls.' - ) + self.fail("There should be no exception.") + self.assertEqual(count, 0, "There should be no changes.") + self.assertGreater(resp.call_count, 1, "Mock server should receive calls.") @responses.activate def test_start_transient_errors_with_max_suppression_all_changes(self): @@ -573,14 +549,14 @@ def test_start_transient_errors_with_max_suppression_all_changes(self): errors=self.transient_errors, ) try: - follower = ChangesFollower(self.client, db='db') - count = self.runner(follower, _Mode.LISTEN, timeout=1) + follower = ChangesFollower(self.client, db="db") + count = self.runner(follower, _Mode.LISTEN, timeout=3) except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") self.assertEqual( count, batches * _BATCH_SIZE, - 'There should be the correct number of changes.', + "There should be the correct number of changes.", ) @responses.activate @@ -590,18 +566,14 @@ def test_stop(self): """ try: self.prepare_mock_changes(batches=MAX_BATCHES) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") start = timeit.default_timer() - count = self.runner( - follower, _Mode.LISTEN, timeout=5, stop_after=1000 - ) + count = self.runner(follower, _Mode.LISTEN, timeout=5, stop_after=1000) stop = timeit.default_timer() - start except BaseException: - self.fail('There should be no exception.') - self.assertGreaterEqual(count, 1000, 'There should be some changes.') - self.assertLess( - stop, 5, 'The thread should have stopped before the wait time.' - ) + self.fail("There should be no exception.") + self.assertGreaterEqual(count, 1000, "There should be some changes.") + self.assertLess(stop, 5, "The thread should have stopped before the wait time.") @responses.activate def test_state_error(self): @@ -610,18 +582,18 @@ def test_state_error(self): """ try: self.prepare_mock_changes(batches=MAX_BATCHES) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") self.runner(follower, _Mode.LISTEN, timeout=1, stop_after=1000) with self.assertRaisesRegex( - RuntimeError, 'Cannot start a feed that has already started.' + RuntimeError, "Cannot start a feed that has already started." ): follower.start_one_off() with self.assertRaisesRegex( - RuntimeError, 'Cannot start a feed that has already started.' + RuntimeError, "Cannot start a feed that has already started." ): follower.start() except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") @responses.activate def test_limit(self): @@ -632,14 +604,14 @@ def test_limit(self): for limit in self.limits: try: self.prepare_mock_changes(batches=MAX_BATCHES) - follower = ChangesFollower(self.client, db='db', limit=limit) + follower = ChangesFollower(self.client, db="db", limit=limit) count = self.runner(follower, _Mode.LISTEN, timeout=3600) except BaseException: - self.fail('There should be no exception.') + self.fail("There should be no exception.") self.assertEqual( count, limit, - 'There should be the correct number of changes.', + "There should be the correct number of changes.", ) @responses.activate @@ -651,11 +623,9 @@ def test_retry_delay(self): try: error = self.transient_errors[0] resp = self.prepare_mock_with_error(error) - follower = ChangesFollower(self.client, db='db') + follower = ChangesFollower(self.client, db="db") count = self.runner(follower, _Mode.LISTEN, timeout=0.6) except BaseException: - self.fail('There should be no exception.') - self.assertEqual(count, 0, 'There should be no changes.') - self.assertLessEqual( - resp.call_count, 15, 'Call count should not exceed limit.' - ) + self.fail("There should be no exception.") + self.assertEqual(count, 0, "There should be no changes.") + self.assertLessEqual(resp.call_count, 15, "Call count should not exceed limit.") From 8ad1d8260fb95cf5805b39442fba240b599f001c Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 9 Jul 2024 07:43:12 -0300 Subject: [PATCH 327/669] refactor(follower): switch from generator to iterator for buffered batches --- ibmcloudant/features/changes_follower.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index a1d89df1..4fafb23e 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -157,7 +157,7 @@ def __next__(self): raise StopIteration from exc if isinstance(data, Exception): raise data from None - self._changes_iter = data + self._changes_iter = iter(data) self._buffer.task_done() def _request_callback(self): @@ -178,9 +178,9 @@ def _request_callback(self): self._buffer.join() if self._stop.is_set(): raise StopIteration - self._buffer.put(( - ChangesResultItem.from_dict(item) for item in results - )) + self._buffer.put( + [ChangesResultItem.from_dict(item) for item in results] + ) except Exception as e: self.logger.debug(f'Exception getting changes {e}') if ( From 721a94eccefb6bf7497492f030a0a0d1122b7996 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 9 Jul 2024 07:50:55 -0300 Subject: [PATCH 328/669] test: improve runner performance --- test/unit/features/conftest.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index f3a9a595..429378d7 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -23,6 +23,7 @@ import os import json import responses +import time import threading import queue @@ -231,11 +232,12 @@ def looper(changes, buf): try: for _ in changes: counter += 1 - buf.put(counter) if stop_after > 0 and stop_after == counter: follower.stop() except Exception as e: buf.put(e) + return + buf.put(counter) def main(): if mode == _Mode.LISTEN: @@ -246,15 +248,16 @@ def main(): thread = threading.Thread(target=looper, args=(changes, buf)) thread.start() thread.join(timeout) - while not buf.empty(): - data = buf.get() - if isinstance(data, Exception): - raise data while True: + time.sleep(0.2) if thread.is_alive(): follower.stop() else: break + while not buf.empty(): + data = buf.get() + if isinstance(data, Exception): + raise data return data return main() From b50e3e25988f6c5bcf3ab09c47a35eddd59d95f6 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 9 Jul 2024 07:51:35 -0300 Subject: [PATCH 329/669] test(follower): revert timeout on error suppression tests --- test/unit/features/test_changes_follower.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index 31005bab..acac60c8 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -512,7 +512,7 @@ def test_start_transient_errors_with_suppression_all_changes(self): ) try: follower = ChangesFollower(self.client, db="db", error_tolerance=300) - count = self.runner(follower, _Mode.LISTEN, timeout=3) + count = self.runner(follower, _Mode.LISTEN, timeout=1) except BaseException: self.fail("There should be no exception.") self.assertEqual( @@ -550,7 +550,7 @@ def test_start_transient_errors_with_max_suppression_all_changes(self): ) try: follower = ChangesFollower(self.client, db="db") - count = self.runner(follower, _Mode.LISTEN, timeout=3) + count = self.runner(follower, _Mode.LISTEN, timeout=1) except BaseException: self.fail("There should be no exception.") self.assertEqual( From 66fb8b0406dd679f13ca78bc198443241b725032 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 08:08:06 +0000 Subject: [PATCH 330/669] build(deps): Bump ibm-cloud-sdk-core from 3.20.1 to 3.20.2 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.20.1 to 3.20.2. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.20.1...v3.20.2) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b252172c..6a8654c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.8.2" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.20.1", + "ibm_cloud_sdk_core==3.20.2", "requests>=2.32.0,<2.32.3", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 9ac4daa08a6d3a813d534d6f41e94c4308d3de23 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 10 Jul 2024 09:48:34 +0100 Subject: [PATCH 331/669] build(deps): `requests>=2.32.2,<3.0.0` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6a8654c4..6e348fed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "0.8.2" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.20.2", - "requests>=2.32.0,<2.32.3", + "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", ] From b5ed55a4b84c1d2a499376f51bc1a7ccef36a498 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:45:54 +0000 Subject: [PATCH 332/669] Update version 0.8.2 -> 0.9.0 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 695a3900..bc0c931f 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.8.2" +current_version = "0.9.0" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 8b2f7377..c768dc0f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.8.2 +# IBM Cloudant Python SDK Version 0.9.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.8.2" +pip install --upgrade "ibmcloudant>=0.9.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.8.2" +easy_install --upgrade "ibmcloudant>=0.9.0" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.8.2/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 7306c686..8daecd70 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.8.2' +__version__ = '0.9.0' diff --git a/pyproject.toml b/pyproject.toml index 6e348fed..107d5199 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.8.2" +version = "0.9.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.20.2", From 1adc01755315783cb4ab98c57f7404707c852c83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:28:09 +0000 Subject: [PATCH 333/669] build(deps): Bump ibm-cloud-sdk-core from 3.20.2 to 3.20.3 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.20.2 to 3.20.3. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.20.2...v3.20.3) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 107d5199..529275ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.9.0" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.20.2", + "ibm_cloud_sdk_core==3.20.3", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 4d0f9a724d36223cdbce5811d5e7d61e3419bbf7 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:10:13 +0000 Subject: [PATCH 334/669] Update version 0.9.0 -> 0.9.1 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index bc0c931f..bf7ecfde 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.9.0" +current_version = "0.9.1" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index c768dc0f..6816262c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.9.0 +# IBM Cloudant Python SDK Version 0.9.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.9.0" +pip install --upgrade "ibmcloudant>=0.9.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.9.0" +easy_install --upgrade "ibmcloudant>=0.9.1" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 8daecd70..46ca911f 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.9.0' +__version__ = '0.9.1' diff --git a/pyproject.toml b/pyproject.toml index 529275ce..210653d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.9.0" +version = "0.9.1" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.20.3", From 3b64548ab508add3670b870ff329e13c5bf4b6f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:41:39 +0000 Subject: [PATCH 335/669] build(deps-dev): Bump coverage from 7.5.4 to 7.6.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.4 to 7.6.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.4...7.6.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bc8e64b7..84eb3dde 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.5 # code coverage -coverage==7.5.4 +coverage==7.6.0 pytest-cov==5.0.0 From 4304ef12e4ccd83efce6f28a5f13083a33fc2ccb Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:43:48 +0000 Subject: [PATCH 336/669] docs(generated): cleanup examples Generated SDK source code using: - Generator version 3.92.2 - Specification version 1.0.0-dev0.1.14 - Automation (cloudant-sdks) version 6f13458 --- examples/README.md | 22 ------------------- .../postMissingRevs/example_request.py | 12 ---------- 2 files changed, 34 deletions(-) delete mode 100644 examples/snippets/postMissingRevs/example_request.py diff --git a/examples/README.md b/examples/README.md index d1f43e5a..495fa908 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1524,28 +1524,6 @@ response = service.put_local_document( print(response) ``` -## postMissingRevs - -_POST `/{db}/_missing_revs`_ - -### [Example request](snippets/postMissingRevs/example_request.py) - -[embedmd]:# (snippets/postMissingRevs/example_request.py) -```py -# section: code -from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 - -service = CloudantV1.new_instance() - -revs = DocumentRevisions(order00077=['', '<2-missing-revision>']) -response = service.post_missing_revs( - db='orders', - missing_revs=revs.to_dict() -).get_result() - -print(response) -``` - ## getPartitionInformation _GET `/{db}/_partition/{partition_key}`_ diff --git a/examples/snippets/postMissingRevs/example_request.py b/examples/snippets/postMissingRevs/example_request.py deleted file mode 100644 index 6550e8d0..00000000 --- a/examples/snippets/postMissingRevs/example_request.py +++ /dev/null @@ -1,12 +0,0 @@ -# section: code -from ibmcloudant.cloudant_v1 import DocumentRevisions, CloudantV1 - -service = CloudantV1.new_instance() - -revs = DocumentRevisions(order00077=['', '<2-missing-revision>']) -response = service.post_missing_revs( - db='orders', - missing_revs=revs.to_dict() -).get_result() - -print(response) From 794ddc7c81ea9a1780707b4de53a601b49d44bec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:53:44 +0000 Subject: [PATCH 337/669] build(deps): Bump sphinx from 7.3.7 to 7.4.3 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.3.7 to 7.4.3. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.3.7...v7.4.3) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 5a7f4097..43043839 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.3.7 +Sphinx==7.4.3 sphinx-autodoc2==0.5.0 myst-parser==3.0.1 sphinx-rtd-theme==2.0.0 From 9dc3ddf768c467eab67cc5bf2ddc5d76b9d6eea8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:11:33 +0000 Subject: [PATCH 338/669] build(deps): Bump sphinx from 7.4.3 to 7.4.4 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.3 to 7.4.4. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.3...v7.4.4) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 43043839..09b2192c 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.4.3 +Sphinx==7.4.4 sphinx-autodoc2==0.5.0 myst-parser==3.0.1 sphinx-rtd-theme==2.0.0 From 27e6ce77c98c1add8c1c2010c9dc53b230a1773b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:56:06 +0000 Subject: [PATCH 339/669] build(deps): Bump sphinx from 7.4.4 to 7.4.5 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.4 to 7.4.5. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.4...v7.4.5) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 09b2192c..d9d226eb 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.4.4 +Sphinx==7.4.5 sphinx-autodoc2==0.5.0 myst-parser==3.0.1 sphinx-rtd-theme==2.0.0 From 132f6f2087b30d55ee277be2ad367c778ef24da5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:33:11 +0000 Subject: [PATCH 340/669] build(deps): Bump sphinx from 7.4.5 to 7.4.6 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.5 to 7.4.6. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.5...v7.4.6) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index d9d226eb..48ac37bf 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.4.5 +Sphinx==7.4.6 sphinx-autodoc2==0.5.0 myst-parser==3.0.1 sphinx-rtd-theme==2.0.0 From 28d3bf9a8c64fc3c75c2a3d9abcd0b90365a4add Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:12:43 +0000 Subject: [PATCH 341/669] build(deps-dev): Bump pylint from 3.2.5 to 3.2.6 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.5 to 3.2.6. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.5...v3.2.6) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 84eb3dde..06f755df 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.2.2 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.2.5 +pylint==3.2.6 # code coverage coverage==7.6.0 pytest-cov==5.0.0 From c40fdda419f170aeb5c9ca1228d05d35a9406b1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 08:20:35 +0000 Subject: [PATCH 342/669] build(deps): Bump sphinx from 7.4.6 to 7.4.7 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.6 to 7.4.7. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.6...v7.4.7) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 48ac37bf..5a4bb14d 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.4.6 +Sphinx==7.4.7 sphinx-autodoc2==0.5.0 myst-parser==3.0.1 sphinx-rtd-theme==2.0.0 From 5ca88ae237514de828c4b7da603fd348028e56ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 08:51:51 +0000 Subject: [PATCH 343/669] build(deps-dev): Bump pytest from 8.2.2 to 8.3.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 06f755df..47986792 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.2.2 +pytest==8.3.1 responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.6 From 7c28810e731304080d2c2ca94d8b775e63152fa6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:08:39 +0000 Subject: [PATCH 344/669] build(deps-dev): Bump pytest from 8.3.1 to 8.3.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.1 to 8.3.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.1...8.3.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 47986792..fd728806 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.3.1 +pytest==8.3.2 responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.6 From b98cf2e403bb5ee233dccb1d99902fab6e2ee34b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:11:52 +0000 Subject: [PATCH 345/669] build(deps): Bump ibm-cloud-sdk-core from 3.20.3 to 3.20.4 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.20.3 to 3.20.4. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.20.3...v3.20.4) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 210653d7..cce20f22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.9.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.20.3", + "ibm_cloud_sdk_core==3.20.4", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 27757b87b84a67a56d381426f914540901723fcb Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:50:04 +0000 Subject: [PATCH 346/669] feat(generated): update generator to 3.93.0 Generated SDK source code using: - Generator version 3.93.0 - Specification version 1.0.0-dev0.1.14 - Automation (cloudant-sdks) version 5de6d7f --- ibmcloudant/cloudant_v1.py | 245 +++++++++++++++++++++------------- test/unit/test_cloudant_v1.py | 10 +- 2 files changed, 160 insertions(+), 95 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 501b7b37..7866bee2 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -11537,6 +11537,8 @@ class DesignDocument: * `secObj` - Security Object, with lists of database security roles, see the `SecurityObject`. :param dict views: (optional) Schema for design document views. + + This type supports additional properties of type object. """ # The set of defined properties for the class @@ -11561,7 +11563,7 @@ def __init__( options: Optional['DesignDocumentOptions'] = None, validate_doc_update: Optional[str] = None, views: Optional[dict] = None, - **kwargs, + **kwargs: Optional[object], ) -> None: """ Initialize a DesignDocument object. @@ -11653,7 +11655,7 @@ def __init__( * `secObj` - Security Object, with lists of database security roles, see the `SecurityObject`. :param dict views: (optional) Schema for design document views. - :param **kwargs: (optional) Any additional properties. + :param object **kwargs: (optional) Additional properties of type object """ self._attachments = _attachments self._conflicts = _conflicts @@ -11671,8 +11673,13 @@ def __init__( self.options = options self.validate_doc_update = validate_doc_update self.views = views - for _key, _value in kwargs.items(): - setattr(self, _key, _value) + for k, v in kwargs.items(): + if k not in DesignDocument._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) @classmethod def from_dict(cls, _dict: Dict) -> 'DesignDocument': @@ -11710,7 +11717,11 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocument': args['validate_doc_update'] = validate_doc_update if (views := _dict.get('views')) is not None: args['views'] = {k: DesignDocumentViewsMapReduce.from_dict(v) for k, v in views.items()} - args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + args[k] = v return cls(**args) @classmethod @@ -11783,8 +11794,8 @@ def to_dict(self) -> Dict: else: views_map[k] = v.to_dict() _dict['views'] = views_map - for _key in [k for k in vars(self).keys() if k not in DesignDocument._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in DesignDocument._properties]: + _dict[k] = getattr(self, k) return _dict def _to_dict(self): @@ -11792,21 +11803,23 @@ def _to_dict(self): return self.to_dict() def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of DesignDocument""" + """Return the additional properties from this instance of DesignDocument in the form of a dict.""" _dict = {} - - for _key in [k for k in vars(self).keys() if k not in DesignDocument._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in DesignDocument._properties]: + _dict[k] = getattr(self, k) return _dict def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of DesignDocument""" - for _key in [k for k in vars(self).keys() if k not in DesignDocument._properties]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in DesignDocument._properties: - setattr(self, _key, _value) + """Set a dictionary of additional properties in this instance of DesignDocument""" + for k in [_k for _k in vars(self).keys() if _k not in DesignDocument._properties]: + delattr(self, k) + for k, v in _dict.items(): + if k not in DesignDocument._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) def __str__(self) -> str: """Return a `str` version of this DesignDocument object.""" @@ -12395,6 +12408,8 @@ class Document: :param Revisions _revisions: (optional) Schema for list of revision information. :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a list of objects with information about local revisions and their status. + + This type supports additional properties of type object. """ # The set of defined properties for the class @@ -12412,7 +12427,7 @@ def __init__( _rev: Optional[str] = None, _revisions: Optional['Revisions'] = None, _revs_info: Optional[List['DocumentRevisionStatus']] = None, - **kwargs, + **kwargs: Optional[object], ) -> None: """ Initialize a Document object. @@ -12433,7 +12448,7 @@ def __init__( information. :param List[DocumentRevisionStatus] _revs_info: (optional) Schema for a list of objects with information about local revisions and their status. - :param **kwargs: (optional) Any additional properties. + :param object **kwargs: (optional) Additional properties of type object """ self._attachments = _attachments self._conflicts = _conflicts @@ -12444,8 +12459,13 @@ def __init__( self._rev = _rev self._revisions = _revisions self._revs_info = _revs_info - for _key, _value in kwargs.items(): - setattr(self, _key, _value) + for k, v in kwargs.items(): + if k not in Document._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) @classmethod def from_dict(cls, _dict: Dict) -> 'Document': @@ -12469,7 +12489,11 @@ def from_dict(cls, _dict: Dict) -> 'Document': args['_revisions'] = Revisions.from_dict(revisions) if (revs_info := _dict.get('_revs_info')) is not None: args['_revs_info'] = [DocumentRevisionStatus.from_dict(v) for v in revs_info] - args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + args[k] = v return cls(**args) @classmethod @@ -12513,8 +12537,8 @@ def to_dict(self) -> Dict: else: _revs_info_list.append(v.to_dict()) _dict['_revs_info'] = _revs_info_list - for _key in [k for k in vars(self).keys() if k not in Document._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in Document._properties]: + _dict[k] = getattr(self, k) return _dict def _to_dict(self): @@ -12522,21 +12546,23 @@ def _to_dict(self): return self.to_dict() def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of Document""" + """Return the additional properties from this instance of Document in the form of a dict.""" _dict = {} - - for _key in [k for k in vars(self).keys() if k not in Document._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in Document._properties]: + _dict[k] = getattr(self, k) return _dict def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of Document""" - for _key in [k for k in vars(self).keys() if k not in Document._properties]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in Document._properties: - setattr(self, _key, _value) + """Set a dictionary of additional properties in this instance of Document""" + for k in [_k for _k in vars(self).keys() if _k not in Document._properties]: + delattr(self, k) + for k, v in _dict.items(): + if k not in Document._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) def __str__(self) -> str: """Return a `str` version of this Document object.""" @@ -14121,6 +14147,8 @@ class IndexField: :param str name: (optional) Name of the field. :param str type: (optional) The type of the named field. + + This type supports additional properties of type str. Schema for sort direction. """ # The set of defined properties for the class @@ -14131,19 +14159,24 @@ def __init__( *, name: Optional[str] = None, type: Optional[str] = None, - **kwargs, + **kwargs: Optional[str], ) -> None: """ Initialize a IndexField object. :param str name: (optional) Name of the field. :param str type: (optional) The type of the named field. - :param **kwargs: (optional) Any additional properties. + :param str **kwargs: (optional) Schema for sort direction. """ self.name = name self.type = type - for _key, _value in kwargs.items(): - setattr(self, _key, _value) + for k, v in kwargs.items(): + if k not in IndexField._properties: + if not isinstance(v, str): + raise ValueError('Value for additional property {} must be of type str'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) @classmethod def from_dict(cls, _dict: Dict) -> 'IndexField': @@ -14153,7 +14186,11 @@ def from_dict(cls, _dict: Dict) -> 'IndexField': args['name'] = name if (type := _dict.get('type')) is not None: args['type'] = type - args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, str): + raise ValueError('Value for additional property {} must be of type str'.format(k)) + args[k] = v return cls(**args) @classmethod @@ -14168,8 +14205,8 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - for _key in [k for k in vars(self).keys() if k not in IndexField._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in IndexField._properties]: + _dict[k] = getattr(self, k) return _dict def _to_dict(self): @@ -14177,21 +14214,23 @@ def _to_dict(self): return self.to_dict() def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of IndexField""" + """Return the additional properties from this instance of IndexField in the form of a dict.""" _dict = {} - - for _key in [k for k in vars(self).keys() if k not in IndexField._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in IndexField._properties]: + _dict[k] = getattr(self, k) return _dict def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of IndexField""" - for _key in [k for k in vars(self).keys() if k not in IndexField._properties]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in IndexField._properties: - setattr(self, _key, _value) + """Set a dictionary of additional properties in this instance of IndexField""" + for k in [_k for _k in vars(self).keys() if _k not in IndexField._properties]: + delattr(self, k) + for k, v in _dict.items(): + if k not in IndexField._properties: + if not isinstance(v, str): + raise ValueError('Value for additional property {} must be of type str'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) def __str__(self) -> str: """Return a `str` version of this IndexField object.""" @@ -15669,6 +15708,8 @@ class ReplicationDocument: :param int worker_processes: (optional) Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput. + + This type supports additional properties of type object. """ # The set of defined properties for the class @@ -15711,7 +15752,7 @@ def __init__( winning_revs_only: Optional[bool] = None, worker_batch_size: Optional[int] = None, worker_processes: Optional[int] = None, - **kwargs, + **kwargs: Optional[object], ) -> None: """ Initialize a ReplicationDocument object. @@ -15829,7 +15870,7 @@ def __init__( :param int worker_processes: (optional) Controls how many separate processes will read from the changes manager and write to the target. A higher number can improve throughput. - :param **kwargs: (optional) Any additional properties. + :param object **kwargs: (optional) Additional properties of type object """ self._attachments = _attachments self._conflicts = _conflicts @@ -15865,8 +15906,13 @@ def __init__( self.winning_revs_only = winning_revs_only self.worker_batch_size = worker_batch_size self.worker_processes = worker_processes - for _key, _value in kwargs.items(): - setattr(self, _key, _value) + for k, v in kwargs.items(): + if k not in ReplicationDocument._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) @classmethod def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': @@ -15944,7 +15990,11 @@ def from_dict(cls, _dict: Dict) -> 'ReplicationDocument': args['worker_batch_size'] = worker_batch_size if (worker_processes := _dict.get('worker_processes')) is not None: args['worker_processes'] = worker_processes - args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + args[k] = v return cls(**args) @classmethod @@ -16050,8 +16100,8 @@ def to_dict(self) -> Dict: _dict['worker_batch_size'] = self.worker_batch_size if hasattr(self, 'worker_processes') and self.worker_processes is not None: _dict['worker_processes'] = self.worker_processes - for _key in [k for k in vars(self).keys() if k not in ReplicationDocument._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in ReplicationDocument._properties]: + _dict[k] = getattr(self, k) return _dict def _to_dict(self): @@ -16059,21 +16109,23 @@ def _to_dict(self): return self.to_dict() def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of ReplicationDocument""" + """Return the additional properties from this instance of ReplicationDocument in the form of a dict.""" _dict = {} - - for _key in [k for k in vars(self).keys() if k not in ReplicationDocument._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in ReplicationDocument._properties]: + _dict[k] = getattr(self, k) return _dict def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of ReplicationDocument""" - for _key in [k for k in vars(self).keys() if k not in ReplicationDocument._properties]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in ReplicationDocument._properties: - setattr(self, _key, _value) + """Set a dictionary of additional properties in this instance of ReplicationDocument""" + for k in [_k for _k in vars(self).keys() if _k not in ReplicationDocument._properties]: + delattr(self, k) + for k, v in _dict.items(): + if k not in ReplicationDocument._properties: + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) def __str__(self) -> str: """Return a `str` version of this ReplicationDocument object.""" @@ -18060,6 +18112,8 @@ class ServerVendor: :param str name: Vendor name. :param str variant: Vendor variant. :param str version: Vendor version. + + This type supports additional properties of type str. """ # The set of defined properties for the class @@ -18070,7 +18124,7 @@ def __init__( name: str, variant: str, version: str, - **kwargs, + **kwargs: Optional[str], ) -> None: """ Initialize a ServerVendor object. @@ -18078,13 +18132,18 @@ def __init__( :param str name: Vendor name. :param str variant: Vendor variant. :param str version: Vendor version. - :param **kwargs: (optional) Any additional properties. + :param str **kwargs: (optional) Additional properties of type str """ self.name = name self.variant = variant self.version = version - for _key, _value in kwargs.items(): - setattr(self, _key, _value) + for k, v in kwargs.items(): + if k not in ServerVendor._properties: + if not isinstance(v, str): + raise ValueError('Value for additional property {} must be of type str'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) @classmethod def from_dict(cls, _dict: Dict) -> 'ServerVendor': @@ -18102,7 +18161,11 @@ def from_dict(cls, _dict: Dict) -> 'ServerVendor': args['version'] = version else: raise ValueError('Required property \'version\' not present in ServerVendor JSON') - args.update({k: v for (k, v) in _dict.items() if k not in cls._properties}) + for k, v in _dict.items(): + if k not in cls._properties: + if not isinstance(v, str): + raise ValueError('Value for additional property {} must be of type str'.format(k)) + args[k] = v return cls(**args) @classmethod @@ -18119,8 +18182,8 @@ def to_dict(self) -> Dict: _dict['variant'] = self.variant if hasattr(self, 'version') and self.version is not None: _dict['version'] = self.version - for _key in [k for k in vars(self).keys() if k not in ServerVendor._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in ServerVendor._properties]: + _dict[k] = getattr(self, k) return _dict def _to_dict(self): @@ -18128,21 +18191,23 @@ def _to_dict(self): return self.to_dict() def get_properties(self) -> Dict: - """Return a dictionary of arbitrary properties from this instance of ServerVendor""" + """Return the additional properties from this instance of ServerVendor in the form of a dict.""" _dict = {} - - for _key in [k for k in vars(self).keys() if k not in ServerVendor._properties]: - _dict[_key] = getattr(self, _key) + for k in [_k for _k in vars(self).keys() if _k not in ServerVendor._properties]: + _dict[k] = getattr(self, k) return _dict def set_properties(self, _dict: dict): - """Set a dictionary of arbitrary properties to this instance of ServerVendor""" - for _key in [k for k in vars(self).keys() if k not in ServerVendor._properties]: - delattr(self, _key) - - for _key, _value in _dict.items(): - if _key not in ServerVendor._properties: - setattr(self, _key, _value) + """Set a dictionary of additional properties in this instance of ServerVendor""" + for k in [_k for _k in vars(self).keys() if _k not in ServerVendor._properties]: + delattr(self, k) + for k, v in _dict.items(): + if k not in ServerVendor._properties: + if not isinstance(v, str): + raise ValueError('Value for additional property {} must be of type str'.format(k)) + setattr(self, k, v) + else: + raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) def __str__(self) -> str: """Return a `str` version of this ServerVendor object.""" diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 249684fa..0feb9c4b 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -14685,7 +14685,7 @@ def test_design_document_serialization(self): expected_dict = {'foo': 'testString'} design_document_model.set_properties(expected_dict) actual_dict = design_document_model.get_properties() - assert actual_dict == expected_dict + assert actual_dict.keys() == expected_dict.keys() class TestModel_DesignDocumentInformation: @@ -15025,7 +15025,7 @@ def test_document_serialization(self): expected_dict = {'foo': 'testString'} document_model.set_properties(expected_dict) actual_dict = document_model.get_properties() - assert actual_dict == expected_dict + assert actual_dict.keys() == expected_dict.keys() class TestModel_DocumentResult: @@ -15654,7 +15654,7 @@ def test_index_field_serialization(self): expected_dict = {'foo': 'asc'} index_field_model.set_properties(expected_dict) actual_dict = index_field_model.get_properties() - assert actual_dict == expected_dict + assert actual_dict.keys() == expected_dict.keys() class TestModel_IndexInformation: @@ -16418,7 +16418,7 @@ def test_replication_document_serialization(self): expected_dict = {'foo': 'testString'} replication_document_model.set_properties(expected_dict) actual_dict = replication_document_model.get_properties() - assert actual_dict == expected_dict + assert actual_dict.keys() == expected_dict.keys() class TestModel_Revisions: @@ -17347,7 +17347,7 @@ def test_server_vendor_serialization(self): expected_dict = {'foo': 'testString'} server_vendor_model.set_properties(expected_dict) actual_dict = server_vendor_model.get_properties() - assert actual_dict == expected_dict + assert actual_dict.keys() == expected_dict.keys() class TestModel_SessionAuthentication: From 0ee19760f729976daf404b17176057661b5ca58f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:53:14 +0000 Subject: [PATCH 347/669] build(deps-dev): Bump coverage from 7.6.0 to 7.6.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.0 to 7.6.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.0...7.6.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fd728806..a088898e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.6 # code coverage -coverage==7.6.0 +coverage==7.6.1 pytest-cov==5.0.0 From 9f0971d956612ecb2a71686c2c7758a078f683d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 08:13:21 +0000 Subject: [PATCH 348/669] build(deps): Bump myst-parser from 3.0.1 to 4.0.0 Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 3.0.1 to 4.0.0. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/executablebooks/MyST-Parser/compare/v3.0.1...v4.0.0) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 5a4bb14d..e3a43d48 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 Sphinx==7.4.7 sphinx-autodoc2==0.5.0 -myst-parser==3.0.1 +myst-parser==4.0.0 sphinx-rtd-theme==2.0.0 From 604539c4436c5f2131d1a7a771ae163b2e68d7fc Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:06:01 +0000 Subject: [PATCH 349/669] build(generated): remove linting on tests Generated SDK source code using: - Generator version 3.93.0 - Specification version 1.0.0-dev0.1.14 - Automation (cloudant-sdks) version 55fd79b --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 18dd8571..f84a0010 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -291,7 +291,7 @@ void runTests() { sh ''' export PIP_INDEX_URL=https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL_DOWN##'https://'}/api/pypi/cloudant-sdks-pypi-virtual/simple pip install -r requirements-dev.txt && flit install --only-deps - pylint --rcfile=.pylintrc ibmcloudant test + pylint --rcfile=.pylintrc ibmcloudant python3 -m pytest --junitxml=junitreports/junit-pytest.xml --cov=ibmcloudant ''' } From ff052f7ce1280d53954dbd07a62f8f580fc7f65a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:24:39 +0000 Subject: [PATCH 350/669] build(deps): Bump ibm-cloud-sdk-core from 3.20.4 to 3.20.6 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.20.4 to 3.20.6. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.20.4...v3.20.6) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cce20f22..b7a3a638 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.9.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.20.4", + "ibm_cloud_sdk_core==3.20.6", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 0744b0e90b9211f561f16456dc40a4d35e5da51c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 21:22:11 +0000 Subject: [PATCH 351/669] build(deps): Bump sphinx from 7.4.7 to 8.0.2 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.7 to 8.0.2. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.7...v8.0.2) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index e3a43d48..cd20c35a 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==7.4.7 +Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 sphinx-rtd-theme==2.0.0 From 97ff416bcf0a0d61d0c8c00561e9a4570a4a90b9 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Fri, 23 Aug 2024 13:47:17 -0300 Subject: [PATCH 352/669] build(deps): Bump sphinx-rtd-theme from 2.0.0 to 3.0.0rc1 --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index cd20c35a..b5f24cb6 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==2.0.0 +sphinx-rtd-theme==3.0.0rc1 From f18b5f08a4eededc7db1b5b11a7f5feaa003d04a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:46:19 +0000 Subject: [PATCH 353/669] build(deps-dev): Bump pylint from 3.2.6 to 3.2.7 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.6 to 3.2.7. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.6...v3.2.7) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a088898e..2fe3b024 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.3.2 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.2.6 +pylint==3.2.7 # code coverage coverage==7.6.1 pytest-cov==5.0.0 From a520b521603898bd2ba4ad830c8d2838d26528ac Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:52:17 +0000 Subject: [PATCH 354/669] feat(generated): update API definition to 1.0.0-dev0.1.15 Generated SDK source code using: - Generator version 3.94.1 - Specification version 1.0.0-dev0.1.15 - Automation (cloudant-sdks) version bd3193b --- ibmcloudant/cloudant_v1.py | 474 ++++++++++++++++++++------- test/integration/test_cloudant_v1.py | 21 +- test/unit/test_cloudant_v1.py | 161 ++++++--- 3 files changed, 478 insertions(+), 178 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 7866bee2..1d02b7da 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -121,45 +121,6 @@ def get_server_information( response = self.send(request, **kwargs) return response - def get_membership_information( - self, - **kwargs, - ) -> DetailedResponse: - """ - Retrieve cluster membership information. - - Displays the nodes that are part of the cluster as `cluster_nodes`. The field, - `all_nodes`, displays all nodes this node knows about, including the ones that are - part of the cluster. This endpoint is useful when you set up a cluster. - - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `MembershipInformation` object - """ - - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='get_membership_information', - ) - headers.update(sdk_headers) - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - url = '/_membership' - request = self.prepare_request( - method='GET', - url=url, - headers=headers, - ) - - response = self.send(request, **kwargs) - return response - def get_uuids( self, *, @@ -260,7 +221,7 @@ def put_capacity_throughput_configuration( :param int blocks: A number of blocks of throughput units. A block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned - throughput capacity. + throughput capacity. Not available for some plans. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CapacityThroughputInformation` object @@ -462,14 +423,19 @@ def post_changes( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str last_event_id: (optional) Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides @@ -675,14 +641,19 @@ def post_changes_as_stream( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str last_event_id: (optional) Header parameter to specify the ID of the last events received by the server on a previous connection. Overrides @@ -1094,6 +1065,9 @@ def put_database( :param str db: Path parameter to specify the database name. :param bool partitioned: (optional) Query parameter to specify whether to enable database partitions when creating a database. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partitioned-databases-database-partitioning) + to understand the limitations and appropriate use cases. :param int q: (optional) The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends using the default value for most databases. However, if your database is expected to @@ -2538,6 +2512,9 @@ def put_document( well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts. + Avoid using this parameter, since this option applies document revisions + without checking for conflicts, so it is very easy to accidentally end up + with a large number of conflicts. :param str rev: (optional) Query parameter to specify a document revision. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -2873,6 +2850,9 @@ def put_design_document( well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts. + Avoid using this parameter, since this option applies document revisions + without checking for conflicts, so it is very easy to accidentally end up + with a large number of conflicts. :param str rev: (optional) Query parameter to specify a document revision. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -3241,6 +3221,9 @@ def post_view( :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. + A default `reduce` view type can be disabled to behave like a `map` by + setting `reduce=false` explicitly. + Be aware that `include_docs=true` can only be used with `map` views. :param bool stable: (optional) Query parameter to specify whether use the same replica of the index on each request. The default value `false` contacts all replicas and returns the result from the first, fastest, @@ -3406,6 +3389,9 @@ def post_view_as_stream( :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. + A default `reduce` view type can be disabled to behave like a `map` by + setting `reduce=false` explicitly. + Be aware that `include_docs=true` can only be used with `map` views. :param bool stable: (optional) Query parameter to specify whether use the same replica of the index on each request. The default value `false` contacts all replicas and returns the result from the first, fastest, @@ -3939,6 +3925,9 @@ def post_partition_search( databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param str partition_key: Path parameter to specify the database partition @@ -4070,6 +4059,9 @@ def post_partition_search_as_stream( databases to be queried by using Lucene Query Parser Syntax. Search indexes are defined by an index function, similar to a map function in MapReduce views. The index function decides what data to index and store in the index. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param str partition_key: Path parameter to specify the database partition @@ -4209,6 +4201,9 @@ def post_partition_view( the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the `GET /{db}/_design/{ddoc}/_view/{view}` API. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param str partition_key: Path parameter to specify the database partition @@ -4258,6 +4253,9 @@ def post_partition_view( :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. + A default `reduce` view type can be disabled to behave like a `map` by + setting `reduce=false` explicitly. + Be aware that `include_docs=true` can only be used with `map` views. :param object start_key: (optional) Schema for any JSON type. :param str start_key_doc_id: (optional) Schema for a document ID. :param str update: (optional) Parameter to specify whether or not the view @@ -4367,6 +4365,9 @@ def post_partition_view_as_stream( the specification of explicit keys to be retrieved from the view results. The remainder of the POST view functionality is identical to the `GET /{db}/_design/{ddoc}/_view/{view}` API. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param str partition_key: Path parameter to specify the database partition @@ -4416,6 +4417,9 @@ def post_partition_view_as_stream( :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. + A default `reduce` view type can be disabled to behave like a `map` by + setting `reduce=false` explicitly. + Be aware that `include_docs=true` can only be used with `map` views. :param object start_key: (optional) Schema for any JSON type. :param str start_key_doc_id: (optional) Schema for a document ID. :param str update: (optional) Parameter to specify whether or not the view @@ -4538,14 +4542,19 @@ def post_partition_explain( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -4585,6 +4594,9 @@ def post_partition_explain( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. + If the specified index does not exist or cannot answer the query then the + value is ignored and another index or a full scan of all documents will + answer the query. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ExplainResult` object @@ -4668,6 +4680,9 @@ def post_partition_find( `_all_docs` index. This is not recommended because it has a noticeable performance impact causing a full scan of the partition with each request. In this case the response body will include a warning field recommending that an index is created. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param str partition_key: Path parameter to specify the database partition @@ -4694,14 +4709,19 @@ def post_partition_find( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -4741,6 +4761,9 @@ def post_partition_find( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. + If the specified index does not exist or cannot answer the query then the + value is ignored and another index or a full scan of all documents will + answer the query. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `FindResult` object @@ -4824,6 +4847,9 @@ def post_partition_find_as_stream( `_all_docs` index. This is not recommended because it has a noticeable performance impact causing a full scan of the partition with each request. In this case the response body will include a warning field recommending that an index is created. + Before using read the + [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) + to understand the limitations and appropriate use cases. :param str db: Path parameter to specify the database name. :param str partition_key: Path parameter to specify the database partition @@ -4850,14 +4876,19 @@ def post_partition_find_as_stream( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -4897,6 +4928,9 @@ def post_partition_find_as_stream( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. + If the specified index does not exist or cannot answer the query then the + value is ignored and another index or a full scan of all documents will + answer the query. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result @@ -5003,14 +5037,19 @@ def post_explain( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -5050,6 +5089,9 @@ def post_explain( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. + If the specified index does not exist or cannot answer the query then the + value is ignored and another index or a full scan of all documents will + answer the query. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5163,14 +5205,19 @@ def post_find( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -5210,6 +5257,9 @@ def post_find( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. + If the specified index does not exist or cannot answer the query then the + value is ignored and another index or a full scan of all documents will + answer the query. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5323,14 +5373,19 @@ def post_find_as_stream( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -5370,6 +5425,9 @@ def post_find_as_stream( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. + If the specified index does not exist or cannot answer the query then the + value is ignored and another index or a full scan of all documents will + answer the query. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -6407,6 +6465,9 @@ def put_replication_document( well-formed _rev must be included in the document. False is used by the replicator to insert documents into the target database even if that leads to the creation of conflicts. + Avoid using this parameter, since this option applies document revisions + without checking for conflicts, so it is very easy to accidentally end up + with a large number of conflicts. :param str rev: (optional) Query parameter to specify a document revision. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -7875,6 +7936,45 @@ def get_active_tasks( response = self.send(request, **kwargs) return response + def get_membership_information( + self, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve cluster membership information. + + Displays the nodes that are part of the cluster as `cluster_nodes`. The field, + `all_nodes`, displays all nodes this node knows about, including the ones that are + part of the cluster. This endpoint is useful when you set up a cluster. + + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `MembershipInformation` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_membership_information', + ) + headers.update(sdk_headers) + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/_membership' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) + return response + def get_up_information( self, **kwargs, @@ -9683,6 +9783,9 @@ class BulkDocs: :param List[Document] docs: Array of documents. :param bool new_edits: (optional) If `false`, prevents the database from assigning them new revision IDs. Default is `true`. + Avoid using this parameter, since this option applies document revisions without + checking for conflicts, so it is very easy to accidentally end up with a large + number of conflicts. """ def __init__( @@ -9697,6 +9800,9 @@ def __init__( :param List[Document] docs: Array of documents. :param bool new_edits: (optional) If `false`, prevents the database from assigning them new revision IDs. Default is `true`. + Avoid using this parameter, since this option applies document revisions + without checking for conflicts, so it is very easy to accidentally end up + with a large number of conflicts. """ self.docs = docs self.new_edits = new_edits @@ -12132,6 +12238,8 @@ class DesignDocumentViewsMapReduce: Schema for view functions definition. :param str map: JavaScript map function as a string. + :param DesignDocumentViewsMapReduceOptions options: (optional) Options of view + build resuls. :param str reduce: (optional) JavaScript reduce function as a string. """ @@ -12139,15 +12247,19 @@ def __init__( self, map: str, *, + options: Optional['DesignDocumentViewsMapReduceOptions'] = None, reduce: Optional[str] = None, ) -> None: """ Initialize a DesignDocumentViewsMapReduce object. :param str map: JavaScript map function as a string. + :param DesignDocumentViewsMapReduceOptions options: (optional) Options of + view build resuls. :param str reduce: (optional) JavaScript reduce function as a string. """ self.map = map + self.options = options self.reduce = reduce @classmethod @@ -12158,6 +12270,8 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduce': args['map'] = map else: raise ValueError('Required property \'map\' not present in DesignDocumentViewsMapReduce JSON') + if (options := _dict.get('options')) is not None: + args['options'] = DesignDocumentViewsMapReduceOptions.from_dict(options) if (reduce := _dict.get('reduce')) is not None: args['reduce'] = reduce return cls(**args) @@ -12172,6 +12286,11 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'map') and self.map is not None: _dict['map'] = self.map + if hasattr(self, 'options') and self.options is not None: + if isinstance(self.options, dict): + _dict['options'] = self.options + else: + _dict['options'] = self.options.to_dict() if hasattr(self, 'reduce') and self.reduce is not None: _dict['reduce'] = self.reduce return _dict @@ -12195,6 +12314,85 @@ def __ne__(self, other: 'DesignDocumentViewsMapReduce') -> bool: return not self == other +class DesignDocumentViewsMapReduceOptions: + """ + Options of view build resuls. + + + This type supports additional properties of type object. + """ + + def __init__( + self, + **kwargs: Optional[object], + ) -> None: + """ + Initialize a DesignDocumentViewsMapReduceOptions object. + + :param object **kwargs: (optional) Additional properties of type object + """ + for k, v in kwargs.items(): + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduceOptions': + """Initialize a DesignDocumentViewsMapReduceOptions object from a json dictionary.""" + args = {} + for k, v in _dict.items(): + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + args[k] = v + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DesignDocumentViewsMapReduceOptions object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + for k in [_k for _k in vars(self).keys()]: + _dict[k] = getattr(self, k) + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def get_properties(self) -> Dict: + """Return the additional properties from this instance of DesignDocumentViewsMapReduceOptions in the form of a dict.""" + _dict = {} + for k in [_k for _k in vars(self).keys()]: + _dict[k] = getattr(self, k) + return _dict + + def set_properties(self, _dict: dict): + """Set a dictionary of additional properties in this instance of DesignDocumentViewsMapReduceOptions""" + for k in [_k for _k in vars(self).keys()]: + delattr(self, k) + for k, v in _dict.items(): + if not isinstance(v, object): + raise ValueError('Value for additional property {} must be of type object'.format(k)) + setattr(self, k, v) + + def __str__(self) -> str: + """Return a `str` version of this DesignDocumentViewsMapReduceOptions object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DesignDocumentViewsMapReduceOptions') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'DesignDocumentViewsMapReduceOptions') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class DocsResultRow: """ Schema for a row of document information in a DocsResult. @@ -12981,15 +13179,19 @@ class ExplainResult: argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when - the specified field contains a value that is equal to the supplied argument. See - [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list - of all available combination and conditional operators. + the specified field contains a value that is equal to the supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered + from an index. For query selectors use these operators in conjunction with + equality operators or create and use a partial index to reduce the number of + documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a list of + all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param List[SelectorHint] selector_hints: (optional) Schema for a list of objects with extra information on the selector to provide insights about its @@ -13047,14 +13249,19 @@ def __init__( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param int skip: Skip parameter used. :param List[IndexCandidate] index_candidates: (optional) Schema for the @@ -13991,15 +14198,19 @@ class IndexDefinition: argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when - the specified field contains a value that is equal to the supplied argument. See - [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list - of all available combination and conditional operators. + the specified field contains a value that is equal to the supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered + from an index. For query selectors use these operators in conjunction with + equality operators or create and use a partial index to reduce the number of + documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a list of + all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). """ @@ -14058,14 +14269,19 @@ def __init__( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). """ self.default_analyzer = default_analyzer @@ -15662,15 +15878,19 @@ class ReplicationDocument: argument is either another selector, or an array of selectors. * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when - the specified field contains a value that is equal to the supplied argument. See - [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list - of all available combination and conditional operators. + the specified field contains a value that is equal to the supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered + from an index. For query selectors use these operators in conjunction with + equality operators or create and use a partial index to reduce the number of + documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a list of + all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str since_seq: (optional) Start the replication at a specific sequence value. @@ -15828,14 +16048,19 @@ def __init__( * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the - supplied argument. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a - list of all available combination and conditional operators. + supplied argument. + It is important for query performance to use appropriate selectors: * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis of a query. You should include at least one of these in a selector. - For further reference see - [selector + * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be + answered from an index. For query selectors use these operators in + conjunction with equality operators or create and use a partial index to + reduce the number of documents that will need to be scanned. + See [the Cloudant + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + list of all available combination and conditional operators. + For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str since_seq: (optional) Start the replication at a specific sequence value. @@ -18452,9 +18677,9 @@ class ThroughputInformation: Schema for detailed information about throughput capacity with breakdown by specific throughput requests classes. - :param int blocks: A number of blocks of throughput units. A block consists of - 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned throughput - capacity. + :param int blocks: (optional) A number of blocks of throughput units. A block + consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of + provisioned throughput capacity. Not available for some plans. :param int query: Provisioned global queries capacity in operations per second. :param int read: Provisioned reads capacity in operations per second. :param int write: Provisioned writes capacity in operations per second. @@ -18462,21 +18687,22 @@ class ThroughputInformation: def __init__( self, - blocks: int, query: int, read: int, write: int, + *, + blocks: Optional[int] = None, ) -> None: """ Initialize a ThroughputInformation object. - :param int blocks: A number of blocks of throughput units. A block consists - of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned - throughput capacity. :param int query: Provisioned global queries capacity in operations per second. :param int read: Provisioned reads capacity in operations per second. :param int write: Provisioned writes capacity in operations per second. + :param int blocks: (optional) A number of blocks of throughput units. A + block consists of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of + provisioned throughput capacity. Not available for some plans. """ self.blocks = blocks self.query = query @@ -18489,8 +18715,6 @@ def from_dict(cls, _dict: Dict) -> 'ThroughputInformation': args = {} if (blocks := _dict.get('blocks')) is not None: args['blocks'] = blocks - else: - raise ValueError('Required property \'blocks\' not present in ThroughputInformation JSON') if (query := _dict.get('query')) is not None: args['query'] = query else: @@ -18970,6 +19194,9 @@ class ViewQuery: :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. + A default `reduce` view type can be disabled to behave like a `map` by setting + `reduce=false` explicitly. + Be aware that `include_docs=true` can only be used with `map` views. :param bool stable: (optional) Query parameter to specify whether use the same replica of the index on each request. The default value `false` contacts all replicas and returns the result from the first, fastest, responder. Setting it @@ -19055,6 +19282,9 @@ def __init__( :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. + A default `reduce` view type can be disabled to behave like a `map` by + setting `reduce=false` explicitly. + Be aware that `include_docs=true` can only be used with `map` views. :param bool stable: (optional) Query parameter to specify whether use the same replica of the index on each request. The default value `false` contacts all replicas and returns the result from the first, fastest, diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index a88ad507..d2cd8069 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -60,14 +60,6 @@ def test_get_server_information(self): server_information = response.get_result() assert server_information is not None - @needscredentials - def test_get_membership_information(self): - response = self.cloudant_service.get_membership_information() - - assert response.get_status_code() == 200 - membership_information = response.get_result() - assert membership_information is not None - @needscredentials def test_get_uuids(self): response = self.cloudant_service.get_uuids( @@ -763,9 +755,14 @@ def test_put_design_document(self): design_document_options_model = { 'partitioned': True, } + # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model + design_document_views_map_reduce_options_model = { + 'foo': 'testString', + } # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = { 'map': 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}', + 'options': design_document_views_map_reduce_options_model, 'reduce': 'testString', } # Construct a dict representation of a DesignDocument model @@ -1901,6 +1898,14 @@ def test_get_active_tasks(self): list_active_task = response.get_result() assert list_active_task is not None + @needscredentials + def test_get_membership_information(self): + response = self.cloudant_service.get_membership_information() + + assert response.get_status_code() == 200 + membership_information = response.get_result() + assert membership_information is not None + @needscredentials def test_get_up_information(self): response = self.cloudant_service.get_up_information() diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 0feb9c4b..6429727e 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -134,44 +134,6 @@ def test_get_server_information_all_params_with_retries(self): self.test_get_server_information_all_params() -class TestGetMembershipInformation: - """ - Test Class for get_membership_information - """ - - @responses.activate - def test_get_membership_information_all_params(self): - """ - get_membership_information() - """ - # Set up mock - url = preprocess_url('/_membership') - mock_response = '{"all_nodes": ["all_nodes"], "cluster_nodes": ["cluster_nodes"]}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Invoke method - response = _service.get_membership_information() - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_membership_information_all_params_with_retries(self): - # Enable retries and run test_get_membership_information_all_params. - _service.enable_retries() - self.test_get_membership_information_all_params() - - # Disable retries and run test_get_membership_information_all_params. - _service.disable_retries() - self.test_get_membership_information_all_params() - - class TestGetUuids: """ Test Class for get_uuids @@ -264,7 +226,7 @@ def test_get_capacity_throughput_information_all_params(self): """ # Set up mock url = preprocess_url('/_api/v2/user/capacity/throughput') - mock_response = '{"current": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}}' + mock_response = '{"current": {"throughput": {"blocks": 1, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 1, "query": 0, "read": 0, "write": 0}}}' responses.add( responses.GET, url, @@ -302,7 +264,7 @@ def test_put_capacity_throughput_configuration_all_params(self): """ # Set up mock url = preprocess_url('/_api/v2/user/capacity/throughput') - mock_response = '{"current": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}}' + mock_response = '{"current": {"throughput": {"blocks": 1, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 1, "query": 0, "read": 0, "write": 0}}}' responses.add( responses.PUT, url, @@ -347,7 +309,7 @@ def test_put_capacity_throughput_configuration_value_error(self): """ # Set up mock url = preprocess_url('/_api/v2/user/capacity/throughput') - mock_response = '{"current": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 0, "query": 0, "read": 0, "write": 0}}}' + mock_response = '{"current": {"throughput": {"blocks": 1, "query": 0, "read": 0, "write": 0}}, "target": {"throughput": {"blocks": 1, "query": 0, "read": 0, "write": 0}}}' responses.add( responses.PUT, url, @@ -4747,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"], "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "options": {}, "reduce": "reduce"}}}' responses.add( responses.GET, url, @@ -4822,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"], "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "options": {}, "reduce": "reduce"}}}' responses.add( responses.GET, url, @@ -4862,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"], "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "options": {}, "reduce": "reduce"}}}' responses.add( responses.GET, url, @@ -4958,9 +4920,14 @@ def test_put_design_document_all_params(self): design_document_options_model = {} design_document_options_model['partitioned'] = True + # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model + design_document_views_map_reduce_options_model = {} + design_document_views_map_reduce_options_model['foo'] = 'testString' + # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' + design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5088,9 +5055,14 @@ def test_put_design_document_required_params(self): design_document_options_model = {} design_document_options_model['partitioned'] = True + # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model + design_document_views_map_reduce_options_model = {} + design_document_views_map_reduce_options_model['foo'] = 'testString' + # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' + design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5204,9 +5176,14 @@ def test_put_design_document_value_error(self): design_document_options_model = {} design_document_options_model['partitioned'] = True + # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model + design_document_views_map_reduce_options_model = {} + design_document_views_map_reduce_options_model['foo'] = 'testString' + # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' + design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -12911,6 +12888,44 @@ def test_get_active_tasks_all_params_with_retries(self): self.test_get_active_tasks_all_params() +class TestGetMembershipInformation: + """ + Test Class for get_membership_information + """ + + @responses.activate + def test_get_membership_information_all_params(self): + """ + get_membership_information() + """ + # Set up mock + url = preprocess_url('/_membership') + mock_response = '{"all_nodes": ["all_nodes"], "cluster_nodes": ["cluster_nodes"]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.get_membership_information() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_membership_information_all_params_with_retries(self): + # Enable retries and run test_get_membership_information_all_params. + _service.enable_retries() + self.test_get_membership_information_all_params() + + # Disable retries and run test_get_membership_information_all_params. + _service.disable_retries() + self.test_get_membership_information_all_params() + + class TestGetUpInformation: """ Test Class for get_up_information @@ -13899,7 +13914,7 @@ def test_capacity_throughput_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. throughput_information_model = {} # ThroughputInformation - throughput_information_model['blocks'] = 0 + throughput_information_model['blocks'] = 1 throughput_information_model['query'] = 0 throughput_information_model['read'] = 0 throughput_information_model['write'] = 0 @@ -13944,7 +13959,7 @@ def test_capacity_throughput_information_current_serialization(self): # Construct dict forms of any model objects needed in order to build this model. throughput_information_model = {} # ThroughputInformation - throughput_information_model['blocks'] = 0 + throughput_information_model['blocks'] = 1 throughput_information_model['query'] = 0 throughput_information_model['read'] = 0 throughput_information_model['write'] = 0 @@ -13982,7 +13997,7 @@ def test_capacity_throughput_information_target_serialization(self): # Construct dict forms of any model objects needed in order to build this model. throughput_information_model = {} # ThroughputInformation - throughput_information_model['blocks'] = 0 + throughput_information_model['blocks'] = 1 throughput_information_model['query'] = 0 throughput_information_model['read'] = 0 throughput_information_model['write'] = 0 @@ -14638,8 +14653,12 @@ def test_design_document_serialization(self): design_document_options_model = {} # DesignDocumentOptions design_document_options_model['partitioned'] = True + design_document_views_map_reduce_options_model = {} # DesignDocumentViewsMapReduceOptions + design_document_views_map_reduce_options_model['foo'] = 'testString' + design_document_views_map_reduce_model = {} # DesignDocumentViewsMapReduce design_document_views_map_reduce_model['map'] = 'testString' + design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a json representation of a DesignDocument model @@ -14832,9 +14851,15 @@ def test_design_document_views_map_reduce_serialization(self): Test serialization/deserialization for DesignDocumentViewsMapReduce """ + # Construct dict forms of any model objects needed in order to build this model. + + design_document_views_map_reduce_options_model = {} # DesignDocumentViewsMapReduceOptions + design_document_views_map_reduce_options_model['foo'] = 'testString' + # Construct a json representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model_json = {} design_document_views_map_reduce_model_json['map'] = 'testString' + design_document_views_map_reduce_model_json['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model_json['reduce'] = 'testString' # Construct a model instance of DesignDocumentViewsMapReduce by calling from_dict on the json representation @@ -14853,6 +14878,46 @@ def test_design_document_views_map_reduce_serialization(self): assert design_document_views_map_reduce_model_json2 == design_document_views_map_reduce_model_json +class TestModel_DesignDocumentViewsMapReduceOptions: + """ + Test Class for DesignDocumentViewsMapReduceOptions + """ + + def test_design_document_views_map_reduce_options_serialization(self): + """ + Test serialization/deserialization for DesignDocumentViewsMapReduceOptions + """ + + # Construct a json representation of a DesignDocumentViewsMapReduceOptions model + design_document_views_map_reduce_options_model_json = {} + design_document_views_map_reduce_options_model_json['foo'] = 'testString' + + # Construct a model instance of DesignDocumentViewsMapReduceOptions by calling from_dict on the json representation + design_document_views_map_reduce_options_model = DesignDocumentViewsMapReduceOptions.from_dict(design_document_views_map_reduce_options_model_json) + assert design_document_views_map_reduce_options_model != False + + # Construct a model instance of DesignDocumentViewsMapReduceOptions by calling from_dict on the json representation + design_document_views_map_reduce_options_model_dict = DesignDocumentViewsMapReduceOptions.from_dict(design_document_views_map_reduce_options_model_json).__dict__ + design_document_views_map_reduce_options_model2 = DesignDocumentViewsMapReduceOptions(**design_document_views_map_reduce_options_model_dict) + + # Verify the model instances are equivalent + assert design_document_views_map_reduce_options_model == design_document_views_map_reduce_options_model2 + + # Convert model instance back to dict and verify no loss of data + design_document_views_map_reduce_options_model_json2 = design_document_views_map_reduce_options_model.to_dict() + assert design_document_views_map_reduce_options_model_json2 == design_document_views_map_reduce_options_model_json + + # Test get_properties and set_properties methods. + design_document_views_map_reduce_options_model.set_properties({}) + actual_dict = design_document_views_map_reduce_options_model.get_properties() + assert actual_dict == {} + + expected_dict = {'foo': 'testString'} + design_document_views_map_reduce_options_model.set_properties(expected_dict) + actual_dict = design_document_views_map_reduce_options_model.get_properties() + assert actual_dict.keys() == expected_dict.keys() + + class TestModel_DocsResultRow: """ Test Class for DocsResultRow @@ -17468,7 +17533,7 @@ def test_throughput_information_serialization(self): # Construct a json representation of a ThroughputInformation model throughput_information_model_json = {} - throughput_information_model_json['blocks'] = 0 + throughput_information_model_json['blocks'] = 1 throughput_information_model_json['query'] = 0 throughput_information_model_json['read'] = 0 throughput_information_model_json['write'] = 0 From 98c70259eb4e2c5b53f9266d64daa60e3886977d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:34:59 +0000 Subject: [PATCH 355/669] feat(generated): update API definition to 1.0.0-dev0.1.18 Generated SDK source code using: - Generator version 3.94.1 - Specification version 1.0.0-dev0.1.18 - Automation (cloudant-sdks) version acd1ed2 --- ibmcloudant/cloudant_v1.py | 92 ---------------------------- test/integration/test_cloudant_v1.py | 5 -- test/unit/test_cloudant_v1.py | 71 +-------------------- 3 files changed, 3 insertions(+), 165 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 1d02b7da..5f31bdd1 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -12238,8 +12238,6 @@ class DesignDocumentViewsMapReduce: Schema for view functions definition. :param str map: JavaScript map function as a string. - :param DesignDocumentViewsMapReduceOptions options: (optional) Options of view - build resuls. :param str reduce: (optional) JavaScript reduce function as a string. """ @@ -12247,19 +12245,15 @@ def __init__( self, map: str, *, - options: Optional['DesignDocumentViewsMapReduceOptions'] = None, reduce: Optional[str] = None, ) -> None: """ Initialize a DesignDocumentViewsMapReduce object. :param str map: JavaScript map function as a string. - :param DesignDocumentViewsMapReduceOptions options: (optional) Options of - view build resuls. :param str reduce: (optional) JavaScript reduce function as a string. """ self.map = map - self.options = options self.reduce = reduce @classmethod @@ -12270,8 +12264,6 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduce': args['map'] = map else: raise ValueError('Required property \'map\' not present in DesignDocumentViewsMapReduce JSON') - if (options := _dict.get('options')) is not None: - args['options'] = DesignDocumentViewsMapReduceOptions.from_dict(options) if (reduce := _dict.get('reduce')) is not None: args['reduce'] = reduce return cls(**args) @@ -12286,11 +12278,6 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'map') and self.map is not None: _dict['map'] = self.map - if hasattr(self, 'options') and self.options is not None: - if isinstance(self.options, dict): - _dict['options'] = self.options - else: - _dict['options'] = self.options.to_dict() if hasattr(self, 'reduce') and self.reduce is not None: _dict['reduce'] = self.reduce return _dict @@ -12314,85 +12301,6 @@ def __ne__(self, other: 'DesignDocumentViewsMapReduce') -> bool: return not self == other -class DesignDocumentViewsMapReduceOptions: - """ - Options of view build resuls. - - - This type supports additional properties of type object. - """ - - def __init__( - self, - **kwargs: Optional[object], - ) -> None: - """ - Initialize a DesignDocumentViewsMapReduceOptions object. - - :param object **kwargs: (optional) Additional properties of type object - """ - for k, v in kwargs.items(): - if not isinstance(v, object): - raise ValueError('Value for additional property {} must be of type object'.format(k)) - setattr(self, k, v) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduceOptions': - """Initialize a DesignDocumentViewsMapReduceOptions object from a json dictionary.""" - args = {} - for k, v in _dict.items(): - if not isinstance(v, object): - raise ValueError('Value for additional property {} must be of type object'.format(k)) - args[k] = v - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DesignDocumentViewsMapReduceOptions object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - for k in [_k for _k in vars(self).keys()]: - _dict[k] = getattr(self, k) - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def get_properties(self) -> Dict: - """Return the additional properties from this instance of DesignDocumentViewsMapReduceOptions in the form of a dict.""" - _dict = {} - for k in [_k for _k in vars(self).keys()]: - _dict[k] = getattr(self, k) - return _dict - - def set_properties(self, _dict: dict): - """Set a dictionary of additional properties in this instance of DesignDocumentViewsMapReduceOptions""" - for k in [_k for _k in vars(self).keys()]: - delattr(self, k) - for k, v in _dict.items(): - if not isinstance(v, object): - raise ValueError('Value for additional property {} must be of type object'.format(k)) - setattr(self, k, v) - - def __str__(self) -> str: - """Return a `str` version of this DesignDocumentViewsMapReduceOptions object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DesignDocumentViewsMapReduceOptions') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'DesignDocumentViewsMapReduceOptions') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class DocsResultRow: """ Schema for a row of document information in a DocsResult. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index d2cd8069..2c708860 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -755,14 +755,9 @@ def test_put_design_document(self): design_document_options_model = { 'partitioned': True, } - # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model - design_document_views_map_reduce_options_model = { - 'foo': 'testString', - } # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = { 'map': 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}', - 'options': design_document_views_map_reduce_options_model, 'reduce': 'testString', } # Construct a dict representation of a DesignDocument model diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 6429727e..8930307f 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", "options": {}, "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"], "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", "options": {}, "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"], "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", "options": {}, "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"], "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, @@ -4920,14 +4920,9 @@ def test_put_design_document_all_params(self): design_document_options_model = {} design_document_options_model['partitioned'] = True - # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model - design_document_views_map_reduce_options_model = {} - design_document_views_map_reduce_options_model['foo'] = 'testString' - # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' - design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5055,14 +5050,9 @@ def test_put_design_document_required_params(self): design_document_options_model = {} design_document_options_model['partitioned'] = True - # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model - design_document_views_map_reduce_options_model = {} - design_document_views_map_reduce_options_model['foo'] = 'testString' - # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' - design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5176,14 +5166,9 @@ def test_put_design_document_value_error(self): design_document_options_model = {} design_document_options_model['partitioned'] = True - # Construct a dict representation of a DesignDocumentViewsMapReduceOptions model - design_document_views_map_reduce_options_model = {} - design_document_views_map_reduce_options_model['foo'] = 'testString' - # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' - design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -14653,12 +14638,8 @@ def test_design_document_serialization(self): design_document_options_model = {} # DesignDocumentOptions design_document_options_model['partitioned'] = True - design_document_views_map_reduce_options_model = {} # DesignDocumentViewsMapReduceOptions - design_document_views_map_reduce_options_model['foo'] = 'testString' - design_document_views_map_reduce_model = {} # DesignDocumentViewsMapReduce design_document_views_map_reduce_model['map'] = 'testString' - design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a json representation of a DesignDocument model @@ -14851,15 +14832,9 @@ def test_design_document_views_map_reduce_serialization(self): Test serialization/deserialization for DesignDocumentViewsMapReduce """ - # Construct dict forms of any model objects needed in order to build this model. - - design_document_views_map_reduce_options_model = {} # DesignDocumentViewsMapReduceOptions - design_document_views_map_reduce_options_model['foo'] = 'testString' - # Construct a json representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model_json = {} design_document_views_map_reduce_model_json['map'] = 'testString' - design_document_views_map_reduce_model_json['options'] = design_document_views_map_reduce_options_model design_document_views_map_reduce_model_json['reduce'] = 'testString' # Construct a model instance of DesignDocumentViewsMapReduce by calling from_dict on the json representation @@ -14878,46 +14853,6 @@ def test_design_document_views_map_reduce_serialization(self): assert design_document_views_map_reduce_model_json2 == design_document_views_map_reduce_model_json -class TestModel_DesignDocumentViewsMapReduceOptions: - """ - Test Class for DesignDocumentViewsMapReduceOptions - """ - - def test_design_document_views_map_reduce_options_serialization(self): - """ - Test serialization/deserialization for DesignDocumentViewsMapReduceOptions - """ - - # Construct a json representation of a DesignDocumentViewsMapReduceOptions model - design_document_views_map_reduce_options_model_json = {} - design_document_views_map_reduce_options_model_json['foo'] = 'testString' - - # Construct a model instance of DesignDocumentViewsMapReduceOptions by calling from_dict on the json representation - design_document_views_map_reduce_options_model = DesignDocumentViewsMapReduceOptions.from_dict(design_document_views_map_reduce_options_model_json) - assert design_document_views_map_reduce_options_model != False - - # Construct a model instance of DesignDocumentViewsMapReduceOptions by calling from_dict on the json representation - design_document_views_map_reduce_options_model_dict = DesignDocumentViewsMapReduceOptions.from_dict(design_document_views_map_reduce_options_model_json).__dict__ - design_document_views_map_reduce_options_model2 = DesignDocumentViewsMapReduceOptions(**design_document_views_map_reduce_options_model_dict) - - # Verify the model instances are equivalent - assert design_document_views_map_reduce_options_model == design_document_views_map_reduce_options_model2 - - # Convert model instance back to dict and verify no loss of data - design_document_views_map_reduce_options_model_json2 = design_document_views_map_reduce_options_model.to_dict() - assert design_document_views_map_reduce_options_model_json2 == design_document_views_map_reduce_options_model_json - - # Test get_properties and set_properties methods. - design_document_views_map_reduce_options_model.set_properties({}) - actual_dict = design_document_views_map_reduce_options_model.get_properties() - assert actual_dict == {} - - expected_dict = {'foo': 'testString'} - design_document_views_map_reduce_options_model.set_properties(expected_dict) - actual_dict = design_document_views_map_reduce_options_model.get_properties() - assert actual_dict.keys() == expected_dict.keys() - - class TestModel_DocsResultRow: """ Test Class for DocsResultRow From 471e99a53b3f09d7098e24bad643849c6d6bf3ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:21:54 +0000 Subject: [PATCH 356/669] build(deps-dev): Bump pytest from 8.3.2 to 8.3.3 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.3. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2fe3b024..a9a439e6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.9.0 # test dependencies -pytest==8.3.2 +pytest==8.3.3 responses==0.25.3 python_dotenv==1.0.1 pylint==3.2.7 From efd2977f09a6ac57ebc0b82cd3039a62fc553f53 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:01:40 +0000 Subject: [PATCH 357/669] docs(generated): use `text` extensions in README instead of `txt` Generated SDK source code using: - Generator version 3.95.0 - Specification version 1.0.0-dev0.1.18 - Automation (cloudant-sdks) version 5d0b323 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6816262c..37754c8e 100644 --- a/README.md +++ b/README.md @@ -339,7 +339,7 @@ print(f'You have created the document:\n{example_document}') When you run the code, you see a result similar to the following output. -```txt +```text "orders" database created. You have created the document: { @@ -401,7 +401,7 @@ print(f'Document retrieved from database:\n'
When you run the code, you see a result similar to the following output. -```txt +```text Server Version: 2.1.1 Document count in "orders" database is 1. Document retrieved from database: @@ -508,7 +508,7 @@ except ApiException as ae:
When you run the code, you see a result similar to the following output. -```txt +```text { "_id": "example", "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", @@ -565,7 +565,7 @@ except ApiException as ae: When you run the code, you see the following output. -```txt +```text You have deleted the document. ``` From 69bab8a34098a2244b66c0f5a7aea0a3447e340c Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 13 Sep 2024 12:33:10 +0100 Subject: [PATCH 358/669] chore: update package classifier --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7a3a638..85a09653 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", From 5ad4c79d6a39f0bb5d49081e2c6771548c651475 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:01:50 +0000 Subject: [PATCH 359/669] build(deps): Bump ibm-cloud-sdk-core from 3.20.6 to 3.21.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.20.6 to 3.21.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.20.6...v3.21.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 85a09653..c182281b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.9.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.20.6", + "ibm_cloud_sdk_core==3.21.0", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 05bd9710a331bd546ba77c8db7c50701ceb10ad1 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 19 Sep 2024 17:27:43 +0100 Subject: [PATCH 360/669] chore: update keywords list --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c182281b..15dc33e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,15 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries :: Application Frameworks", ] -keywords = ["ibmcloudant"] +keywords = [ + "ibmcloudant", + "Cloudant", + "IBM", + "database", + "client", + "SDK", + "official" +] [project.urls] "Homepage" = "https://github.com/IBM/cloudant-python-sdk" From a3a78ccdca81fadab3364848c431f4e800a7a6f5 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:23:44 +0000 Subject: [PATCH 361/669] Update version 0.9.1 -> 0.9.2 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index bf7ecfde..7063659f 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.9.1" +current_version = "0.9.2" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 37754c8e..61792d68 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.9.1 +# IBM Cloudant Python SDK Version 0.9.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.9.1" +pip install --upgrade "ibmcloudant>=0.9.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.9.1" +easy_install --upgrade "ibmcloudant>=0.9.2" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.1/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 46ca911f..921e79c6 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.9.1' +__version__ = '0.9.2' diff --git a/pyproject.toml b/pyproject.toml index 15dc33e9..dc6cfffc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.9.1" +version = "0.9.2" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.21.0", From 994444fc0bea1dd7abfeb6dacac6913989c1a8a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:30:53 +0000 Subject: [PATCH 362/669] build(deps): Bump sphinx-rtd-theme from 3.0.0rc1 to 3.0.0rc2 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.0rc1 to 3.0.0rc2. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.0rc1...3.0.0rc2) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index b5f24cb6..70754e7c 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==3.0.0rc1 +sphinx-rtd-theme==3.0.0rc2 From ea2504ad1914cb923cd8c94d487543a7b46c7353 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:20:42 +0000 Subject: [PATCH 363/669] build(deps): Bump sphinx-rtd-theme from 3.0.0rc2 to 3.0.0rc3 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.0rc2 to 3.0.0rc3. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.0rc2...3.0.0rc3) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 70754e7c..e1dc49e4 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==3.0.0rc2 +sphinx-rtd-theme==3.0.0rc3 From 72337315dcbd605dabde19cae188eb1ffa2cd4eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:52:48 +0000 Subject: [PATCH 364/669] build(deps): Bump sphinx-rtd-theme from 3.0.0rc3 to 3.0.0rc4 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.0rc3 to 3.0.0rc4. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.0rc3...3.0.0rc4) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index e1dc49e4..6259cfed 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==3.0.0rc3 +sphinx-rtd-theme==3.0.0rc4 From c27ed6769cddf3e790dab1abfc064c360fa5e317 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 8 Oct 2024 11:21:09 -0300 Subject: [PATCH 365/669] chore: bump python reqs to 3.9-3.13 --- .github/workflows/docs.yml | 4 ++-- .github/workflows/test.yml | 2 +- pyproject.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9ec53b12..91ed555e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,10 +10,10 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Setup python 3.12 + - name: Setup python 3.13 uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.13' cache: 'pip' - name: Install deps run: pip install -r requirements-docs.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9604ba0..f30c895f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: test: strategy: matrix: - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] runs-on: ubuntu-latest services: couchdb: diff --git a/pyproject.toml b/pyproject.toml index dc6cfffc..e20fdf7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,16 +16,16 @@ authors = [ { name="IBM", email="cldtsdks@us.ibm.com" }, ] readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = {file = "LICENSE"} classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", From c344123d1ea0d317d7fa0bc9e62e166d4a0ef7c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:31:28 +0000 Subject: [PATCH 366/669] build(deps): Bump sphinx-rtd-theme from 3.0.0rc4 to 3.0.0 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.0rc4 to 3.0.0. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.0rc4...3.0.0) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 6259cfed..310518a7 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==3.0.0rc4 +sphinx-rtd-theme==3.0.0 From 4a7758c972f689ece2bdecea504838789fd51217 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:17:03 +0000 Subject: [PATCH 367/669] chore(generated): bump minimal python to 3.9 Generated SDK source code using: - Generator version 3.95.2 - Specification version 1.0.0-dev0.1.18 - Automation (cloudant-sdks) version 2db9045 --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index fc336c19..c1c51489 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ assignees: '' **Must gather (please complete the following information):** - SDK Version [e.g. 1.2.1] - - Python Version [e.g. Python 3.8] + - Python Version [e.g. Python 3.9] - Name of service that you're trying to use (if applicable) - Name of operation that you're trying to invoke (if applicable) diff --git a/README.md b/README.md index 61792d68..4af8ecdc 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ project: service instance or a [CouchDB](https://docs.couchdb.org/en/latest/install/index.html) server. -- Python 3.8 or above. +- Python 3.9 or above. ## Installation From 8deb77fce43a6704f8bf2feb3871c3bc5ef33fe4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:43:39 -0300 Subject: [PATCH 368/669] build(deps-dev): Bump pylint from 3.2.7 to 3.3.1 (#707) * build(deps-dev): Bump pylint from 3.2.7 to 3.3.1 * fix(ci): disable new linting rule for too many positional args --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eric Avdey --- .pylintrc | 1 + requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 44bbda31..6bf7a061 100644 --- a/.pylintrc +++ b/.pylintrc @@ -45,6 +45,7 @@ confidence=HIGH # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". disable=too-many-arguments, + too-many-positional-arguments, too-many-public-methods, too-few-public-methods, too-many-instance-attributes, diff --git a/requirements-dev.txt b/requirements-dev.txt index a9a439e6..b7915bbc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.9.0 pytest==8.3.3 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.2.7 +pylint==3.3.1 # code coverage coverage==7.6.1 pytest-cov==5.0.0 From e6d749cbeac5426ccd98ea285a982e9813945977 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:01:36 +0000 Subject: [PATCH 369/669] build(deps): Bump sphinx-rtd-theme from 3.0.0 to 3.0.1 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.0 to 3.0.1. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.0...3.0.1) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 310518a7..ad443730 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.0.2 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==3.0.0 +sphinx-rtd-theme==3.0.1 From 815e16b158d5639fb240061de3c694acc3bbf539 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 07:06:44 +0000 Subject: [PATCH 370/669] build(deps-dev): Bump coverage from 7.6.1 to 7.6.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.1 to 7.6.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.1...7.6.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b7915bbc..ea3c5c54 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 # code coverage -coverage==7.6.1 +coverage==7.6.2 pytest-cov==5.0.0 From 7d42d24b1f945667a6eb6cba5a16ce6d97f27337 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:42:18 +0000 Subject: [PATCH 371/669] build(deps): Bump sphinx from 8.0.2 to 8.1.0 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.0.2 to 8.1.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.0.2...v8.1.0) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index ad443730..efb0d5f9 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==8.0.2 +Sphinx==8.1.0 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 sphinx-rtd-theme==3.0.1 From 49a3da4ea4cf4b4240f425730e529bcac9e52670 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:25:34 +0000 Subject: [PATCH 372/669] build(deps): Bump sphinx from 8.1.0 to 8.1.3 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.1.0 to 8.1.3. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.1.0...v8.1.3) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index efb0d5f9..849d9d4b 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==8.1.0 +Sphinx==8.1.3 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 sphinx-rtd-theme==3.0.1 From d357a525bf32de2af1c75f3fa12651f6bfead4b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:29:04 +0000 Subject: [PATCH 373/669] build(deps-dev): Bump coverage from 7.6.2 to 7.6.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.2 to 7.6.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.2...7.6.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ea3c5c54..e28988ae 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 # code coverage -coverage==7.6.2 +coverage==7.6.3 pytest-cov==5.0.0 From ff3ac6ebeea7135de513ebd90b855eeead6172cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:37:27 +0000 Subject: [PATCH 374/669] build(deps): Bump ibm-cloud-sdk-core from 3.21.0 to 3.22.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.21.0 to 3.22.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.21.0...v3.22.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e20fdf7a..fd687919 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.9.2" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.21.0", + "ibm_cloud_sdk_core==3.22.0", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 0ef384bcd0494f2703f7e189eda01b648b6eb471 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:45:47 +0100 Subject: [PATCH 375/669] fix(generated): update partitioned database examples (#720) Generated SDK source code using: - Generator version 3.96.0 - Specification version 1.0.0-dev0.1.18 - Automation (cloudant-sdks) version 30afc34 --- examples/README.md | 166 ++++++++++-------- .../deleteAttachment/example_request.py | 4 +- .../deleteDocument/example_request.py | 6 +- .../snippets/getAttachment/example_request.py | 4 +- .../snippets/getDocument/example_request.py | 2 +- .../getDocumentShardsInfo/example_request.py | 2 +- .../example_request.py | 4 +- .../snippets/getSearchInfo/example_request.py | 8 +- .../headAttachment/example_request.py | 4 +- .../headDesignDocument/example_request.py | 4 +- .../snippets/headDocument/example_request.py | 4 +- .../postAllDocsQueries/example_request.py | 2 +- .../example_request_as_a_stream.py | 8 +- .../example_request_create_documents.py | 8 +- .../example_request_delete_documents.py | 4 +- .../snippets/postDocument/example_request.py | 4 +- .../example_request_for_json_index_type.py | 2 +- .../example_request_for_text_index_type.py | 2 +- .../postPartitionAllDocs/example_request.py | 4 +- .../postPartitionExplain/example_request.py | 14 ++ .../postPartitionFind/example_request.py | 8 +- .../postPartitionSearch/example_request.py | 12 +- .../postPartitionView/example_request.py | 11 +- .../snippets/postRevsDiff/example_request.py | 2 + .../snippets/putAttachment/example_request.py | 2 +- .../snippets/putDatabase/example_request.py | 2 +- .../putDesignDocument/example_request.py | 20 +-- .../snippets/putDocument/example_request.py | 4 +- .../putLocalDocument/example_request.py | 6 +- 29 files changed, 183 insertions(+), 140 deletions(-) create mode 100644 examples/snippets/postPartitionExplain/example_request.py diff --git a/examples/README.md b/examples/README.md index 495fa908..0018942f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -640,9 +640,9 @@ from ibmcloudant.cloudant_v1 import Document, CloudantV1 service = CloudantV1.new_instance() products_doc = Document( - _id="small-appliances:1000042", + _id="1000042", type="product", - productid="1000042", + productId="1000042", brand="Salter", name="Digital Kitchen Scales", description="Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green", @@ -667,7 +667,7 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() -response = service.put_database(db='products', partitioned=True).get_result() +response = service.put_database(db='events', partitioned=True).get_result() print(response) ``` @@ -730,7 +730,7 @@ from ibmcloudant.cloudant_v1 import AllDocsQuery, CloudantV1 service = CloudantV1.new_instance() all_docs_query1 = AllDocsQuery( - keys=['small-appliances:1000042', 'small-appliances:1000043'] + keys=['1000042', '1000043'] ) all_docs_query2 = AllDocsQuery( @@ -760,17 +760,17 @@ from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() event_doc_1 = Document( - _id="0007241142412418284", + _id="ns1HJS13AMkK:0007241142412418284", type="event", - userid="abc123", + userId="abc123", eventType="addedToBasket", productId="1000042", date="2019-01-28T10:44:22.000Z" ) event_doc_2 = Document( - _id="0007241142412418285", + _id="H8tDIwfadxp9:0007241142412418285", type="event", - userid="abc234", + userId="abc234", eventType="addedToBasket", productId="1000050", date="2019-01-25T20:00:00.000Z" @@ -796,12 +796,12 @@ from ibmcloudant.cloudant_v1 import Document, CloudantV1, BulkDocs service = CloudantV1.new_instance() event_doc_1 = Document( - _id="0007241142412418284", + _id="ns1HJS13AMkK:0007241142412418284", _rev="1-5005d65514fe9e90f8eccf174af5dd64", _deleted=True, ) event_doc_2 = Document( - _id="0007241142412418285", + _id="H8tDIwfadxp9:0007241142412418285", _rev="1-2d7810b054babeda4812b3924428d6d6", _deleted=True, ) @@ -838,17 +838,17 @@ print(response) { "docs": [ { - "_id": "0007241142412418284", + "_id": "ns1HJS13AMkK:0007241142412418284", "type": "event", - "userid": "abc123", + "userId": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { - "_id": "0007241142412418285", + "_id": "H8tDIwfadxp9:0007241142412418285", "type": "event", - "userid": "abc123", + "userId": "abc234", "eventType": "addedToBasket", "productId": "1000050", "date": "2019-01-25T20:00:00.000Z" @@ -1019,8 +1019,8 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_design_document( - db='products', - ddoc='appliances' + db='events', + ddoc='checkout' ) print(response.get_status_code()) print(response.get_headers()['ETag']) @@ -1040,11 +1040,11 @@ from ibmcloudant.cloudant_v1 import Analyzer, AnalyzerConfiguration, CloudantV1, service = CloudantV1.new_instance() email_view_map_reduce = DesignDocumentViewsMapReduce( - map='function(doc) { if(doc.email_verified === true){\n emit(doc.email, [doc.name, doc.email_verified, doc.joined]) }}' + map='function(doc) { if(doc.email_verified === true) { emit(doc.email, [doc.name, doc.email_verified, doc.joined]); }}' ) user_index = SearchIndexDefinition( - index='function (doc) { index("name", doc.name); index("active", doc.active); }', + index='function(doc) { index("name", doc.name); index("active", doc.active); }', analyzer=AnalyzerConfiguration(name="standard", fields={"email": Analyzer(name="email")})) design_document = DesignDocument( @@ -1063,11 +1063,11 @@ print(response) # Partitioned DesignDocument Example product_map = DesignDocumentViewsMapReduce( - map='function(doc) { emit(doc.productId, [doc.brand, doc.name, doc.description]) }' + map='function(doc) { emit(doc.productId, [doc.date, doc.eventType, doc.userId]); }' ) -price_index = SearchIndexDefinition( - index='function (doc) { index("price", doc.price);}', +date_index = SearchIndexDefinition( + index='function(doc) { index("date", doc.date); }', analyzer=AnalyzerConfiguration(name="classic", fields={"description": Analyzer(name="english")}) ) @@ -1076,20 +1076,20 @@ design_document_options = DesignDocumentOptions( ) partitioned_design_doc = DesignDocument( - views={'byApplianceProdId': product_map}, - indexes={'findByPrice': price_index}, + views={'byProductId': product_map}, + indexes={'findByDate': date_index}, options=design_document_options ) response = service.put_design_document( - db='products', + db='events', design_document=partitioned_design_doc, - ddoc='appliances' + ddoc='checkout' ).get_result() print(response) # section: markdown -# This example creates `allusers` design document in the `users` database and `appliances` design document in the partitioned `products` database. +# This example creates `allusers` design document in the `users` database and `checkout` design document in the partitioned `events` database. ``` ## getDesignDocumentInformation @@ -1152,14 +1152,14 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_search_info( - db='products', - ddoc='appliances', - index='findByPrice' + db='events', + ddoc='checkout', + index='findByDate' ).get_result() print(response) # section: markdown -# This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) +# This example requires the `findByDate` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ``` ## postView @@ -1318,7 +1318,7 @@ response = service.post_find( ).get_result() print(response) # section: markdown -# This example requires the `getUserByAddress` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) +# This example requires the `getUserByEmail` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) ``` ### [Example request for "text" index type](snippets/postFind/example_request_for_text_index_type.py) @@ -1338,7 +1338,7 @@ response = service.post_find( ).get_result() print(response) # section: markdown -# This example requires the `getUserByVerifiedEmail` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) +# This example requires the `getUserByAddress` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) ``` ## getIndexesInformation @@ -1505,13 +1505,13 @@ service = CloudantV1.new_instance() local_document = Document( type='order', user='Bob Smith', - orderid='0007741142412418284', - userid='abc123', + orderId='0007741142412418284', + userId='abc123', total=214.98, deliveryAddress='19 Front Street, Darlington, DL5 1TY', delivered='true', courier='UPS', - courierid='15125425151261289', + courierId='15125425151261289', date='2019-01-28T10:44:22.000Z' ) @@ -1538,8 +1538,8 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.get_partition_information( - db='products', - partition_key='small-appliances' + db='events', + partition_key='ns1HJS13AMkK' ).get_result() print(response) @@ -1559,8 +1559,8 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_all_docs( - db='products', - partition_key='small-appliances', + db='events', + partition_key='ns1HJS13AMkK', include_docs=True ).get_result() @@ -1581,16 +1581,16 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_search( - db='products', - partition_key='small-appliances', - ddoc='appliances', - index='findByPrice', - query='price:[14 TO 20]' + db='events', + partition_key='ns1HJS13AMkK', + ddoc='checkout', + index='findByDate', + query='date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]' ).get_result() print(response) # section: markdown -# This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) +# This example requires the `findByDate` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) ``` ## postPartitionView @@ -1607,16 +1607,40 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_view( - db='products', - ddoc='appliances', + db='events', + ddoc='checkout', + include_docs=True, limit=10, - partition_key='small-appliances', - view='byApplianceProdId' + partition_key='ns1HJS13AMkK', + view='byProductId' ).get_result() print(response) # section: markdown -# This example requires the `byApplianceProdId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) +# This example requires the `byProductId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) +``` + +## postPartitionExplain + +_POST `/{db}/_partition/{partition_key}/_explain`_ + +### [Example request](snippets/postPartitionExplain/example_request.py) + +[embedmd]:# (snippets/postPartitionFind/example_request.py) +```py +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_partition_find( + db='events', + partition_key='ns1HJS13AMkK', + fields=['productId', 'eventType', 'date'], + selector={'userId': {'$eq': 'abc123'}} +).get_result() + +print(response) ``` ## postPartitionFind @@ -1633,10 +1657,10 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_partition_find( - db='products', - partition_key='small-appliances', - fields=['productid', 'name', 'description'], - selector={'type': {'$eq': 'product'}} + db='events', + partition_key='ns1HJS13AMkK', + fields=['productId', 'eventType', 'date'], + selector={'userId': {'$eq': 'abc123'}} ).get_result() print(response) @@ -1669,6 +1693,8 @@ response = service.post_revs_diff( ).get_result() print(response) +// section: markdown +// This example requires the example revisions in the POST body to be replaced with valid revisions. ``` ## getSecurity @@ -1756,7 +1782,7 @@ service = CloudantV1.new_instance() response = service.get_document_shards_info( db='products', - doc_id='small-appliances:1000042' + doc_id='1000042' ).get_result() print(response) @@ -1776,9 +1802,9 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.delete_document( - db='events', - doc_id='0007241142412418284', - rev='2-9a0d1cd9f40472509e9aac6461837367' + db='orders', + doc_id='order00058', + rev='1-99b02e08da151943c2dcb40090160bb8' ).get_result() print(response) @@ -1799,7 +1825,7 @@ service = CloudantV1.new_instance() response = service.get_document( db='products', - doc_id='small-appliances:1000042' + doc_id='1000042' ).get_result() print(response) @@ -1819,8 +1845,8 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.head_document( - db='events', - doc_id='0007241142412418284' + db='orders', + doc_id='order00058' ) print(response.get_status_code()) print(response.get_headers()['ETag']) @@ -1841,14 +1867,14 @@ service = CloudantV1.new_instance() event_doc = Document( type='event', - userid='abc123', + userId='abc123', eventType='addedToBasket', productId='1000042', date='2019-01-28T10:44:22.000Z' ) response = service.put_document( db='events', - doc_id='0007241142412418284', + doc_id='ns1HJS13AMkK:0007241142412418284', document=event_doc ).get_result() @@ -1870,14 +1896,14 @@ service = CloudantV1.new_instance() response = service.delete_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt', rev='4-1a0d1cd6f40472509e9aac646183736a' ).get_result() print(response) # section: markdown -# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) +# This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ``` ## getAttachment @@ -1895,13 +1921,13 @@ service = CloudantV1.new_instance() response_attachment = service.get_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt' ).get_result().content print(response_attachment) # section: markdown -# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) +# This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ``` ## headAttachment @@ -1919,14 +1945,14 @@ service = CloudantV1.new_instance() response = service.head_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt' ) print(response.get_status_code()) print(response.get_headers()['Content-Length']) print(response.get_headers()['Content-Type']) # section: markdown -# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) +# This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) ``` ## putAttachment @@ -1945,7 +1971,7 @@ service = CloudantV1.new_instance() detailed_description = "This appliance includes..." response = service.put_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt', attachment=detailed_description, content_type='text/plain' diff --git a/examples/snippets/deleteAttachment/example_request.py b/examples/snippets/deleteAttachment/example_request.py index f51d4e52..dc2c3a2c 100644 --- a/examples/snippets/deleteAttachment/example_request.py +++ b/examples/snippets/deleteAttachment/example_request.py @@ -5,11 +5,11 @@ response = service.delete_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt', rev='4-1a0d1cd6f40472509e9aac646183736a' ).get_result() print(response) # section: markdown -# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) +# This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) diff --git a/examples/snippets/deleteDocument/example_request.py b/examples/snippets/deleteDocument/example_request.py index a51d55c1..ee64b47a 100644 --- a/examples/snippets/deleteDocument/example_request.py +++ b/examples/snippets/deleteDocument/example_request.py @@ -4,9 +4,9 @@ service = CloudantV1.new_instance() response = service.delete_document( - db='events', - doc_id='0007241142412418284', - rev='2-9a0d1cd9f40472509e9aac6461837367' + db='orders', + doc_id='order00058', + rev='1-99b02e08da151943c2dcb40090160bb8' ).get_result() print(response) diff --git a/examples/snippets/getAttachment/example_request.py b/examples/snippets/getAttachment/example_request.py index da91599e..ab1d3044 100644 --- a/examples/snippets/getAttachment/example_request.py +++ b/examples/snippets/getAttachment/example_request.py @@ -5,10 +5,10 @@ response_attachment = service.get_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt' ).get_result().content print(response_attachment) # section: markdown -# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) +# This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) diff --git a/examples/snippets/getDocument/example_request.py b/examples/snippets/getDocument/example_request.py index 888454fe..49e43fbd 100644 --- a/examples/snippets/getDocument/example_request.py +++ b/examples/snippets/getDocument/example_request.py @@ -5,7 +5,7 @@ response = service.get_document( db='products', - doc_id='small-appliances:1000042' + doc_id='1000042' ).get_result() print(response) diff --git a/examples/snippets/getDocumentShardsInfo/example_request.py b/examples/snippets/getDocumentShardsInfo/example_request.py index 4891a04c..52855494 100644 --- a/examples/snippets/getDocumentShardsInfo/example_request.py +++ b/examples/snippets/getDocumentShardsInfo/example_request.py @@ -5,7 +5,7 @@ response = service.get_document_shards_info( db='products', - doc_id='small-appliances:1000042' + doc_id='1000042' ).get_result() print(response) diff --git a/examples/snippets/getPartitionInformation/example_request.py b/examples/snippets/getPartitionInformation/example_request.py index 4fded20d..e5a8b0b9 100644 --- a/examples/snippets/getPartitionInformation/example_request.py +++ b/examples/snippets/getPartitionInformation/example_request.py @@ -4,8 +4,8 @@ service = CloudantV1.new_instance() response = service.get_partition_information( - db='products', - partition_key='small-appliances' + db='events', + partition_key='ns1HJS13AMkK' ).get_result() print(response) diff --git a/examples/snippets/getSearchInfo/example_request.py b/examples/snippets/getSearchInfo/example_request.py index 71c97d98..b24b7c29 100644 --- a/examples/snippets/getSearchInfo/example_request.py +++ b/examples/snippets/getSearchInfo/example_request.py @@ -4,11 +4,11 @@ service = CloudantV1.new_instance() response = service.get_search_info( - db='products', - ddoc='appliances', - index='findByPrice' + db='events', + ddoc='checkout', + index='findByDate' ).get_result() print(response) # section: markdown -# This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) +# This example requires the `findByDate` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) diff --git a/examples/snippets/headAttachment/example_request.py b/examples/snippets/headAttachment/example_request.py index 8fde6d97..137e002c 100644 --- a/examples/snippets/headAttachment/example_request.py +++ b/examples/snippets/headAttachment/example_request.py @@ -5,11 +5,11 @@ response = service.head_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt' ) print(response.get_status_code()) print(response.get_headers()['Content-Length']) print(response.get_headers()['Content-Type']) # section: markdown -# This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) +# This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment) diff --git a/examples/snippets/headDesignDocument/example_request.py b/examples/snippets/headDesignDocument/example_request.py index c1ecf015..ed2c1a20 100644 --- a/examples/snippets/headDesignDocument/example_request.py +++ b/examples/snippets/headDesignDocument/example_request.py @@ -4,8 +4,8 @@ service = CloudantV1.new_instance() response = service.head_design_document( - db='products', - ddoc='appliances' + db='events', + ddoc='checkout' ) print(response.get_status_code()) print(response.get_headers()['ETag']) diff --git a/examples/snippets/headDocument/example_request.py b/examples/snippets/headDocument/example_request.py index 71692421..6141844e 100644 --- a/examples/snippets/headDocument/example_request.py +++ b/examples/snippets/headDocument/example_request.py @@ -4,8 +4,8 @@ service = CloudantV1.new_instance() response = service.head_document( - db='events', - doc_id='0007241142412418284' + db='orders', + doc_id='order00058' ) print(response.get_status_code()) print(response.get_headers()['ETag']) diff --git a/examples/snippets/postAllDocsQueries/example_request.py b/examples/snippets/postAllDocsQueries/example_request.py index cc333a43..d625e9c9 100644 --- a/examples/snippets/postAllDocsQueries/example_request.py +++ b/examples/snippets/postAllDocsQueries/example_request.py @@ -4,7 +4,7 @@ service = CloudantV1.new_instance() all_docs_query1 = AllDocsQuery( - keys=['small-appliances:1000042', 'small-appliances:1000043'] + keys=['1000042', '1000043'] ) all_docs_query2 = AllDocsQuery( diff --git a/examples/snippets/postBulkDocs/example_request_as_a_stream.py b/examples/snippets/postBulkDocs/example_request_as_a_stream.py index e8891bfc..c3a6d7d3 100644 --- a/examples/snippets/postBulkDocs/example_request_as_a_stream.py +++ b/examples/snippets/postBulkDocs/example_request_as_a_stream.py @@ -16,17 +16,17 @@ { "docs": [ { - "_id": "0007241142412418284", + "_id": "ns1HJS13AMkK:0007241142412418284", "type": "event", - "userid": "abc123", + "userId": "abc123", "eventType": "addedToBasket", "productId": "1000042", "date": "2019-01-28T10:44:22.000Z" }, { - "_id": "0007241142412418285", + "_id": "H8tDIwfadxp9:0007241142412418285", "type": "event", - "userid": "abc123", + "userId": "abc234", "eventType": "addedToBasket", "productId": "1000050", "date": "2019-01-25T20:00:00.000Z" diff --git a/examples/snippets/postBulkDocs/example_request_create_documents.py b/examples/snippets/postBulkDocs/example_request_create_documents.py index d231369f..172125e2 100644 --- a/examples/snippets/postBulkDocs/example_request_create_documents.py +++ b/examples/snippets/postBulkDocs/example_request_create_documents.py @@ -4,17 +4,17 @@ service = CloudantV1.new_instance() event_doc_1 = Document( - _id="0007241142412418284", + _id="ns1HJS13AMkK:0007241142412418284", type="event", - userid="abc123", + userId="abc123", eventType="addedToBasket", productId="1000042", date="2019-01-28T10:44:22.000Z" ) event_doc_2 = Document( - _id="0007241142412418285", + _id="H8tDIwfadxp9:0007241142412418285", type="event", - userid="abc234", + userId="abc234", eventType="addedToBasket", productId="1000050", date="2019-01-25T20:00:00.000Z" diff --git a/examples/snippets/postBulkDocs/example_request_delete_documents.py b/examples/snippets/postBulkDocs/example_request_delete_documents.py index 64beca90..c70a8e80 100644 --- a/examples/snippets/postBulkDocs/example_request_delete_documents.py +++ b/examples/snippets/postBulkDocs/example_request_delete_documents.py @@ -4,12 +4,12 @@ service = CloudantV1.new_instance() event_doc_1 = Document( - _id="0007241142412418284", + _id="ns1HJS13AMkK:0007241142412418284", _rev="1-5005d65514fe9e90f8eccf174af5dd64", _deleted=True, ) event_doc_2 = Document( - _id="0007241142412418285", + _id="H8tDIwfadxp9:0007241142412418285", _rev="1-2d7810b054babeda4812b3924428d6d6", _deleted=True, ) diff --git a/examples/snippets/postDocument/example_request.py b/examples/snippets/postDocument/example_request.py index 79653966..a18fe7cb 100644 --- a/examples/snippets/postDocument/example_request.py +++ b/examples/snippets/postDocument/example_request.py @@ -4,9 +4,9 @@ service = CloudantV1.new_instance() products_doc = Document( - _id="small-appliances:1000042", + _id="1000042", type="product", - productid="1000042", + productId="1000042", brand="Salter", name="Digital Kitchen Scales", description="Slim Colourful Design Electronic Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic for Liquids ml + fl. oz. 15Yr Guarantee - Green", diff --git a/examples/snippets/postFind/example_request_for_json_index_type.py b/examples/snippets/postFind/example_request_for_json_index_type.py index b2393326..1e4544e7 100644 --- a/examples/snippets/postFind/example_request_for_json_index_type.py +++ b/examples/snippets/postFind/example_request_for_json_index_type.py @@ -12,4 +12,4 @@ ).get_result() print(response) # section: markdown -# This example requires the `getUserByAddress` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) +# This example requires the `getUserByEmail` Cloudant Query "json" index to exist. To create the index, see [Create a new index on a database.](#postindex) diff --git a/examples/snippets/postFind/example_request_for_text_index_type.py b/examples/snippets/postFind/example_request_for_text_index_type.py index a6f74f9b..ae8f3583 100644 --- a/examples/snippets/postFind/example_request_for_text_index_type.py +++ b/examples/snippets/postFind/example_request_for_text_index_type.py @@ -11,4 +11,4 @@ ).get_result() print(response) # section: markdown -# This example requires the `getUserByVerifiedEmail` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) +# This example requires the `getUserByAddress` Cloudant Query "text" index to exist. To create the index, see [Create a new index on a database.](#postindex) diff --git a/examples/snippets/postPartitionAllDocs/example_request.py b/examples/snippets/postPartitionAllDocs/example_request.py index a01cc841..4ac774a6 100644 --- a/examples/snippets/postPartitionAllDocs/example_request.py +++ b/examples/snippets/postPartitionAllDocs/example_request.py @@ -4,8 +4,8 @@ service = CloudantV1.new_instance() response = service.post_partition_all_docs( - db='products', - partition_key='small-appliances', + db='events', + partition_key='ns1HJS13AMkK', include_docs=True ).get_result() diff --git a/examples/snippets/postPartitionExplain/example_request.py b/examples/snippets/postPartitionExplain/example_request.py new file mode 100644 index 00000000..48b8c477 --- /dev/null +++ b/examples/snippets/postPartitionExplain/example_request.py @@ -0,0 +1,14 @@ +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 + +service = CloudantV1.new_instance() + +response = service.post_partition_explain( + db='events', + execution_stats=True, + limit=10, + partition_key='ns1HJS13AMkK', + selector={'userId': {'$eq': 'abc123'}} +).get_result() + +print(response) diff --git a/examples/snippets/postPartitionFind/example_request.py b/examples/snippets/postPartitionFind/example_request.py index 74dbab5c..95095789 100644 --- a/examples/snippets/postPartitionFind/example_request.py +++ b/examples/snippets/postPartitionFind/example_request.py @@ -4,10 +4,10 @@ service = CloudantV1.new_instance() response = service.post_partition_find( - db='products', - partition_key='small-appliances', - fields=['productid', 'name', 'description'], - selector={'type': {'$eq': 'product'}} + db='events', + partition_key='ns1HJS13AMkK', + fields=['productId', 'eventType', 'date'], + selector={'userId': {'$eq': 'abc123'}} ).get_result() print(response) diff --git a/examples/snippets/postPartitionSearch/example_request.py b/examples/snippets/postPartitionSearch/example_request.py index 34eb160c..d1a1aa1e 100644 --- a/examples/snippets/postPartitionSearch/example_request.py +++ b/examples/snippets/postPartitionSearch/example_request.py @@ -4,13 +4,13 @@ service = CloudantV1.new_instance() response = service.post_partition_search( - db='products', - partition_key='small-appliances', - ddoc='appliances', - index='findByPrice', - query='price:[14 TO 20]' + db='events', + partition_key='ns1HJS13AMkK', + ddoc='checkout', + index='findByDate', + query='date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]' ).get_result() print(response) # section: markdown -# This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) +# This example requires the `findByDate` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument) diff --git a/examples/snippets/postPartitionView/example_request.py b/examples/snippets/postPartitionView/example_request.py index 27251002..5f3c31b4 100644 --- a/examples/snippets/postPartitionView/example_request.py +++ b/examples/snippets/postPartitionView/example_request.py @@ -4,13 +4,14 @@ service = CloudantV1.new_instance() response = service.post_partition_view( - db='products', - ddoc='appliances', + db='events', + ddoc='checkout', + include_docs=True, limit=10, - partition_key='small-appliances', - view='byApplianceProdId' + partition_key='ns1HJS13AMkK', + view='byProductId' ).get_result() print(response) # section: markdown -# This example requires the `byApplianceProdId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) +# This example requires the `byProductId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument) diff --git a/examples/snippets/postRevsDiff/example_request.py b/examples/snippets/postRevsDiff/example_request.py index 85cc5b75..970c1a96 100644 --- a/examples/snippets/postRevsDiff/example_request.py +++ b/examples/snippets/postRevsDiff/example_request.py @@ -17,3 +17,5 @@ ).get_result() print(response) +// section: markdown +// This example requires the example revisions in the POST body to be replaced with valid revisions. diff --git a/examples/snippets/putAttachment/example_request.py b/examples/snippets/putAttachment/example_request.py index 6ddaed4f..2e6edf80 100644 --- a/examples/snippets/putAttachment/example_request.py +++ b/examples/snippets/putAttachment/example_request.py @@ -6,7 +6,7 @@ detailed_description = "This appliance includes..." response = service.put_attachment( db='products', - doc_id='small-appliances:100001', + doc_id='1000042', attachment_name='product_details.txt', attachment=detailed_description, content_type='text/plain' diff --git a/examples/snippets/putDatabase/example_request.py b/examples/snippets/putDatabase/example_request.py index d3424b70..fa6b8b4f 100644 --- a/examples/snippets/putDatabase/example_request.py +++ b/examples/snippets/putDatabase/example_request.py @@ -3,6 +3,6 @@ service = CloudantV1.new_instance() -response = service.put_database(db='products', partitioned=True).get_result() +response = service.put_database(db='events', partitioned=True).get_result() print(response) diff --git a/examples/snippets/putDesignDocument/example_request.py b/examples/snippets/putDesignDocument/example_request.py index 37d5ca5b..135dcbbc 100644 --- a/examples/snippets/putDesignDocument/example_request.py +++ b/examples/snippets/putDesignDocument/example_request.py @@ -4,11 +4,11 @@ service = CloudantV1.new_instance() email_view_map_reduce = DesignDocumentViewsMapReduce( - map='function(doc) { if(doc.email_verified === true){\n emit(doc.email, [doc.name, doc.email_verified, doc.joined]) }}' + map='function(doc) { if(doc.email_verified === true) { emit(doc.email, [doc.name, doc.email_verified, doc.joined]); }}' ) user_index = SearchIndexDefinition( - index='function (doc) { index("name", doc.name); index("active", doc.active); }', + index='function(doc) { index("name", doc.name); index("active", doc.active); }', analyzer=AnalyzerConfiguration(name="standard", fields={"email": Analyzer(name="email")})) design_document = DesignDocument( @@ -27,11 +27,11 @@ # Partitioned DesignDocument Example product_map = DesignDocumentViewsMapReduce( - map='function(doc) { emit(doc.productId, [doc.brand, doc.name, doc.description]) }' + map='function(doc) { emit(doc.productId, [doc.date, doc.eventType, doc.userId]); }' ) -price_index = SearchIndexDefinition( - index='function (doc) { index("price", doc.price);}', +date_index = SearchIndexDefinition( + index='function(doc) { index("date", doc.date); }', analyzer=AnalyzerConfiguration(name="classic", fields={"description": Analyzer(name="english")}) ) @@ -40,17 +40,17 @@ ) partitioned_design_doc = DesignDocument( - views={'byApplianceProdId': product_map}, - indexes={'findByPrice': price_index}, + views={'byProductId': product_map}, + indexes={'findByDate': date_index}, options=design_document_options ) response = service.put_design_document( - db='products', + db='events', design_document=partitioned_design_doc, - ddoc='appliances' + ddoc='checkout' ).get_result() print(response) # section: markdown -# This example creates `allusers` design document in the `users` database and `appliances` design document in the partitioned `products` database. +# This example creates `allusers` design document in the `users` database and `checkout` design document in the partitioned `events` database. diff --git a/examples/snippets/putDocument/example_request.py b/examples/snippets/putDocument/example_request.py index 6b442d9f..98a384bc 100644 --- a/examples/snippets/putDocument/example_request.py +++ b/examples/snippets/putDocument/example_request.py @@ -5,14 +5,14 @@ event_doc = Document( type='event', - userid='abc123', + userId='abc123', eventType='addedToBasket', productId='1000042', date='2019-01-28T10:44:22.000Z' ) response = service.put_document( db='events', - doc_id='0007241142412418284', + doc_id='ns1HJS13AMkK:0007241142412418284', document=event_doc ).get_result() diff --git a/examples/snippets/putLocalDocument/example_request.py b/examples/snippets/putLocalDocument/example_request.py index 412e4912..cf0fb203 100644 --- a/examples/snippets/putLocalDocument/example_request.py +++ b/examples/snippets/putLocalDocument/example_request.py @@ -6,13 +6,13 @@ local_document = Document( type='order', user='Bob Smith', - orderid='0007741142412418284', - userid='abc123', + orderId='0007741142412418284', + userId='abc123', total=214.98, deliveryAddress='19 Front Street, Darlington, DL5 1TY', delivered='true', courier='UPS', - courierid='15125425151261289', + courierId='15125425151261289', date='2019-01-28T10:44:22.000Z' ) From 5fd55ca8fe897048e452ff4fbc67ea5a133f7db8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:46:02 +0000 Subject: [PATCH 376/669] build(deps-dev): Bump coverage from 7.6.3 to 7.6.4 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.3 to 7.6.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.3...7.6.4) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e28988ae..e4709fa3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 # code coverage -coverage==7.6.3 +coverage==7.6.4 pytest-cov==5.0.0 From e521fa5128d0ce66bbcc62d6d69c34009aa3f13c Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 23 Oct 2024 16:30:48 +0100 Subject: [PATCH 377/669] ci: hash pinning for actions --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/docs.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5beba59f..bac932ac 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -18,17 +18,17 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 91ed555e..3d42c8d5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: Setup python 3.13 - uses: actions/setup-python@v5 + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.13' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f30c895f..c2d30770 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,11 +33,11 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@v5 + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 210e284f9588fb440226bed7785bdcd854d4d354 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 23 Oct 2024 17:11:10 +0100 Subject: [PATCH 378/669] ci: explicit actions permissions --- .github/workflows/codeql.yml | 1 + .github/workflows/docs.yml | 1 + .github/workflows/test.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bac932ac..1fa0b238 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -6,6 +6,7 @@ on: branches: ['main'] schedule: - cron: '00 4 * * 2' +permissions: {} jobs: analyze: name: Analyze diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3d42c8d5..69473dc4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,6 +2,7 @@ name: docs on: pull_request: branches: ['main'] +permissions: {} jobs: docs: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2d30770..22f91758 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: branches: ['main'] pull_request: branches-ignore: ['gh-pages'] +permissions: {} env: SERVER_AUTH_TYPE: basic SERVER_URL: http://127.0.0.1:5984 From 22f25e61786167da6ec4a4d60014e545e27f93c9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 24 Oct 2024 08:17:28 +0000 Subject: [PATCH 379/669] build(generated): dependabot for actions Generated SDK source code using: - Generator version 3.96.0 - Specification version 1.0.0-dev0.1.18 - Automation (cloudant-sdks) version 9bcd4ad --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cdf4a779..f866c334 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,11 @@ version: 2 updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + pull-request-branch-name: + separator: "-" - package-ecosystem: "pip" directory: "/" open-pull-requests-limit: 10 From 48fd513ab0d2b40e492b2a45279eb1cb9aa80232 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 24 Oct 2024 17:05:50 +0100 Subject: [PATCH 380/669] build(dev-deps): pin dependencies --- requirements-dev.txt | 82 ++++++++++++++++++++++++++++++++++++++---- requirements-docs.txt | 84 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 154 insertions(+), 12 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e4709fa3..be7e97e1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,78 @@ # build dependencies -flit==3.9.0 +flit==3.9.0\ + --hash=sha256:076c3aaba5ac24cf0ad3251f910900d95a08218e6bcb26f21fef1036cc4679ca +flit_core==3.9.0\ + --hash=sha256:7aada352fb0c7f5538c4fafeddf314d3a6a92ee8e2b1de70482329e42de70301 +requests==2.32.3\ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 +docutils==0.21.2\ + --hash=sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2 +tomli-w==1.1.0\ + --hash=sha256:1403179c78193e3184bfaade390ddbd071cba48a32a2e62ba11aae47490c63f7 +charset-normalizer==3.4.0\ + --hash=sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed\ + --hash=sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15\ + --hash=sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc\ + --hash=sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3\ + --hash=sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62\ + --hash=sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc +idna==3.10.0\ + --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 +urllib3==2.2.3\ + --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac +certifi==2024.8.30\ + --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 # test dependencies -pytest==8.3.3 -responses==0.25.3 -python_dotenv==1.0.1 -pylint==3.3.1 +pytest==8.3.3\ + --hash=sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2 +responses==0.25.3\ + --hash=sha256:521efcbc82081ab8daa588e08f7e8a64ce79b91c39f6e62199b19159bea7dbcb +python_dotenv==1.0.1\ + --hash=sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a +pylint==3.3.1\ + --hash=sha256:2f846a466dd023513240bc140ad2dd73bfc080a5d85a710afdb728c420a5a2b9 # code coverage -coverage==7.6.4 -pytest-cov==5.0.0 +coverage==7.6.4\ + --hash=sha256:3c65d37f3a9ebb703e710befdc489a38683a5b152242664b973a7b7b22348a4e\ + --hash=sha256:dacbc52de979f2823a819571f2e3a350a7e36b8cb7484cdb1e289bceaf35305f\ + --hash=sha256:12394842a3a8affa3ba62b0d4ab7e9e210c5e366fbac3e8b2a68636fb19892c2\ + --hash=sha256:023bf8ee3ec6d35af9c1c6ccc1d18fa69afa1cb29eaac57cb064dbb262a517f9\ + --hash=sha256:5915fcdec0e54ee229926868e9b08586376cae1f5faa9bbaf8faf3561b393d52\ + --hash=sha256:1f76846299ba5c54d12c91d776d9605ae33f8ae2b9d1d3c3703cf2db1a67f2c0\ + --hash=sha256:b369ead6527d025a0fe7bd3864e46dbee3aa8f652d48df6174f8d0bac9e26e0e\ + --hash=sha256:0809082ee480bb8f7416507538243c8863ac74fd8a5d2485c46f0f7499f2b491 +pytest-cov==5.0.0\ + --hash=sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652 +astroid==3.3.5\ + --hash=sha256:a9d1c946ada25098d790e079ba2a1b112157278f3fb7e718ae6a9252f5835dc8 +iniconfig==2.0.0\ + --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 +packaging==24.1.0\ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 +pluggy==1.5.0\ + --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 +pyyaml==6.0.2\ + --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba\ + --hash=sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed\ + --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476\ + --hash=sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85\ + --hash=sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19\ + --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 +platformdirs==4.3.6\ + --hash=sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb +isort==5.13.2\ + --hash=sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6 +mccabe==0.7.0\ + --hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e +tomlkit==0.13.2\ + --hash=sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde +dill==0.3.9\ + --hash=sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a +exceptiongroup==1.2.2\ + --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b\ + ; python_version < "3.11" +tomli==2.0.2\ + --hash=sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38\ + ; python_version< "3.11" +typing-extensions==4.12.2\ + --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d diff --git a/requirements-docs.txt b/requirements-docs.txt index 849d9d4b..f54d7003 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,80 @@ # documentation -recommonmark==0.7.1 -Sphinx==8.1.3 -sphinx-autodoc2==0.5.0 -myst-parser==4.0.0 -sphinx-rtd-theme==3.0.1 +recommonmark==0.7.1\ + --hash=sha256:1b1db69af0231efce3fa21b94ff627ea33dee7079a01dd0a7f8482c3da148b3f +Sphinx==8.1.3\ + --hash=sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2 +sphinx-autodoc2==0.5.0\ + --hash=sha256:e867013b1512f9d6d7e6f6799f8b537d6884462acd118ef361f3f619a60b5c9e +myst-parser==4.0.0\ + --hash=sha256:b9317997552424448c6096c2558872fdb6f81d3ecb3a40ce84a7518798f3f28d +sphinx-rtd-theme==3.0.1\ + --hash=sha256:921c0ece75e90633ee876bd7b148cfaad136b481907ad154ac3669b6fc957916 +commonmark==0.9.1\ + --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 +sphinxcontrib-applehelp==2.0.0\ + --hash=sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5 +sphinxcontrib-devhelp==2.0.0\ + --hash=sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2 +sphinxcontrib-htmlhelp==2.1.0\ + --hash=sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8 +sphinxcontrib-jsmath==1.0.1\ + --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 +sphinxcontrib-qthelp==2.0.0\ + --hash=sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb +sphinxcontrib-serializinghtml==2.0.0\ + --hash=sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331 +jinja2==3.1.4\ + --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d +Pygments==2.18.0\ + --hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a +snowballstemmer==2.2.0\ + --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a +babel==2.16.0\ + --hash=sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b +alabaster==1.0.0\ + --hash=sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b +imagesize==1.4.1\ + --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b +typing-extensions==4.12.2\ + --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d +markdown-it-py==3.0.0\ + --hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 +mdit-py-plugins==0.4.2\ + --hash=sha256:0c673c3f889399a33b95e88d2f0d111b4447bdfea7f237dab2d488f459835636 +sphinxcontrib-jquery==4.1.0\ + --hash=sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae +MarkupSafe==3.0.2\ + --hash=sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf\ + --hash=sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d\ + --hash=sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396\ + --hash=sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd +mdurl==0.1.2\ + --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 +docutils==0.21.2\ + --hash=sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2 +requests==2.32.3\ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 +charset-normalizer==3.4.0\ + --hash=sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed\ + --hash=sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15\ + --hash=sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc\ + --hash=sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3\ + --hash=sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62\ + --hash=sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc +idna==3.10.0\ + --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 +urllib3==2.2.3\ + --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac +certifi==2024.8.30\ + --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 +packaging==24.1.0\ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 +astroid==3.3.5\ + --hash=sha256:a9d1c946ada25098d790e079ba2a1b112157278f3fb7e718ae6a9252f5835dc8 +pyyaml==6.0.2\ + --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba\ + --hash=sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed\ + --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476\ + --hash=sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85\ + --hash=sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19\ + --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 From 0996fede9f271154fce7f24c0ce9acc1f5402816 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 25 Oct 2024 18:51:44 +0100 Subject: [PATCH 381/669] Revert "build(dev-deps): pin dependencies" This reverts commit 48fd513ab0d2b40e492b2a45279eb1cb9aa80232. --- requirements-dev.txt | 82 ++++-------------------------------------- requirements-docs.txt | 84 +++---------------------------------------- 2 files changed, 12 insertions(+), 154 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index be7e97e1..e4709fa3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,78 +1,10 @@ # build dependencies -flit==3.9.0\ - --hash=sha256:076c3aaba5ac24cf0ad3251f910900d95a08218e6bcb26f21fef1036cc4679ca -flit_core==3.9.0\ - --hash=sha256:7aada352fb0c7f5538c4fafeddf314d3a6a92ee8e2b1de70482329e42de70301 -requests==2.32.3\ - --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 -docutils==0.21.2\ - --hash=sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2 -tomli-w==1.1.0\ - --hash=sha256:1403179c78193e3184bfaade390ddbd071cba48a32a2e62ba11aae47490c63f7 -charset-normalizer==3.4.0\ - --hash=sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed\ - --hash=sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15\ - --hash=sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc\ - --hash=sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3\ - --hash=sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62\ - --hash=sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc -idna==3.10.0\ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 -urllib3==2.2.3\ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac -certifi==2024.8.30\ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 +flit==3.9.0 # test dependencies -pytest==8.3.3\ - --hash=sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2 -responses==0.25.3\ - --hash=sha256:521efcbc82081ab8daa588e08f7e8a64ce79b91c39f6e62199b19159bea7dbcb -python_dotenv==1.0.1\ - --hash=sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a -pylint==3.3.1\ - --hash=sha256:2f846a466dd023513240bc140ad2dd73bfc080a5d85a710afdb728c420a5a2b9 +pytest==8.3.3 +responses==0.25.3 +python_dotenv==1.0.1 +pylint==3.3.1 # code coverage -coverage==7.6.4\ - --hash=sha256:3c65d37f3a9ebb703e710befdc489a38683a5b152242664b973a7b7b22348a4e\ - --hash=sha256:dacbc52de979f2823a819571f2e3a350a7e36b8cb7484cdb1e289bceaf35305f\ - --hash=sha256:12394842a3a8affa3ba62b0d4ab7e9e210c5e366fbac3e8b2a68636fb19892c2\ - --hash=sha256:023bf8ee3ec6d35af9c1c6ccc1d18fa69afa1cb29eaac57cb064dbb262a517f9\ - --hash=sha256:5915fcdec0e54ee229926868e9b08586376cae1f5faa9bbaf8faf3561b393d52\ - --hash=sha256:1f76846299ba5c54d12c91d776d9605ae33f8ae2b9d1d3c3703cf2db1a67f2c0\ - --hash=sha256:b369ead6527d025a0fe7bd3864e46dbee3aa8f652d48df6174f8d0bac9e26e0e\ - --hash=sha256:0809082ee480bb8f7416507538243c8863ac74fd8a5d2485c46f0f7499f2b491 -pytest-cov==5.0.0\ - --hash=sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652 -astroid==3.3.5\ - --hash=sha256:a9d1c946ada25098d790e079ba2a1b112157278f3fb7e718ae6a9252f5835dc8 -iniconfig==2.0.0\ - --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 -packaging==24.1.0\ - --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 -pluggy==1.5.0\ - --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 -pyyaml==6.0.2\ - --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba\ - --hash=sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed\ - --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476\ - --hash=sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85\ - --hash=sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19\ - --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 -platformdirs==4.3.6\ - --hash=sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb -isort==5.13.2\ - --hash=sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6 -mccabe==0.7.0\ - --hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e -tomlkit==0.13.2\ - --hash=sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde -dill==0.3.9\ - --hash=sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a -exceptiongroup==1.2.2\ - --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b\ - ; python_version < "3.11" -tomli==2.0.2\ - --hash=sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38\ - ; python_version< "3.11" -typing-extensions==4.12.2\ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d +coverage==7.6.4 +pytest-cov==5.0.0 diff --git a/requirements-docs.txt b/requirements-docs.txt index f54d7003..849d9d4b 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,80 +1,6 @@ # documentation -recommonmark==0.7.1\ - --hash=sha256:1b1db69af0231efce3fa21b94ff627ea33dee7079a01dd0a7f8482c3da148b3f -Sphinx==8.1.3\ - --hash=sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2 -sphinx-autodoc2==0.5.0\ - --hash=sha256:e867013b1512f9d6d7e6f6799f8b537d6884462acd118ef361f3f619a60b5c9e -myst-parser==4.0.0\ - --hash=sha256:b9317997552424448c6096c2558872fdb6f81d3ecb3a40ce84a7518798f3f28d -sphinx-rtd-theme==3.0.1\ - --hash=sha256:921c0ece75e90633ee876bd7b148cfaad136b481907ad154ac3669b6fc957916 -commonmark==0.9.1\ - --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 -sphinxcontrib-applehelp==2.0.0\ - --hash=sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5 -sphinxcontrib-devhelp==2.0.0\ - --hash=sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2 -sphinxcontrib-htmlhelp==2.1.0\ - --hash=sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8 -sphinxcontrib-jsmath==1.0.1\ - --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 -sphinxcontrib-qthelp==2.0.0\ - --hash=sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb -sphinxcontrib-serializinghtml==2.0.0\ - --hash=sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331 -jinja2==3.1.4\ - --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d -Pygments==2.18.0\ - --hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a -snowballstemmer==2.2.0\ - --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a -babel==2.16.0\ - --hash=sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b -alabaster==1.0.0\ - --hash=sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b -imagesize==1.4.1\ - --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b -typing-extensions==4.12.2\ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d -markdown-it-py==3.0.0\ - --hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 -mdit-py-plugins==0.4.2\ - --hash=sha256:0c673c3f889399a33b95e88d2f0d111b4447bdfea7f237dab2d488f459835636 -sphinxcontrib-jquery==4.1.0\ - --hash=sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae -MarkupSafe==3.0.2\ - --hash=sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf\ - --hash=sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d\ - --hash=sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396\ - --hash=sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd -mdurl==0.1.2\ - --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 -docutils==0.21.2\ - --hash=sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2 -requests==2.32.3\ - --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 -charset-normalizer==3.4.0\ - --hash=sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed\ - --hash=sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15\ - --hash=sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc\ - --hash=sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3\ - --hash=sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62\ - --hash=sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc -idna==3.10.0\ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 -urllib3==2.2.3\ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac -certifi==2024.8.30\ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 -packaging==24.1.0\ - --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 -astroid==3.3.5\ - --hash=sha256:a9d1c946ada25098d790e079ba2a1b112157278f3fb7e718ae6a9252f5835dc8 -pyyaml==6.0.2\ - --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba\ - --hash=sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed\ - --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476\ - --hash=sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85\ - --hash=sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19\ - --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 +recommonmark==0.7.1 +Sphinx==8.1.3 +sphinx-autodoc2==0.5.0 +myst-parser==4.0.0 +sphinx-rtd-theme==3.0.1 From 36898949540fa783e601cfbe98a6a43228698ddd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:06:44 +0000 Subject: [PATCH 382/669] build(deps): Bump actions/setup-python from 5.2.0 to 5.3.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/f677139bbe7f9c59b41e40162b753c062f5d49a3...0b93645e9fea7318ecaed2b359559ac225c90a2b) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 69473dc4..5b3056cb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.13 - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: python-version: '3.13' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22f91758..5314d68d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 5d0f0202d821b8ff672e35ede05f13b27c1b1465 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:55:13 +0000 Subject: [PATCH 383/669] ci(generated): run SonarQube on dependabot core update branches Generated SDK source code using: - Generator version 3.96.0 - Specification version 1.0.0-dev0.1.20 - Automation (cloudant-sdks) version fdbe4d5 --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f84a0010..be7cf2e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,10 +62,13 @@ pipeline { environment { scannerHome = tool 'SonarQubeScanner' } - // Scanning runs only on non-dependabot branches + // Scanning runs on dependabot core update and non-dependabot branches when { - not { - branch 'dependabot*' + anyOf { + branch pattern: /^dependabot.*(?i)(ibm)[\.-].+sdk-core.*$/, comparator: 'REGEXP' + not { + branch 'dependabot*' + } } } steps { From 309baaaaff258ff38c1cc6c8794beaafbff33223 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 24 May 2024 17:02:27 +0100 Subject: [PATCH 384/669] feat: improve error responses Create _error_response_hook function to augment error messages. Add hook to the client requests session. Unit tests for the hook. --- ibmcloudant/__init__.py | 6 +- ibmcloudant/cloudant_base_service.py | 117 ++++- test/unit/test_cloudant_base_error_augment.py | 470 ++++++++++++++++++ 3 files changed, 570 insertions(+), 23 deletions(-) create mode 100644 test/unit/test_cloudant_base_error_augment.py diff --git a/ibmcloudant/__init__.py b/ibmcloudant/__init__.py index 7046d6cf..650d39da 100644 --- a/ibmcloudant/__init__.py +++ b/ibmcloudant/__init__.py @@ -1,5 +1,5 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2021. +# © Copyright IBM Corporation 2020, 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ from ibm_cloud_sdk_core import IAMTokenManager, DetailedResponse, BaseService, ApiException, get_authenticator from .couchdb_session_authenticator import CouchDbSessionAuthenticator from .couchdb_session_get_authenticator_patch import new_construct_authenticator -from .cloudant_base_service import new_init, new_prepare_request, new_set_service_url, new_set_default_headers +from .cloudant_base_service import new_init, new_prepare_request, new_set_default_headers, new_set_http_client, new_set_service_url from .couchdb_session_token_manager import CouchDbSessionTokenManager from .cloudant_v1 import CloudantV1 from .features.changes_follower import ChangesFollower @@ -34,3 +34,5 @@ CloudantV1.set_default_headers = new_set_default_headers CloudantV1.prepare_request = new_prepare_request + +CloudantV1.set_http_client = new_set_http_client diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index cd39059e..45ecde3a 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2022. +# © Copyright IBM Corporation 2020, 2024. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,12 +15,17 @@ # limitations under the License. """ Module to patch sdk core base service for session authentication +and other helpful features. """ from collections import namedtuple from typing import Dict, Optional, Union, Tuple, List from urllib.parse import urlsplit, unquote +from json import dumps +from json.decoder import JSONDecodeError +from io import BytesIO from ibm_cloud_sdk_core.authenticators import Authenticator +from requests import Response, Session from requests.cookies import RequestsCookieJar from .common import get_sdk_headers @@ -67,12 +72,10 @@ def __hash__(self): # Since Py3.6 dict is ordered so use a key only dict for our set rules_by_operation.setdefault(operation_id, dict()).setdefault(rule) - -old_init = CloudantV1.__init__ - +_old_init = CloudantV1.__init__ def new_init(self, authenticator: Authenticator = None): - old_init(self, authenticator) + _old_init(self, authenticator) # Overwrite default read timeout to 2.5 minutes if not ('timeout' in self.http_config): new_http_config = self.http_config.copy() @@ -83,25 +86,22 @@ def new_init(self, authenticator: Authenticator = None): # Replacing BaseService's http.cookiejar.CookieJar as RequestsCookieJar supports update(CookieJar) self.jar = RequestsCookieJar(self.jar) self.authenticator.set_jar(self.jar) # Authenticators don't have access to cookie jars by default + add_hooks(self) - -old_set_service_url = CloudantV1.set_service_url - +_old_set_service_url = CloudantV1.set_service_url def new_set_service_url(self, service_url: str): - old_set_service_url(self, service_url) + _old_set_service_url(self, service_url) try: if isinstance(self.authenticator, CouchDbSessionAuthenticator): self.authenticator.token_manager.set_service_url(service_url) except AttributeError: pass # in case no authenticator is configured yet, pass - -old_set_default_headers = CloudantV1.set_default_headers - +_old_set_default_headers = CloudantV1.set_default_headers def new_set_default_headers(self, headers: Dict[str, str]): - old_set_default_headers(self, headers) + _old_set_default_headers(self, headers) if isinstance(self.authenticator, CouchDbSessionAuthenticator): combined_headers = {} combined_headers.update(headers) @@ -112,18 +112,82 @@ def new_set_default_headers(self, headers: Dict[str, str]): ) self.authenticator.token_manager.set_default_headers(combined_headers) +_old_set_disable_ssl_verification = CloudantV1.set_disable_ssl_verification -old_set_disable_ssl_verification = CloudantV1.set_disable_ssl_verification - - +# Note this is currently unused, but probably should be enabled. +# To enable it we need to resolve whether CouchDbSessionAuthenticator +# should ever be allowed to have a different value from the service client. def new_set_disable_ssl_verification(self, status: bool = False) -> None: - old_set_disable_ssl_verification(self, status) + _old_set_disable_ssl_verification(self, status) if isinstance(self.authenticator, CouchDbSessionAuthenticator): self.authenticator.token_manager.set_disable_ssl_verification(status) - -old_prepare_request = CloudantV1.prepare_request - +def _error_response_hook(response:Response, *args, **kwargs) -> Optional[Response]: + # pylint: disable=W0613 + # unused args and kwargs required by requests event hook interface + """Function for augmenting error responses. + Converts the Cloudant response to better match the + standard error response formats including adding a + trace ID and appending the Cloudant/CouchDB error + reason to the message. + + Follows the requests event hook pattern. + + :param response: the requests Response object + :type response: Response + + :return: A new response object, defaults to the existing response + :rtype: Response,optional + """ + # Only hook into error responses + # Ignore HEAD request responses because there is no body to read + if not response.ok and response.request.method != 'HEAD': + content_type = response.headers.get('content-type') + # If it isn't JSON don't mess with it! + if content_type is not None and content_type.startswith('application/json'): + try: + error_json: dict = response.json() + # Only augment if there isn't a trace or errors already + send_augmented_response = False + if 'trace' not in error_json: + if 'errors' not in error_json: + error = error_json.get('error') + reason = error_json.get('reason') + if error is not None: + error_model: dict = {'code': error, 'message': f'{error}'} + if reason: + error_model['message'] += f': {reason}' + error_json['errors'] = [error_model] + send_augmented_response = True + if 'errors' in error_json: + trace = response.headers.get('x-couch-request-id') + if trace is not None: + # Augment trace if there was a value + error_json['trace'] = trace + send_augmented_response = True + if send_augmented_response: + # It'd be nice to just change content on response, but it's internal. + # Instead copy the named attributes to a new Response and then set + # the encoding and bytes of the modified error body. + error_response = Response() + error_response.status_code = response.status_code + error_response.headers = response.headers + error_response.url = response.url + error_response.history = response.history + error_response.reason = response.reason + error_response.cookies = response.cookies + error_response.elapsed = response.elapsed + error_response.request = response.request + error_response.encoding = 'utf-8' + error_response.raw = BytesIO(dumps(error_json).encode('utf-8')) + return error_response + except JSONDecodeError: + # If we couldn't read the JSON we just return the response as-is + # so the exception can surface elsewhere. + pass + return response + +_old_prepare_request = CloudantV1.prepare_request def new_prepare_request(self, method: str, @@ -159,4 +223,15 @@ def new_prepare_request(self, if segment_to_validate.startswith('_'): raise ValueError('{0} {1} starts with the invalid _ character.'.format(rule.error_parameter_name, unquote(segment_to_validate))) - return old_prepare_request(self, method, url, *args, headers=headers, params=params, data=data, files=files, **kwargs) + return _old_prepare_request(self, method, url, *args, headers=headers, params=params, data=data, files=files, **kwargs) + +def add_hooks(self): + response_hooks = self.get_http_client().hooks['response'] + if _error_response_hook not in response_hooks: + response_hooks.append(_error_response_hook) + +_old_set_http_client = CloudantV1.set_http_client + +def new_set_http_client(self, http_client: Session) -> None: + _old_set_http_client(self, http_client) + add_hooks(self) diff --git a/test/unit/test_cloudant_base_error_augment.py b/test/unit/test_cloudant_base_error_augment.py new file mode 100644 index 00000000..2f46dc0d --- /dev/null +++ b/test/unit/test_cloudant_base_error_augment.py @@ -0,0 +1,470 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2024. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Any, Literal, TypedDict +import responses +import unittest +from json.decoder import JSONDecodeError +from ibm_cloud_sdk_core import ApiException +from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator +from ibmcloudant.cloudant_v1 import * +from ibmcloudant.cloudant_base_service import _error_response_hook + +class MockResponse(TypedDict): + body: Union[dict[str,Any], str, bytes, None] + headers: dict[str, str] + status: int + stream: bool + +class ExpectedResponse(TypedDict, total=False): + body: Union[dict[str,Any], str, bytes, None] + message: str # not required (but can't be marked that way until 3.11) + +class TestErrorAugment(unittest.TestCase): + + _base_url = 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud' + _db_name = 'testdb' + _doc_id = 'testdoc' + _req_id = 'testreqid' + _error_name = 'test_value' + _error_reason = 'A valid test reason' + _content_type_header = {'content-type': 'application/json'} + _request_id_header = {'x-couch-request-id': _req_id} + _default_mock_headers = _content_type_header | _request_id_header + _error_only_body = {'error': _error_name} + _error_reason_body = {'error': _error_name, 'reason': _error_reason} + _errors_error_only = {'errors': [{'code': _error_name, 'message': _error_name}]} + _errors_error_reason = {'errors': [{'code': _error_name, 'message': f'{_error_name}: {_error_reason}'}]} + _trace = {'trace': _req_id} + + @classmethod + def setUpClass(cls): + cls._service = CloudantV1( + authenticator=NoAuthAuthenticator() + ) + cls._service.set_service_url(cls._base_url) + + def _make_request(self, method: Literal['GET','HEAD'], stream: bool): + if method == responses.GET: + if stream: + return self._service.get_document_as_stream(self._db_name, self._doc_id) + else: + return self._service.get_document(self._db_name, self._doc_id) + elif method == responses.HEAD: + return self._service.head_document(self._db_name, self._doc_id) + else: + raise Exception('Only GET and HEAD requests expected.') + + def _expected_message_from_mock_response(self, mock_response: MockResponse): + body = mock_response['body'] + status_code = mock_response['status'] + err = body['error'] + msg: str = f'Error: {err}' + if 'reason' in body: + reason = body['reason'] + msg += f': {reason}' + msg += f', Status code: {status_code}' + return msg + + def _run_test( + self, + method: Literal['GET', 'HEAD'] = responses.GET, + mock_response: MockResponse = { + 'body': _error_reason_body, + 'headers': _default_mock_headers, + 'status': 444, + 'stream': False + }, + expected_response: ExpectedResponse = None + ) -> Union[Exception, None]: + + if expected_response is None: + # Default to a no-augment body pass-through + expected_response = { + 'body': mock_response['body'] + } + + if mock_response['status'] == 200: + expect_raises = False + else: + expect_raises = True + if 'message' not in expected_response: + expected_response['message'] = self._expected_message_from_mock_response(mock_response) + + if isinstance(mock_response['body'], dict): + # stringify dict responses + mock_response['body'] = json.dumps(mock_response['body']) + + caught_exception = None + with responses.RequestsMock(response_callback=self._response_callback) as mock_ctx: + # Add the mock response + # Copy the headers so we can remove content-type for responses preferred format + mock_response['headers'] = dict(mock_response['headers']) + mock_content_type = mock_response['headers'].pop('content-type', None) + mock_ctx.add( + method, + url=self._base_url + f'/{self._db_name}/{self._doc_id}', + content_type=mock_content_type, + **mock_response + ) + if expect_raises: + with self.assertRaisesRegex(ApiException, expected_response['message']) as e_ctx: + self._make_request(method, mock_response['stream']) + caught_exception = e_ctx.exception + actual_status_code = caught_exception.status_code + actual_headers = caught_exception.http_response.headers + # Default to raw body + actual_body = caught_exception.http_response.content + if method != 'HEAD' and mock_content_type: + if mock_content_type.startswith('application/json'): + try: + actual_body = caught_exception.http_response.json() + except JSONDecodeError: + # Catch the malformed JSON case + actual_body = caught_exception.http_response.text + elif mock_content_type == 'text/plain': + actual_body = caught_exception.http_response.text + else: + try: + service_response = self._make_request(method, mock_response['stream']) + actual_status_code = service_response.get_status_code() + actual_headers = service_response.get_headers() + actual_body = service_response.get_result() + except Exception as e: + raise Exception('There should be no exception raised in this case.') from e + # Assert expected status_code + self.assertEqual(mock_response['status'], actual_status_code) + # Assert headers unchanged, re-adding the content-type we had to pop for responses mock + if mock_content_type: + expected_headers = mock_response['headers'] | {'content-type': mock_content_type} + else: + expected_headers = mock_response['headers'] + self.assertEqual(expected_headers, actual_headers) + # Assert expected body + self.assertEqual(expected_response['body'], actual_body) + return caught_exception + + # Responses mocking doesn't actually go through requests it presents + # a requests like API. This means the requests event hooks aren't called + # when mocking with responses. However, the response_callback behaves like + # requests response event hook so we use it to invoke our _error_response_hook + # during testing. + @classmethod + def _response_callback(cls, resp): + return _error_response_hook(resp) + + def test_response_hook_added(self): + self.assertEqual(_error_response_hook, self._service.get_http_client().hooks['response'][0]) + + def test_response_hook_not_double_added_via_set_http_client(self): + client = self._service.get_http_client() + self._service.set_http_client(client) + response_hooks = self._service.get_http_client().hooks['response'] + self.assertEqual(1, len(response_hooks)) + self.assertEqual(_error_response_hook, response_hooks[0]) + + def test_response_hook_added_via_set_http_client(self): + client = self._service.get_http_client() + client.hooks['response'].clear() + self._service.set_http_client(client) + response_hooks = self._service.get_http_client().hooks['response'] + self.assertEqual(1, len(response_hooks)) + self.assertEqual(_error_response_hook, response_hooks[0]) + + def test_augment_error(self): + self._run_test( + mock_response={ + 'body': self._error_only_body, + 'headers': self._content_type_header, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': self._error_only_body | self._errors_error_only + } + ) + + def test_augment_error_with_trace(self): + self._run_test( + mock_response={ + 'body': self._error_only_body, + 'headers': self._default_mock_headers, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': self._error_only_body | self._errors_error_only | self._trace + } + ) + + def test_augment_error_reason(self): + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._content_type_header, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason + } + ) + + def test_augment_error_reason_with_trace(self): + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._default_mock_headers, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason | self._trace + } + ) + + def test_augment_error_reason_stream(self): + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._default_mock_headers, + 'status': 444, + 'stream': True + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason | self._trace + } + ) + + def test_augment_json_charset(self): + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._request_id_header | {'content-type': 'application/json; charset=utf-8'}, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason | self._trace + } + ) + + def test_augment_no_header(self): + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._content_type_header, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason + } + ) + + def test_no_augment_success(self): + self._run_test( + mock_response={ + 'body': {'_id': self._doc_id, '_rev': '1-abc', 'foo': 'bar'}, + 'headers': self._default_mock_headers, + 'status': 200, + 'stream': False + } + ) + + def test_no_augment_head(self): + self._run_test( + method=responses.HEAD, + mock_response={ + 'body': None, + 'headers': self._default_mock_headers, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': b'', # no body content for HEAD + 'message': 'Error: Unknown error, Status code: 444' + } + ) + + def test_no_augment_id_only(self): + self._run_test( + mock_response={ + 'body': {}, + 'headers': self._default_mock_headers, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': {}, + 'message': 'Error: {}, Status code: 444' + } + ) + + def test_no_augment_existing_trace(self): + test_body = { + 'trace': 'testanotherreqid', + 'error': 'too_many_requests', + 'reason': 'Buy a bigger plan.' + } + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._default_mock_headers, + 'status': 429, + 'stream': False + }, + expected_response={ + 'body': test_body, + 'message': 'Error: too_many_requests, Status code: 429' + } + ) + + def test_no_augment_existing_errors_no_id(self): + test_body = { + 'errors': [ + { + 'code': 'forbidden', + 'message':'forbidden: You must have _reader to access this resource.' + }], + 'error': 'forbidden', # error for use by assertion + 'reason': 'You must have _reader to access this resource.' # reason for use by assertion + } + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._content_type_header, + 'status': 403, + 'stream': False + }, + expected_response={ + 'body': test_body, + } + ) + + def test_augment_trace_existing_errors(self): + test_body = { + 'errors': [ + { + 'code': 'forbidden', + 'message':'forbidden: You must have _reader to access this resource.' + }], + 'error': 'forbidden', # error for use by assertion + 'reason': 'You must have _reader to access this resource.' # reason for use by assertion + } + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._default_mock_headers, + 'status': 403, + 'stream': False + }, + expected_response={ + 'body': test_body | self._trace + } + ) + + def test_no_augment_non_json(self): + test_body = 'foo' + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._request_id_header | {'content-type': 'text/plain'}, + 'status': 400, + 'stream': False + }, + expected_response={ + 'body': test_body, + 'message': f'Error: {test_body}, Status code: 400' + } + ) + + def test_no_augment_no_content_type(self): + test_body = b'000' + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._request_id_header, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': test_body, + 'message': 'Error: 000, Status code: 444' + } + ) + + def test_no_augment_no_error(self): + test_body = {'foo':'bar', 'reason': 'testing'} + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._default_mock_headers, + 'status': 400, + 'stream': False + }, + expected_response={ + 'body': test_body, + 'message': 'Error: Bad Request, Status code: 400' + } + ) + + def test_no_augment_no_error_no_header(self): + test_body = {'foo':'bar', 'reason': 'testing'} + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._content_type_header, + 'status': 400, + 'stream': False + }, + expected_response={ + 'body': test_body, + 'message': 'Error: Bad Request, Status code: 400' + } + ) + + def test_no_augment_invalid_json(self): + test_body = '{"err' + e = self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._content_type_header, + 'status': 400, + 'stream': False + }, + expected_response={ + 'body': test_body, + 'message': 'Error: {"err, Status code: 400' + } + ) + with self.assertRaises(JSONDecodeError): + e.http_response.json() + + def test_augment_error_empty_reason_with_trace(self): + test_body = self._error_only_body | {"reason": ''} + self._run_test( + mock_response={ + 'body': test_body, + 'headers': self._default_mock_headers, + 'status': 444, + 'stream': False + }, + expected_response={ + 'body': test_body | self._errors_error_only | self._trace, + "message": f'Error: {self._error_name}, Status code: 444' + } + ) From b990ef5aa7abb984e37c5d71cd3e7e577f0ece3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:53:39 +0000 Subject: [PATCH 385/669] build(deps-dev): Bump pytest-cov from 5.0.0 to 6.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 5.0.0 to 6.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v5.0.0...v6.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e4709fa3..514895e9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.0.1 pylint==3.3.1 # code coverage coverage==7.6.4 -pytest-cov==5.0.0 +pytest-cov==6.0.0 From a7f02a898c168399a1937e71b7c452e26ce0bc3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:26:38 +0000 Subject: [PATCH 386/669] build(deps-dev): Bump flit from 3.9.0 to 3.10.0 Bumps [flit](https://github.com/pypa/flit) from 3.9.0 to 3.10.0. - [Changelog](https://github.com/pypa/flit/blob/main/doc/history.rst) - [Commits](https://github.com/pypa/flit/compare/3.9.0...3.10.0) --- updated-dependencies: - dependency-name: flit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 514895e9..13e42b10 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # build dependencies -flit==3.9.0 +flit==3.10.0 # test dependencies pytest==8.3.3 responses==0.25.3 From 3af327dce18c77bca5bd9e1b9e45f327684435ef Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 1 Nov 2024 11:23:16 +0000 Subject: [PATCH 387/669] test: update responses stream usage --- test/unit/test_cloudant_base_error_augment.py | 71 +++++++------------ 1 file changed, 26 insertions(+), 45 deletions(-) diff --git a/test/unit/test_cloudant_base_error_augment.py b/test/unit/test_cloudant_base_error_augment.py index 2f46dc0d..6c1fe810 100644 --- a/test/unit/test_cloudant_base_error_augment.py +++ b/test/unit/test_cloudant_base_error_augment.py @@ -27,7 +27,6 @@ class MockResponse(TypedDict): body: Union[dict[str,Any], str, bytes, None] headers: dict[str, str] status: int - stream: bool class ExpectedResponse(TypedDict, total=False): body: Union[dict[str,Any], str, bytes, None] @@ -85,10 +84,10 @@ def _run_test( mock_response: MockResponse = { 'body': _error_reason_body, 'headers': _default_mock_headers, - 'status': 444, - 'stream': False + 'status': 444 }, - expected_response: ExpectedResponse = None + expected_response: ExpectedResponse = None, + stream=False ) -> Union[Exception, None]: if expected_response is None: @@ -122,7 +121,7 @@ def _run_test( ) if expect_raises: with self.assertRaisesRegex(ApiException, expected_response['message']) as e_ctx: - self._make_request(method, mock_response['stream']) + self._make_request(method, stream) caught_exception = e_ctx.exception actual_status_code = caught_exception.status_code actual_headers = caught_exception.http_response.headers @@ -139,7 +138,7 @@ def _run_test( actual_body = caught_exception.http_response.text else: try: - service_response = self._make_request(method, mock_response['stream']) + service_response = self._make_request(method, stream) actual_status_code = service_response.get_status_code() actual_headers = service_response.get_headers() actual_body = service_response.get_result() @@ -189,8 +188,7 @@ def test_augment_error(self): mock_response={ 'body': self._error_only_body, 'headers': self._content_type_header, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': self._error_only_body | self._errors_error_only @@ -202,8 +200,7 @@ def test_augment_error_with_trace(self): mock_response={ 'body': self._error_only_body, 'headers': self._default_mock_headers, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': self._error_only_body | self._errors_error_only | self._trace @@ -215,8 +212,7 @@ def test_augment_error_reason(self): mock_response={ 'body': self._error_reason_body, 'headers': self._content_type_header, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': self._error_reason_body | self._errors_error_reason @@ -228,8 +224,7 @@ def test_augment_error_reason_with_trace(self): mock_response={ 'body': self._error_reason_body, 'headers': self._default_mock_headers, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': self._error_reason_body | self._errors_error_reason | self._trace @@ -241,12 +236,12 @@ def test_augment_error_reason_stream(self): mock_response={ 'body': self._error_reason_body, 'headers': self._default_mock_headers, - 'status': 444, - 'stream': True + 'status': 444 }, expected_response={ 'body': self._error_reason_body | self._errors_error_reason | self._trace - } + }, + stream = True ) def test_augment_json_charset(self): @@ -254,8 +249,7 @@ def test_augment_json_charset(self): mock_response={ 'body': self._error_reason_body, 'headers': self._request_id_header | {'content-type': 'application/json; charset=utf-8'}, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': self._error_reason_body | self._errors_error_reason | self._trace @@ -267,8 +261,7 @@ def test_augment_no_header(self): mock_response={ 'body': self._error_reason_body, 'headers': self._content_type_header, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': self._error_reason_body | self._errors_error_reason @@ -280,8 +273,7 @@ def test_no_augment_success(self): mock_response={ 'body': {'_id': self._doc_id, '_rev': '1-abc', 'foo': 'bar'}, 'headers': self._default_mock_headers, - 'status': 200, - 'stream': False + 'status': 200 } ) @@ -291,8 +283,7 @@ def test_no_augment_head(self): mock_response={ 'body': None, 'headers': self._default_mock_headers, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': b'', # no body content for HEAD @@ -305,8 +296,7 @@ def test_no_augment_id_only(self): mock_response={ 'body': {}, 'headers': self._default_mock_headers, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': {}, @@ -324,8 +314,7 @@ def test_no_augment_existing_trace(self): mock_response={ 'body': test_body, 'headers': self._default_mock_headers, - 'status': 429, - 'stream': False + 'status': 429 }, expected_response={ 'body': test_body, @@ -347,8 +336,7 @@ def test_no_augment_existing_errors_no_id(self): mock_response={ 'body': test_body, 'headers': self._content_type_header, - 'status': 403, - 'stream': False + 'status': 403 }, expected_response={ 'body': test_body, @@ -369,8 +357,7 @@ def test_augment_trace_existing_errors(self): mock_response={ 'body': test_body, 'headers': self._default_mock_headers, - 'status': 403, - 'stream': False + 'status': 403 }, expected_response={ 'body': test_body | self._trace @@ -383,8 +370,7 @@ def test_no_augment_non_json(self): mock_response={ 'body': test_body, 'headers': self._request_id_header | {'content-type': 'text/plain'}, - 'status': 400, - 'stream': False + 'status': 400 }, expected_response={ 'body': test_body, @@ -398,8 +384,7 @@ def test_no_augment_no_content_type(self): mock_response={ 'body': test_body, 'headers': self._request_id_header, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': test_body, @@ -413,8 +398,7 @@ def test_no_augment_no_error(self): mock_response={ 'body': test_body, 'headers': self._default_mock_headers, - 'status': 400, - 'stream': False + 'status': 400 }, expected_response={ 'body': test_body, @@ -428,8 +412,7 @@ def test_no_augment_no_error_no_header(self): mock_response={ 'body': test_body, 'headers': self._content_type_header, - 'status': 400, - 'stream': False + 'status': 400 }, expected_response={ 'body': test_body, @@ -443,8 +426,7 @@ def test_no_augment_invalid_json(self): mock_response={ 'body': test_body, 'headers': self._content_type_header, - 'status': 400, - 'stream': False + 'status': 400 }, expected_response={ 'body': test_body, @@ -460,8 +442,7 @@ def test_augment_error_empty_reason_with_trace(self): mock_response={ 'body': test_body, 'headers': self._default_mock_headers, - 'status': 444, - 'stream': False + 'status': 444 }, expected_response={ 'body': test_body | self._errors_error_only | self._trace, From 53a9fedcba92650de0e5ad0772d55c01b2f0324f Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 31 Oct 2024 11:47:30 -0300 Subject: [PATCH 388/669] refactor(follower): twist test timeouts for more stable values --- test/unit/features/test_changes_follower.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index acac60c8..11fed59e 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -287,12 +287,12 @@ def test_stop(self): self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db="db") start = timeit.default_timer() - count = self.runner(follower, _Mode.FINITE, timeout=5, stop_after=1000) + count = self.runner(follower, _Mode.FINITE, timeout=2, stop_after=1000) stop = timeit.default_timer() - start except BaseException: self.fail("There should be no exception.") self.assertGreaterEqual(count, 1000, "There should be some changes.") - self.assertLess(stop, 5, "The thread should have stopped before the wait time.") + self.assertLess(stop, 2, "The thread should have stopped before the wait time.") @responses.activate def test_state_error(self): @@ -324,7 +324,7 @@ def test_limit(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db="db", limit=limit) - count = self.runner(follower, _Mode.FINITE, timeout=3600) + count = self.runner(follower, _Mode.FINITE, timeout=180) except BaseException: self.fail("There should be no exception.") self.assertEqual( @@ -446,7 +446,7 @@ def test_start(self): try: self.prepare_mock_changes(batches=3) follower = ChangesFollower(self.client, db="db") - count = self.runner(follower, _Mode.LISTEN, timeout=5) + count = self.runner(follower, _Mode.LISTEN, timeout=2) except BaseException: self.fail("There should be no exception.") self.assertGreater(count, 2 * _BATCH_SIZE + 1, "There should be some changes.") @@ -543,7 +543,7 @@ def test_start_transient_errors_with_max_suppression_all_changes(self): Checks that a LISTEN mode runs through transient errors with max suppression to receive changes until stopped. """ - batches = 3 + batches = 2 self.prepare_mock_changes( batches=batches, errors=self.transient_errors, @@ -568,12 +568,12 @@ def test_stop(self): self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db="db") start = timeit.default_timer() - count = self.runner(follower, _Mode.LISTEN, timeout=5, stop_after=1000) + count = self.runner(follower, _Mode.LISTEN, timeout=2, stop_after=1000) stop = timeit.default_timer() - start except BaseException: self.fail("There should be no exception.") self.assertGreaterEqual(count, 1000, "There should be some changes.") - self.assertLess(stop, 5, "The thread should have stopped before the wait time.") + self.assertLess(stop, 2, "The thread should have stopped before the wait time.") @responses.activate def test_state_error(self): @@ -605,7 +605,7 @@ def test_limit(self): try: self.prepare_mock_changes(batches=MAX_BATCHES) follower = ChangesFollower(self.client, db="db", limit=limit) - count = self.runner(follower, _Mode.LISTEN, timeout=3600) + count = self.runner(follower, _Mode.LISTEN, timeout=180) except BaseException: self.fail("There should be no exception.") self.assertEqual( From 140755063d4b6dee516cf8d2f553a1ae7447cd38 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 31 Oct 2024 11:52:52 -0300 Subject: [PATCH 389/669] refactor(follower): stabilize test runner --- test/unit/features/conftest.py | 47 ++++++++++------------------------ 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index 429378d7..d591e3de 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -23,10 +23,8 @@ import os import json import responses -import time -import threading -import queue +from threading import Timer import itertools @@ -218,46 +216,27 @@ def prepare_mock_with_error(self, error: str): json={'error': error}, ) - def runner(self, follower, mode, timeout=0, stop_after=0): + def runner(self, follower, mode, timeout=1, stop_after=0): """ blocking runner with timeout """ - class TimeoutError(Exception): - pass - - def looper(changes, buf): + def main(): + if mode == _Mode.LISTEN: + changes = follower.start() + elif mode == _Mode.FINITE: + changes = follower.start_one_off() + stop_timer = Timer(timeout, follower.stop) + stop_timer.start() counter = 0 - buf.put(counter) try: for _ in changes: counter += 1 if stop_after > 0 and stop_after == counter: follower.stop() - except Exception as e: - buf.put(e) - return - buf.put(counter) - - def main(): - if mode == _Mode.LISTEN: - changes = follower.start() - elif mode == _Mode.FINITE: - changes = follower.start_one_off() - buf = queue.Queue() - thread = threading.Thread(target=looper, args=(changes, buf)) - thread.start() - thread.join(timeout) - while True: - time.sleep(0.2) - if thread.is_alive(): - follower.stop() - else: - break - while not buf.empty(): - data = buf.get() - if isinstance(data, Exception): - raise data - return data + break + finally: + stop_timer.cancel() + return counter return main() From 57f6071c6ffcb72ea05a4227ea096e87359c27ea Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 31 Oct 2024 11:56:59 -0300 Subject: [PATCH 390/669] refactor(follower): switch to generator expression for changes iterator --- ibmcloudant/features/changes_follower.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index 4fafb23e..d9860233 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -157,7 +157,9 @@ def __next__(self): raise StopIteration from exc if isinstance(data, Exception): raise data from None - self._changes_iter = iter(data) + self._changes_iter = iter( + (ChangesResultItem.from_dict(item) for item in data) + ) self._buffer.task_done() def _request_callback(self): @@ -178,9 +180,7 @@ def _request_callback(self): self._buffer.join() if self._stop.is_set(): raise StopIteration - self._buffer.put( - [ChangesResultItem.from_dict(item) for item in results] - ) + self._buffer.put(results) except Exception as e: self.logger.debug(f'Exception getting changes {e}') if ( From bd0c9468de39ed671f6cac4f5b6f10b752301178 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 31 Oct 2024 10:59:17 -0300 Subject: [PATCH 391/669] refactor(follower): handle StopIteration in req callback separately --- ibmcloudant/features/changes_follower.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index d9860233..d8d13a0c 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -181,6 +181,11 @@ def _request_callback(self): if self._stop.is_set(): raise StopIteration self._buffer.put(results) + except StopIteration as e: + self.logger.debug('Iterator stopped.') + self._buffer.join() + self._buffer.put(e) + break except Exception as e: self.logger.debug(f'Exception getting changes {e}') if ( @@ -196,10 +201,7 @@ def _request_callback(self): self._buffer.join() self._buffer.put(e) break - if ( - type(e) is ApiException and e.status_code in [400, 401, 403, 404] - or type(e) is StopIteration - ): + if type(e) is ApiException and e.status_code in [400, 401, 403, 404]: self.logger.debug('Terminal error.') self._buffer.join() self._buffer.put(e) From c96094245614bd5dfef60da21b599a8de64782a3 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Fri, 1 Nov 2024 12:35:24 -0300 Subject: [PATCH 392/669] fix: correctly set 'since' on one off follower (#734) --- ibmcloudant/features/changes_follower.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index d8d13a0c..144d244c 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -107,7 +107,6 @@ def __init__( self._limit = None self._stop = Event() self.logger = logging.getLogger(__name__) - self._request_thread.start() @property def limit(self) -> int: @@ -127,6 +126,9 @@ def since(self) -> str: def since(self, value: str) -> None: self._since = value + def _start(self) -> None: + self._request_thread.start() + def stop(self) -> None: # shortcut limit and cancel in-flight self.limit = 0 @@ -454,4 +456,5 @@ def _run(self, mode: _Mode): self._iter.limit = self.limit if self.options.get('since') is not None: self._iter.since = self.options.get('since') + self._iter._start() return self._iter From 7d820bc7ac3e86e76eba885771affeaa683b0f59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:26:46 +0000 Subject: [PATCH 393/669] build(deps-dev): Bump flit from 3.10.0 to 3.10.1 Bumps [flit](https://github.com/pypa/flit) from 3.10.0 to 3.10.1. - [Changelog](https://github.com/pypa/flit/blob/main/doc/history.rst) - [Commits](https://github.com/pypa/flit/compare/3.10.0...3.10.1) --- updated-dependencies: - dependency-name: flit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 13e42b10..74984bb7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # build dependencies -flit==3.10.0 +flit==3.10.1 # test dependencies pytest==8.3.3 responses==0.25.3 From 5978b63bf15cea36da6bdf1f5ae56b478a2080dc Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 6 Nov 2024 11:23:31 +0000 Subject: [PATCH 394/669] feat: set x-request-id as error trace --- ibmcloudant/cloudant_base_service.py | 5 +++- test/unit/test_cloudant_base_error_augment.py | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index 45ecde3a..f9922bc4 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -160,7 +160,10 @@ def _error_response_hook(response:Response, *args, **kwargs) -> Optional[Respons error_json['errors'] = [error_model] send_augmented_response = True if 'errors' in error_json: - trace = response.headers.get('x-couch-request-id') + # Get the x-request-id header if available + # otherwise try the x-couch-request-id header + trace = response.headers.get('x-request-id', + response.headers.get('x-couch-request-id')) if trace is not None: # Augment trace if there was a value error_json['trace'] = trace diff --git a/test/unit/test_cloudant_base_error_augment.py b/test/unit/test_cloudant_base_error_augment.py index 6c1fe810..f126ec93 100644 --- a/test/unit/test_cloudant_base_error_augment.py +++ b/test/unit/test_cloudant_base_error_augment.py @@ -231,6 +231,31 @@ def test_augment_error_reason_with_trace(self): } ) + def test_augment_error_reason_with_trace_request_id(self): + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._content_type_header | {'x-request-id': self._req_id}, + 'status': 444 + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason | self._trace + } + ) + + def test_augment_error_reason_with_trace_request_id_preferred(self): + expected_req_id = 'preferred_req_id' + self._run_test( + mock_response={ + 'body': self._error_reason_body, + 'headers': self._default_mock_headers | {'x-request-id': expected_req_id}, + 'status': 444 + }, + expected_response={ + 'body': self._error_reason_body | self._errors_error_reason | {'trace': expected_req_id} + } + ) + def test_augment_error_reason_stream(self): self._run_test( mock_response={ From 6f26f515965024691a8fbb0e848f666f613ecdb3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:49:47 +0000 Subject: [PATCH 395/669] feat(generated): update API definition to 1.0.0-dev0.1.22 Generated SDK source code using: - Generator version 3.96.0 - Specification version 1.0.0-dev0.1.22 - Automation (cloudant-sdks) version bfea063 --- ibmcloudant/cloudant_v1.py | 263 ++++++++++++++++++--------- test/integration/test_cloudant_v1.py | 6 + test/unit/test_cloudant_v1.py | 42 ++++- 3 files changed, 211 insertions(+), 100 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 5f31bdd1..e692e91f 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -4499,6 +4499,7 @@ def post_partition_explain( partition_key: str, selector: dict, *, + allow_fallback: Optional[bool] = None, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, @@ -4556,6 +4557,8 @@ def post_partition_explain( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param bool allow_fallback: (optional) Whether to allow fallback to other + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4594,9 +4597,11 @@ def post_partition_explain( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. - If the specified index does not exist or cannot answer the query then the - value is ignored and another index or a full scan of all documents will - answer the query. + If the specified index doesn't exist or can't answer the query then the + server ignores the value and answers using another index or a full scan of + all documents. To change this behavior set `allow_fallback` to `false` and + the server responds instead with a `400` status code if the requested index + is unsuitable to answer the query. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ExplainResult` object @@ -4618,6 +4623,7 @@ def post_partition_explain( data = { 'selector': selector, + 'allow_fallback': allow_fallback, 'bookmark': bookmark, 'conflicts': conflicts, 'execution_stats': execution_stats, @@ -4658,6 +4664,7 @@ def post_partition_find( partition_key: str, selector: dict, *, + allow_fallback: Optional[bool] = None, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, @@ -4676,10 +4683,15 @@ def post_partition_find( Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the `_index` endpoint. - Queries without an appropriate backing index will fallback to using the built-in - `_all_docs` index. This is not recommended because it has a noticeable performance - impact causing a full scan of the partition with each request. In this case the - response body will include a warning field recommending that an index is created. + Queries without an appropriate backing index by default fallback to using the + built-in `_all_docs` index. This isn't recommended because it has a significant + performance impact causing a full scan of the partition with each request. In this + case the response body includes a warning field recommending the creation of an + index. + To avoid the fallback behavior set the `allow_fallback` option to `false` and the + server responds with a `400` status code if no suitable index exists. If you want + to use only a specific index for your query set + `allow_fallback` to `false` and set the `use_index` option. Before using read the [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) to understand the limitations and appropriate use cases. @@ -4723,6 +4735,8 @@ def post_partition_find( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param bool allow_fallback: (optional) Whether to allow fallback to other + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4761,9 +4775,11 @@ def post_partition_find( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. - If the specified index does not exist or cannot answer the query then the - value is ignored and another index or a full scan of all documents will - answer the query. + If the specified index doesn't exist or can't answer the query then the + server ignores the value and answers using another index or a full scan of + all documents. To change this behavior set `allow_fallback` to `false` and + the server responds instead with a `400` status code if the requested index + is unsuitable to answer the query. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `FindResult` object @@ -4785,6 +4801,7 @@ def post_partition_find( data = { 'selector': selector, + 'allow_fallback': allow_fallback, 'bookmark': bookmark, 'conflicts': conflicts, 'execution_stats': execution_stats, @@ -4825,6 +4842,7 @@ def post_partition_find_as_stream( partition_key: str, selector: dict, *, + allow_fallback: Optional[bool] = None, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, @@ -4843,10 +4861,15 @@ def post_partition_find_as_stream( Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the `_index` endpoint. - Queries without an appropriate backing index will fallback to using the built-in - `_all_docs` index. This is not recommended because it has a noticeable performance - impact causing a full scan of the partition with each request. In this case the - response body will include a warning field recommending that an index is created. + Queries without an appropriate backing index by default fallback to using the + built-in `_all_docs` index. This isn't recommended because it has a significant + performance impact causing a full scan of the partition with each request. In this + case the response body includes a warning field recommending the creation of an + index. + To avoid the fallback behavior set the `allow_fallback` option to `false` and the + server responds with a `400` status code if no suitable index exists. If you want + to use only a specific index for your query set + `allow_fallback` to `false` and set the `use_index` option. Before using read the [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-database-partitioning#partition-querying) to understand the limitations and appropriate use cases. @@ -4890,6 +4913,8 @@ def post_partition_find_as_stream( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param bool allow_fallback: (optional) Whether to allow fallback to other + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4928,9 +4953,11 @@ def post_partition_find_as_stream( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. - If the specified index does not exist or cannot answer the query then the - value is ignored and another index or a full scan of all documents will - answer the query. + If the specified index doesn't exist or can't answer the query then the + server ignores the value and answers using another index or a full scan of + all documents. To change this behavior set `allow_fallback` to `false` and + the server responds instead with a `400` status code if the requested index + is unsuitable to answer the query. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result @@ -4952,6 +4979,7 @@ def post_partition_find_as_stream( data = { 'selector': selector, + 'allow_fallback': allow_fallback, 'bookmark': bookmark, 'conflicts': conflicts, 'execution_stats': execution_stats, @@ -4995,6 +5023,7 @@ def post_explain( db: str, selector: dict, *, + allow_fallback: Optional[bool] = None, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, @@ -5051,6 +5080,8 @@ def post_explain( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param bool allow_fallback: (optional) Whether to allow fallback to other + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5089,9 +5120,11 @@ def post_explain( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. - If the specified index does not exist or cannot answer the query then the - value is ignored and another index or a full scan of all documents will - answer the query. + If the specified index doesn't exist or can't answer the query then the + server ignores the value and answers using another index or a full scan of + all documents. To change this behavior set `allow_fallback` to `false` and + the server responds instead with a `400` status code if the requested index + is unsuitable to answer the query. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5117,6 +5150,7 @@ def post_explain( data = { 'selector': selector, + 'allow_fallback': allow_fallback, 'bookmark': bookmark, 'conflicts': conflicts, 'execution_stats': execution_stats, @@ -5157,6 +5191,7 @@ def post_find( db: str, selector: dict, *, + allow_fallback: Optional[bool] = None, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, @@ -5176,11 +5211,15 @@ def post_find( Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the `_index` endpoint. - Queries without an appropriate backing index will fallback to using the built-in - `_all_docs` index. This is not recommended because it has a significant + Queries without an appropriate backing index by default fallback to using the + built-in `_all_docs` index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this - case the response body will include a warning field recommending that an index is - created. + case the response body includes a warning field recommending the creation of an + index. + To avoid the fallback behavior set the `allow_fallback` option to `false` and the + server responds with a `400` status code if no suitable index exists. If you want + to use only a specific index for your query set + `allow_fallback` to `false` and set the `use_index` option. :param str db: Path parameter to specify the database name. :param dict selector: JSON object describing criteria used to select @@ -5219,6 +5258,8 @@ def post_find( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param bool allow_fallback: (optional) Whether to allow fallback to other + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5257,9 +5298,11 @@ def post_find( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. - If the specified index does not exist or cannot answer the query then the - value is ignored and another index or a full scan of all documents will - answer the query. + If the specified index doesn't exist or can't answer the query then the + server ignores the value and answers using another index or a full scan of + all documents. To change this behavior set `allow_fallback` to `false` and + the server responds instead with a `400` status code if the requested index + is unsuitable to answer the query. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5285,6 +5328,7 @@ def post_find( data = { 'selector': selector, + 'allow_fallback': allow_fallback, 'bookmark': bookmark, 'conflicts': conflicts, 'execution_stats': execution_stats, @@ -5325,6 +5369,7 @@ def post_find_as_stream( db: str, selector: dict, *, + allow_fallback: Optional[bool] = None, bookmark: Optional[str] = None, conflicts: Optional[bool] = None, execution_stats: Optional[bool] = None, @@ -5344,11 +5389,15 @@ def post_find_as_stream( Query documents by using a declarative JSON querying syntax. It's best practice to create an appropriate index for all fields in selector by using the `_index` endpoint. - Queries without an appropriate backing index will fallback to using the built-in - `_all_docs` index. This is not recommended because it has a significant + Queries without an appropriate backing index by default fallback to using the + built-in `_all_docs` index. This isn't recommended because it has a significant performance impact causing a full scan of the database with each request. In this - case the response body will include a warning field recommending that an index is - created. + case the response body includes a warning field recommending the creation of an + index. + To avoid the fallback behavior set the `allow_fallback` option to `false` and the + server responds with a `400` status code if no suitable index exists. If you want + to use only a specific index for your query set + `allow_fallback` to `false` and set the `use_index` option. :param str db: Path parameter to specify the database name. :param dict selector: JSON object describing criteria used to select @@ -5387,6 +5436,8 @@ def post_find_as_stream( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param bool allow_fallback: (optional) Whether to allow fallback to other + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5425,9 +5476,11 @@ def post_find_as_stream( "my_index"]`. It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new indexes that might get added later. - If the specified index does not exist or cannot answer the query then the - value is ignored and another index or a full scan of all documents will - answer the query. + If the specified index doesn't exist or can't answer the query then the + server ignores the value and answers using another index or a full scan of + all documents. To change this behavior set `allow_fallback` to `false` and + the server responds instead with a `400` status code if the requested index + is unsuitable to answer the query. :param int r: (optional) The read quorum that is needed for the result. The value defaults to 1, in which case the document that was found in the index is returned. If set to a higher value, each document is read from at least @@ -5453,6 +5506,7 @@ def post_find_as_stream( data = { 'selector': selector, + 'allow_fallback': allow_fallback, 'bookmark': bookmark, 'conflicts': conflicts, 'execution_stats': execution_stats, @@ -8495,8 +8549,7 @@ class ActiveTask: tasks. :param str type: Operation type. :param int updated_on: Schema for a Unix epoch timestamp. - :param str user: (optional) Name of user running replication or owning the - indexer. Available for `indexer`, `replication` type tasks. + :param str user: (optional) Name of user running the process. :param int view: (optional) Number of view indexes. Available for `view_compaction` type tasks. """ @@ -8607,8 +8660,7 @@ def __init__( :param int total_changes: (optional) Total changes to process. Available for `database_compaction`, `indexer`, `search_indexer`, `view_compaction` type tasks. - :param str user: (optional) Name of user running replication or owning the - indexer. Available for `indexer`, `replication` type tasks. + :param str user: (optional) Name of user running the process. :param int view: (optional) Number of view indexes. Available for `view_compaction` type tasks. """ @@ -10940,7 +10992,7 @@ class DatabaseInformation: operating on this database. :param str compacted_seq: (optional) An opaque string that describes the compaction state of the database. - :param str db_name: The name of the database. + :param str db_name: Schema for a database name. :param int disk_format_version: The version of the physical format used for the data when it is stored on disk. :param int doc_count: A count of the documents in the specified database. @@ -10985,7 +11037,7 @@ def __init__( information. :param bool compact_running: True if the database compaction routine is operating on this database. - :param str db_name: The name of the database. + :param str db_name: Schema for a database name. :param int disk_format_version: The version of the physical format used for the data when it is stored on disk. :param int doc_count: A count of the documents in the specified database. @@ -11313,7 +11365,7 @@ class DbEvent: """ Schema for a database change event. - :param str db_name: Database name. + :param str db_name: Schema for a database name. :param str seq: Sequence number. :param str type: A database event. """ @@ -11327,7 +11379,7 @@ def __init__( """ Initialize a DbEvent object. - :param str db_name: Database name. + :param str db_name: Schema for a database name. :param str seq: Sequence number. :param str type: A database event. """ @@ -11480,7 +11532,7 @@ class DbsInfoResult: :param str error: (optional) The name of the error. :param DatabaseInformation info: (optional) Schema for information about a database. - :param str key: Database name. + :param str key: Schema for a database name. """ def __init__( @@ -11493,7 +11545,7 @@ def __init__( """ Initialize a DbsInfoResult object. - :param str key: Database name. + :param str key: Schema for a database name. :param str error: (optional) The name of the error. :param DatabaseInformation info: (optional) Schema for information about a database. @@ -11566,7 +11618,8 @@ class DesignDocument: removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Schema for a design document ID. + :param str _id: (optional) Schema for a design document ID including a + `_design/` prefix. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -11682,7 +11735,8 @@ def __init__( removed. :param List[str] _deleted_conflicts: (optional) Schema for a list of document revision identifiers. - :param str _id: (optional) Schema for a design document ID. + :param str _id: (optional) Schema for a design document ID including a + `_design/` prefix. :param str _local_seq: (optional) Document's update sequence in current database. Available if requested with local_seq=true query parameter. :param str _rev: (optional) Schema for a document revision identifier. @@ -12310,8 +12364,8 @@ class DocsResultRow: :param str reason: (optional) The reason the error occurred (if available). :param int ref: (optional) An internal error reference (if available). :param Document doc: (optional) Schema for a document. - :param str id: (optional) id. - :param str key: Document ID. + :param str id: (optional) Schema for a document ID. + :param str key: Schema for a document ID. :param DocsResultRowValue value: (optional) Value of built-in `/_all_docs` style view. """ @@ -12331,13 +12385,13 @@ def __init__( """ Initialize a DocsResultRow object. - :param str key: Document ID. + :param str key: Schema for a document ID. :param str caused_by: (optional) The cause of the error (if available). :param str error: (optional) The name of the error. :param str reason: (optional) The reason the error occurred (if available). :param int ref: (optional) An internal error reference (if available). :param Document doc: (optional) Schema for a document. - :param str id: (optional) id. + :param str id: (optional) Schema for a document ID. :param DocsResultRowValue value: (optional) Value of built-in `/_all_docs` style view. """ @@ -13055,13 +13109,13 @@ class ExplainResult: :param bool covering: When `true`, the query is answered using the index only and no documents are fetched. - :param str dbname: Name of database. + :param str dbname: Schema for a database name. :param List[str] fields: Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned. :param IndexInformation index: Schema for information about an index. - :param List[IndexCandidate] index_candidates: (optional) Schema for the list of - all the other indexes that were not chosen for serving the query. + :param List[IndexCandidate] index_candidates: Schema for the list of all the + other indexes that were not chosen for serving the query. :param int limit: The used maximum number of results returned. :param ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying view. @@ -13101,9 +13155,8 @@ class ExplainResult: all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). - :param List[SelectorHint] selector_hints: (optional) Schema for a list of - objects with extra information on the selector to provide insights about its - usability. + :param List[SelectorHint] selector_hints: Schema for a list of objects with + extra information on the selector to provide insights about its usability. :param int skip: Skip parameter used. """ @@ -13113,26 +13166,28 @@ def __init__( dbname: str, fields: List[str], index: 'IndexInformation', + index_candidates: List['IndexCandidate'], limit: int, opts: 'ExplainResultOpts', selector: dict, + selector_hints: List['SelectorHint'], skip: int, *, - index_candidates: Optional[List['IndexCandidate']] = None, mrargs: Optional['ExplainResultMrArgs'] = None, partitioned: Optional[object] = None, - selector_hints: Optional[List['SelectorHint']] = None, ) -> None: """ Initialize a ExplainResult object. :param bool covering: When `true`, the query is answered using the index only and no documents are fetched. - :param str dbname: Name of database. + :param str dbname: Schema for a database name. :param List[str] fields: Fields that were requested to be projected from the document. If no fields were requested to be projected this will be empty and all fields will be returned. :param IndexInformation index: Schema for information about an index. + :param List[IndexCandidate] index_candidates: Schema for the list of all + the other indexes that were not chosen for serving the query. :param int limit: The used maximum number of results returned. :param ExplainResultOpts opts: Options used for the request. :param dict selector: JSON object describing criteria used to select @@ -13171,15 +13226,12 @@ def __init__( list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). + :param List[SelectorHint] selector_hints: Schema for a list of objects with + extra information on the selector to provide insights about its usability. :param int skip: Skip parameter used. - :param List[IndexCandidate] index_candidates: (optional) Schema for the - list of all the other indexes that were not chosen for serving the query. :param ExplainResultMrArgs mrargs: (optional) Arguments passed to the underlying view. :param object partitioned: (optional) Schema for any JSON type. - :param List[SelectorHint] selector_hints: (optional) Schema for a list of - objects with extra information on the selector to provide insights about - its usability. """ self.covering = covering self.dbname = dbname @@ -13216,6 +13268,8 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResult': raise ValueError('Required property \'index\' not present in ExplainResult JSON') if (index_candidates := _dict.get('index_candidates')) is not None: args['index_candidates'] = [IndexCandidate.from_dict(v) for v in index_candidates] + else: + raise ValueError('Required property \'index_candidates\' not present in ExplainResult JSON') if (limit := _dict.get('limit')) is not None: args['limit'] = limit else: @@ -13234,6 +13288,8 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResult': raise ValueError('Required property \'selector\' not present in ExplainResult JSON') if (selector_hints := _dict.get('selector_hints')) is not None: args['selector_hints'] = [SelectorHint.from_dict(v) for v in selector_hints] + else: + raise ValueError('Required property \'selector_hints\' not present in ExplainResult JSON') if (skip := _dict.get('skip')) is not None: args['skip'] = skip else: @@ -13457,6 +13513,15 @@ def __ne__(self, other: 'ExplainResultMrArgs') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DirectionEnum(str, Enum): + """ + Direction parameter passed to the underlying view. + """ + + ASC = 'asc' + DESC = 'desc' + + class ViewTypeEnum(str, Enum): """ The type of the underlying view. @@ -14073,8 +14138,8 @@ class IndexDefinition: :param IndexTextOperatorDefaultField default_field: (optional) Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator. - :param List[IndexField] fields: (optional) List of field objects to index. - Nested fields are also allowed, e.g. `person.name`. + :param List[IndexField] fields: List of field objects to index. Nested fields + are also allowed, e.g. `person.name`. For "json" type indexes each object is a mapping of field name to sort direction (asc or desc). For "text" type indexes each object has a `name` property of the field name and @@ -14124,28 +14189,28 @@ class IndexDefinition: def __init__( self, + fields: List['IndexField'], *, default_analyzer: Optional['Analyzer'] = None, default_field: Optional['IndexTextOperatorDefaultField'] = None, - fields: Optional[List['IndexField']] = None, index_array_lengths: Optional[bool] = None, partial_filter_selector: Optional[dict] = None, ) -> None: """ Initialize a IndexDefinition object. + :param List[IndexField] fields: List of field objects to index. Nested + fields are also allowed, e.g. `person.name`. + For "json" type indexes each object is a mapping of field name to sort + direction (asc or desc). + For "text" type indexes each object has a `name` property of the field name + and a `type` property of the field type (string, number, or boolean). :param Analyzer default_analyzer: (optional) Schema for a full text search analyzer. :param IndexTextOperatorDefaultField default_field: (optional) Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator. - :param List[IndexField] fields: (optional) List of field objects to index. - Nested fields are also allowed, e.g. `person.name`. - For "json" type indexes each object is a mapping of field name to sort - direction (asc or desc). - For "text" type indexes each object has a `name` property of the field name - and a `type` property of the field type (string, number, or boolean). :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: @@ -14208,6 +14273,8 @@ def from_dict(cls, _dict: Dict) -> 'IndexDefinition': args['default_field'] = IndexTextOperatorDefaultField.from_dict(default_field) if (fields := _dict.get('fields')) is not None: args['fields'] = [IndexField.from_dict(v) for v in fields] + else: + raise ValueError('Required property \'fields\' not present in IndexDefinition JSON') if (index_array_lengths := _dict.get('index_array_lengths')) is not None: args['index_array_lengths'] = index_array_lengths if (partial_filter_selector := _dict.get('partial_filter_selector')) is not None: @@ -14385,7 +14452,8 @@ class IndexInformation: """ Schema for information about an index. - :param str ddoc: Design document ID including a `_design/` prefix. + :param str ddoc: Schema for a nullable design document ID including a `_design/` + prefix. :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: @@ -14409,7 +14477,8 @@ def __init__( """ Initialize a IndexInformation object. - :param str ddoc: Design document ID including a `_design/` prefix. + :param str ddoc: Schema for a nullable design document ID including a + `_design/` prefix. :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: @@ -14872,11 +14941,11 @@ class PartitionInformation: """ Schema for information about a database partition. - :param str db_name: The name of the database. + :param str db_name: Schema for a database name. :param int doc_count: A count of the documents in the specified database partition. :param int doc_del_count: Number of deleted documents. - :param str partition: The name of the partition in the database. + :param str partition: Schema for a partition key. :param PartitionInformationIndexes partitioned_indexes: (optional) Schema for information about the partition index count and limit in a database. :param PartitionInformationSizes sizes: The size of active and external data, in @@ -14896,11 +14965,11 @@ def __init__( """ Initialize a PartitionInformation object. - :param str db_name: The name of the database. + :param str db_name: Schema for a database name. :param int doc_count: A count of the documents in the specified database partition. :param int doc_del_count: Number of deleted documents. - :param str partition: The name of the partition in the database. + :param str partition: Schema for a partition key. :param PartitionInformationSizes sizes: The size of active and external data, in bytes. :param PartitionInformationIndexes partitioned_indexes: (optional) Schema @@ -15596,7 +15665,7 @@ class ReplicationDatabaseAuthBasic: Schema for basic authentication of replication source or target database. :param str password: The password associated with the username. - :param str username: The username. + :param str username: Schema for a username. """ def __init__( @@ -15608,7 +15677,7 @@ def __init__( Initialize a ReplicationDatabaseAuthBasic object. :param str password: The password associated with the username. - :param str username: The username. + :param str username: Schema for a username. """ self.password = password self.username = username @@ -16867,7 +16936,7 @@ class SchedulerJob: :param str source: Replication source. :param datetime start_time: Timestamp of when the replication was started. :param str target: Replication target. - :param str user: Name of user running replication. + :param str user: Name of user running the process. """ def __init__( @@ -16900,7 +16969,7 @@ def __init__( :param str source: Replication source. :param datetime start_time: Timestamp of when the replication was started. :param str target: Replication target. - :param str user: Name of user running replication. + :param str user: Name of user running the process. """ self.database = database self.doc_id = doc_id @@ -17542,7 +17611,7 @@ class SearchResult: :param dict ranges: (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. - :param List[SearchResultRow] rows: (optional) Array of row objects. + :param List[SearchResultRow] rows: Array of row objects. :param List[SearchResultProperties] groups: (optional) Array of grouped search matches. """ @@ -17550,18 +17619,19 @@ class SearchResult: def __init__( self, total_rows: int, + rows: List['SearchResultRow'], *, bookmark: Optional[str] = None, by: Optional[str] = None, counts: Optional[dict] = None, ranges: Optional[dict] = None, - rows: Optional[List['SearchResultRow']] = None, groups: Optional[List['SearchResultProperties']] = None, ) -> None: """ Initialize a SearchResult object. :param int total_rows: Number of total rows. + :param List[SearchResultRow] rows: Array of row objects. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param str by: (optional) Grouped search matches. @@ -17570,7 +17640,6 @@ def __init__( :param dict ranges: (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. - :param List[SearchResultRow] rows: (optional) Array of row objects. :param List[SearchResultProperties] groups: (optional) Array of grouped search matches. """ @@ -17600,6 +17669,8 @@ def from_dict(cls, _dict: Dict) -> 'SearchResult': args['ranges'] = ranges if (rows := _dict.get('rows')) is not None: args['rows'] = [SearchResultRow.from_dict(v) for v in rows] + else: + raise ValueError('Required property \'rows\' not present in SearchResult JSON') if (groups := _dict.get('groups')) is not None: args['groups'] = [SearchResultProperties.from_dict(v) for v in groups] return cls(**args) @@ -17672,23 +17743,24 @@ class SearchResultProperties: :param dict ranges: (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. - :param List[SearchResultRow] rows: (optional) Array of row objects. + :param List[SearchResultRow] rows: Array of row objects. """ def __init__( self, total_rows: int, + rows: List['SearchResultRow'], *, bookmark: Optional[str] = None, by: Optional[str] = None, counts: Optional[dict] = None, ranges: Optional[dict] = None, - rows: Optional[List['SearchResultRow']] = None, ) -> None: """ Initialize a SearchResultProperties object. :param int total_rows: Number of total rows. + :param List[SearchResultRow] rows: Array of row objects. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param str by: (optional) Grouped search matches. @@ -17697,7 +17769,6 @@ def __init__( :param dict ranges: (optional) The range facet syntax reuses the standard Lucene syntax for ranges to return counts of results that fit into each specified category. - :param List[SearchResultRow] rows: (optional) Array of row objects. """ self.total_rows = total_rows self.bookmark = bookmark @@ -17724,6 +17795,8 @@ def from_dict(cls, _dict: Dict) -> 'SearchResultProperties': args['ranges'] = ranges if (rows := _dict.get('rows')) is not None: args['rows'] = [SearchResultRow.from_dict(v) for v in rows] + else: + raise ValueError('Required property \'rows\' not present in SearchResultProperties JSON') return cls(**args) @classmethod @@ -18356,6 +18429,14 @@ def __ne__(self, other: 'ServerVendor') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class VariantEnum(str, Enum): + """ + Vendor variant. + """ + + PAAS = 'paas' + + class SessionAuthentication: """ @@ -18842,7 +18923,7 @@ class UserContext: :param str db: (optional) Database name in the context of the provided operation. - :param str name: User name. + :param str name: Name of user running the process. :param List[str] roles: List of user roles. """ @@ -18856,7 +18937,7 @@ def __init__( """ Initialize a UserContext object. - :param str name: User name. + :param str name: Name of user running the process. :param List[str] roles: List of user roles. :param str db: (optional) Database name in the context of the provided operation. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 2c708860..bce02adb 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1175,6 +1175,7 @@ def test_post_partition_explain(self): db='testString', partition_key='testString', selector={'type': {'$eq': 'product'}}, + allow_fallback=True, bookmark='testString', conflicts=True, execution_stats=True, @@ -1197,6 +1198,7 @@ def test_post_partition_find(self): db='testString', partition_key='testString', selector={'type': {'$eq': 'product'}}, + allow_fallback=True, bookmark='testString', conflicts=True, execution_stats=True, @@ -1219,6 +1221,7 @@ def test_post_partition_find_as_stream(self): db='testString', partition_key='testString', selector={'type': {'$eq': 'product'}}, + allow_fallback=True, bookmark='testString', conflicts=True, execution_stats=True, @@ -1240,6 +1243,7 @@ def test_post_explain(self): response = self.cloudant_service.post_explain( db='testString', selector={'email_verified': {'$eq': True}}, + allow_fallback=True, bookmark='testString', conflicts=True, execution_stats=True, @@ -1262,6 +1266,7 @@ def test_post_find(self): response = self.cloudant_service.post_find( db='testString', selector={'email_verified': {'$eq': True}}, + allow_fallback=True, bookmark='testString', conflicts=True, execution_stats=True, @@ -1284,6 +1289,7 @@ def test_post_find_as_stream(self): response = self.cloudant_service.post_find_as_stream( db='testString', selector={'email_verified': {'$eq': True}}, + allow_fallback=True, bookmark='testString', conflicts=True, execution_stats=True, diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 8930307f..dfe562c2 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -108,7 +108,7 @@ def test_get_server_information_all_params(self): """ # Set up mock url = preprocess_url('/') - mock_response = '{"couchdb": "couchdb", "features": ["features"], "vendor": {"name": "name", "variant": "variant", "version": "version"}, "version": "version", "features_flags": ["features_flags"]}' + mock_response = '{"couchdb": "couchdb", "features": ["features"], "vendor": {"name": "name", "variant": "paas", "version": "version"}, "version": "version", "features_flags": ["features_flags"]}' responses.add( responses.GET, url, @@ -7409,7 +7409,7 @@ def test_post_partition_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7422,6 +7422,7 @@ def test_post_partition_explain_all_params(self): db = 'testString' partition_key = 'testString' selector = {'type': {'$eq': 'product'}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7438,6 +7439,7 @@ def test_post_partition_explain_all_params(self): db, partition_key, selector, + allow_fallback=allow_fallback, bookmark=bookmark, conflicts=conflicts, execution_stats=execution_stats, @@ -7461,6 +7463,7 @@ def test_post_partition_explain_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['selector'] == {'type': {'$eq': 'product'}} + assert req_body['allow_fallback'] == True assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7488,7 +7491,7 @@ def test_post_partition_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7501,6 +7504,7 @@ def test_post_partition_explain_value_error(self): db = 'testString' partition_key = 'testString' selector = {'type': {'$eq': 'product'}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7558,6 +7562,7 @@ def test_post_partition_find_all_params(self): db = 'testString' partition_key = 'testString' selector = {'type': {'$eq': 'product'}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7574,6 +7579,7 @@ def test_post_partition_find_all_params(self): db, partition_key, selector, + allow_fallback=allow_fallback, bookmark=bookmark, conflicts=conflicts, execution_stats=execution_stats, @@ -7597,6 +7603,7 @@ def test_post_partition_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['selector'] == {'type': {'$eq': 'product'}} + assert req_body['allow_fallback'] == True assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7637,6 +7644,7 @@ def test_post_partition_find_value_error(self): db = 'testString' partition_key = 'testString' selector = {'type': {'$eq': 'product'}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7694,6 +7702,7 @@ def test_post_partition_find_as_stream_all_params(self): db = 'testString' partition_key = 'testString' selector = {'type': {'$eq': 'product'}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7710,6 +7719,7 @@ def test_post_partition_find_as_stream_all_params(self): db, partition_key, selector, + allow_fallback=allow_fallback, bookmark=bookmark, conflicts=conflicts, execution_stats=execution_stats, @@ -7733,6 +7743,7 @@ def test_post_partition_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['selector'] == {'type': {'$eq': 'product'}} + assert req_body['allow_fallback'] == True assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7779,6 +7790,7 @@ def test_post_partition_find_as_stream_value_error(self): db = 'testString' partition_key = 'testString' selector = {'type': {'$eq': 'product'}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7862,7 +7874,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7874,6 +7886,7 @@ def test_post_explain_all_params(self): # Set up parameter values db = 'testString' selector = {'email_verified': {'$eq': True}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -7890,6 +7903,7 @@ def test_post_explain_all_params(self): response = _service.post_explain( db, selector, + allow_fallback=allow_fallback, bookmark=bookmark, conflicts=conflicts, execution_stats=execution_stats, @@ -7914,6 +7928,7 @@ def test_post_explain_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['selector'] == {'email_verified': {'$eq': True}} + assert req_body['allow_fallback'] == True assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -7942,7 +7957,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "direction", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7954,6 +7969,7 @@ def test_post_explain_value_error(self): # Set up parameter values db = 'testString' selector = {'email_verified': {'$eq': True}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -8010,6 +8026,7 @@ def test_post_find_all_params(self): # Set up parameter values db = 'testString' selector = {'email_verified': {'$eq': True}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -8026,6 +8043,7 @@ def test_post_find_all_params(self): response = _service.post_find( db, selector, + allow_fallback=allow_fallback, bookmark=bookmark, conflicts=conflicts, execution_stats=execution_stats, @@ -8050,6 +8068,7 @@ def test_post_find_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['selector'] == {'email_verified': {'$eq': True}} + assert req_body['allow_fallback'] == True assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -8090,6 +8109,7 @@ def test_post_find_value_error(self): # Set up parameter values db = 'testString' selector = {'email_verified': {'$eq': True}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -8146,6 +8166,7 @@ def test_post_find_as_stream_all_params(self): # Set up parameter values db = 'testString' selector = {'email_verified': {'$eq': True}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -8162,6 +8183,7 @@ def test_post_find_as_stream_all_params(self): response = _service.post_find_as_stream( db, selector, + allow_fallback=allow_fallback, bookmark=bookmark, conflicts=conflicts, execution_stats=execution_stats, @@ -8186,6 +8208,7 @@ def test_post_find_as_stream_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['selector'] == {'email_verified': {'$eq': True}} + assert req_body['allow_fallback'] == True assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True @@ -8232,6 +8255,7 @@ def test_post_find_as_stream_value_error(self): # Set up parameter values db = 'testString' selector = {'email_verified': {'$eq': True}} + allow_fallback = True bookmark = 'testString' conflicts = True execution_stats = True @@ -15214,7 +15238,7 @@ def test_explain_result_serialization(self): explain_result_mr_args_model = {} # ExplainResultMrArgs explain_result_mr_args_model['conflicts'] = 'testString' - explain_result_mr_args_model['direction'] = 'testString' + explain_result_mr_args_model['direction'] = 'asc' explain_result_mr_args_model['end_key'] = 'testString' explain_result_mr_args_model['include_docs'] = True explain_result_mr_args_model['partition'] = 'testString' @@ -15288,7 +15312,7 @@ def test_explain_result_mr_args_serialization(self): # Construct a json representation of a ExplainResultMrArgs model explain_result_mr_args_model_json = {} explain_result_mr_args_model_json['conflicts'] = 'testString' - explain_result_mr_args_model_json['direction'] = 'testString' + explain_result_mr_args_model_json['direction'] = 'asc' explain_result_mr_args_model_json['end_key'] = 'testString' explain_result_mr_args_model_json['include_docs'] = True explain_result_mr_args_model_json['partition'] = 'testString' @@ -17279,7 +17303,7 @@ def test_server_information_serialization(self): server_vendor_model = {} # ServerVendor server_vendor_model['name'] = 'testString' - server_vendor_model['variant'] = 'testString' + server_vendor_model['variant'] = 'paas' server_vendor_model['version'] = 'testString' server_vendor_model['foo'] = 'testString' @@ -17320,7 +17344,7 @@ def test_server_vendor_serialization(self): # Construct a json representation of a ServerVendor model server_vendor_model_json = {} server_vendor_model_json['name'] = 'testString' - server_vendor_model_json['variant'] = 'testString' + server_vendor_model_json['variant'] = 'paas' server_vendor_model_json['version'] = 'testString' server_vendor_model_json['foo'] = 'testString' From 92f4759004c89af6694d00777d9d28686d85c3f6 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:42:03 +0000 Subject: [PATCH 396/669] Update version 0.9.2 -> 0.9.3 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 7063659f..88fa95ea 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.9.2" +current_version = "0.9.3" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 4af8ecdc..1be9d6af 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.9.2 +# IBM Cloudant Python SDK Version 0.9.3 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.9.2" +pip install --upgrade "ibmcloudant>=0.9.3" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.9.2" +easy_install --upgrade "ibmcloudant>=0.9.3" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.2/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 921e79c6..9f7312e5 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.9.2' +__version__ = '0.9.3' diff --git a/pyproject.toml b/pyproject.toml index fd687919..d11c824d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.9.2" +version = "0.9.3" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.22.0", From 7c0dcd970d854eb87f827d8ecc7881d1a217cca4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:49:32 +0000 Subject: [PATCH 397/669] build(deps): Bump github/codeql-action from 3.27.0 to 3.27.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/662472033e021d55d94146f66f6058822b0b39fd...4f3212b61783c3c68e8309a0f18a699764811cda) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1fa0b238..a7e59be0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/autobuild@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 with: category: "/language:${{matrix.language}}" From e98406c93abd633e35a45c562d0eb72d69ddb048 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:06:06 +0000 Subject: [PATCH 398/669] build(deps): Bump sphinx-rtd-theme from 3.0.1 to 3.0.2 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.1 to 3.0.2. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.1...3.0.2) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 849d9d4b..ecc91de6 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.1.3 sphinx-autodoc2==0.5.0 myst-parser==4.0.0 -sphinx-rtd-theme==3.0.1 +sphinx-rtd-theme==3.0.2 From ba4c66f79987ca2676665c2c8792080a5f402dc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:15:58 +0000 Subject: [PATCH 399/669] build(deps-dev): Bump coverage from 7.6.4 to 7.6.5 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.4 to 7.6.5. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.4...7.6.5) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 74984bb7..7fe9699a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 # code coverage -coverage==7.6.4 +coverage==7.6.5 pytest-cov==6.0.0 From babe1bcfd8071d79af61e0130b2dd494a25a926a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:00:57 +0000 Subject: [PATCH 400/669] build(deps-dev): Bump coverage from 7.6.5 to 7.6.7 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.5 to 7.6.7. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.5...7.6.7) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7fe9699a..06c931bc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 # code coverage -coverage==7.6.5 +coverage==7.6.7 pytest-cov==6.0.0 From 4551194105ad8297377cf1463a90f77c76d10d62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:13:00 +0000 Subject: [PATCH 401/669] build(deps): Bump github/codeql-action from 3.27.1 to 3.27.4 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.1 to 3.27.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/4f3212b61783c3c68e8309a0f18a699764811cda...ea9e4e37992a54ee68a9622e985e60c8e8f12d9f) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a7e59be0..5d8ac6b3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 + uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 + uses: github/codeql-action/autobuild@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 + uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 with: category: "/language:${{matrix.language}}" From 91771eca3f8bd03d6bb8f1b83c8d6a7919f768dd Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:24:37 +0000 Subject: [PATCH 402/669] feat(generated): update generator to 3.97.0 Generated SDK source code using: - Generator version 3.97.0 - Specification version 1.0.0-dev0.1.22 - Automation (cloudant-sdks) version cafcbd3 --- ibmcloudant/cloudant_v1.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index e692e91f..6ac8fbd9 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -11979,7 +11979,7 @@ def set_properties(self, _dict: dict): raise ValueError('Value for additional property {} must be of type object'.format(k)) setattr(self, k, v) else: - raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) def __str__(self) -> str: """Return a `str` version of this DesignDocument object.""" @@ -12722,7 +12722,7 @@ def set_properties(self, _dict: dict): raise ValueError('Value for additional property {} must be of type object'.format(k)) setattr(self, k, v) else: - raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) def __str__(self) -> str: """Return a `str` version of this Document object.""" @@ -14421,7 +14421,7 @@ def set_properties(self, _dict: dict): raise ValueError('Value for additional property {} must be of type str'.format(k)) setattr(self, k, v) else: - raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) def __str__(self) -> str: """Return a `str` version of this IndexField object.""" @@ -16327,7 +16327,7 @@ def set_properties(self, _dict: dict): raise ValueError('Value for additional property {} must be of type object'.format(k)) setattr(self, k, v) else: - raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) def __str__(self) -> str: """Return a `str` version of this ReplicationDocument object.""" @@ -18413,7 +18413,7 @@ def set_properties(self, _dict: dict): raise ValueError('Value for additional property {} must be of type str'.format(k)) setattr(self, k, v) else: - raise ValueError('Property {} cannot be specified as an additional property'.format(_key)) + raise ValueError('Property {} cannot be specified as an additional property'.format(k)) def __str__(self) -> str: """Return a `str` version of this ServerVendor object.""" From 523e0b9702956d632c9445f37180ebdc5dcc4d42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 18:05:22 +0000 Subject: [PATCH 403/669] build(deps-dev): Bump coverage from 7.6.7 to 7.6.8 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.7 to 7.6.8. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.7...7.6.8) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 06c931bc..721f1991 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 # code coverage -coverage==7.6.7 +coverage==7.6.8 pytest-cov==6.0.0 From d45007c8c474694929933313f8b7bc5384c3360c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:51:25 +0000 Subject: [PATCH 404/669] build(deps): Bump github/codeql-action from 3.27.4 to 3.27.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.4 to 3.27.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/ea9e4e37992a54ee68a9622e985e60c8e8f12d9f...f09c1c0a94de965c15400f5634aa42fac8fb8f88) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5d8ac6b3..66629c66 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: category: "/language:${{matrix.language}}" From 70f5874488e49a87e97513394d7e1d40ead6a396 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:02:08 +0000 Subject: [PATCH 405/669] build(deps-dev): Bump pytest from 8.3.3 to 8.3.4 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 721f1991..3fa58d82 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.10.1 # test dependencies -pytest==8.3.3 +pytest==8.3.4 responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.1 From ecc24b0bbd356fe7831d54fe518de9f067f7fabc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 08:42:24 +0000 Subject: [PATCH 406/669] build(deps-dev): Bump pylint from 3.3.1 to 3.3.2 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.1...v3.3.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3fa58d82..98e4f1a6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.10.1 pytest==8.3.4 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.3.1 +pylint==3.3.2 # code coverage coverage==7.6.8 pytest-cov==6.0.0 From f22897e8306ceab620a5eb35f6b807dcd6a46905 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:49:16 +0000 Subject: [PATCH 407/669] build(deps-dev): Bump coverage from 7.6.8 to 7.6.9 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.8 to 7.6.9. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.8...7.6.9) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 98e4f1a6..29f14968 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.2 # code coverage -coverage==7.6.8 +coverage==7.6.9 pytest-cov==6.0.0 From 4347878c4b6588bc3cce41cdfdfb804193ffec77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:06:32 +0000 Subject: [PATCH 408/669] build(deps): Bump github/codeql-action from 3.27.5 to 3.27.6 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.27.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f09c1c0a94de965c15400f5634aa42fac8fb8f88...aa578102511db1f4524ed59b8cc2bae4f6e88195) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 66629c66..22cdb46f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 with: category: "/language:${{matrix.language}}" From 40d4d47e7d3d3bd8fed76c660f84357c3f2399a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:57:06 +0000 Subject: [PATCH 409/669] build(deps): Bump github/codeql-action from 3.27.6 to 3.27.9 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.6 to 3.27.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/aa578102511db1f4524ed59b8cc2bae4f6e88195...df409f7d9260372bd5f19e5b04e83cb3c43714ae) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 22cdb46f..c0a1e147 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 with: category: "/language:${{matrix.language}}" From 24fe412d56a9185c55d72922a199bb84180dcdb6 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:12:03 +0000 Subject: [PATCH 410/669] ci(generated): add POST /_replicator IT stub Generated SDK source code using: - Generator version 3.98.0 - Specification version 1.0.0-dev0.1.23 - Automation (cloudant-sdks) version eea18a5 --- ibmcloudant/cloudant_v1.py | 681 ++++++++----- stubs/gen-its-mappings.json | 48 +- test/integration/test_cloudant_v1.py | 216 +++- test/unit/test_cloudant_v1.py | 1413 +++++++++++++++++--------- 4 files changed, 1518 insertions(+), 840 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 6ac8fbd9..715a15c2 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -121,77 +121,81 @@ def get_server_information( response = self.send(request, **kwargs) return response - def get_uuids( + def get_capacity_throughput_information( self, - *, - count: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Retrieve one or more UUIDs. + Retrieve provisioned throughput capacity information. - Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The - response is a JSON object that provides a list of UUIDs. - **Tip:** The authentication for this endpoint is only enforced when using IAM. + View the amount of provisioned throughput capacity that is allocated to an IBM + Cloudant instance and what is the target provisioned throughput capacity. - :param int count: (optional) Query parameter to specify the number of UUIDs - to return. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `UuidsResult` object + :rtype: DetailedResponse with `dict` result representing a `CapacityThroughputInformation` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_uuids', + operation_id='get_capacity_throughput_information', ) headers.update(sdk_headers) - params = { - 'count': count, - } - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_uuids' + url = '/_api/v2/user/capacity/throughput' request = self.prepare_request( method='GET', url=url, headers=headers, - params=params, ) response = self.send(request, **kwargs) return response - def get_capacity_throughput_information( + def put_capacity_throughput_configuration( self, + blocks: int, **kwargs, ) -> DetailedResponse: """ - Retrieve provisioned throughput capacity information. + Update the target provisioned throughput capacity. - View the amount of provisioned throughput capacity that is allocated to an IBM - Cloudant instance and what is the target provisioned throughput capacity. + Sets the target provisioned throughput capacity for an IBM Cloudant instance. When + target capacity is changed, the current capacity asynchronously changes to meet + the target capacity. + :param int blocks: A number of blocks of throughput units. A block consists + of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned + throughput capacity. Not available for some plans. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CapacityThroughputInformation` object """ + if blocks is None: + raise ValueError('blocks must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_capacity_throughput_information', + operation_id='put_capacity_throughput_configuration', ) headers.update(sdk_headers) + data = { + 'blocks': blocks, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] @@ -199,62 +203,58 @@ def get_capacity_throughput_information( url = '/_api/v2/user/capacity/throughput' request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, + data=data, ) response = self.send(request, **kwargs) return response - def put_capacity_throughput_configuration( + def get_uuids( self, - blocks: int, + *, + count: Optional[int] = None, **kwargs, ) -> DetailedResponse: """ - Update the target provisioned throughput capacity. + Retrieve one or more UUIDs. - Sets the target provisioned throughput capacity for an IBM Cloudant instance. When - target capacity is changed, the current capacity asynchronously changes to meet - the target capacity. + Requests one or more Universally Unique Identifiers (UUIDs) from the instance. The + response is a JSON object that provides a list of UUIDs. + **Tip:** The authentication for this endpoint is only enforced when using IAM. - :param int blocks: A number of blocks of throughput units. A block consists - of 100 reads/sec, 50 writes/sec, and 5 global queries/sec of provisioned - throughput capacity. Not available for some plans. + :param int count: (optional) Query parameter to specify the number of UUIDs + to return. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `CapacityThroughputInformation` object + :rtype: DetailedResponse with `dict` result representing a `UuidsResult` object """ - if blocks is None: - raise ValueError('blocks must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='put_capacity_throughput_configuration', + operation_id='get_uuids', ) headers.update(sdk_headers) - data = { - 'blocks': blocks, + params = { + 'count': count, } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_api/v2/user/capacity/throughput' + url = '/_uuids' request = self.prepare_request( - method='PUT', + method='GET', url=url, headers=headers, - data=data, + params=params, ) response = self.send(request, **kwargs) @@ -5887,12 +5887,11 @@ def post_search( relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries. - :param dict ranges: (optional) This field defines ranges for faceted, - numeric search fields. The value is a JSON object where the fields names - are faceted numeric search fields, and the values of the fields are JSON - objects. The field names of the JSON objects are names for ranges. The - values are strings that describe the range, for example "[0 TO 10]". This - option is only available when making global queries. + :param dict ranges: (optional) Object mapping faceted, numeric search field + names to the required ranges. Each key is a field name and each value is + another object defining the ranges by mapping range name keys to string + values describing the numeric ranges, for example "[0 TO 10]". This option + is only available when making global queries. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `SearchResult` object @@ -6057,12 +6056,11 @@ def post_search_as_stream( relevance. This field can have the same values as the sort field, so single fields and arrays of fields are supported. This option is only available when making global queries. - :param dict ranges: (optional) This field defines ranges for faceted, - numeric search fields. The value is a JSON object where the fields names - are faceted numeric search fields, and the values of the fields are JSON - objects. The field names of the JSON objects are names for ranges. The - values are strings that describe the range, for example "[0 TO 10]". This - option is only available when making global queries. + :param dict ranges: (optional) Object mapping faceted, numeric search field + names to the required ranges. Each key is a field name and each value is + another object defining the ranges by mapping range name keys to string + values describing the numeric ranges, for example "[0 TO 10]". This option + is only available when making global queries. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result @@ -6193,7 +6191,7 @@ def head_replication_document( **kwargs, ) -> DetailedResponse: """ - Retrieve the HTTP headers for a replication document. + Retrieve the HTTP headers for a persistent replication. Retrieves the HTTP headers containing minimal amount of information about the specified replication document from the `_replicator` database. The method @@ -6327,6 +6325,65 @@ def head_scheduler_job( response = self.send(request, **kwargs) return response + def post_replicator( + self, + replication_document: 'ReplicationDocument', + *, + batch: Optional[str] = None, + **kwargs, + ) -> DetailedResponse: + """ + Create a persistent replication with a generated ID. + + Creates or modifies a document in the `_replicator` database to start a new + replication or to edit an existing replication. + + :param ReplicationDocument replication_document: HTTP request body for + replication operations. + :param str batch: (optional) Query parameter to specify whether to store in + batch mode. The server will respond with a HTTP 202 Accepted response code + immediately. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `DocumentResult` object + """ + + if replication_document is None: + raise ValueError('replication_document must be provided') + if isinstance(replication_document, ReplicationDocument): + replication_document = convert_model(replication_document) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='post_replicator', + ) + headers.update(sdk_headers) + + params = { + 'batch': batch, + } + + data = json.dumps(replication_document) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/_replicator' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + def delete_replication_document( self, doc_id: str, @@ -6337,7 +6394,7 @@ def delete_replication_document( **kwargs, ) -> DetailedResponse: """ - Cancel a replication. + Cancel a persistent replication. Cancels a replication by deleting the document that describes it from the `_replicator` database. @@ -6408,7 +6465,7 @@ def get_replication_document( **kwargs, ) -> DetailedResponse: """ - Retrieve a replication document. + Retrieve the configuration for a persistent replication. Retrieves a replication document from the `_replicator` database to view the configuration of the replication. The status of the replication is no longer @@ -6501,7 +6558,7 @@ def put_replication_document( **kwargs, ) -> DetailedResponse: """ - Create or modify a replication using a replication document. + Create or modify a persistent replication. Creates or modifies a document in the `_replicator` database to start a new replication or to edit an existing replication. @@ -6819,33 +6876,28 @@ def get_session_information( # Authorization ######################### - def get_security( + def post_api_keys( self, - db: str, **kwargs, ) -> DetailedResponse: """ - Retrieve database permissions information. + Generates API keys for apps or persons to enable database access. - See who has permission to read, write, and manage the database. The credentials - you use to log in to the dashboard automatically include `_admin` permissions to - all databases you create. Everyone and everything else, including users you share - databases with and API keys you create, must be given a permission level - explicitly. + Generates API keys to enable database access for a person or application, but + without creating a new IBM Cloudant account for that person or application. An API + key is a randomly generated username and password. The key is given the wanted + access permissions for a database. - :param str db: Path parameter to specify the database name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `Security` object + :rtype: DetailedResponse with `dict` result representing a `ApiKeysResult` object """ - if not db: - raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_security', + operation_id='post_api_keys', ) headers.update(sdk_headers) @@ -6854,12 +6906,9 @@ def get_security( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['db'] - path_param_values = self.encode_path_vars(db) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/{db}/_security'.format(**path_param_dict) + url = '/_api/v2/api_keys' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, ) @@ -6867,24 +6916,22 @@ def get_security( response = self.send(request, **kwargs) return response - def put_security( + def put_cloudant_security_configuration( self, db: str, + cloudant: dict, *, admins: Optional['SecurityObject'] = None, - members: Optional['SecurityObject'] = None, - cloudant: Optional[dict] = None, couchdb_auth_only: Optional[bool] = None, + members: Optional['SecurityObject'] = None, **kwargs, ) -> DetailedResponse: """ - Modify database permissions. + Modify only Cloudant related database permissions. - Modify who has permission to read, write, or manage a database. This endpoint can - be used to modify both Cloudant and CouchDB related permissions. Be careful: by - removing a Cloudant API key, a member or an admin from the list of users that have - access permissions, you remove it from the list of users that have access to the - database. + Modify only Cloudant related permissions to database. Be careful: by removing an + API key from the list, you remove the API key from the list of users that have + access to the database. ### Note about nobody role The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not @@ -6892,14 +6939,14 @@ def put_security( `_reader`. :param str db: Path parameter to specify the database name. + :param dict cloudant: Database permissions for Cloudant users and/or API + keys. :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param SecurityObject members: (optional) Schema for names and roles to map - to a database permission. - :param dict cloudant: (optional) Database permissions for Cloudant users - and/or API keys. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. + :param SecurityObject members: (optional) Schema for names and roles to map + to a database permission. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Ok` object @@ -6907,6 +6954,8 @@ def put_security( if not db: raise ValueError('db must be provided') + if cloudant is None: + raise ValueError('cloudant must be provided') if admins is not None: admins = convert_model(admins) if members is not None: @@ -6915,15 +6964,15 @@ def put_security( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='put_security', + operation_id='put_cloudant_security_configuration', ) headers.update(sdk_headers) data = { - 'admins': admins, - 'members': members, 'cloudant': cloudant, + 'admins': admins, 'couchdb_auth_only': couchdb_auth_only, + 'members': members, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -6937,7 +6986,7 @@ def put_security( path_param_keys = ['db'] path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/{db}/_security'.format(**path_param_dict) + url = '/_api/v2/db/{db}/_security'.format(**path_param_dict) request = self.prepare_request( method='PUT', url=url, @@ -6948,28 +6997,33 @@ def put_security( response = self.send(request, **kwargs) return response - def post_api_keys( + def get_security( self, + db: str, **kwargs, ) -> DetailedResponse: """ - Generates API keys for apps or persons to enable database access. + Retrieve database permissions information. - Generates API keys to enable database access for a person or application, but - without creating a new IBM Cloudant account for that person or application. An API - key is a randomly generated username and password. The key is given the wanted - access permissions for a database. + See who has permission to read, write, and manage the database. The credentials + you use to log in to the dashboard automatically include `_admin` permissions to + all databases you create. Everyone and everything else, including users you share + databases with and API keys you create, must be given a permission level + explicitly. + :param str db: Path parameter to specify the database name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ApiKeysResult` object + :rtype: DetailedResponse with `dict` result representing a `Security` object """ + if not db: + raise ValueError('db must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='post_api_keys', + operation_id='get_security', ) headers.update(sdk_headers) @@ -6978,9 +7032,12 @@ def post_api_keys( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_api/v2/api_keys' + path_param_keys = ['db'] + path_param_values = self.encode_path_vars(db) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/{db}/_security'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, ) @@ -6988,22 +7045,24 @@ def post_api_keys( response = self.send(request, **kwargs) return response - def put_cloudant_security_configuration( + def put_security( self, db: str, - cloudant: dict, *, admins: Optional['SecurityObject'] = None, - members: Optional['SecurityObject'] = None, + cloudant: Optional[dict] = None, couchdb_auth_only: Optional[bool] = None, + members: Optional['SecurityObject'] = None, **kwargs, ) -> DetailedResponse: """ - Modify only Cloudant related database permissions. + Modify database permissions. - Modify only Cloudant related permissions to database. Be careful: by removing an - API key from the list, you remove the API key from the list of users that have - access to the database. + Modify who has permission to read, write, or manage a database. This endpoint can + be used to modify both Cloudant and CouchDB related permissions. Be careful: by + removing a Cloudant API key, a member or an admin from the list of users that have + access permissions, you remove it from the list of users that have access to the + database. ### Note about nobody role The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to read data from a database, but did not @@ -7011,14 +7070,14 @@ def put_cloudant_security_configuration( `_reader`. :param str db: Path parameter to specify the database name. - :param dict cloudant: Database permissions for Cloudant users and/or API - keys. :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param SecurityObject members: (optional) Schema for names and roles to map - to a database permission. + :param dict cloudant: (optional) Database permissions for Cloudant users + and/or API keys. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. + :param SecurityObject members: (optional) Schema for names and roles to map + to a database permission. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Ok` object @@ -7026,8 +7085,6 @@ def put_cloudant_security_configuration( if not db: raise ValueError('db must be provided') - if cloudant is None: - raise ValueError('cloudant must be provided') if admins is not None: admins = convert_model(admins) if members is not None: @@ -7036,15 +7093,15 @@ def put_cloudant_security_configuration( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='put_cloudant_security_configuration', + operation_id='put_security', ) headers.update(sdk_headers) data = { - 'cloudant': cloudant, 'admins': admins, - 'members': members, + 'cloudant': cloudant, 'couchdb_auth_only': couchdb_auth_only, + 'members': members, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -7058,7 +7115,7 @@ def put_cloudant_security_configuration( path_param_keys = ['db'] path_param_values = self.encode_path_vars(db) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/_api/v2/db/{db}/_security'.format(**path_param_dict) + url = '/{db}/_security'.format(**path_param_dict) request = self.prepare_request( method='PUT', url=url, @@ -7990,27 +8047,26 @@ def get_active_tasks( response = self.send(request, **kwargs) return response - def get_membership_information( + def get_activity_tracker_events( self, **kwargs, ) -> DetailedResponse: """ - Retrieve cluster membership information. + Retrieve Activity Tracker events information. - Displays the nodes that are part of the cluster as `cluster_nodes`. The field, - `all_nodes`, displays all nodes this node knows about, including the ones that are - part of the cluster. This endpoint is useful when you set up a cluster. + Check event types that are being sent to IBM Cloud Activity Tracker for the IBM + Cloudant instance. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `MembershipInformation` object + :rtype: DetailedResponse with `dict` result representing a `ActivityTrackerEvents` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_membership_information', + operation_id='get_activity_tracker_events', ) headers.update(sdk_headers) @@ -8019,7 +8075,7 @@ def get_membership_information( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_membership' + url = '/_api/v2/user/activity_tracker/events' request = self.prepare_request( method='GET', url=url, @@ -8029,65 +8085,79 @@ def get_membership_information( response = self.send(request, **kwargs) return response - def get_up_information( + def post_activity_tracker_events( self, + types: List[str], **kwargs, ) -> DetailedResponse: """ - Retrieve information about whether the server is up. + Modify Activity Tracker events configuration. - Confirms that the server is up, running, and ready to respond to requests. If - `maintenance_mode` is `true` or `nolb`, the endpoint returns a 404 response. - **Tip:** The authentication for this endpoint is only enforced when using IAM. + Configure event types that are being sent to IBM Cloud Activity Tracker for the + IBM Cloudant instance. + :param List[str] types: An array of event types that are being sent to IBM + Cloud Activity Tracker for the IBM Cloudant instance. "management" is a + required element of this array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `UpInformation` object + :rtype: DetailedResponse with `dict` result representing a `Ok` object """ + if types is None: + raise ValueError('types must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_up_information', + operation_id='post_activity_tracker_events', ) headers.update(sdk_headers) + data = { + 'types': types, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_up' + url = '/_api/v2/user/activity_tracker/events' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, + data=data, ) response = self.send(request, **kwargs) return response - def get_activity_tracker_events( + def get_current_throughput_information( self, **kwargs, ) -> DetailedResponse: """ - Retrieve Activity Tracker events information. + Retrieve the current provisioned throughput capacity consumption. - Check event types that are being sent to IBM Cloud Activity Tracker for the IBM - Cloudant instance. + View the current consumption of provisioned throughput capacity for an IBM + Cloudant instance. The current consumption shows the quantities of reads, writes, + and global queries conducted against the instance for a given second. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ActivityTrackerEvents` object + :rtype: DetailedResponse with `dict` result representing a `CurrentThroughputInformation` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_activity_tracker_events', + operation_id='get_current_throughput_information', ) headers.update(sdk_headers) @@ -8096,7 +8166,7 @@ def get_activity_tracker_events( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_api/v2/user/activity_tracker/events' + url = '/_api/v2/user/current/throughput' request = self.prepare_request( method='GET', url=url, @@ -8106,79 +8176,66 @@ def get_activity_tracker_events( response = self.send(request, **kwargs) return response - def post_activity_tracker_events( + def get_membership_information( self, - types: List[str], **kwargs, ) -> DetailedResponse: """ - Modify Activity Tracker events configuration. + Retrieve cluster membership information. - Configure event types that are being sent to IBM Cloud Activity Tracker for the - IBM Cloudant instance. + Displays the nodes that are part of the cluster as `cluster_nodes`. The field, + `all_nodes`, displays all nodes this node knows about, including the ones that are + part of the cluster. This endpoint is useful when you set up a cluster. - :param List[str] types: An array of event types that are being sent to IBM - Cloud Activity Tracker for the IBM Cloudant instance. "management" is a - required element of this array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `Ok` object + :rtype: DetailedResponse with `dict` result representing a `MembershipInformation` object """ - if types is None: - raise ValueError('types must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='post_activity_tracker_events', + operation_id='get_membership_information', ) headers.update(sdk_headers) - data = { - 'types': types, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_api/v2/user/activity_tracker/events' + url = '/_membership' request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, - data=data, ) response = self.send(request, **kwargs) return response - def get_current_throughput_information( + def get_up_information( self, **kwargs, ) -> DetailedResponse: """ - Retrieve the current provisioned throughput capacity consumption. + Retrieve information about whether the server is up. - View the current consumption of provisioned throughput capacity for an IBM - Cloudant instance. The current consumption shows the quantities of reads, writes, - and global queries conducted against the instance for a given second. + Confirms that the server is up, running, and ready to respond to requests. If + `maintenance_mode` is `true` or `nolb`, the endpoint returns a 404 response. + **Tip:** The authentication for this endpoint is only enforced when using IAM. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `CurrentThroughputInformation` object + :rtype: DetailedResponse with `dict` result representing a `UpInformation` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_current_throughput_information', + operation_id='get_up_information', ) headers.update(sdk_headers) @@ -8187,7 +8244,7 @@ def get_current_throughput_information( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/_api/v2/user/current/throughput' + url = '/_up' request = self.prepare_request( method='GET', url=url, @@ -8228,6 +8285,16 @@ class Feed(str, Enum): EVENTSOURCE = 'eventsource' LONGPOLL = 'longpoll' NORMAL = 'normal' + class Style(str, Enum): + """ + Query parameter to specify how many revisions are returned in the changes array. + The default, `main_only`, will only return the current "winning" revision; + all_docs will return all leaf revisions (including conflicts and deleted former + conflicts). + """ + + MAIN_ONLY = 'main_only' + ALL_DOCS = 'all_docs' class PostChangesAsStreamEnums: @@ -8244,6 +8311,16 @@ class Feed(str, Enum): EVENTSOURCE = 'eventsource' LONGPOLL = 'longpoll' NORMAL = 'normal' + class Style(str, Enum): + """ + Query parameter to specify how many revisions are returned in the changes array. + The default, `main_only`, will only return the current "winning" revision; + all_docs will return all leaf revisions (including conflicts and deleted former + conflicts). + """ + + MAIN_ONLY = 'main_only' + ALL_DOCS = 'all_docs' class PostDocumentEnums: @@ -8363,6 +8440,20 @@ class Type(str, Enum): TEXT = 'text' +class PostReplicatorEnums: + """ + Enums for post_replicator parameters. + """ + + class Batch(str, Enum): + """ + Query parameter to specify whether to store in batch mode. The server will respond + with a HTTP 202 Accepted response code immediately. + """ + + OK = 'ok' + + class DeleteReplicationDocumentEnums: """ Enums for delete_replication_document parameters. @@ -9244,7 +9335,7 @@ class AllDocsResult: """ Schema for the result of an all documents operation. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of document results. :param List[DocsResultRow] rows: List of doc results. :param str update_seq: (optional) Current update sequence for the database. """ @@ -9259,7 +9350,7 @@ def __init__( """ Initialize a AllDocsResult object. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of document results. :param List[DocsResultRow] rows: List of doc results. :param str update_seq: (optional) Current update sequence for the database. """ @@ -9328,8 +9419,8 @@ class Analyzer: """ Schema for a full text search analyzer. - :param str name: (optional) Schema for the name of the Apache Lucene analyzer to - use for text indexing. The default value varies depending on the analyzer usage: + :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`. @@ -9339,16 +9430,16 @@ class Analyzer: def __init__( self, + name: str, *, - name: Optional[str] = None, stopwords: Optional[List[str]] = None, ) -> None: """ Initialize a Analyzer object. - :param str name: (optional) Schema for the name of the Apache Lucene - analyzer to use for text indexing. The default value varies depending on - the analyzer usage: + :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`. @@ -9364,6 +9455,8 @@ def from_dict(cls, _dict: Dict) -> 'Analyzer': args = {} if (name := _dict.get('name')) is not None: args['name'] = name + else: + raise ValueError('Required property \'name\' not present in Analyzer JSON') if (stopwords := _dict.get('stopwords')) is not None: args['stopwords'] = stopwords return cls(**args) @@ -9457,8 +9550,8 @@ class AnalyzerConfiguration: """ Schema for a search analyzer configuration. - :param str name: (optional) Schema for the name of the Apache Lucene analyzer to - use for text indexing. The default value varies depending on the analyzer usage: + :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`. @@ -9470,17 +9563,17 @@ class AnalyzerConfiguration: def __init__( self, + name: str, *, - name: Optional[str] = None, stopwords: Optional[List[str]] = None, fields: Optional[dict] = None, ) -> None: """ Initialize a AnalyzerConfiguration object. - :param str name: (optional) Schema for the name of the Apache Lucene - analyzer to use for text indexing. The default value varies depending on - the analyzer usage: + :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`. @@ -9499,6 +9592,8 @@ def from_dict(cls, _dict: Dict) -> 'AnalyzerConfiguration': args = {} if (name := _dict.get('name')) is not None: args['name'] = name + else: + raise ValueError('Required property \'name\' not present in AnalyzerConfiguration JSON') if (stopwords := _dict.get('stopwords')) is not None: args['stopwords'] = stopwords if (fields := _dict.get('fields')) is not None: @@ -11002,13 +11097,13 @@ class DatabaseInformation: has been recreated. The field name is for compatibility with old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators. + :param PartitionedIndexesInformation partitioned_indexes: (optional) Information + about database's partitioned indexes. :param DatabaseInformationProps props: Schema for database properties. :param ContentInformationSizes sizes: Schema for size information of content. :param str update_seq: An opaque string that describes the state of the database. Do not rely on this string for counting the number of updates. :param str uuid: (optional) The UUID of the database. - :param PartitionedIndexesInformation partitioned_indexes: (optional) Information - about database's partitioned indexes. """ def __init__( @@ -11027,8 +11122,8 @@ def __init__( committed_update_seq: Optional[str] = None, compacted_seq: Optional[str] = None, engine: Optional[str] = None, - uuid: Optional[str] = None, partitioned_indexes: Optional['PartitionedIndexesInformation'] = None, + uuid: Optional[str] = None, ) -> None: """ Initialize a DatabaseInformation object. @@ -11056,9 +11151,9 @@ def __init__( :param str compacted_seq: (optional) An opaque string that describes the compaction state of the database. :param str engine: (optional) The engine used for the database. - :param str uuid: (optional) The UUID of the database. :param PartitionedIndexesInformation partitioned_indexes: (optional) Information about database's partitioned indexes. + :param str uuid: (optional) The UUID of the database. """ self.cluster = cluster self.committed_update_seq = committed_update_seq @@ -11070,11 +11165,11 @@ def __init__( self.doc_del_count = doc_del_count self.engine = engine self.instance_start_time = instance_start_time + self.partitioned_indexes = partitioned_indexes self.props = props self.sizes = sizes self.update_seq = update_seq self.uuid = uuid - self.partitioned_indexes = partitioned_indexes @classmethod def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': @@ -11114,6 +11209,8 @@ def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': args['instance_start_time'] = instance_start_time else: raise ValueError('Required property \'instance_start_time\' not present in DatabaseInformation JSON') + if (partitioned_indexes := _dict.get('partitioned_indexes')) is not None: + args['partitioned_indexes'] = PartitionedIndexesInformation.from_dict(partitioned_indexes) if (props := _dict.get('props')) is not None: args['props'] = DatabaseInformationProps.from_dict(props) else: @@ -11128,8 +11225,6 @@ def from_dict(cls, _dict: Dict) -> 'DatabaseInformation': raise ValueError('Required property \'update_seq\' not present in DatabaseInformation JSON') if (uuid := _dict.get('uuid')) is not None: args['uuid'] = uuid - if (partitioned_indexes := _dict.get('partitioned_indexes')) is not None: - args['partitioned_indexes'] = PartitionedIndexesInformation.from_dict(partitioned_indexes) return cls(**args) @classmethod @@ -11163,6 +11258,11 @@ def to_dict(self) -> Dict: _dict['engine'] = self.engine if hasattr(self, 'instance_start_time') and self.instance_start_time is not None: _dict['instance_start_time'] = self.instance_start_time + if hasattr(self, 'partitioned_indexes') and self.partitioned_indexes is not None: + if isinstance(self.partitioned_indexes, dict): + _dict['partitioned_indexes'] = self.partitioned_indexes + else: + _dict['partitioned_indexes'] = self.partitioned_indexes.to_dict() if hasattr(self, 'props') and self.props is not None: if isinstance(self.props, dict): _dict['props'] = self.props @@ -11177,11 +11277,6 @@ def to_dict(self) -> Dict: _dict['update_seq'] = self.update_seq if hasattr(self, 'uuid') and self.uuid is not None: _dict['uuid'] = self.uuid - if hasattr(self, 'partitioned_indexes') and self.partitioned_indexes is not None: - if isinstance(self.partitioned_indexes, dict): - _dict['partitioned_indexes'] = self.partitioned_indexes - else: - _dict['partitioned_indexes'] = self.partitioned_indexes.to_dict() return _dict def _to_dict(self): @@ -13374,59 +13469,52 @@ class ExplainResultMrArgs: """ Arguments passed to the underlying view. - :param object conflicts: (optional) Schema for any JSON type. - :param str direction: (optional) Direction parameter passed to the underlying - view. - :param object end_key: (optional) Schema for any JSON type. - :param bool include_docs: (optional) A parameter that specifies whether to - include the full content of the documents in the response in the underlying - view. - :param str partition: (optional) Partition parameter passed to the underlying - view. - :param bool reduce: (optional) A parameter that specifies returning only - documents that match any of the specified keys in the underlying view. - :param bool stable: (optional) A parameter that specifies whether the view - results should be returned form a "stable" set of shards passed to the - underlying view. + :param object conflicts: Schema for any JSON type. + :param str direction: Direction parameter passed to the underlying view. + :param object end_key: Schema for any JSON type. + :param bool include_docs: A parameter that specifies whether to include the full + content of the documents in the response in the underlying view. + :param str partition: Partition parameter passed to the underlying view. + :param bool reduce: A parameter that specifies returning only documents that + match any of the specified keys in the underlying view. + :param bool stable: A parameter that specifies whether the view results should + be returned form a "stable" set of shards passed to the underlying view. :param object start_key: (optional) Schema for any JSON type. - :param object update: (optional) Schema for any JSON type. - :param str view_type: (optional) The type of the underlying view. + :param object update: Schema for any JSON type. + :param str view_type: The type of the underlying view. """ def __init__( self, + conflicts: object, + direction: str, + end_key: object, + include_docs: bool, + partition: str, + reduce: bool, + stable: bool, + update: object, + view_type: str, *, - conflicts: Optional[object] = None, - direction: Optional[str] = None, - end_key: Optional[object] = None, - include_docs: Optional[bool] = None, - partition: Optional[str] = None, - reduce: Optional[bool] = None, - stable: Optional[bool] = None, start_key: Optional[object] = None, - update: Optional[object] = None, - view_type: Optional[str] = None, ) -> None: """ Initialize a ExplainResultMrArgs object. - :param object conflicts: (optional) Schema for any JSON type. - :param str direction: (optional) Direction parameter passed to the - underlying view. - :param object end_key: (optional) Schema for any JSON type. - :param bool include_docs: (optional) A parameter that specifies whether to - include the full content of the documents in the response in the underlying + :param object conflicts: Schema for any JSON type. + :param str direction: Direction parameter passed to the underlying view. + :param object end_key: Schema for any JSON type. + :param bool include_docs: A parameter that specifies whether to include the + full content of the documents in the response in the underlying view. + :param str partition: Partition parameter passed to the underlying view. + :param bool reduce: A parameter that specifies returning only documents + that match any of the specified keys in the underlying view. + :param bool stable: A parameter that specifies whether the view results + should be returned form a "stable" set of shards passed to the underlying view. - :param str partition: (optional) Partition parameter passed to the - underlying view. - :param bool reduce: (optional) A parameter that specifies returning only - documents that match any of the specified keys in the underlying view. - :param bool stable: (optional) A parameter that specifies whether the view - results should be returned form a "stable" set of shards passed to the - underlying view. + :param object update: Schema for any JSON type. + :param str view_type: The type of the underlying view. :param object start_key: (optional) Schema for any JSON type. - :param object update: (optional) Schema for any JSON type. - :param str view_type: (optional) The type of the underlying view. """ self.conflicts = conflicts self.direction = direction @@ -13445,24 +13533,42 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': args = {} if (conflicts := _dict.get('conflicts')) is not None: args['conflicts'] = conflicts + else: + raise ValueError('Required property \'conflicts\' not present in ExplainResultMrArgs JSON') if (direction := _dict.get('direction')) is not None: args['direction'] = direction + else: + raise ValueError('Required property \'direction\' not present in ExplainResultMrArgs JSON') if (end_key := _dict.get('end_key')) is not None: args['end_key'] = end_key + else: + raise ValueError('Required property \'end_key\' not present in ExplainResultMrArgs JSON') if (include_docs := _dict.get('include_docs')) is not None: args['include_docs'] = include_docs + else: + raise ValueError('Required property \'include_docs\' not present in ExplainResultMrArgs JSON') if (partition := _dict.get('partition')) is not None: args['partition'] = partition + else: + raise ValueError('Required property \'partition\' not present in ExplainResultMrArgs JSON') if (reduce := _dict.get('reduce')) is not None: args['reduce'] = reduce + else: + raise ValueError('Required property \'reduce\' not present in ExplainResultMrArgs JSON') if (stable := _dict.get('stable')) is not None: args['stable'] = stable + else: + raise ValueError('Required property \'stable\' not present in ExplainResultMrArgs JSON') if (start_key := _dict.get('start_key')) is not None: args['start_key'] = start_key if (update := _dict.get('update')) is not None: args['update'] = update + else: + raise ValueError('Required property \'update\' not present in ExplainResultMrArgs JSON') if (view_type := _dict.get('view_type')) is not None: args['view_type'] = view_type + else: + raise ValueError('Required property \'view_type\' not present in ExplainResultMrArgs JSON') return cls(**args) @classmethod @@ -13518,8 +13624,8 @@ class DirectionEnum(str, Enum): Direction parameter passed to the underlying view. """ - ASC = 'asc' - DESC = 'desc' + FWD = 'fwd' + REV = 'rev' class ViewTypeEnum(str, Enum): @@ -13922,7 +14028,7 @@ class IndexAnalysisExclusionReason: """ A reason for index's exclusion. - :param str name: (optional) A reason code for index's exclusion. + :param str name: A reason code for index's exclusion. The full list of possible reason codes is following: * alphabetically_comes_after: json There is another suitable index whose name comes before that of this index. @@ -13944,13 +14050,12 @@ class IndexAnalysisExclusionReason: def __init__( self, - *, - name: Optional[str] = None, + name: str, ) -> None: """ Initialize a IndexAnalysisExclusionReason object. - :param str name: (optional) A reason code for index's exclusion. + :param str name: A reason code for index's exclusion. The full list of possible reason codes is following: * alphabetically_comes_after: json There is another suitable index whose name comes before that of this @@ -13980,6 +14085,8 @@ def from_dict(cls, _dict: Dict) -> 'IndexAnalysisExclusionReason': args = {} if (name := _dict.get('name')) is not None: args['name'] = name + else: + raise ValueError('Required property \'name\' not present in IndexAnalysisExclusionReason JSON') return cls(**args) @classmethod @@ -14737,7 +14844,7 @@ class IndexesInformation: """ Schema for information about the indexes in a database. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of query indexes in the database. :param List[IndexInformation] indexes: Indexes. """ @@ -14749,7 +14856,7 @@ def __init__( """ Initialize a IndexesInformation object. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of query indexes in the database. :param List[IndexInformation] indexes: Indexes. """ self.total_rows = total_rows @@ -16487,7 +16594,7 @@ class SchedulerDocsResult: """ Schema for a listing of replication scheduler documents. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of replication scheduler documents. :param List[SchedulerDocument] docs: Array of replication scheduler doc objects. """ @@ -16499,7 +16606,7 @@ def __init__( """ Initialize a SchedulerDocsResult object. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of replication scheduler documents. :param List[SchedulerDocument] docs: Array of replication scheduler doc objects. """ @@ -17175,7 +17282,7 @@ class SchedulerJobsResult: """ Schema for a listing of replication scheduler jobs. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of replication jobs. :param List[SchedulerJob] jobs: Array of replication job objects. """ @@ -17187,7 +17294,7 @@ def __init__( """ Initialize a SchedulerJobsResult object. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of replication jobs. :param List[SchedulerJob] jobs: Array of replication job objects. """ self.total_rows = total_rows @@ -17602,7 +17709,8 @@ class SearchResult: """ Schema for the result of a query search operation. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of rows in the index matching the search + query. The limit may truncate the number of matches returned. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param str by: (optional) Grouped search matches. @@ -17630,7 +17738,8 @@ def __init__( """ Initialize a SearchResult object. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of rows in the index matching the + search query. The limit may truncate the number of matches returned. :param List[SearchResultRow] rows: Array of row objects. :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -17734,7 +17843,8 @@ class SearchResultProperties: """ Schema for the result of a query search operation. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of rows in the index matching the search + query. The limit may truncate the number of matches returned. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param str by: (optional) Grouped search matches. @@ -17759,7 +17869,8 @@ def __init__( """ Initialize a SearchResultProperties object. - :param int total_rows: Number of total rows. + :param int total_rows: Total number of rows in the index matching the + search query. The limit may truncate the number of matches returned. :param List[SearchResultRow] rows: Array of row objects. :param str bookmark: (optional) Opaque bookmark token used when paginating results. @@ -17946,38 +18057,38 @@ class Security: :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param SecurityObject members: (optional) Schema for names and roles to map to a - database permission. :param dict cloudant: (optional) Database permissions for Cloudant users and/or API keys. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. + :param SecurityObject members: (optional) Schema for names and roles to map to a + database permission. """ def __init__( self, *, admins: Optional['SecurityObject'] = None, - members: Optional['SecurityObject'] = None, cloudant: Optional[dict] = None, couchdb_auth_only: Optional[bool] = None, + members: Optional['SecurityObject'] = None, ) -> None: """ Initialize a Security object. :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param SecurityObject members: (optional) Schema for names and roles to map - to a database permission. :param dict cloudant: (optional) Database permissions for Cloudant users and/or API keys. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. + :param SecurityObject members: (optional) Schema for names and roles to map + to a database permission. """ self.admins = admins - self.members = members self.cloudant = cloudant self.couchdb_auth_only = couchdb_auth_only + self.members = members @classmethod def from_dict(cls, _dict: Dict) -> 'Security': @@ -17985,12 +18096,12 @@ def from_dict(cls, _dict: Dict) -> 'Security': args = {} if (admins := _dict.get('admins')) is not None: args['admins'] = SecurityObject.from_dict(admins) - if (members := _dict.get('members')) is not None: - args['members'] = SecurityObject.from_dict(members) if (cloudant := _dict.get('cloudant')) is not None: args['cloudant'] = cloudant if (couchdb_auth_only := _dict.get('couchdb_auth_only')) is not None: args['couchdb_auth_only'] = couchdb_auth_only + if (members := _dict.get('members')) is not None: + args['members'] = SecurityObject.from_dict(members) return cls(**args) @classmethod @@ -18006,15 +18117,15 @@ def to_dict(self) -> Dict: _dict['admins'] = self.admins else: _dict['admins'] = self.admins.to_dict() + if hasattr(self, 'cloudant') and self.cloudant is not None: + _dict['cloudant'] = self.cloudant + if hasattr(self, 'couchdb_auth_only') and self.couchdb_auth_only is not None: + _dict['couchdb_auth_only'] = self.couchdb_auth_only if hasattr(self, 'members') and self.members is not None: if isinstance(self.members, dict): _dict['members'] = self.members else: _dict['members'] = self.members.to_dict() - if hasattr(self, 'cloudant') and self.cloudant is not None: - _dict['cloudant'] = self.cloudant - if hasattr(self, 'couchdb_auth_only') and self.couchdb_auth_only is not None: - _dict['couchdb_auth_only'] = self.couchdb_auth_only return _dict def _to_dict(self): @@ -18215,33 +18326,33 @@ class ServerInformation: :param str couchdb: Welcome message. :param List[str] features: List of enabled optional features. + :param List[str] features_flags: List of feature flags. :param ServerVendor vendor: Schema for server vendor information. :param str version: Apache CouchDB version. - :param List[str] features_flags: List of feature flags. """ def __init__( self, couchdb: str, features: List[str], + features_flags: List[str], vendor: 'ServerVendor', version: str, - features_flags: List[str], ) -> None: """ Initialize a ServerInformation object. :param str couchdb: Welcome message. :param List[str] features: List of enabled optional features. + :param List[str] features_flags: List of feature flags. :param ServerVendor vendor: Schema for server vendor information. :param str version: Apache CouchDB version. - :param List[str] features_flags: List of feature flags. """ self.couchdb = couchdb self.features = features + self.features_flags = features_flags self.vendor = vendor self.version = version - self.features_flags = features_flags @classmethod def from_dict(cls, _dict: Dict) -> 'ServerInformation': @@ -18255,6 +18366,10 @@ def from_dict(cls, _dict: Dict) -> 'ServerInformation': args['features'] = features else: raise ValueError('Required property \'features\' not present in ServerInformation JSON') + if (features_flags := _dict.get('features_flags')) is not None: + args['features_flags'] = features_flags + else: + raise ValueError('Required property \'features_flags\' not present in ServerInformation JSON') if (vendor := _dict.get('vendor')) is not None: args['vendor'] = ServerVendor.from_dict(vendor) else: @@ -18263,10 +18378,6 @@ def from_dict(cls, _dict: Dict) -> 'ServerInformation': args['version'] = version else: raise ValueError('Required property \'version\' not present in ServerInformation JSON') - if (features_flags := _dict.get('features_flags')) is not None: - args['features_flags'] = features_flags - else: - raise ValueError('Required property \'features_flags\' not present in ServerInformation JSON') return cls(**args) @classmethod @@ -18281,6 +18392,8 @@ def to_dict(self) -> Dict: _dict['couchdb'] = self.couchdb if hasattr(self, 'features') and self.features is not None: _dict['features'] = self.features + if hasattr(self, 'features_flags') and self.features_flags is not None: + _dict['features_flags'] = self.features_flags if hasattr(self, 'vendor') and self.vendor is not None: if isinstance(self.vendor, dict): _dict['vendor'] = self.vendor @@ -18288,8 +18401,6 @@ def to_dict(self) -> Dict: _dict['vendor'] = self.vendor.to_dict() if hasattr(self, 'version') and self.version is not None: _dict['version'] = self.version - if hasattr(self, 'features_flags') and self.features_flags is not None: - _dict['features_flags'] = self.features_flags return _dict def _to_dict(self): @@ -19447,7 +19558,10 @@ class ViewResult: """ Schema for the result of a query view operation. - :param int total_rows: (optional) Number of total rows. + :param int total_rows: (optional) Total number of rows in the view index. Note + that if the request query narrows the view this is not the number of matching + rows. The number of matching rows, up to the specified `limit`, is the size of + the `rows` array. :param str update_seq: (optional) Current update sequence for the database. :param List[ViewResultRow] rows: rows. """ @@ -19463,7 +19577,10 @@ def __init__( Initialize a ViewResult object. :param List[ViewResultRow] rows: rows. - :param int total_rows: (optional) Number of total rows. + :param int total_rows: (optional) Total number of rows in the view index. + Note that if the request query narrows the view this is not the number of + matching rows. The number of matching rows, up to the specified `limit`, is + the size of the `rows` array. :param str update_seq: (optional) Current update sequence for the database. """ self.total_rows = total_rows diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 981ed646..dc40ad97 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -383,7 +383,7 @@ "equalTo": "normal" }, "heartbeat": { - "equalTo": "0" + "equalTo": "1" }, "since": { "equalTo": "0" @@ -476,6 +476,48 @@ }, "uuid": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba" }, + { + "id": "109ff4b5-4d2a-32b8-890d-f15cfe54173b", + "request": { + "urlPath": "/_replicator", + "method": "POST", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"source\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}, \"target\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"1-257d246167d34fcc2ca07926ba0213d1\"}", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:54:50 GMT", + "ETag": "W/\"22-257d246167d34fcc2ca07926ba0213d1\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/_replicator/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "ce157aeb0e62a81f05c0e8c9e4d24c55", + "X-Cloudant-Action": "cloudantnosqldb.replication.write", + "X-Couch-Request-ID": "ce157aeb0e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "109ff4b5-4d2a-32b8-890d-f15cfe54173b" + }, { "id": "ea621c78-5215-34ac-94ce-95e13e1182bd", "request": { @@ -1222,7 +1264,7 @@ "equalTo": "testString" }, "heartbeat": { - "equalTo": "0" + "equalTo": "1" }, "include_docs": { "equalTo": "false" @@ -2444,7 +2486,7 @@ "equalTo": "false" }, "q": { - "equalTo": "26" + "equalTo": "16" } } }, diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index bce02adb..354a2f69 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -60,16 +60,6 @@ def test_get_server_information(self): server_information = response.get_result() assert server_information is not None - @needscredentials - def test_get_uuids(self): - response = self.cloudant_service.get_uuids( - count=1, - ) - - assert response.get_status_code() == 200 - uuids_result = response.get_result() - assert uuids_result is not None - @needscredentials def test_get_capacity_throughput_information(self): response = self.cloudant_service.get_capacity_throughput_information() @@ -88,12 +78,22 @@ def test_put_capacity_throughput_configuration(self): capacity_throughput_information = response.get_result() assert capacity_throughput_information is not None + @needscredentials + def test_get_uuids(self): + response = self.cloudant_service.get_uuids( + count=1, + ) + + assert response.get_status_code() == 200 + uuids_result = response.get_result() + assert uuids_result is not None + @needscredentials def test_get_db_updates(self): response = self.cloudant_service.get_db_updates( descending=False, feed='normal', - heartbeat=0, + heartbeat=1, limit=0, timeout=60000, since='0', @@ -117,7 +117,7 @@ def test_post_changes(self): descending=False, feed='normal', filter='testString', - heartbeat=0, + heartbeat=1, include_docs=False, limit=0, seq_interval=1, @@ -145,7 +145,7 @@ def test_post_changes_as_stream(self): descending=False, feed='normal', filter='testString', - heartbeat=0, + heartbeat=1, include_docs=False, limit=0, seq_interval=1, @@ -206,7 +206,7 @@ def test_put_database(self): response = self.cloudant_service.put_database( db='testString', partitioned=False, - q=26, + q=16, ) assert response.get_status_code() == 201 @@ -1391,7 +1391,7 @@ def test_post_search(self): group_field='testString', group_limit=1, group_sort=['testString'], - ranges={'key1': {'key1': {'key1': 'testString'}}}, + ranges={'key1': {'key1': 'testString'}}, ) assert response.get_status_code() == 200 @@ -1421,7 +1421,7 @@ def test_post_search_as_stream(self): group_field='testString', group_limit=1, group_sort=['testString'], - ranges={'key1': {'key1': {'key1': 'testString'}}}, + ranges={'key1': {'key1': 'testString'}}, ) assert response.get_status_code() == 200 @@ -1465,6 +1465,110 @@ def test_head_scheduler_job(self): assert response.get_status_code() == 200 + @needscredentials + def test_post_replicator(self): + # Construct a dict representation of a Attachment model + attachment_model = { + 'content_type': 'testString', + 'data': 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=', + 'digest': 'testString', + 'encoded_length': 0, + 'encoding': 'testString', + 'follows': True, + 'length': 0, + 'revpos': 1, + 'stub': True, + } + # Construct a dict representation of a Revisions model + revisions_model = { + 'ids': ['testString'], + 'start': 1, + } + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = { + 'rev': 'testString', + 'status': 'available', + } + # Construct a dict representation of a ReplicationCreateTargetParameters model + replication_create_target_parameters_model = { + 'n': 3, + 'partitioned': False, + 'q': 1, + } + # Construct a dict representation of a ReplicationDatabaseAuthBasic model + replication_database_auth_basic_model = { + 'password': 'testString', + 'username': 'testString', + } + # Construct a dict representation of a ReplicationDatabaseAuthIam model + replication_database_auth_iam_model = { + 'api_key': 'testString', + } + # Construct a dict representation of a ReplicationDatabaseAuth model + replication_database_auth_model = { + 'basic': replication_database_auth_basic_model, + 'iam': replication_database_auth_iam_model, + } + # Construct a dict representation of a ReplicationDatabase model + replication_database_model = { + 'auth': replication_database_auth_model, + 'headers': {'key1': 'testString'}, + 'url': 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb', + } + # Construct a dict representation of a UserContext model + user_context_model = { + 'db': 'testString', + 'name': 'john', + 'roles': ['_replicator'], + } + # Construct a dict representation of a ReplicationDocument model + replication_document_model = { + '_attachments': {'key1': attachment_model}, + '_conflicts': ['testString'], + '_deleted': True, + '_deleted_conflicts': ['testString'], + '_id': 'testString', + '_local_seq': 'testString', + '_rev': 'testString', + '_revisions': revisions_model, + '_revs_info': [document_revision_status_model], + 'cancel': False, + 'checkpoint_interval': 4500, + 'connection_timeout': 15000, + 'continuous': True, + 'create_target': True, + 'create_target_params': replication_create_target_parameters_model, + 'doc_ids': ['badger', 'lemur', 'llama'], + 'filter': 'ddoc/my_filter', + 'http_connections': 10, + 'owner': 'testString', + 'query_params': {'key1': 'testString'}, + 'retries_per_request': 3, + 'selector': {'_id': {'$regex': 'docid'}}, + 'since_seq': '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU', + 'socket_options': '[{keepalive, true}, {nodelay, false}]', + 'source': replication_database_model, + 'source_proxy': 'testString', + 'target': replication_database_model, + 'target_proxy': 'testString', + 'use_bulk_get': True, + 'use_checkpoints': False, + 'user_ctx': user_context_model, + 'winning_revs_only': False, + 'worker_batch_size': 400, + 'worker_processes': 3, + 'foo': 'testString', + } + + response = self.cloudant_service.post_replicator( + replication_document=replication_document_model, + batch='ok', + ) + + assert response.get_status_code() == 201 + document_result = response.get_result() + assert document_result is not None + @needscredentials def test_get_replication_document(self): response = self.cloudant_service.get_replication_document( @@ -1646,29 +1750,27 @@ def test_get_session_information(self): assert session_information is not None @needscredentials - def test_get_security(self): - response = self.cloudant_service.get_security( - db='testString', - ) + def test_post_api_keys(self): + response = self.cloudant_service.post_api_keys() - assert response.get_status_code() == 200 - security = response.get_result() - assert security is not None + assert response.get_status_code() == 201 + api_keys_result = response.get_result() + assert api_keys_result is not None @needscredentials - def test_put_security(self): + def test_put_cloudant_security_configuration(self): # Construct a dict representation of a SecurityObject model security_object_model = { - 'names': ['superuser'], - 'roles': ['admins'], + 'names': ['testString'], + 'roles': ['testString'], } - response = self.cloudant_service.put_security( + response = self.cloudant_service.put_cloudant_security_configuration( db='testString', + cloudant={'antsellseadespecteposene': ['_reader', '_writer', '_admin'], 'garbados': ['_reader', '_writer'], 'nobody': ['_reader']}, admins=security_object_model, - members=security_object_model, - cloudant={'key1': ['_reader']}, couchdb_auth_only=True, + members=security_object_model, ) assert response.get_status_code() == 200 @@ -1676,27 +1778,29 @@ def test_put_security(self): assert ok is not None @needscredentials - def test_post_api_keys(self): - response = self.cloudant_service.post_api_keys() + def test_get_security(self): + response = self.cloudant_service.get_security( + db='testString', + ) - assert response.get_status_code() == 201 - api_keys_result = response.get_result() - assert api_keys_result is not None + assert response.get_status_code() == 200 + security = response.get_result() + assert security is not None @needscredentials - def test_put_cloudant_security_configuration(self): + def test_put_security(self): # Construct a dict representation of a SecurityObject model security_object_model = { - 'names': ['testString'], - 'roles': ['testString'], + 'names': ['superuser'], + 'roles': ['admins'], } - response = self.cloudant_service.put_cloudant_security_configuration( + response = self.cloudant_service.put_security( db='testString', - cloudant={'antsellseadespecteposene': ['_reader', '_writer', '_admin'], 'garbados': ['_reader', '_writer'], 'nobody': ['_reader']}, admins=security_object_model, - members=security_object_model, + cloudant={'key1': ['_reader']}, couchdb_auth_only=True, + members=security_object_model, ) assert response.get_status_code() == 200 @@ -1899,22 +2003,6 @@ def test_get_active_tasks(self): list_active_task = response.get_result() assert list_active_task is not None - @needscredentials - def test_get_membership_information(self): - response = self.cloudant_service.get_membership_information() - - assert response.get_status_code() == 200 - membership_information = response.get_result() - assert membership_information is not None - - @needscredentials - def test_get_up_information(self): - response = self.cloudant_service.get_up_information() - - assert response.get_status_code() == 200 - up_information = response.get_result() - assert up_information is not None - @needscredentials def test_get_activity_tracker_events(self): response = self.cloudant_service.get_activity_tracker_events() @@ -1941,6 +2029,22 @@ def test_get_current_throughput_information(self): current_throughput_information = response.get_result() assert current_throughput_information is not None + @needscredentials + def test_get_membership_information(self): + response = self.cloudant_service.get_membership_information() + + assert response.get_status_code() == 200 + membership_information = response.get_result() + assert membership_information is not None + + @needscredentials + def test_get_up_information(self): + response = self.cloudant_service.get_up_information() + + assert response.get_status_code() == 200 + up_information = response.get_result() + assert up_information is not None + @needscredentials def test_delete_database(self): response = self.cloudant_service.delete_database( diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index dfe562c2..9b71aa5d 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -108,7 +108,7 @@ def test_get_server_information_all_params(self): """ # Set up mock url = preprocess_url('/') - mock_response = '{"couchdb": "couchdb", "features": ["features"], "vendor": {"name": "name", "variant": "paas", "version": "version"}, "version": "version", "features_flags": ["features_flags"]}' + mock_response = '{"couchdb": "couchdb", "features": ["features"], "features_flags": ["features_flags"], "vendor": {"name": "name", "variant": "paas", "version": "version"}, "version": "version"}' responses.add( responses.GET, url, @@ -134,86 +134,6 @@ def test_get_server_information_all_params_with_retries(self): self.test_get_server_information_all_params() -class TestGetUuids: - """ - Test Class for get_uuids - """ - - @responses.activate - def test_get_uuids_all_params(self): - """ - get_uuids() - """ - # Set up mock - url = preprocess_url('/_uuids') - mock_response = '{"uuids": ["uuids"]}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - count = 1 - - # Invoke method - response = _service.get_uuids( - count=count, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'count={}'.format(count) in query_string - - def test_get_uuids_all_params_with_retries(self): - # Enable retries and run test_get_uuids_all_params. - _service.enable_retries() - self.test_get_uuids_all_params() - - # Disable retries and run test_get_uuids_all_params. - _service.disable_retries() - self.test_get_uuids_all_params() - - @responses.activate - def test_get_uuids_required_params(self): - """ - test_get_uuids_required_params() - """ - # Set up mock - url = preprocess_url('/_uuids') - mock_response = '{"uuids": ["uuids"]}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Invoke method - response = _service.get_uuids() - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_uuids_required_params_with_retries(self): - # Enable retries and run test_get_uuids_required_params. - _service.enable_retries() - self.test_get_uuids_required_params() - - # Disable retries and run test_get_uuids_required_params. - _service.disable_retries() - self.test_get_uuids_required_params() - - class TestGetCapacityThroughputInformation: """ Test Class for get_capacity_throughput_information @@ -340,6 +260,86 @@ def test_put_capacity_throughput_configuration_value_error_with_retries(self): self.test_put_capacity_throughput_configuration_value_error() +class TestGetUuids: + """ + Test Class for get_uuids + """ + + @responses.activate + def test_get_uuids_all_params(self): + """ + get_uuids() + """ + # Set up mock + url = preprocess_url('/_uuids') + mock_response = '{"uuids": ["uuids"]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + count = 1 + + # Invoke method + response = _service.get_uuids( + count=count, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'count={}'.format(count) in query_string + + def test_get_uuids_all_params_with_retries(self): + # Enable retries and run test_get_uuids_all_params. + _service.enable_retries() + self.test_get_uuids_all_params() + + # Disable retries and run test_get_uuids_all_params. + _service.disable_retries() + self.test_get_uuids_all_params() + + @responses.activate + def test_get_uuids_required_params(self): + """ + test_get_uuids_required_params() + """ + # Set up mock + url = preprocess_url('/_uuids') + mock_response = '{"uuids": ["uuids"]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.get_uuids() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_uuids_required_params_with_retries(self): + # Enable retries and run test_get_uuids_required_params. + _service.enable_retries() + self.test_get_uuids_required_params() + + # Disable retries and run test_get_uuids_required_params. + _service.disable_retries() + self.test_get_uuids_required_params() + + # endregion ############################################################################## # End of Service: Server @@ -403,7 +403,7 @@ def test_get_db_updates_all_params(self): # Set up parameter values descending = False feed = 'normal' - heartbeat = 0 + heartbeat = 1 limit = 0 timeout = 60000 since = '0' @@ -486,7 +486,7 @@ def test_post_changes_all_params(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 0, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -507,7 +507,7 @@ def test_post_changes_all_params(self): descending = False feed = 'normal' filter = 'testString' - heartbeat = 0 + heartbeat = 1 include_docs = False limit = 0 seq_interval = 1 @@ -586,7 +586,7 @@ def test_post_changes_required_params(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 0, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -639,7 +639,7 @@ def test_post_changes_value_error(self): """ # Set up mock url = preprocess_url('/testString/_changes') - mock_response = '{"last_seq": "last_seq", "pending": 7, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' + mock_response = '{"last_seq": "last_seq", "pending": 0, "results": [{"changes": [{"rev": "rev"}], "deleted": false, "doc": {"_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"}]}, "id": "id", "seq": "seq"}]}' responses.add( responses.POST, url, @@ -706,7 +706,7 @@ def test_post_changes_as_stream_all_params(self): descending = False feed = 'normal' filter = 'testString' - heartbeat = 0 + heartbeat = 1 include_docs = False limit = 0 seq_interval = 1 @@ -1102,7 +1102,7 @@ def test_post_dbs_info_all_params(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 16, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 1, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}, "props": {"partitioned": false}, "sizes": {"active": 0, "external": 0, "file": 0}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' responses.add( responses.POST, url, @@ -1147,7 +1147,7 @@ def test_post_dbs_info_value_error(self): """ # Set up mock url = preprocess_url('/_dbs_info') - mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}, "key": "key"}]' + mock_response = '[{"error": "error", "info": {"cluster": {"n": 3, "q": 16, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 1, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}, "props": {"partitioned": false}, "sizes": {"active": 0, "external": 0, "file": 0}, "update_seq": "update_seq", "uuid": "uuid"}, "key": "key"}]' responses.add( responses.POST, url, @@ -1271,7 +1271,7 @@ def test_get_database_information_all_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' + mock_response = '{"cluster": {"n": 3, "q": 16, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 1, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}, "props": {"partitioned": false}, "sizes": {"active": 0, "external": 0, "file": 0}, "update_seq": "update_seq", "uuid": "uuid"}' responses.add( responses.GET, url, @@ -1309,7 +1309,7 @@ def test_get_database_information_value_error(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"cluster": {"n": 3, "q": 1, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 19, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "props": {"partitioned": false}, "sizes": {"active": 6, "external": 8, "file": 4}, "update_seq": "update_seq", "uuid": "uuid", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}}' + mock_response = '{"cluster": {"n": 3, "q": 16, "r": 1, "w": 1}, "committed_update_seq": "committed_update_seq", "compact_running": false, "compacted_seq": "compacted_seq", "db_name": "db_name", "disk_format_version": 1, "doc_count": 0, "doc_del_count": 0, "engine": "engine", "instance_start_time": "instance_start_time", "partitioned_indexes": {"count": 0, "indexes": {"search": 0, "view": 0}, "limit": 10}, "props": {"partitioned": false}, "sizes": {"active": 0, "external": 0, "file": 0}, "update_seq": "update_seq", "uuid": "uuid"}' responses.add( responses.GET, url, @@ -1364,7 +1364,7 @@ def test_put_database_all_params(self): # Set up parameter values db = 'testString' partitioned = False - q = 26 + q = 16 # Invoke method response = _service.put_database( @@ -1646,7 +1646,7 @@ def test_post_document_all_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.POST, url, @@ -1743,7 +1743,7 @@ def test_post_document_required_params(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.POST, url, @@ -1832,7 +1832,7 @@ def test_post_document_value_error(self): """ # Set up mock url = preprocess_url('/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.POST, url, @@ -1921,7 +1921,7 @@ def test_post_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2004,7 +2004,7 @@ def test_post_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -2205,7 +2205,7 @@ def test_post_all_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2268,7 +2268,7 @@ def test_post_all_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_all_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -2459,7 +2459,7 @@ def test_post_bulk_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_docs') - mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}]' + mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}]' responses.add( responses.POST, url, @@ -2550,7 +2550,7 @@ def test_post_bulk_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_bulk_docs') - mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}]' + mock_response = '[{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}]' responses.add( responses.POST, url, @@ -2639,7 +2639,7 @@ def test_post_bulk_get_all_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}, "ok": {"_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"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2707,7 +2707,7 @@ def test_post_bulk_get_required_params(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}, "ok": {"_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"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -2760,7 +2760,7 @@ def test_post_bulk_get_value_error(self): """ # Set up mock url = preprocess_url('/testString/_bulk_get') - mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}, "ok": {"_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"}]}}], "id": "id"}]}' + mock_response = '{"results": [{"docs": [{"error": {"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}, "ok": {"_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"}]}}], "id": "id"}]}' responses.add( responses.POST, url, @@ -3339,7 +3339,7 @@ def test_delete_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -3390,7 +3390,7 @@ def test_delete_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -3430,7 +3430,7 @@ def test_delete_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -4127,7 +4127,7 @@ def test_put_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -4234,7 +4234,7 @@ def test_put_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -4325,7 +4325,7 @@ def test_put_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -4573,7 +4573,7 @@ def test_delete_design_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -4624,7 +4624,7 @@ def test_delete_design_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -4664,7 +4664,7 @@ def test_delete_design_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -4869,7 +4869,7 @@ def test_put_design_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -4999,7 +4999,7 @@ def test_put_design_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -5115,7 +5115,7 @@ def test_put_design_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -5229,7 +5229,7 @@ def test_get_design_document_information_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_info') - mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "updates_pending": {"minimum": 7, "preferred": 9, "total": 5}, "waiting_clients": 0, "waiting_commit": true}}' + mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 0, "external": 0, "file": 0}, "updater_running": false, "updates_pending": {"minimum": 0, "preferred": 0, "total": 0}, "waiting_clients": 0, "waiting_commit": true}}' responses.add( responses.GET, url, @@ -5269,7 +5269,7 @@ def test_get_design_document_information_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_info') - mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 6, "external": 8, "file": 4}, "updater_running": false, "updates_pending": {"minimum": 7, "preferred": 9, "total": 5}, "waiting_clients": 0, "waiting_commit": true}}' + mock_response = '{"name": "name", "view_index": {"collator_versions": ["collator_versions"], "compact_running": false, "language": "language", "signature": "signature", "sizes": {"active": 0, "external": 0, "file": 0}, "updater_running": false, "updates_pending": {"minimum": 0, "preferred": 0, "total": 0}, "waiting_clients": 0, "waiting_commit": true}}' responses.add( responses.GET, url, @@ -5314,7 +5314,7 @@ def test_post_design_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5397,7 +5397,7 @@ def test_post_design_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -5453,7 +5453,7 @@ def test_post_design_docs_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5518,7 +5518,7 @@ def test_post_design_docs_queries_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5581,7 +5581,7 @@ def test_post_design_docs_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design_docs/queries') - mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' + mock_response = '{"results": [{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}]}' responses.add( responses.POST, url, @@ -5681,7 +5681,7 @@ def test_post_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -5789,7 +5789,7 @@ def test_post_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -6037,7 +6037,7 @@ def test_post_view_queries_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6111,7 +6111,7 @@ def test_post_view_queries_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_view/testString/queries') - mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' + mock_response = '{"results": [{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}]}' responses.add( responses.POST, url, @@ -6459,7 +6459,7 @@ def test_post_partition_all_docs_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -6544,7 +6544,7 @@ def test_post_partition_all_docs_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_all_docs') - mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' + mock_response = '{"total_rows": 0, "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "key", "value": {"deleted": false, "rev": "rev"}}], "update_seq": "update_seq"}' responses.add( responses.POST, url, @@ -7053,7 +7053,7 @@ def test_post_partition_view_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7160,7 +7160,7 @@ def test_post_partition_view_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_design/testString/_view/testString') - mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' + mock_response = '{"total_rows": 0, "update_seq": "update_seq", "rows": [{"caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0, "doc": {"_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"}]}, "id": "id", "key": "anyValue", "value": "anyValue"}]}' responses.add( responses.POST, url, @@ -7409,7 +7409,7 @@ def test_post_partition_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "fwd", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7491,7 +7491,7 @@ def test_post_partition_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_partition/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "fwd", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7874,7 +7874,7 @@ def test_post_explain_all_params(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "fwd", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -7957,7 +7957,7 @@ def test_post_explain_value_error(self): """ # Set up mock url = preprocess_url('/testString/_explain') - mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "asc", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' + mock_response = '{"covering": true, "dbname": "dbname", "fields": ["fields"], "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}, "index_candidates": [{"analysis": {"covering": true, "ranking": 1, "reasons": [{"name": "alphabetically_comes_after"}], "usable": true}, "index": {"ddoc": "ddoc", "def": {"default_analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "default_field": {"analyzer": {"name": "classic", "stopwords": ["stopwords"]}, "enabled": true}, "fields": [{"name": "name", "type": "boolean"}], "index_array_lengths": true, "partial_filter_selector": {"anyKey": "anyValue"}}, "name": "name", "partitioned": false, "type": "json"}}], "limit": 25, "mrargs": {"conflicts": "anyValue", "direction": "fwd", "end_key": "anyValue", "include_docs": true, "partition": "partition", "reduce": true, "stable": true, "start_key": "anyValue", "update": "anyValue", "view_type": "map"}, "opts": {"bookmark": "bookmark", "conflicts": false, "execution_stats": false, "fields": ["fields"], "limit": 25, "partition": "partition", "r": 1, "skip": 0, "sort": "anyValue", "stable": false, "stale": false, "update": true, "use_index": ["use_index"]}, "partitioned": "anyValue", "selector": {"anyKey": "anyValue"}, "selector_hints": [{"indexable_fields": ["indexable_fields"], "type": "json", "unindexable_fields": ["unindexable_fields"]}], "skip": 0}' responses.add( responses.POST, url, @@ -8792,7 +8792,7 @@ def test_post_search_all_params(self): group_field = 'testString' group_limit = 1 group_sort = ['testString'] - ranges = {'key1': {'key1': {'key1': 'testString'}}} + ranges = {'key1': {'key1': 'testString'}} # Invoke method response = _service.post_search( @@ -8846,7 +8846,7 @@ def test_post_search_all_params(self): assert req_body['group_field'] == 'testString' assert req_body['group_limit'] == 1 assert req_body['group_sort'] == ['testString'] - assert req_body['ranges'] == {'key1': {'key1': {'key1': 'testString'}}} + assert req_body['ranges'] == {'key1': {'key1': 'testString'}} def test_post_search_all_params_with_retries(self): # Enable retries and run test_post_search_all_params. @@ -8894,7 +8894,7 @@ def test_post_search_value_error(self): group_field = 'testString' group_limit = 1 group_sort = ['testString'] - ranges = {'key1': {'key1': {'key1': 'testString'}}} + ranges = {'key1': {'key1': 'testString'}} # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -8960,7 +8960,7 @@ def test_post_search_as_stream_all_params(self): group_field = 'testString' group_limit = 1 group_sort = ['testString'] - ranges = {'key1': {'key1': {'key1': 'testString'}}} + ranges = {'key1': {'key1': 'testString'}} # Invoke method response = _service.post_search_as_stream( @@ -9014,7 +9014,7 @@ def test_post_search_as_stream_all_params(self): assert req_body['group_field'] == 'testString' assert req_body['group_limit'] == 1 assert req_body['group_sort'] == ['testString'] - assert req_body['ranges'] == {'key1': {'key1': {'key1': 'testString'}}} + assert req_body['ranges'] == {'key1': {'key1': 'testString'}} # Verify streamed JSON response result = response.get_result() @@ -9068,7 +9068,7 @@ def test_post_search_as_stream_value_error(self): group_field = 'testString' group_limit = 1 group_sort = ['testString'] - ranges = {'key1': {'key1': {'key1': 'testString'}}} + ranges = {'key1': {'key1': 'testString'}} # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -9104,7 +9104,7 @@ def test_get_search_info_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search_info/testString') - mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' + mock_response = '{"name": "name", "search_index": {"committed_seq": 0, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 0, "signature": "signature"}}' responses.add( responses.GET, url, @@ -9146,7 +9146,7 @@ def test_get_search_info_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString/_search_info/testString') - mock_response = '{"name": "name", "search_index": {"committed_seq": 13, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 11, "signature": "signature"}}' + mock_response = '{"name": "name", "search_index": {"committed_seq": 0, "disk_size": 0, "doc_count": 0, "doc_del_count": 0, "pending_seq": 0, "signature": "signature"}}' responses.add( responses.GET, url, @@ -9482,87 +9482,502 @@ def test_head_scheduler_job_value_error_with_retries(self): self.test_head_scheduler_job_value_error() -class TestDeleteReplicationDocument: +class TestPostReplicator: """ - Test Class for delete_replication_document + Test Class for post_replicator """ @responses.activate - def test_delete_replication_document_all_params(self): + def test_post_replicator_all_params(self): """ - delete_replication_document() + post_replicator() """ # Set up mock - url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + url = preprocess_url('/_replicator') + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( - responses.DELETE, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Set up parameter values - doc_id = 'testString' - if_match = 'testString' - batch = 'ok' - rev = 'testString' - - # Invoke method - response = _service.delete_replication_document( - doc_id, - if_match=if_match, - batch=batch, - rev=rev, - headers={}, - ) + # Construct a dict representation of a Attachment model + attachment_model = {} + attachment_model['content_type'] = 'testString' + attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' + attachment_model['digest'] = 'testString' + attachment_model['encoded_length'] = 0 + attachment_model['encoding'] = 'testString' + attachment_model['follows'] = True + attachment_model['length'] = 0 + attachment_model['revpos'] = 1 + attachment_model['stub'] = True - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - # Validate query params - query_string = responses.calls[0].request.url.split('?', 1)[1] - query_string = urllib.parse.unquote_plus(query_string) - assert 'batch={}'.format(batch) in query_string - assert 'rev={}'.format(rev) in query_string + # Construct a dict representation of a Revisions model + revisions_model = {} + revisions_model['ids'] = ['testString'] + revisions_model['start'] = 1 - def test_delete_replication_document_all_params_with_retries(self): - # Enable retries and run test_delete_replication_document_all_params. - _service.enable_retries() - self.test_delete_replication_document_all_params() + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = {} + document_revision_status_model['rev'] = 'testString' + document_revision_status_model['status'] = 'available' - # Disable retries and run test_delete_replication_document_all_params. - _service.disable_retries() - self.test_delete_replication_document_all_params() + # Construct a dict representation of a ReplicationCreateTargetParameters model + replication_create_target_parameters_model = {} + replication_create_target_parameters_model['n'] = 3 + replication_create_target_parameters_model['partitioned'] = False + replication_create_target_parameters_model['q'] = 1 - @responses.activate - def test_delete_replication_document_required_params(self): - """ - test_delete_replication_document_required_params() - """ - # Set up mock - url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' - responses.add( - responses.DELETE, - url, - body=mock_response, - content_type='application/json', - status=200, - ) + # Construct a dict representation of a ReplicationDatabaseAuthBasic model + replication_database_auth_basic_model = {} + replication_database_auth_basic_model['password'] = 'testString' + replication_database_auth_basic_model['username'] = 'testString' - # Set up parameter values - doc_id = 'testString' + # Construct a dict representation of a ReplicationDatabaseAuthIam model + replication_database_auth_iam_model = {} + replication_database_auth_iam_model['api_key'] = 'testString' - # Invoke method - response = _service.delete_replication_document( - doc_id, - headers={}, - ) + # Construct a dict representation of a ReplicationDatabaseAuth model + replication_database_auth_model = {} + replication_database_auth_model['basic'] = replication_database_auth_basic_model + replication_database_auth_model['iam'] = replication_database_auth_iam_model - # Check for correct operation - assert len(responses.calls) == 1 + # Construct a dict representation of a ReplicationDatabase model + replication_database_model = {} + replication_database_model['auth'] = replication_database_auth_model + replication_database_model['headers'] = {'key1': 'testString'} + replication_database_model['url'] = 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb' + + # Construct a dict representation of a UserContext model + user_context_model = {} + user_context_model['db'] = 'testString' + user_context_model['name'] = 'john' + user_context_model['roles'] = ['_replicator'] + + # Construct a dict representation of a ReplicationDocument model + replication_document_model = {} + replication_document_model['_attachments'] = {'key1': attachment_model} + replication_document_model['_conflicts'] = ['testString'] + replication_document_model['_deleted'] = True + replication_document_model['_deleted_conflicts'] = ['testString'] + replication_document_model['_id'] = 'testString' + replication_document_model['_local_seq'] = 'testString' + replication_document_model['_rev'] = 'testString' + replication_document_model['_revisions'] = revisions_model + replication_document_model['_revs_info'] = [document_revision_status_model] + replication_document_model['cancel'] = False + replication_document_model['checkpoint_interval'] = 4500 + replication_document_model['connection_timeout'] = 15000 + replication_document_model['continuous'] = True + replication_document_model['create_target'] = True + replication_document_model['create_target_params'] = replication_create_target_parameters_model + replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] + replication_document_model['filter'] = 'ddoc/my_filter' + replication_document_model['http_connections'] = 10 + replication_document_model['owner'] = 'testString' + replication_document_model['query_params'] = {'key1': 'testString'} + replication_document_model['retries_per_request'] = 3 + replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} + replication_document_model['since_seq'] = '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU' + replication_document_model['socket_options'] = '[{keepalive, true}, {nodelay, false}]' + replication_document_model['source'] = replication_database_model + replication_document_model['source_proxy'] = 'testString' + replication_document_model['target'] = replication_database_model + replication_document_model['target_proxy'] = 'testString' + replication_document_model['use_bulk_get'] = True + replication_document_model['use_checkpoints'] = False + replication_document_model['user_ctx'] = user_context_model + replication_document_model['winning_revs_only'] = False + replication_document_model['worker_batch_size'] = 400 + replication_document_model['worker_processes'] = 3 + replication_document_model['foo'] = 'testString' + + # Set up parameter values + replication_document = replication_document_model + batch = 'ok' + + # Invoke method + response = _service.post_replicator( + replication_document, + batch=batch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'batch={}'.format(batch) in query_string + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) + + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == replication_document + + def test_post_replicator_all_params_with_retries(self): + # Enable retries and run test_post_replicator_all_params. + _service.enable_retries() + self.test_post_replicator_all_params() + + # Disable retries and run test_post_replicator_all_params. + _service.disable_retries() + self.test_post_replicator_all_params() + + @responses.activate + def test_post_replicator_required_params(self): + """ + test_post_replicator_required_params() + """ + # Set up mock + url = preprocess_url('/_replicator') + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a Attachment model + attachment_model = {} + attachment_model['content_type'] = 'testString' + attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' + attachment_model['digest'] = 'testString' + attachment_model['encoded_length'] = 0 + attachment_model['encoding'] = 'testString' + attachment_model['follows'] = True + attachment_model['length'] = 0 + attachment_model['revpos'] = 1 + attachment_model['stub'] = True + + # Construct a dict representation of a Revisions model + revisions_model = {} + revisions_model['ids'] = ['testString'] + revisions_model['start'] = 1 + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = {} + document_revision_status_model['rev'] = 'testString' + document_revision_status_model['status'] = 'available' + + # Construct a dict representation of a ReplicationCreateTargetParameters model + replication_create_target_parameters_model = {} + replication_create_target_parameters_model['n'] = 3 + replication_create_target_parameters_model['partitioned'] = False + replication_create_target_parameters_model['q'] = 1 + + # Construct a dict representation of a ReplicationDatabaseAuthBasic model + replication_database_auth_basic_model = {} + replication_database_auth_basic_model['password'] = 'testString' + replication_database_auth_basic_model['username'] = 'testString' + + # Construct a dict representation of a ReplicationDatabaseAuthIam model + replication_database_auth_iam_model = {} + replication_database_auth_iam_model['api_key'] = 'testString' + + # Construct a dict representation of a ReplicationDatabaseAuth model + replication_database_auth_model = {} + replication_database_auth_model['basic'] = replication_database_auth_basic_model + replication_database_auth_model['iam'] = replication_database_auth_iam_model + + # Construct a dict representation of a ReplicationDatabase model + replication_database_model = {} + replication_database_model['auth'] = replication_database_auth_model + replication_database_model['headers'] = {'key1': 'testString'} + replication_database_model['url'] = 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb' + + # Construct a dict representation of a UserContext model + user_context_model = {} + user_context_model['db'] = 'testString' + user_context_model['name'] = 'john' + user_context_model['roles'] = ['_replicator'] + + # Construct a dict representation of a ReplicationDocument model + replication_document_model = {} + replication_document_model['_attachments'] = {'key1': attachment_model} + replication_document_model['_conflicts'] = ['testString'] + replication_document_model['_deleted'] = True + replication_document_model['_deleted_conflicts'] = ['testString'] + replication_document_model['_id'] = 'testString' + replication_document_model['_local_seq'] = 'testString' + replication_document_model['_rev'] = 'testString' + replication_document_model['_revisions'] = revisions_model + replication_document_model['_revs_info'] = [document_revision_status_model] + replication_document_model['cancel'] = False + replication_document_model['checkpoint_interval'] = 4500 + replication_document_model['connection_timeout'] = 15000 + replication_document_model['continuous'] = True + replication_document_model['create_target'] = True + replication_document_model['create_target_params'] = replication_create_target_parameters_model + replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] + replication_document_model['filter'] = 'ddoc/my_filter' + replication_document_model['http_connections'] = 10 + replication_document_model['owner'] = 'testString' + replication_document_model['query_params'] = {'key1': 'testString'} + replication_document_model['retries_per_request'] = 3 + replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} + replication_document_model['since_seq'] = '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU' + replication_document_model['socket_options'] = '[{keepalive, true}, {nodelay, false}]' + replication_document_model['source'] = replication_database_model + replication_document_model['source_proxy'] = 'testString' + replication_document_model['target'] = replication_database_model + replication_document_model['target_proxy'] = 'testString' + replication_document_model['use_bulk_get'] = True + replication_document_model['use_checkpoints'] = False + replication_document_model['user_ctx'] = user_context_model + replication_document_model['winning_revs_only'] = False + replication_document_model['worker_batch_size'] = 400 + replication_document_model['worker_processes'] = 3 + replication_document_model['foo'] = 'testString' + + # Set up parameter values + replication_document = replication_document_model + + # Invoke method + response = _service.post_replicator( + replication_document, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Decompress gzip compressed request body. + raw_body = responses.calls[0].request.body + responses.calls[0].request.body = gzip.decompress(raw_body.read() if isinstance(raw_body, io.IOBase) else raw_body) + + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == replication_document + + def test_post_replicator_required_params_with_retries(self): + # Enable retries and run test_post_replicator_required_params. + _service.enable_retries() + self.test_post_replicator_required_params() + + # Disable retries and run test_post_replicator_required_params. + _service.disable_retries() + self.test_post_replicator_required_params() + + @responses.activate + def test_post_replicator_value_error(self): + """ + test_post_replicator_value_error() + """ + # Set up mock + url = preprocess_url('/_replicator') + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a Attachment model + attachment_model = {} + attachment_model['content_type'] = 'testString' + attachment_model['data'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=' + attachment_model['digest'] = 'testString' + attachment_model['encoded_length'] = 0 + attachment_model['encoding'] = 'testString' + attachment_model['follows'] = True + attachment_model['length'] = 0 + attachment_model['revpos'] = 1 + attachment_model['stub'] = True + + # Construct a dict representation of a Revisions model + revisions_model = {} + revisions_model['ids'] = ['testString'] + revisions_model['start'] = 1 + + # Construct a dict representation of a DocumentRevisionStatus model + document_revision_status_model = {} + document_revision_status_model['rev'] = 'testString' + document_revision_status_model['status'] = 'available' + + # Construct a dict representation of a ReplicationCreateTargetParameters model + replication_create_target_parameters_model = {} + replication_create_target_parameters_model['n'] = 3 + replication_create_target_parameters_model['partitioned'] = False + replication_create_target_parameters_model['q'] = 1 + + # Construct a dict representation of a ReplicationDatabaseAuthBasic model + replication_database_auth_basic_model = {} + replication_database_auth_basic_model['password'] = 'testString' + replication_database_auth_basic_model['username'] = 'testString' + + # Construct a dict representation of a ReplicationDatabaseAuthIam model + replication_database_auth_iam_model = {} + replication_database_auth_iam_model['api_key'] = 'testString' + + # Construct a dict representation of a ReplicationDatabaseAuth model + replication_database_auth_model = {} + replication_database_auth_model['basic'] = replication_database_auth_basic_model + replication_database_auth_model['iam'] = replication_database_auth_iam_model + + # Construct a dict representation of a ReplicationDatabase model + replication_database_model = {} + replication_database_model['auth'] = replication_database_auth_model + replication_database_model['headers'] = {'key1': 'testString'} + replication_database_model['url'] = 'https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb' + + # Construct a dict representation of a UserContext model + user_context_model = {} + user_context_model['db'] = 'testString' + user_context_model['name'] = 'john' + user_context_model['roles'] = ['_replicator'] + + # Construct a dict representation of a ReplicationDocument model + replication_document_model = {} + replication_document_model['_attachments'] = {'key1': attachment_model} + replication_document_model['_conflicts'] = ['testString'] + replication_document_model['_deleted'] = True + replication_document_model['_deleted_conflicts'] = ['testString'] + replication_document_model['_id'] = 'testString' + replication_document_model['_local_seq'] = 'testString' + replication_document_model['_rev'] = 'testString' + replication_document_model['_revisions'] = revisions_model + replication_document_model['_revs_info'] = [document_revision_status_model] + replication_document_model['cancel'] = False + replication_document_model['checkpoint_interval'] = 4500 + replication_document_model['connection_timeout'] = 15000 + replication_document_model['continuous'] = True + replication_document_model['create_target'] = True + replication_document_model['create_target_params'] = replication_create_target_parameters_model + replication_document_model['doc_ids'] = ['badger', 'lemur', 'llama'] + replication_document_model['filter'] = 'ddoc/my_filter' + replication_document_model['http_connections'] = 10 + replication_document_model['owner'] = 'testString' + replication_document_model['query_params'] = {'key1': 'testString'} + replication_document_model['retries_per_request'] = 3 + replication_document_model['selector'] = {'_id': {'$regex': 'docid'}} + replication_document_model['since_seq'] = '34-g1AAAAGjeJzLYWBgYMlgTmGQT0lKzi9KdU' + replication_document_model['socket_options'] = '[{keepalive, true}, {nodelay, false}]' + replication_document_model['source'] = replication_database_model + replication_document_model['source_proxy'] = 'testString' + replication_document_model['target'] = replication_database_model + replication_document_model['target_proxy'] = 'testString' + replication_document_model['use_bulk_get'] = True + replication_document_model['use_checkpoints'] = False + replication_document_model['user_ctx'] = user_context_model + replication_document_model['winning_revs_only'] = False + replication_document_model['worker_batch_size'] = 400 + replication_document_model['worker_processes'] = 3 + replication_document_model['foo'] = 'testString' + + # Set up parameter values + replication_document = replication_document_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "replication_document": replication_document, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.post_replicator(**req_copy) + + def test_post_replicator_value_error_with_retries(self): + # Enable retries and run test_post_replicator_value_error. + _service.enable_retries() + self.test_post_replicator_value_error() + + # Disable retries and run test_post_replicator_value_error. + _service.disable_retries() + self.test_post_replicator_value_error() + + +class TestDeleteReplicationDocument: + """ + Test Class for delete_replication_document + """ + + @responses.activate + def test_delete_replication_document_all_params(self): + """ + delete_replication_document() + """ + # Set up mock + url = preprocess_url('/_replicator/testString') + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + doc_id = 'testString' + if_match = 'testString' + batch = 'ok' + rev = 'testString' + + # Invoke method + response = _service.delete_replication_document( + doc_id, + if_match=if_match, + batch=batch, + rev=rev, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'batch={}'.format(batch) in query_string + assert 'rev={}'.format(rev) in query_string + + def test_delete_replication_document_all_params_with_retries(self): + # Enable retries and run test_delete_replication_document_all_params. + _service.enable_retries() + self.test_delete_replication_document_all_params() + + # Disable retries and run test_delete_replication_document_all_params. + _service.disable_retries() + self.test_delete_replication_document_all_params() + + @responses.activate + def test_delete_replication_document_required_params(self): + """ + test_delete_replication_document_required_params() + """ + # Set up mock + url = preprocess_url('/_replicator/testString') + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + doc_id = 'testString' + + # Invoke method + response = _service.delete_replication_document( + doc_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 assert response.status_code == 200 def test_delete_replication_document_required_params_with_retries(self): @@ -9581,7 +9996,7 @@ def test_delete_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -9624,7 +10039,7 @@ def test_get_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 16}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9697,7 +10112,7 @@ def test_get_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 16}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9735,7 +10150,7 @@ def test_get_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 1}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' + 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"}], "cancel": true, "checkpoint_interval": 30000, "connection_timeout": 30000, "continuous": false, "create_target": false, "create_target_params": {"n": 3, "partitioned": false, "q": 16}, "doc_ids": ["doc_ids"], "filter": "filter", "http_connections": 20, "owner": "owner", "query_params": {"mapKey": "inner"}, "retries_per_request": 5, "selector": {"anyKey": "anyValue"}, "since_seq": "since_seq", "socket_options": "socket_options", "source": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "source_proxy": "source_proxy", "target": {"auth": {"basic": {"password": "password", "username": "username"}, "iam": {"api_key": "api_key"}}, "headers": {"mapKey": "inner"}, "url": "url"}, "target_proxy": "target_proxy", "use_bulk_get": true, "use_checkpoints": true, "user_ctx": {"db": "db", "name": "name", "roles": ["_reader"]}, "winning_revs_only": false, "worker_batch_size": 500, "worker_processes": 4}' responses.add( responses.GET, url, @@ -9778,7 +10193,7 @@ def test_put_replication_document_all_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -9931,7 +10346,7 @@ def test_put_replication_document_required_params(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -10070,7 +10485,7 @@ def test_put_replication_document_value_error(self): """ # Set up mock url = preprocess_url('/_replicator/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -10642,99 +11057,56 @@ def test_new_instance_without_authenticator(self): ) -class TestGetSecurity: +class TestPostApiKeys: """ - Test Class for get_security + Test Class for post_api_keys """ @responses.activate - def test_get_security_all_params(self): + def test_post_api_keys_all_params(self): """ - get_security() + post_api_keys() """ # Set up mock - url = preprocess_url('/testString/_security') - mock_response = '{"admins": {"names": ["names"], "roles": ["roles"]}, "members": {"names": ["names"], "roles": ["roles"]}, "cloudant": {"mapKey": ["_reader"]}, "couchdb_auth_only": false}' + url = preprocess_url('/_api/v2/api_keys') + mock_response = '{"ok": true, "key": "key", "password": "password"}' responses.add( - responses.GET, + responses.POST, url, body=mock_response, content_type='application/json', - status=200, + status=201, ) - # Set up parameter values - db = 'testString' - # Invoke method - response = _service.get_security( - db, - headers={}, - ) + response = _service.post_api_keys() # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_security_all_params_with_retries(self): - # Enable retries and run test_get_security_all_params. - _service.enable_retries() - self.test_get_security_all_params() - - # Disable retries and run test_get_security_all_params. - _service.disable_retries() - self.test_get_security_all_params() - - @responses.activate - def test_get_security_value_error(self): - """ - test_get_security_value_error() - """ - # Set up mock - url = preprocess_url('/testString/_security') - mock_response = '{"admins": {"names": ["names"], "roles": ["roles"]}, "members": {"names": ["names"], "roles": ["roles"]}, "cloudant": {"mapKey": ["_reader"]}, "couchdb_auth_only": false}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Set up parameter values - db = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "db": db, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.get_security(**req_copy) + assert response.status_code == 201 - def test_get_security_value_error_with_retries(self): - # Enable retries and run test_get_security_value_error. + def test_post_api_keys_all_params_with_retries(self): + # Enable retries and run test_post_api_keys_all_params. _service.enable_retries() - self.test_get_security_value_error() + self.test_post_api_keys_all_params() - # Disable retries and run test_get_security_value_error. + # Disable retries and run test_post_api_keys_all_params. _service.disable_retries() - self.test_get_security_value_error() + self.test_post_api_keys_all_params() -class TestPutSecurity: +class TestPutCloudantSecurityConfiguration: """ - Test Class for put_security + Test Class for put_cloudant_security_configuration """ @responses.activate - def test_put_security_all_params(self): + def test_put_cloudant_security_configuration_all_params(self): """ - put_security() + put_cloudant_security_configuration() """ # Set up mock - url = preprocess_url('/testString/_security') + url = preprocess_url('/_api/v2/db/testString/_security') mock_response = '{"ok": true}' responses.add( responses.PUT, @@ -10746,23 +11118,23 @@ def test_put_security_all_params(self): # Construct a dict representation of a SecurityObject model security_object_model = {} - security_object_model['names'] = ['superuser'] - security_object_model['roles'] = ['admins'] + security_object_model['names'] = ['testString'] + security_object_model['roles'] = ['testString'] # Set up parameter values db = 'testString' - admins = security_object_model - members = security_object_model cloudant = {'key1': ['_reader']} + admins = security_object_model couchdb_auth_only = True + members = security_object_model # Invoke method - response = _service.put_security( + response = _service.put_cloudant_security_configuration( db, + cloudant, admins=admins, - members=members, - cloudant=cloudant, couchdb_auth_only=couchdb_auth_only, + members=members, headers={}, ) @@ -10775,27 +11147,27 @@ def test_put_security_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['admins'] == security_object_model - assert req_body['members'] == security_object_model assert req_body['cloudant'] == {'key1': ['_reader']} + assert req_body['admins'] == security_object_model assert req_body['couchdb_auth_only'] == True + assert req_body['members'] == security_object_model - def test_put_security_all_params_with_retries(self): - # Enable retries and run test_put_security_all_params. + def test_put_cloudant_security_configuration_all_params_with_retries(self): + # Enable retries and run test_put_cloudant_security_configuration_all_params. _service.enable_retries() - self.test_put_security_all_params() + self.test_put_cloudant_security_configuration_all_params() - # Disable retries and run test_put_security_all_params. + # Disable retries and run test_put_cloudant_security_configuration_all_params. _service.disable_retries() - self.test_put_security_all_params() + self.test_put_cloudant_security_configuration_all_params() @responses.activate - def test_put_security_value_error(self): + def test_put_cloudant_security_configuration_value_error(self): """ - test_put_security_value_error() + test_put_cloudant_security_configuration_value_error() """ # Set up mock - url = preprocess_url('/testString/_security') + url = preprocess_url('/_api/v2/db/testString/_security') mock_response = '{"ok": true}' responses.add( responses.PUT, @@ -10807,85 +11179,129 @@ def test_put_security_value_error(self): # Construct a dict representation of a SecurityObject model security_object_model = {} - security_object_model['names'] = ['superuser'] - security_object_model['roles'] = ['admins'] + security_object_model['names'] = ['testString'] + security_object_model['roles'] = ['testString'] # Set up parameter values db = 'testString' - admins = security_object_model - members = security_object_model cloudant = {'key1': ['_reader']} + admins = security_object_model couchdb_auth_only = True + members = security_object_model # Pass in all but one required param and check for a ValueError req_param_dict = { "db": db, + "cloudant": cloudant, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.put_security(**req_copy) + _service.put_cloudant_security_configuration(**req_copy) - def test_put_security_value_error_with_retries(self): - # Enable retries and run test_put_security_value_error. + def test_put_cloudant_security_configuration_value_error_with_retries(self): + # Enable retries and run test_put_cloudant_security_configuration_value_error. _service.enable_retries() - self.test_put_security_value_error() + self.test_put_cloudant_security_configuration_value_error() - # Disable retries and run test_put_security_value_error. + # Disable retries and run test_put_cloudant_security_configuration_value_error. _service.disable_retries() - self.test_put_security_value_error() + self.test_put_cloudant_security_configuration_value_error() -class TestPostApiKeys: +class TestGetSecurity: """ - Test Class for post_api_keys + Test Class for get_security """ @responses.activate - def test_post_api_keys_all_params(self): + def test_get_security_all_params(self): """ - post_api_keys() + get_security() """ # Set up mock - url = preprocess_url('/_api/v2/api_keys') - mock_response = '{"ok": true, "key": "key", "password": "password"}' + url = preprocess_url('/testString/_security') + mock_response = '{"admins": {"names": ["names"], "roles": ["roles"]}, "cloudant": {"mapKey": ["_reader"]}, "couchdb_auth_only": false, "members": {"names": ["names"], "roles": ["roles"]}}' responses.add( - responses.POST, + responses.GET, url, body=mock_response, content_type='application/json', - status=201, + status=200, ) + # Set up parameter values + db = 'testString' + # Invoke method - response = _service.post_api_keys() + response = _service.get_security( + db, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 201 + assert response.status_code == 200 + + def test_get_security_all_params_with_retries(self): + # Enable retries and run test_get_security_all_params. + _service.enable_retries() + self.test_get_security_all_params() + + # Disable retries and run test_get_security_all_params. + _service.disable_retries() + self.test_get_security_all_params() + + @responses.activate + def test_get_security_value_error(self): + """ + test_get_security_value_error() + """ + # Set up mock + url = preprocess_url('/testString/_security') + mock_response = '{"admins": {"names": ["names"], "roles": ["roles"]}, "cloudant": {"mapKey": ["_reader"]}, "couchdb_auth_only": false, "members": {"names": ["names"], "roles": ["roles"]}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + db = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "db": db, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_security(**req_copy) - def test_post_api_keys_all_params_with_retries(self): - # Enable retries and run test_post_api_keys_all_params. + def test_get_security_value_error_with_retries(self): + # Enable retries and run test_get_security_value_error. _service.enable_retries() - self.test_post_api_keys_all_params() + self.test_get_security_value_error() - # Disable retries and run test_post_api_keys_all_params. + # Disable retries and run test_get_security_value_error. _service.disable_retries() - self.test_post_api_keys_all_params() + self.test_get_security_value_error() -class TestPutCloudantSecurityConfiguration: +class TestPutSecurity: """ - Test Class for put_cloudant_security_configuration + Test Class for put_security """ @responses.activate - def test_put_cloudant_security_configuration_all_params(self): + def test_put_security_all_params(self): """ - put_cloudant_security_configuration() + put_security() """ # Set up mock - url = preprocess_url('/_api/v2/db/testString/_security') + url = preprocess_url('/testString/_security') mock_response = '{"ok": true}' responses.add( responses.PUT, @@ -10897,23 +11313,23 @@ def test_put_cloudant_security_configuration_all_params(self): # Construct a dict representation of a SecurityObject model security_object_model = {} - security_object_model['names'] = ['testString'] - security_object_model['roles'] = ['testString'] + security_object_model['names'] = ['superuser'] + security_object_model['roles'] = ['admins'] # Set up parameter values db = 'testString' - cloudant = {'key1': ['_reader']} admins = security_object_model - members = security_object_model + cloudant = {'key1': ['_reader']} couchdb_auth_only = True + members = security_object_model # Invoke method - response = _service.put_cloudant_security_configuration( + response = _service.put_security( db, - cloudant, admins=admins, - members=members, + cloudant=cloudant, couchdb_auth_only=couchdb_auth_only, + members=members, headers={}, ) @@ -10926,27 +11342,27 @@ def test_put_cloudant_security_configuration_all_params(self): # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['cloudant'] == {'key1': ['_reader']} assert req_body['admins'] == security_object_model - assert req_body['members'] == security_object_model + assert req_body['cloudant'] == {'key1': ['_reader']} assert req_body['couchdb_auth_only'] == True + assert req_body['members'] == security_object_model - def test_put_cloudant_security_configuration_all_params_with_retries(self): - # Enable retries and run test_put_cloudant_security_configuration_all_params. + def test_put_security_all_params_with_retries(self): + # Enable retries and run test_put_security_all_params. _service.enable_retries() - self.test_put_cloudant_security_configuration_all_params() + self.test_put_security_all_params() - # Disable retries and run test_put_cloudant_security_configuration_all_params. + # Disable retries and run test_put_security_all_params. _service.disable_retries() - self.test_put_cloudant_security_configuration_all_params() + self.test_put_security_all_params() @responses.activate - def test_put_cloudant_security_configuration_value_error(self): + def test_put_security_value_error(self): """ - test_put_cloudant_security_configuration_value_error() + test_put_security_value_error() """ # Set up mock - url = preprocess_url('/_api/v2/db/testString/_security') + url = preprocess_url('/testString/_security') mock_response = '{"ok": true}' responses.add( responses.PUT, @@ -10958,34 +11374,33 @@ def test_put_cloudant_security_configuration_value_error(self): # Construct a dict representation of a SecurityObject model security_object_model = {} - security_object_model['names'] = ['testString'] - security_object_model['roles'] = ['testString'] + security_object_model['names'] = ['superuser'] + security_object_model['roles'] = ['admins'] # Set up parameter values db = 'testString' - cloudant = {'key1': ['_reader']} admins = security_object_model - members = security_object_model + cloudant = {'key1': ['_reader']} couchdb_auth_only = True + members = security_object_model # Pass in all but one required param and check for a ValueError req_param_dict = { "db": db, - "cloudant": cloudant, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.put_cloudant_security_configuration(**req_copy) + _service.put_security(**req_copy) - def test_put_cloudant_security_configuration_value_error_with_retries(self): - # Enable retries and run test_put_cloudant_security_configuration_value_error. + def test_put_security_value_error_with_retries(self): + # Enable retries and run test_put_security_value_error. _service.enable_retries() - self.test_put_cloudant_security_configuration_value_error() + self.test_put_security_value_error() - # Disable retries and run test_put_cloudant_security_configuration_value_error. + # Disable retries and run test_put_security_value_error. _service.disable_retries() - self.test_put_cloudant_security_configuration_value_error() + self.test_put_security_value_error() # endregion @@ -11344,7 +11759,7 @@ def test_delete_attachment_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -11397,7 +11812,7 @@ def test_delete_attachment_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -11439,7 +11854,7 @@ def test_delete_attachment_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -11629,7 +12044,7 @@ def test_put_attachment_all_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -11688,7 +12103,7 @@ def test_put_attachment_required_params(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -11739,7 +12154,7 @@ def test_put_attachment_value_error(self): """ # Set up mock url = preprocess_url('/testString/testString/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -11947,7 +12362,7 @@ def test_delete_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -11993,7 +12408,7 @@ def test_delete_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -12033,7 +12448,7 @@ def test_delete_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.DELETE, url, @@ -12219,7 +12634,7 @@ def test_put_local_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -12318,7 +12733,7 @@ def test_put_local_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -12409,7 +12824,7 @@ def test_put_local_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_local/testString') - mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 3}' + mock_response = '{"id": "id", "rev": "rev", "ok": true, "caused_by": "caused_by", "error": "error", "reason": "reason", "ref": 0}' responses.add( responses.PUT, url, @@ -12897,82 +13312,6 @@ def test_get_active_tasks_all_params_with_retries(self): self.test_get_active_tasks_all_params() -class TestGetMembershipInformation: - """ - Test Class for get_membership_information - """ - - @responses.activate - def test_get_membership_information_all_params(self): - """ - get_membership_information() - """ - # Set up mock - url = preprocess_url('/_membership') - mock_response = '{"all_nodes": ["all_nodes"], "cluster_nodes": ["cluster_nodes"]}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Invoke method - response = _service.get_membership_information() - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_membership_information_all_params_with_retries(self): - # Enable retries and run test_get_membership_information_all_params. - _service.enable_retries() - self.test_get_membership_information_all_params() - - # Disable retries and run test_get_membership_information_all_params. - _service.disable_retries() - self.test_get_membership_information_all_params() - - -class TestGetUpInformation: - """ - Test Class for get_up_information - """ - - @responses.activate - def test_get_up_information_all_params(self): - """ - get_up_information() - """ - # Set up mock - url = preprocess_url('/_up') - mock_response = '{"seeds": {"anyKey": "anyValue"}, "status": "maintenance_mode"}' - responses.add( - responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200, - ) - - # Invoke method - response = _service.get_up_information() - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_up_information_all_params_with_retries(self): - # Enable retries and run test_get_up_information_all_params. - _service.enable_retries() - self.test_get_up_information_all_params() - - # Disable retries and run test_get_up_information_all_params. - _service.disable_retries() - self.test_get_up_information_all_params() - - class TestGetActivityTrackerEvents: """ Test Class for get_activity_tracker_events @@ -13137,6 +13476,82 @@ def test_get_current_throughput_information_all_params_with_retries(self): self.test_get_current_throughput_information_all_params() +class TestGetMembershipInformation: + """ + Test Class for get_membership_information + """ + + @responses.activate + def test_get_membership_information_all_params(self): + """ + get_membership_information() + """ + # Set up mock + url = preprocess_url('/_membership') + mock_response = '{"all_nodes": ["all_nodes"], "cluster_nodes": ["cluster_nodes"]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.get_membership_information() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_membership_information_all_params_with_retries(self): + # Enable retries and run test_get_membership_information_all_params. + _service.enable_retries() + self.test_get_membership_information_all_params() + + # Disable retries and run test_get_membership_information_all_params. + _service.disable_retries() + self.test_get_membership_information_all_params() + + +class TestGetUpInformation: + """ + Test Class for get_up_information + """ + + @responses.activate + def test_get_up_information_all_params(self): + """ + get_up_information() + """ + # Set up mock + url = preprocess_url('/_up') + mock_response = '{"seeds": {"anyKey": "anyValue"}, "status": "maintenance_mode"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.get_up_information() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_up_information_all_params_with_retries(self): + # Enable retries and run test_get_up_information_all_params. + _service.enable_retries() + self.test_get_up_information_all_params() + + # Disable retries and run test_get_up_information_all_params. + _service.disable_retries() + self.test_get_up_information_all_params() + + # endregion ############################################################################## # End of Service: Monitoring @@ -13293,7 +13708,7 @@ def test_all_docs_queries_result_serialization(self): docs_result_row_model['caused_by'] = 'testString' docs_result_row_model['error'] = 'testString' docs_result_row_model['reason'] = 'testString' - docs_result_row_model['ref'] = 26 + docs_result_row_model['ref'] = 0 docs_result_row_model['doc'] = document_model docs_result_row_model['id'] = 'testString' docs_result_row_model['key'] = 'testString' @@ -13417,7 +13832,7 @@ def test_all_docs_result_serialization(self): docs_result_row_model['caused_by'] = 'testString' docs_result_row_model['error'] = 'testString' docs_result_row_model['reason'] = 'testString' - docs_result_row_model['ref'] = 26 + docs_result_row_model['ref'] = 0 docs_result_row_model['doc'] = document_model docs_result_row_model['id'] = 'testString' docs_result_row_model['key'] = 'testString' @@ -13699,7 +14114,7 @@ def test_bulk_get_result_serialization(self): document_result_model['caused_by'] = 'testString' document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' - document_result_model['ref'] = 26 + document_result_model['ref'] = 0 attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' @@ -13779,7 +14194,7 @@ def test_bulk_get_result_document_serialization(self): document_result_model['caused_by'] = 'testString' document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' - document_result_model['ref'] = 26 + document_result_model['ref'] = 0 attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' @@ -13852,7 +14267,7 @@ def test_bulk_get_result_item_serialization(self): document_result_model['caused_by'] = 'testString' document_result_model['error'] = 'testString' document_result_model['reason'] = 'testString' - document_result_model['ref'] = 26 + document_result_model['ref'] = 0 attachment_model = {} # Attachment attachment_model['content_type'] = 'testString' @@ -14117,7 +14532,7 @@ def test_changes_result_serialization(self): # Construct a json representation of a ChangesResult model changes_result_model_json = {} changes_result_model_json['last_seq'] = 'testString' - changes_result_model_json['pending'] = 26 + changes_result_model_json['pending'] = 0 changes_result_model_json['results'] = [changes_result_item_model] # Construct a model instance of ChangesResult by calling from_dict on the json representation @@ -14218,9 +14633,9 @@ def test_content_information_sizes_serialization(self): # Construct a json representation of a ContentInformationSizes model content_information_sizes_model_json = {} - content_information_sizes_model_json['active'] = 26 - content_information_sizes_model_json['external'] = 26 - content_information_sizes_model_json['file'] = 26 + content_information_sizes_model_json['active'] = 0 + content_information_sizes_model_json['external'] = 0 + content_information_sizes_model_json['file'] = 0 # Construct a model instance of ContentInformationSizes by calling from_dict on the json representation content_information_sizes_model = ContentInformationSizes.from_dict(content_information_sizes_model_json) @@ -14353,18 +14768,10 @@ def test_database_information_serialization(self): database_information_cluster_model = {} # DatabaseInformationCluster database_information_cluster_model['n'] = 3 - database_information_cluster_model['q'] = 26 + database_information_cluster_model['q'] = 16 database_information_cluster_model['r'] = 1 database_information_cluster_model['w'] = 1 - database_information_props_model = {} # DatabaseInformationProps - database_information_props_model['partitioned'] = True - - content_information_sizes_model = {} # ContentInformationSizes - content_information_sizes_model['active'] = 26 - content_information_sizes_model['external'] = 26 - content_information_sizes_model['file'] = 26 - partitioned_indexes_detailed_information_model = {} # PartitionedIndexesDetailedInformation partitioned_indexes_detailed_information_model['search'] = 0 partitioned_indexes_detailed_information_model['view'] = 0 @@ -14374,6 +14781,14 @@ def test_database_information_serialization(self): partitioned_indexes_information_model['indexes'] = partitioned_indexes_detailed_information_model partitioned_indexes_information_model['limit'] = 10 + database_information_props_model = {} # DatabaseInformationProps + database_information_props_model['partitioned'] = True + + content_information_sizes_model = {} # ContentInformationSizes + content_information_sizes_model['active'] = 0 + content_information_sizes_model['external'] = 0 + content_information_sizes_model['file'] = 0 + # Construct a json representation of a DatabaseInformation model database_information_model_json = {} database_information_model_json['cluster'] = database_information_cluster_model @@ -14381,16 +14796,16 @@ def test_database_information_serialization(self): database_information_model_json['compact_running'] = True database_information_model_json['compacted_seq'] = 'testString' database_information_model_json['db_name'] = 'testString' - database_information_model_json['disk_format_version'] = 26 + database_information_model_json['disk_format_version'] = 1 database_information_model_json['doc_count'] = 0 database_information_model_json['doc_del_count'] = 0 database_information_model_json['engine'] = 'testString' database_information_model_json['instance_start_time'] = 'testString' + database_information_model_json['partitioned_indexes'] = partitioned_indexes_information_model database_information_model_json['props'] = database_information_props_model database_information_model_json['sizes'] = content_information_sizes_model database_information_model_json['update_seq'] = 'testString' database_information_model_json['uuid'] = 'testString' - database_information_model_json['partitioned_indexes'] = partitioned_indexes_information_model # Construct a model instance of DatabaseInformation by calling from_dict on the json representation database_information_model = DatabaseInformation.from_dict(database_information_model_json) @@ -14421,7 +14836,7 @@ def test_database_information_cluster_serialization(self): # Construct a json representation of a DatabaseInformationCluster model database_information_cluster_model_json = {} database_information_cluster_model_json['n'] = 3 - database_information_cluster_model_json['q'] = 26 + database_information_cluster_model_json['q'] = 16 database_information_cluster_model_json['r'] = 1 database_information_cluster_model_json['w'] = 1 @@ -14555,18 +14970,10 @@ def test_dbs_info_result_serialization(self): database_information_cluster_model = {} # DatabaseInformationCluster database_information_cluster_model['n'] = 3 - database_information_cluster_model['q'] = 26 + database_information_cluster_model['q'] = 16 database_information_cluster_model['r'] = 1 database_information_cluster_model['w'] = 1 - database_information_props_model = {} # DatabaseInformationProps - database_information_props_model['partitioned'] = True - - content_information_sizes_model = {} # ContentInformationSizes - content_information_sizes_model['active'] = 26 - content_information_sizes_model['external'] = 26 - content_information_sizes_model['file'] = 26 - partitioned_indexes_detailed_information_model = {} # PartitionedIndexesDetailedInformation partitioned_indexes_detailed_information_model['search'] = 0 partitioned_indexes_detailed_information_model['view'] = 0 @@ -14576,22 +14983,30 @@ def test_dbs_info_result_serialization(self): partitioned_indexes_information_model['indexes'] = partitioned_indexes_detailed_information_model partitioned_indexes_information_model['limit'] = 10 + database_information_props_model = {} # DatabaseInformationProps + database_information_props_model['partitioned'] = True + + content_information_sizes_model = {} # ContentInformationSizes + content_information_sizes_model['active'] = 0 + content_information_sizes_model['external'] = 0 + content_information_sizes_model['file'] = 0 + database_information_model = {} # DatabaseInformation database_information_model['cluster'] = database_information_cluster_model database_information_model['committed_update_seq'] = 'testString' database_information_model['compact_running'] = True database_information_model['compacted_seq'] = 'testString' database_information_model['db_name'] = 'testString' - database_information_model['disk_format_version'] = 26 + database_information_model['disk_format_version'] = 1 database_information_model['doc_count'] = 0 database_information_model['doc_del_count'] = 0 database_information_model['engine'] = 'testString' database_information_model['instance_start_time'] = 'testString' + database_information_model['partitioned_indexes'] = partitioned_indexes_information_model database_information_model['props'] = database_information_props_model database_information_model['sizes'] = content_information_sizes_model database_information_model['update_seq'] = 'testString' database_information_model['uuid'] = 'testString' - database_information_model['partitioned_indexes'] = partitioned_indexes_information_model # Construct a json representation of a DbsInfoResult model dbs_info_result_model_json = {} @@ -14725,14 +15140,14 @@ def test_design_document_information_serialization(self): # Construct dict forms of any model objects needed in order to build this model. content_information_sizes_model = {} # ContentInformationSizes - content_information_sizes_model['active'] = 26 - content_information_sizes_model['external'] = 26 - content_information_sizes_model['file'] = 26 + content_information_sizes_model['active'] = 0 + content_information_sizes_model['external'] = 0 + content_information_sizes_model['file'] = 0 updates_pending_model = {} # UpdatesPending - updates_pending_model['minimum'] = 26 - updates_pending_model['preferred'] = 26 - updates_pending_model['total'] = 26 + updates_pending_model['minimum'] = 0 + updates_pending_model['preferred'] = 0 + updates_pending_model['total'] = 0 design_document_view_index_model = {} # DesignDocumentViewIndex design_document_view_index_model['collator_versions'] = ['testString'] @@ -14809,14 +15224,14 @@ def test_design_document_view_index_serialization(self): # Construct dict forms of any model objects needed in order to build this model. content_information_sizes_model = {} # ContentInformationSizes - content_information_sizes_model['active'] = 26 - content_information_sizes_model['external'] = 26 - content_information_sizes_model['file'] = 26 + content_information_sizes_model['active'] = 0 + content_information_sizes_model['external'] = 0 + content_information_sizes_model['file'] = 0 updates_pending_model = {} # UpdatesPending - updates_pending_model['minimum'] = 26 - updates_pending_model['preferred'] = 26 - updates_pending_model['total'] = 26 + updates_pending_model['minimum'] = 0 + updates_pending_model['preferred'] = 0 + updates_pending_model['total'] = 0 # Construct a json representation of a DesignDocumentViewIndex model design_document_view_index_model_json = {} @@ -14929,7 +15344,7 @@ def test_docs_result_row_serialization(self): docs_result_row_model_json['caused_by'] = 'testString' docs_result_row_model_json['error'] = 'testString' docs_result_row_model_json['reason'] = 'testString' - docs_result_row_model_json['ref'] = 26 + docs_result_row_model_json['ref'] = 0 docs_result_row_model_json['doc'] = document_model docs_result_row_model_json['id'] = 'testString' docs_result_row_model_json['key'] = 'testString' @@ -15070,7 +15485,7 @@ def test_document_result_serialization(self): document_result_model_json['caused_by'] = 'testString' document_result_model_json['error'] = 'testString' document_result_model_json['reason'] = 'testString' - document_result_model_json['ref'] = 26 + document_result_model_json['ref'] = 0 # Construct a model instance of DocumentResult by calling from_dict on the json representation document_result_model = DocumentResult.from_dict(document_result_model_json) @@ -15238,7 +15653,7 @@ def test_explain_result_serialization(self): explain_result_mr_args_model = {} # ExplainResultMrArgs explain_result_mr_args_model['conflicts'] = 'testString' - explain_result_mr_args_model['direction'] = 'asc' + explain_result_mr_args_model['direction'] = 'fwd' explain_result_mr_args_model['end_key'] = 'testString' explain_result_mr_args_model['include_docs'] = True explain_result_mr_args_model['partition'] = 'testString' @@ -15312,7 +15727,7 @@ def test_explain_result_mr_args_serialization(self): # Construct a json representation of a ExplainResultMrArgs model explain_result_mr_args_model_json = {} explain_result_mr_args_model_json['conflicts'] = 'testString' - explain_result_mr_args_model_json['direction'] = 'asc' + explain_result_mr_args_model_json['direction'] = 'fwd' explain_result_mr_args_model_json['end_key'] = 'testString' explain_result_mr_args_model_json['include_docs'] = True explain_result_mr_args_model_json['partition'] = 'testString' @@ -16160,7 +16575,7 @@ def test_replication_create_target_parameters_serialization(self): replication_create_target_parameters_model_json = {} replication_create_target_parameters_model_json['n'] = 3 replication_create_target_parameters_model_json['partitioned'] = False - replication_create_target_parameters_model_json['q'] = 26 + replication_create_target_parameters_model_json['q'] = 16 # Construct a model instance of ReplicationCreateTargetParameters by calling from_dict on the json representation replication_create_target_parameters_model = ReplicationCreateTargetParameters.from_dict(replication_create_target_parameters_model_json) @@ -16358,7 +16773,7 @@ def test_replication_document_serialization(self): replication_create_target_parameters_model = {} # ReplicationCreateTargetParameters replication_create_target_parameters_model['n'] = 3 replication_create_target_parameters_model['partitioned'] = False - replication_create_target_parameters_model['q'] = 26 + replication_create_target_parameters_model['q'] = 16 replication_database_auth_basic_model = {} # ReplicationDatabaseAuthBasic replication_database_auth_basic_model['password'] = 'testString' @@ -16900,11 +17315,11 @@ def test_search_index_info_serialization(self): # Construct a json representation of a SearchIndexInfo model search_index_info_model_json = {} - search_index_info_model_json['committed_seq'] = 26 + search_index_info_model_json['committed_seq'] = 0 search_index_info_model_json['disk_size'] = 0 search_index_info_model_json['doc_count'] = 0 search_index_info_model_json['doc_del_count'] = 0 - search_index_info_model_json['pending_seq'] = 26 + search_index_info_model_json['pending_seq'] = 0 search_index_info_model_json['signature'] = 'testString' # Construct a model instance of SearchIndexInfo by calling from_dict on the json representation @@ -16936,11 +17351,11 @@ def test_search_info_result_serialization(self): # Construct dict forms of any model objects needed in order to build this model. search_index_info_model = {} # SearchIndexInfo - search_index_info_model['committed_seq'] = 26 + search_index_info_model['committed_seq'] = 0 search_index_info_model['disk_size'] = 0 search_index_info_model['doc_count'] = 0 search_index_info_model['doc_del_count'] = 0 - search_index_info_model['pending_seq'] = 26 + search_index_info_model['pending_seq'] = 0 search_index_info_model['signature'] = 'testString' # Construct a json representation of a SearchInfoResult model @@ -17206,9 +17621,9 @@ def test_security_serialization(self): # Construct a json representation of a Security model security_model_json = {} security_model_json['admins'] = security_object_model - security_model_json['members'] = security_object_model security_model_json['cloudant'] = {'key1': ['_reader']} security_model_json['couchdb_auth_only'] = True + security_model_json['members'] = security_object_model # Construct a model instance of Security by calling from_dict on the json representation security_model = Security.from_dict(security_model_json) @@ -17311,9 +17726,9 @@ def test_server_information_serialization(self): server_information_model_json = {} server_information_model_json['couchdb'] = 'testString' server_information_model_json['features'] = ['testString'] + server_information_model_json['features_flags'] = ['testString'] server_information_model_json['vendor'] = server_vendor_model server_information_model_json['version'] = 'testString' - server_information_model_json['features_flags'] = ['testString'] # Construct a model instance of ServerInformation by calling from_dict on the json representation server_information_model = ServerInformation.from_dict(server_information_model_json) @@ -17556,9 +17971,9 @@ def test_updates_pending_serialization(self): # Construct a json representation of a UpdatesPending model updates_pending_model_json = {} - updates_pending_model_json['minimum'] = 26 - updates_pending_model_json['preferred'] = 26 - updates_pending_model_json['total'] = 26 + updates_pending_model_json['minimum'] = 0 + updates_pending_model_json['preferred'] = 0 + updates_pending_model_json['total'] = 0 # Construct a model instance of UpdatesPending by calling from_dict on the json representation updates_pending_model = UpdatesPending.from_dict(updates_pending_model_json) @@ -17685,7 +18100,7 @@ def test_view_queries_result_serialization(self): view_result_row_model['caused_by'] = 'testString' view_result_row_model['error'] = 'testString' view_result_row_model['reason'] = 'testString' - view_result_row_model['ref'] = 26 + view_result_row_model['ref'] = 0 view_result_row_model['doc'] = document_model view_result_row_model['id'] = 'testString' view_result_row_model['key'] = 'testString' @@ -17812,7 +18227,7 @@ def test_view_result_serialization(self): view_result_row_model['caused_by'] = 'testString' view_result_row_model['error'] = 'testString' view_result_row_model['reason'] = 'testString' - view_result_row_model['ref'] = 26 + view_result_row_model['ref'] = 0 view_result_row_model['doc'] = document_model view_result_row_model['id'] = 'testString' view_result_row_model['key'] = 'testString' @@ -17888,7 +18303,7 @@ def test_view_result_row_serialization(self): view_result_row_model_json['caused_by'] = 'testString' view_result_row_model_json['error'] = 'testString' view_result_row_model_json['reason'] = 'testString' - view_result_row_model_json['ref'] = 26 + view_result_row_model_json['ref'] = 0 view_result_row_model_json['doc'] = document_model view_result_row_model_json['id'] = 'testString' view_result_row_model_json['key'] = 'testString' From fbf19450f64f12740285a7019ac91ac503d138ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:38:50 +0000 Subject: [PATCH 411/669] build(deps): Bump github/codeql-action from 3.27.9 to 3.28.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.9 to 3.28.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/df409f7d9260372bd5f19e5b04e83cb3c43714ae...48ab28a6f5dbc2a99bf1e0131198dd8f1df78169) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c0a1e147..60c36fbd 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 + uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 + uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 + uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 with: category: "/language:${{matrix.language}}" From 9215fed1d6c81d4aedf2d6bccea96839f7bb3285 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:09:53 +0000 Subject: [PATCH 412/669] build(deps-dev): Bump pylint from 3.3.2 to 3.3.3 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.2 to 3.3.3. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.2...v3.3.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 29f14968..d743af93 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.10.1 pytest==8.3.4 responses==0.25.3 python_dotenv==1.0.1 -pylint==3.3.2 +pylint==3.3.3 # code coverage coverage==7.6.9 pytest-cov==6.0.0 From fc4a4c0a75d03c20d582142e4efd6ae8e083f9a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:01:52 +0000 Subject: [PATCH 413/669] build(deps-dev): Bump coverage from 7.6.9 to 7.6.10 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.9 to 7.6.10. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.9...7.6.10) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d743af93..b7f83e81 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.3 python_dotenv==1.0.1 pylint==3.3.3 # code coverage -coverage==7.6.9 +coverage==7.6.10 pytest-cov==6.0.0 From 675206ed438bab5525eaeeda27bd977d4bcfade3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:21:08 +0000 Subject: [PATCH 414/669] chore(generated): 2025 updates Generated SDK source code using: - Generator version 3.98.0 - Specification version 1.0.0-dev0.1.23 - Automation (cloudant-sdks) version c1e4608 --- ibmcloudant/cloudant_v1.py | 2 +- test/integration/test_cloudant_v1.py | 2 +- test/unit/test_cloudant_v1.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 715a15c2..fbb5e11c 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 354a2f69..361001a0 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 9b71aa5d..ed5d7f89 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2024. +# (C) Copyright IBM Corp. 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From c2ef1515944651a001f0285b786930c456a3c953 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:33:14 +0000 Subject: [PATCH 415/669] build(deps): Bump ibm-cloud-sdk-core from 3.22.0 to 3.22.1 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.22.0 to 3.22.1. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.22.0...v3.22.1) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d11c824d..ceab5653 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.9.3" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.22.0", + "ibm_cloud_sdk_core==3.22.1", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From fdb1a5eb273186f0fe945e60b0cdb008717a57d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:28:34 +0000 Subject: [PATCH 416/669] build(deps-dev): Bump responses from 0.25.3 to 0.25.5 Bumps [responses](https://github.com/getsentry/responses) from 0.25.3 to 0.25.5. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.3...0.25.5) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b7f83e81..07e09f55 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.10.1 # test dependencies pytest==8.3.4 -responses==0.25.3 +responses==0.25.5 python_dotenv==1.0.1 pylint==3.3.3 # code coverage From aaa73c488a89d4480bd239dc27c463b0f6c6bee4 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:31:53 +0000 Subject: [PATCH 417/669] ci(generated): add _search_disk_size IT stub Generated SDK source code using: - Generator version 3.98.0 - Specification version 1.0.0-dev0.1.23 - Automation (cloudant-sdks) version bb9efb7 --- stubs/gen-its-mappings.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index dc40ad97..9b7f2058 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -1519,6 +1519,32 @@ }, "uuid": "8e817ede-8647-3ada-ab72-58dfc263fc30" }, + { + "id" : "bbecd8e4-e759-3d2a-959b-d5e9f94b7dd9", + "request" : { + "url" : "/testString/_design/testString/_search_disk_size/testString", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\"name\":\"_design/testString/testString\",\"search_index\":{\"disk_size\":11906}}", + "headers" : { + "X-Frame-Options" : "DENY", + "X-Cloudant-Action" : "cloudantnosqldb.any-document.read", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Cloudant", + "Cache-Control" : "must-revalidate", + "X-Content-Type-Options" : "nosniff", + "X-Cloudant-Backend" : "bigblue", + "X-Couch-Request-ID" : "6b16a74e", + "X-Cloudant-Request-Class" : "unlimited", + "Date" : "Wed, 08 Jan 2025 17:25:47 GMT", + "Via" : "1.1 lb3.bigblue (Glum)", + "Content-Type" : "application/json" + } + }, + "uuid" : "bbecd8e4-e759-3d2a-959b-d5e9f94b7dd9" + }, { "id": "e6c0db1b-cd2e-379e-b7a6-27ec75049831", "request": { From 8b9b72db20f75717bcffe59922c75c6c8dbfd909 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:10:28 +0000 Subject: [PATCH 418/669] build(deps): Bump github/codeql-action from 3.28.0 to 3.28.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.0 to 3.28.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/48ab28a6f5dbc2a99bf1e0131198dd8f1df78169...b6a472f63d85b9c78a3ac5e89422239fc15e9b3c) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 60c36fbd..1837b9fb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 with: category: "/language:${{matrix.language}}" From 56796be4754808f5eff55e43a1b15aad968b85a2 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:33:44 +0000 Subject: [PATCH 419/669] feat(generated): update API definition to 1.0.0-dev0.1.25 Generated SDK source code using: - Generator version 3.98.0 - Specification version 1.0.0-dev0.1.25 - Automation (cloudant-sdks) version bb333b3 --- ibmcloudant/cloudant_v1.py | 198 ++++++++++++++++++++++++++- test/integration/test_cloudant_v1.py | 12 ++ test/unit/test_cloudant_v1.py | 155 +++++++++++++++++++++ 3 files changed, 361 insertions(+), 4 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index fbb5e11c..768b6ab6 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -6125,6 +6125,60 @@ def post_search_as_stream( response = self.send(request, stream=True, **kwargs) return response + def get_search_disk_size( + self, + db: str, + ddoc: str, + index: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve information about the search index disk size. + + Retrieve size of the search index on disk. + + :param str db: Path parameter to specify the database name. + :param str ddoc: Path parameter to specify the design document name. The + design document name is the design document ID excluding the `_design/` + prefix. + :param str index: Path parameter to specify the index name. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `SearchDiskSizeInformation` object + """ + + if not db: + raise ValueError('db must be provided') + if not ddoc: + raise ValueError('ddoc must be provided') + if not index: + raise ValueError('index must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_search_disk_size', + ) + headers.update(sdk_headers) + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['db', 'ddoc', 'index'] + path_param_values = self.encode_path_vars(db, ddoc, index) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/{db}/_design/{ddoc}/_search_disk_size/{index}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) + return response + def get_search_info( self, db: str, @@ -6198,7 +6252,8 @@ def head_replication_document( supports the same query arguments as the `GET /_replicator/{doc_id}` method, but only headers like content length and the revision (ETag header) are returned. - :param str doc_id: Path parameter to specify the document ID. + :param str doc_id: Path parameter to specify the ID of the stored + replication configuration in the `_replicator` database. :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param dict headers: A `dict` containing the request headers @@ -6399,7 +6454,8 @@ def delete_replication_document( Cancels a replication by deleting the document that describes it from the `_replicator` database. - :param str doc_id: Path parameter to specify the document ID. + :param str doc_id: Path parameter to specify the ID of the stored + replication configuration in the `_replicator` database. :param str if_match: (optional) Header parameter for a conditional HTTP request matching an ETag. :param str batch: (optional) Query parameter to specify whether to store in @@ -6471,7 +6527,8 @@ def get_replication_document( configuration of the replication. The status of the replication is no longer recorded in the document but can be checked via the replication scheduler. - :param str doc_id: Path parameter to specify the document ID. + :param str doc_id: Path parameter to specify the ID of the stored + replication configuration in the `_replicator` database. :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to @@ -6563,7 +6620,8 @@ def put_replication_document( Creates or modifies a document in the `_replicator` database to start a new replication or to edit an existing replication. - :param str doc_id: Path parameter to specify the document ID. + :param str doc_id: Path parameter to specify the ID of the stored + replication configuration in the `_replicator` database. :param ReplicationDocument replication_document: HTTP request body for replication operations. :param str if_match: (optional) Header parameter for a conditional HTTP @@ -17412,6 +17470,80 @@ def __ne__(self, other: 'SearchAnalyzeResult') -> bool: return not self == other +class SearchDiskSizeInformation: + """ + Schema for search index disk size. + + :param str name: The name of the search index prefixed by the design document ID + where the index is stored. + :param SearchIndexDiskSize search_index: Schema for search index disk size. + """ + + def __init__( + self, + name: str, + search_index: 'SearchIndexDiskSize', + ) -> None: + """ + Initialize a SearchDiskSizeInformation object. + + :param str name: The name of the search index prefixed by the design + document ID where the index is stored. + :param SearchIndexDiskSize search_index: Schema for search index disk size. + """ + self.name = name + self.search_index = search_index + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchDiskSizeInformation': + """Initialize a SearchDiskSizeInformation object from a json dictionary.""" + args = {} + if (name := _dict.get('name')) is not None: + args['name'] = name + else: + raise ValueError('Required property \'name\' not present in SearchDiskSizeInformation JSON') + if (search_index := _dict.get('search_index')) is not None: + args['search_index'] = SearchIndexDiskSize.from_dict(search_index) + else: + raise ValueError('Required property \'search_index\' not present in SearchDiskSizeInformation JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchDiskSizeInformation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'search_index') and self.search_index is not None: + if isinstance(self.search_index, dict): + _dict['search_index'] = self.search_index + else: + _dict['search_index'] = self.search_index.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchDiskSizeInformation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchDiskSizeInformation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchDiskSizeInformation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class SearchIndexDefinition: """ Schema for a search index definition. @@ -17520,6 +17652,64 @@ def __ne__(self, other: 'SearchIndexDefinition') -> bool: return not self == other +class SearchIndexDiskSize: + """ + Schema for search index disk size. + + :param int disk_size: (optional) The size of the search index on disk. + """ + + def __init__( + self, + *, + disk_size: Optional[int] = None, + ) -> None: + """ + Initialize a SearchIndexDiskSize object. + + :param int disk_size: (optional) The size of the search index on disk. + """ + self.disk_size = disk_size + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SearchIndexDiskSize': + """Initialize a SearchIndexDiskSize object from a json dictionary.""" + args = {} + if (disk_size := _dict.get('disk_size')) is not None: + args['disk_size'] = disk_size + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SearchIndexDiskSize object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'disk_size') and self.disk_size is not None: + _dict['disk_size'] = self.disk_size + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SearchIndexDiskSize object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SearchIndexDiskSize') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SearchIndexDiskSize') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class SearchIndexInfo: """ Schema for metadata information about a search index. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 361001a0..c145881e 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1428,6 +1428,18 @@ def test_post_search_as_stream(self): result = response.get_result() assert result is not None + @needscredentials + def test_get_search_disk_size(self): + response = self.cloudant_service.get_search_disk_size( + db='testString', + ddoc='testString', + index='testString', + ) + + assert response.get_status_code() == 200 + search_disk_size_information = response.get_result() + assert search_disk_size_information is not None + @needscredentials def test_get_search_info(self): response = self.cloudant_service.get_search_info( diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index ed5d7f89..04e53335 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -9092,6 +9092,95 @@ def test_post_search_as_stream_value_error_with_retries(self): self.test_post_search_as_stream_value_error() +class TestGetSearchDiskSize: + """ + Test Class for get_search_disk_size + """ + + @responses.activate + def test_get_search_disk_size_all_params(self): + """ + get_search_disk_size() + """ + # Set up mock + url = preprocess_url('/testString/_design/testString/_search_disk_size/testString') + mock_response = '{"name": "name", "search_index": {"disk_size": 0}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + db = 'testString' + ddoc = 'testString' + index = 'testString' + + # Invoke method + response = _service.get_search_disk_size( + db, + ddoc, + index, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_search_disk_size_all_params_with_retries(self): + # Enable retries and run test_get_search_disk_size_all_params. + _service.enable_retries() + self.test_get_search_disk_size_all_params() + + # Disable retries and run test_get_search_disk_size_all_params. + _service.disable_retries() + self.test_get_search_disk_size_all_params() + + @responses.activate + def test_get_search_disk_size_value_error(self): + """ + test_get_search_disk_size_value_error() + """ + # Set up mock + url = preprocess_url('/testString/_design/testString/_search_disk_size/testString') + mock_response = '{"name": "name", "search_index": {"disk_size": 0}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + db = 'testString' + ddoc = 'testString' + index = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "db": db, + "ddoc": ddoc, + "index": index, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_search_disk_size(**req_copy) + + def test_get_search_disk_size_value_error_with_retries(self): + # Enable retries and run test_get_search_disk_size_value_error. + _service.enable_retries() + self.test_get_search_disk_size_value_error() + + # Disable retries and run test_get_search_disk_size_value_error. + _service.disable_retries() + self.test_get_search_disk_size_value_error() + + class TestGetSearchInfo: """ Test Class for get_search_info @@ -17261,6 +17350,42 @@ def test_search_analyze_result_serialization(self): assert search_analyze_result_model_json2 == search_analyze_result_model_json +class TestModel_SearchDiskSizeInformation: + """ + Test Class for SearchDiskSizeInformation + """ + + def test_search_disk_size_information_serialization(self): + """ + Test serialization/deserialization for SearchDiskSizeInformation + """ + + # Construct dict forms of any model objects needed in order to build this model. + + search_index_disk_size_model = {} # SearchIndexDiskSize + search_index_disk_size_model['disk_size'] = 0 + + # Construct a json representation of a SearchDiskSizeInformation model + search_disk_size_information_model_json = {} + search_disk_size_information_model_json['name'] = 'testString' + search_disk_size_information_model_json['search_index'] = search_index_disk_size_model + + # Construct a model instance of SearchDiskSizeInformation by calling from_dict on the json representation + search_disk_size_information_model = SearchDiskSizeInformation.from_dict(search_disk_size_information_model_json) + assert search_disk_size_information_model != False + + # Construct a model instance of SearchDiskSizeInformation by calling from_dict on the json representation + search_disk_size_information_model_dict = SearchDiskSizeInformation.from_dict(search_disk_size_information_model_json).__dict__ + search_disk_size_information_model2 = SearchDiskSizeInformation(**search_disk_size_information_model_dict) + + # Verify the model instances are equivalent + assert search_disk_size_information_model == search_disk_size_information_model2 + + # Convert model instance back to dict and verify no loss of data + search_disk_size_information_model_json2 = search_disk_size_information_model.to_dict() + assert search_disk_size_information_model_json2 == search_disk_size_information_model_json + + class TestModel_SearchIndexDefinition: """ Test Class for SearchIndexDefinition @@ -17303,6 +17428,36 @@ def test_search_index_definition_serialization(self): assert search_index_definition_model_json2 == search_index_definition_model_json +class TestModel_SearchIndexDiskSize: + """ + Test Class for SearchIndexDiskSize + """ + + def test_search_index_disk_size_serialization(self): + """ + Test serialization/deserialization for SearchIndexDiskSize + """ + + # Construct a json representation of a SearchIndexDiskSize model + search_index_disk_size_model_json = {} + search_index_disk_size_model_json['disk_size'] = 0 + + # Construct a model instance of SearchIndexDiskSize by calling from_dict on the json representation + search_index_disk_size_model = SearchIndexDiskSize.from_dict(search_index_disk_size_model_json) + assert search_index_disk_size_model != False + + # Construct a model instance of SearchIndexDiskSize by calling from_dict on the json representation + search_index_disk_size_model_dict = SearchIndexDiskSize.from_dict(search_index_disk_size_model_json).__dict__ + search_index_disk_size_model2 = SearchIndexDiskSize(**search_index_disk_size_model_dict) + + # Verify the model instances are equivalent + assert search_index_disk_size_model == search_index_disk_size_model2 + + # Convert model instance back to dict and verify no loss of data + search_index_disk_size_model_json2 = search_index_disk_size_model.to_dict() + assert search_index_disk_size_model_json2 == search_index_disk_size_model_json + + class TestModel_SearchIndexInfo: """ Test Class for SearchIndexInfo From 5fdec1f0adb814e9277436202991f6630fd44fe1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:13:16 +0000 Subject: [PATCH 420/669] build(deps-dev): Bump responses from 0.25.5 to 0.25.6 Bumps [responses](https://github.com/getsentry/responses) from 0.25.5 to 0.25.6. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.5...0.25.6) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 07e09f55..c46c2cbf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.10.1 # test dependencies pytest==8.3.4 -responses==0.25.5 +responses==0.25.6 python_dotenv==1.0.1 pylint==3.3.3 # code coverage From 4e38147d4690adb9bab2bcb2ed90d522118641c9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:48:59 +0000 Subject: [PATCH 421/669] Update version 0.9.3 -> 0.10.0 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 88fa95ea..8f100653 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.9.3" +current_version = "0.10.0" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 1be9d6af..4e19a727 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.9.3 +# IBM Cloudant Python SDK Version 0.10.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.9.3" +pip install --upgrade "ibmcloudant>=0.10.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.9.3" +easy_install --upgrade "ibmcloudant>=0.10.0" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.9.3/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 9f7312e5..42a10510 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.9.3' +__version__ = '0.10.0' diff --git a/pyproject.toml b/pyproject.toml index ceab5653..cbd39723 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.9.3" +version = "0.10.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.22.1", From 60d431d5868ec874bcfb85c843ed23b7d5e855f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 18:13:47 +0000 Subject: [PATCH 422/669] build(deps): Bump github/codeql-action from 3.28.1 to 3.28.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.1 to 3.28.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/b6a472f63d85b9c78a3ac5e89422239fc15e9b3c...f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1837b9fb..c41bcc02 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 + uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 + uses: github/codeql-action/autobuild@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 + uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 with: category: "/language:${{matrix.language}}" From 7246120d77ccaf921f786d65d139094531a1cfc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:50:32 +0000 Subject: [PATCH 423/669] build(deps-dev): Bump pylint from 3.3.3 to 3.3.4 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.3 to 3.3.4. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.3...v3.3.4) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c46c2cbf..7a30b2ff 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.10.1 pytest==8.3.4 responses==0.25.6 python_dotenv==1.0.1 -pylint==3.3.3 +pylint==3.3.4 # code coverage coverage==7.6.10 pytest-cov==6.0.0 From de31da7eb4eed168267280b4847eb176e0ee7a3a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 31 Jan 2025 15:25:30 +0000 Subject: [PATCH 424/669] test(generated): add db count stubs Generated SDK source code using: - Generator version 3.99.0 - Specification version 1.0.0-dev0.1.25 - Automation (cloudant-sdks) version df0434a --- stubs/gen-its-mappings.json | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 9b7f2058..a4a16614 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -214,6 +214,33 @@ }, "uuid": "e42d0204-7e2b-3850-bab6-3188dad08068" }, + { + "id" : "8593b1aa-6297-3120-a04e-c199e2808167", + "request" : { + "url" : "/_api/v2/user/capacity/databases", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\"current\": {\"databases\":{\"total\":200}}}", + "headers" : { + "Server" : "Cloudant", + "X-Content-Type-Options" : "nosniff", + "X-Cloudant-Backend" : "bigblue", + "X-Couch-Request-ID" : "686418ce", + "X-Cloudant-Request-Class" : "unlimited", + "Date" : "Wed, 29 Jan 2025 00:26:57 GMT", + "Via" : "1.1 lb4.bigblue (Glum)", + "X-Frame-Options" : "DENY", + "X-Cloudant-Action" : "cloudantnosqldb.account-capacity-dbs.read", + "Strict-Transport-Security" : "max-age=31536000", + "content-security-policy" : "sandbox", + "Cache-Control" : "must-revalidate", + "Content-Type" : "application/json" + } + }, + "uuid" : "8593b1aa-6297-3120-a04e-c199e2808167" + }, { "id": "f3eef08d-1cac-3c95-90bb-e1d95690c74b", "request": { @@ -344,6 +371,33 @@ }, "uuid": "a2e4e696-e631-33f8-b168-5015048cdad8" }, + { + "id" : "8593b1aa-6297-3120-a04e-c199e2808167", + "request" : { + "url" : "/_api/v2/user/current/databases", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\"databases\":{\"total\":42}}", + "headers" : { + "Server" : "Cloudant", + "X-Content-Type-Options" : "nosniff", + "X-Cloudant-Backend" : "bigblue", + "X-Couch-Request-ID" : "686418ce", + "X-Cloudant-Request-Class" : "unlimited", + "Date" : "Wed, 29 Jan 2025 00:26:57 GMT", + "Via" : "1.1 lb4.bigblue (Glum)", + "X-Frame-Options" : "DENY", + "X-Cloudant-Action" : "cloudantnosqldb.account-current-dbs.read", + "Strict-Transport-Security" : "max-age=31536000", + "content-security-policy" : "sandbox", + "Cache-Control" : "must-revalidate", + "Content-Type" : "application/json" + } + }, + "uuid" : "8593b1aa-6297-3120-a04e-c199e2808167" + }, { "id": "8c38b725-a6ac-3f63-a723-9f4925ae23fd", "request": { From c9363cd92069e683db779a018fec8a96ca37edaf Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:50:20 +0000 Subject: [PATCH 425/669] test(generated): replace body with jsonBody Generated SDK source code using: - Generator version 3.99.0 - Specification version 1.0.0-dev0.1.25 - Automation (cloudant-sdks) version 42a435f --- stubs/gen-its-mappings.json | 6566 ++++++++++++++++++++--------------- stubs/mappings.json | 858 +++-- 2 files changed, 4156 insertions(+), 3268 deletions(-) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index a4a16614..737cf1c6 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -1,2899 +1,3683 @@ -{"mappings": [ - { - "id": "3afba80c-759a-3356-acf2-93866111665b", - "request": { - "url": "/", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"couchdb\":\"Welcome\",\"version\":\"3.2.1\",\"vendor\":{\"name\":\"IBM Cloudant\",\"version\":\"8287\",\"variant\":\"paas\"},\"features\":[\"geo\",\"search\",\"access-ready\",\"iam\",\"partitioned\",\"pluggable-storage-engines\",\"scheduler\"],\"features_flags\":[\"partitioned\"]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:31 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "95afae62f0ea5c9f26c869d9d00e2b8a", - "X-Cloudant-Action": "cloudantnosqldb.account-meta-info.read", - "X-Couch-Request-ID": "95afae62f0", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "3afba80c-759a-3356-acf2-93866111665b" - }, - { - "id": "082f68f8-c053-36d3-9eb1-cb8686d296aa", - "request": { - "url": "/_active_tasks", - "method": "GET" - }, - "response": { - "status": 200, - "body": "[]", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:09:00 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "249fc0a91bbf42406f8d93f1e20e401f", - "X-Cloudant-Action": "cloudantnosqldb.account-active-tasks.read", - "X-Couch-Request-ID": "249fc0a91b", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "082f68f8-c053-36d3-9eb1-cb8686d296aa" - }, - { - "id": "ad18e9e4-40a9-3cda-afe4-28217cbd04f5", - "request": { - "url": "/_all_dbs?descending=false&end_key=testString&limit=0&skip=0&start_key=testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "[\"testString\"]", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "ETag": "W/\"8I1PKGO1BVSLINUMI3N4GOJTG\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "3153310816b744a750175766d6c3c436", - "X-Cloudant-Action": "cloudantnosqldb.account-all-dbs.read", - "X-Couch-Request-ID": "3153310816", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "ad18e9e4-40a9-3cda-afe4-28217cbd04f5" - }, - { - "id": "544965f4-c99a-38ac-8b9d-b8ae4eafc952", - "request": { - "url": "/_api/v2/api_keys", - "method": "POST" - }, - "response": { - "status": 201, - "body": "{\"ok\": true, \"key\": \"apikey-98d494672e2c47beaec43f4633411189\", \"password\": \"54fcd98b4bb1206afb7d9be049e81234c768ab4d\"}", - "headers": { - "Date": "Mon, 16 May 2022 21:08:53 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.sapi.apikeys", - "x-envoy-upstream-service-time": "1075", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c717515d76586c-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "544965f4-c99a-38ac-8b9d-b8ae4eafc952" - }, - { - "id": "cf012f70-bff3-3596-bc47-c1f4cf97212d", - "request": { - "url": "/_api/v2/db/testString/_security", - "method": "PUT", - "bodyPatterns": [ - { - "matchesJsonPath": "$.[?(@.cloudant == null || @.cloudant.key1 != null)]", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"ok\":true}", - "headers": { - "Date": "Mon, 16 May 2022 21:08:54 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.sapi.db-security", - "x-envoy-upstream-service-time": "1461", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c717591f00822a-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "cf012f70-bff3-3596-bc47-c1f4cf97212d" - }, - { - "id": "44f68031-9fad-3ed6-9871-d9e7c5fd396a", - "request": { - "url": "/_api/v2/user/activity_tracker/events", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"types\": [\"data\", \"management\"]}", - "headers": { - "Date": "Mon, 16 May 2022 21:09:05 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.activity-tracker-event-types.read", - "x-envoy-upstream-service-time": "5165", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c71787be096fd7-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "44f68031-9fad-3ed6-9871-d9e7c5fd396a" - }, - { - "id": "e42d0204-7e2b-3850-bab6-3188dad08068", - "request": { - "url": "/_api/v2/user/activity_tracker/events", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"types\": [\"management\", \"data\"]}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"ok\": true}", - "headers": { - "Date": "Mon, 16 May 2022 21:09:07 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.activity-tracker-event-types.write", - "x-envoy-upstream-service-time": "1396", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c717a998cb5d80-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb1.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "e42d0204-7e2b-3850-bab6-3188dad08068" - }, - { - "id" : "8593b1aa-6297-3120-a04e-c199e2808167", - "request" : { - "url" : "/_api/v2/user/capacity/databases", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"current\": {\"databases\":{\"total\":200}}}", - "headers" : { - "Server" : "Cloudant", - "X-Content-Type-Options" : "nosniff", - "X-Cloudant-Backend" : "bigblue", - "X-Couch-Request-ID" : "686418ce", - "X-Cloudant-Request-Class" : "unlimited", - "Date" : "Wed, 29 Jan 2025 00:26:57 GMT", - "Via" : "1.1 lb4.bigblue (Glum)", - "X-Frame-Options" : "DENY", - "X-Cloudant-Action" : "cloudantnosqldb.account-capacity-dbs.read", - "Strict-Transport-Security" : "max-age=31536000", - "content-security-policy" : "sandbox", - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json" - } - }, - "uuid" : "8593b1aa-6297-3120-a04e-c199e2808167" - }, - { - "id": "f3eef08d-1cac-3c95-90bb-e1d95690c74b", - "request": { - "url": "/_api/v2/user/capacity/throughput", - "method": "PUT", - "bodyPatterns": [ - { - "matchesJsonPath": "$.blocks", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"current\":{\"throughput\":{\"blocks\":5,\"query\":25,\"read\":500,\"write\":250}},\"target\":{\"throughput\":{\"blocks\":10,\"query\":50,\"read\":1000,\"write\":500}}}", - "headers": { - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.capacity-throughput.write", - "x-envoy-upstream-service-time": "838", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c716dc9fa05a2e-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "f3eef08d-1cac-3c95-90bb-e1d95690c74b" - }, - { - "id": "472c4134-a11c-3c72-980c-85518316a338", - "request": { - "url": "/_api/v2/user/capacity/throughput", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"current\": {\"throughput\": {\"read\": 20, \"write\": 10, \"query\": 5}}}", - "headers": { - "Date": "Mon, 16 May 2022 21:08:33 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.capacity-throughput.read", - "x-envoy-upstream-service-time": "1135", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c716d47ab17ffd-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "472c4134-a11c-3c72-980c-85518316a338" - }, - { - "id": "620fd692-b6a6-3b64-967c-ffee174c2cff", - "request": { - "url": "/_api/v2/user/config/cors", - "method": "PUT", - "bodyPatterns": [ - { - "equalToJson": "{\"allow_credentials\": true, \"enable_cors\": true, \"origins\": [ \"https://example.com\", \"https://www.example.com\" ]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": false - } - ] - }, - "response": { - "status": 200, - "body": "{\"ok\": true}", - "headers": { - "Date": "Fri, 20 May 2022 18:04:13 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.sapi.usercors", - "x-envoy-upstream-service-time": "2487", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70e6fe465b125962-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" - } - }, - "uuid": "620fd692-b6a6-3b64-967c-ffee174c2cff" - }, - { - "id": "a2e4e696-e631-33f8-b168-5015048cdad8", - "request": { - "url": "/_api/v2/user/config/cors", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"enable_cors\": true, \"origins\": [\"https://example.com\"], \"allow_credentials\": false}", - "headers": { - "Date": "Mon, 16 May 2022 21:08:56 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.sapi.usercors", - "x-envoy-upstream-service-time": "1371", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c717635b6d82ea-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "a2e4e696-e631-33f8-b168-5015048cdad8" - }, - { - "id" : "8593b1aa-6297-3120-a04e-c199e2808167", - "request" : { - "url" : "/_api/v2/user/current/databases", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"databases\":{\"total\":42}}", - "headers" : { - "Server" : "Cloudant", - "X-Content-Type-Options" : "nosniff", - "X-Cloudant-Backend" : "bigblue", - "X-Couch-Request-ID" : "686418ce", - "X-Cloudant-Request-Class" : "unlimited", - "Date" : "Wed, 29 Jan 2025 00:26:57 GMT", - "Via" : "1.1 lb4.bigblue (Glum)", - "X-Frame-Options" : "DENY", - "X-Cloudant-Action" : "cloudantnosqldb.account-current-dbs.read", - "Strict-Transport-Security" : "max-age=31536000", - "content-security-policy" : "sandbox", - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json" - } - }, - "uuid" : "8593b1aa-6297-3120-a04e-c199e2808167" - }, - { - "id": "8c38b725-a6ac-3f63-a723-9f4925ae23fd", - "request": { - "url": "/_api/v2/user/current/throughput", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"throughput\": {\"read\": 0, \"write\": 0, \"query\": 0}}", - "headers": { - "Date": "Mon, 16 May 2022 21:09:09 GMT", - "Content-Type": "application/json", - "Cache-Control": "no-cache, no-store, must-revalidate", - "Vary": "Accept-Encoding", - "X-Cloudant-Action": "cloudantnosqldb.current-throughput.read", - "x-envoy-upstream-service-time": "1269", - "cf-cache-status": "DYNAMIC", - "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", - "Server": "cloudflare", - "cf-ray": "70c717b35e550660-IAD", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "sapi.lb1.bm-cc-us-east-05.cloudant.net", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "8c38b725-a6ac-3f63-a723-9f4925ae23fd" - }, - { - "id": "1caf7257-c094-3a41-92ad-a6e49a376615", - "request": { - "urlPath": "/_db_updates", - "method": "GET", - "queryParameters": { - "feed": { - "equalTo": "normal" - }, - "heartbeat": { - "equalTo": "1" - }, - "since": { - "equalTo": "0" - }, - "timeout": { - "equalTo": "60000" - } - } - }, - "response": { - "status": 200, - "body": "{\"last_seq\":\"1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0\",\"results\":[{\"dbname\":\"events\",\"seq\":\"1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0\",\"type\":\"created\"}]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "2d4a268c250238deeff1fe847741aca0", - "X-Cloudant-Action": "cloudantnosqldb.account-db-updates.read", - "X-Couch-Request-ID": "2d4a268c25", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "1caf7257-c094-3a41-92ad-a6e49a376615" - }, - { - "id": "0e3d6794-25ed-3bf2-90ea-34410b429c76", - "request": { - "url": "/_dbs_info", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"keys\": [\"products\", \"users\", \"orders\"]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "[{\"key\":\"testdb\",\"info\":{\"db_name\":\"testdb\",\"instance_start_time\":\"1652999321\",\"purge_seq\":\"0-g1AAAAQXeJzLYWBgEMhgTmHQSElKzi9KdUhJMtRLytVNTtYtLdZNTSwu0TUw1UvOyS9NScwr0ctLLckB6mDKYwGSDB-A1H8gyEpkABmhiTCCeDMeQMx4DzUD4QwToo24ADHiPoYR5kQbcQBixHkMI4j3yAaIEfspCYwFEDPWUxAYEyBGzKcgMBogRvSTFRhJBUAyqZ7sVJGUANKfj9BPWiAkBYC0x2PTTkwAJDmAtPtj006U4w1A2u3J97wCSL8-2Z4XAGmXJ9fziQxJ_BC9WQB5BlMh\",\"update_seq\":\"14-g1AAAAereJy908tNwzAYwHHT8jjSDeAIhxTbiWPnRDeADcCfH6qqPhBtz7ABbAAbwAawAWxAN4ANwI4jpbk1SG4OjhQl30_OPxkjhHrDrkYnGtTs1gw0kD5MEqWS5Twxcr5IMOur8Wyp5XTRn5rF2D3Rme66Ff240687RsOu7EzchQPLcJpp1mKct0_rmzfHVwH_9jgqcYazlGeizbzmzrON8c-Af9U4yWXGqGgxrmnzje33YH_UtmDCgCYtxv23-Guw32qbG4u5Ntso_hzwlxpXime8YNso_hjwp7XPrbAU22ILxe-D_bC2cWA5FjZqcbhxK9xV_3dVmyrCDI1bG649PGvAqSo01TJuabj08FUDNnmusSFRK8PAuxeVuxMKE0ssp3ELY--eN_Zrtdug4pELH3v4rIL3ShhEqhk1kQv3PHxUwfslTAtgTEDUwhLBYeM1C4GNkdBizugP-uNrDA\",\"sizes\":{\"file\":666707,\"external\":304,\"active\":12758},\"props\":{},\"doc_del_count\":1,\"doc_count\":3,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":16,\"n\":3,\"w\":2,\"r\":2}}}]", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "20e0a09fd367bbb1463ff32d6616f4e6", - "X-Cloudant-Action": "cloudantnosqldb.account-dbs-info.read", - "X-Couch-Request-ID": "20e0a09fd3", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "0e3d6794-25ed-3bf2-90ea-34410b429c76" - }, - { - "id": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba", - "request": { - "url": "/_membership", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"all_nodes\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\",\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\",\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"cluster_nodes\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\",\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\",\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:31 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "fa692f7cfd6a091210084696d74c9e78", - "X-Cloudant-Action": "cloudantnosqldb.cluster-membership.read", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba" - }, - { - "id": "109ff4b5-4d2a-32b8-890d-f15cfe54173b", - "request": { - "urlPath": "/_replicator", - "method": "POST", - "queryParameters": { - "batch": { - "equalTo": "ok" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{\"source\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}, \"target\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"1-257d246167d34fcc2ca07926ba0213d1\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 16:54:50 GMT", - "ETag": "W/\"22-257d246167d34fcc2ca07926ba0213d1\"", - "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/_replicator/testString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "ce157aeb0e62a81f05c0e8c9e4d24c55", - "X-Cloudant-Action": "cloudantnosqldb.replication.write", - "X-Couch-Request-ID": "ce157aeb0e", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "109ff4b5-4d2a-32b8-890d-f15cfe54173b" - }, - { - "id": "ea621c78-5215-34ac-94ce-95e13e1182bd", - "request": { - "url": "/_replicator/testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 16:18:40 GMT", - "ETag": "\"2-2eb76179e2608844d7fab7a4ab67c5bf\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "a957f9a0e94e5cc392c318ddfd9530a1", - "X-Cloudant-Action": "cloudantnosqldb.replication.read", - "X-Couch-Request-ID": "a957f9a0e9", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)" - } - }, - "uuid": "ea621c78-5215-34ac-94ce-95e13e1182bd" - }, - { - "id": "ee208ab6-a73d-3325-b9b0-afcdaaaccab3", - "request": { - "urlPath": "/_replicator/testString", - "method": "DELETE", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - } - } - }, - "response": { - "status": 200, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"3-364238f68a4eb90d4e10ad0ca5ad7772\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 23 May 2022 19:04:39 GMT", - "ETag": "W/\"27-364238f68a4eb90d4e10ad0ca5ad7772\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "68250b09c2b37af95a2b3507bd887d90", - "X-Cloudant-Action": "cloudantnosqldb.replication.write", - "X-Couch-Request-ID": "68250b09c2", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "ee208ab6-a73d-3325-b9b0-afcdaaaccab3" - }, - { - "id": "109ff4b5-4d2a-32b8-890d-f15cfe54173a", - "request": { - "urlPath": "/_replicator/testString", - "method": "PUT", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - }, - "new_edits": { - "equalTo": "false" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{\"source\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}, \"target\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"1-257d246167d34fcc2ca07926ba0213d1\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 16:54:50 GMT", - "ETag": "W/\"22-257d246167d34fcc2ca07926ba0213d1\"", - "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/_replicator/testString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "ce157aeb0e62a81f05c0e8c9e4d24c55", - "X-Cloudant-Action": "cloudantnosqldb.replication.write", - "X-Couch-Request-ID": "ce157aeb0e", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "109ff4b5-4d2a-32b8-890d-f15cfe54173a" - }, - { - "id": "44eb7118-b9d0-38ee-8ada-9097415e6950", - "request": { - "urlPath": "/_replicator/testString", - "method": "GET", - "queryParameters": { - "att_encoding_info": { - "equalTo": "false" - }, - "attachments": { - "equalTo": "false" - }, - "deleted_conflicts": { - "equalTo": "false" - }, - "conflicts": { - "equalTo": "false" - }, - "latest": { - "equalTo": "false" - }, - "local_seq": { - "equalTo": "false" - }, - "meta": { - "equalTo": "false" - }, - "rev": { - "equalTo": "testString" - }, - "revs": { - "equalTo": "false" - }, - "revs_info": { - "equalTo": "false" - } - } - }, - "response": { - "status": 200, - "body": "{\"_id\":\"testString\",\"_rev\":\"2-2eb76179e2608844d7fab7a4ab67c5bf\",\"source\":{\"url\":\"testString\"},\"target\":{\"url\":\"testString\"},\"owner\":\"iam-ServiceId-d3730bc8-88fb-4a35-9f1d-6e17f6cf369e\",\"_replication_state\":\"failed\",\"_replication_state_time\":\"2022-05-16T21:08:50Z\",\"_replication_state_reason\":\"{error,{case_clause,{error,invalid_uri}}}\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 16:20:06 GMT", - "ETag": "W/\"2-2eb76179e2608844d7fab7a4ab67c5bf\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "2211e195b24b7597aa72a5b7aa9bb756", - "X-Cloudant-Action": "cloudantnosqldb.replication.read", - "X-Couch-Request-ID": "2211e195b2", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "44eb7118-b9d0-38ee-8ada-9097415e6950" - }, - { - "id": "13d8a8e0-e54e-3e8f-9649-d902a9950f31", - "request": { - "url": "/_scheduler/docs?limit=0&skip=0&states=initializing", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"total_rows\":1,\"offset\":0,\"docs\":[\r\n{\"database\":\"84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix/_replicator\",\"doc_id\":\"e945ba14464aef7dd519ba36ae6f9466\",\"id\":null,\"source\":\"https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/animaldb-target/\",\"target\":\"https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/animaldb/\",\"state\":\"completed\",\"error_count\":0,\"info\":{\"revisions_checked\":15,\"missing_revisions_found\":15,\"docs_read\":15,\"docs_written\":15,\"changes_pending\":null,\"doc_write_failures\":0,\"checkpointed_source_seq\":\"15-g1AAAAcaeJyt1MFNwzAUgGHTIiFOdAM4wiHFdmPHOdENYAPwsx2Vqk0Rbc-wAWwAG8AGsAFsQDeADYpTVyQ50CZuL4kUJf-nxM8ZIIRavaZGJxrU6NZ0NRDWhmGgVDAdB0aOJwEmbTUYTbVMJ-3UTAb2kYZEcDCfz_u9pmwM7YU9iIgxgDU6_gt1Vnc8VGjZIxwu4Z0FHCkBRIlSi25fPsrk05JsGAUFUHzlePswzuCzEiy5lFrSIhzWgnkVuJvB5yUYFOYCS_9FrgRfZPDlEkYLOCEmDIWF96epNsl1arRP-Sorj0pl2qGMJnjT8k1WviuVcRhzJfWK8pppWZTTXXtE9_Zk4w_5fpMMKGPKfymq448OfyoMYGSiiJsN9lx1_dnpL7muGO2EOPHfd9XxV4e_5d89hAg4Ft57j665u4C_O_wjxzmNRSi496LXwD8d_pXPc0woSUD8P8816jNX_87rSsSJYWQr9R9XL_4xATBwVWPV-r9_cTjG\"},\"start_time\":\"2021-11-07T23:54:45Z\",\"last_updated\":\"2021-11-07T23:54:49Z\"}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:50 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "95a00aef1c8f1b5d2ccd575501f38e8a", - "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", - "X-Couch-Request-ID": "95a00aef1c", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "13d8a8e0-e54e-3e8f-9649-d902a9950f31" - }, - { - "id": "775f4f0a-3b8a-37e2-aa47-140285fb2b1c", - "request": { - "url": "/_scheduler/docs/_replicator/testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"database\":\"_replicator\",\"doc_id\":\"testString\",\"id\":null,\"source\":null,\"target\":null,\"state\":\"failed\",\"error_count\":1,\"info\":{\"error\":\"{error,{case_clause,{error,invalid_uri}}}\"},\"start_time\":\"2022-05-16T21:08:50Z\",\"last_updated\":\"2022-05-16T21:08:50Z\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:50 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "2dd32790877ffef6279a3f9fe908836f", - "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", - "X-Couch-Request-ID": "2dd3279087", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "775f4f0a-3b8a-37e2-aa47-140285fb2b1c" - }, - { - "id": "266af994-f5f5-31d5-bcda-15a9ea3c86b5", - "request": { - "url": "/_scheduler/docs/_replicator/testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 16:22:17 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "da1acdc1a05b5d5bbaca269dca53b94d", - "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", - "X-Couch-Request-ID": "da1acdc1a0", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)" - } - }, - "uuid": "266af994-f5f5-31d5-bcda-15a9ea3c86b5" - }, - { - "id": "5c158d49-97e6-3f2b-99ec-2f6629a13c77", - "request": { - "url": "/_scheduler/jobs?limit=25&skip=0", - "method": "GET" - }, - "response": { - "status": 200, - "jsonBody": { - "total_rows":1, - "offset":0, - "jobs":[ +{ + "mappings": [ + { + "id": "3afba80c-759a-3356-acf2-93866111665b", + "request": { + "url": "/", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:31 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "95afae62f0ea5c9f26c869d9d00e2b8a", + "X-Cloudant-Action": "cloudantnosqldb.account-meta-info.read", + "X-Couch-Request-ID": "95afae62f0", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "couchdb": "Welcome", + "version": "3.2.1", + "vendor": { + "name": "IBM Cloudant", + "version": "8287", + "variant": "paas" + }, + "features": [ + "geo", + "search", + "access-ready", + "iam", + "partitioned", + "pluggable-storage-engines", + "scheduler" + ], + "features_flags": [ + "partitioned" + ] + } + }, + "uuid": "3afba80c-759a-3356-acf2-93866111665b" + }, + { + "id": "082f68f8-c053-36d3-9eb1-cb8686d296aa", + "request": { + "url": "/_active_tasks", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[]", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:00 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "249fc0a91bbf42406f8d93f1e20e401f", + "X-Cloudant-Action": "cloudantnosqldb.account-active-tasks.read", + "X-Couch-Request-ID": "249fc0a91b", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "082f68f8-c053-36d3-9eb1-cb8686d296aa" + }, + { + "id": "ad18e9e4-40a9-3cda-afe4-28217cbd04f5", + "request": { + "url": "/_all_dbs?descending=false&end_key=testString&limit=0&skip=0&start_key=testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[\"testString\"]", + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "ETag": "W/\"8I1PKGO1BVSLINUMI3N4GOJTG\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3153310816b744a750175766d6c3c436", + "X-Cloudant-Action": "cloudantnosqldb.account-all-dbs.read", + "X-Couch-Request-ID": "3153310816", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "ad18e9e4-40a9-3cda-afe4-28217cbd04f5" + }, + { + "id": "544965f4-c99a-38ac-8b9d-b8ae4eafc952", + "request": { + "url": "/_api/v2/api_keys", + "method": "POST" + }, + "response": { + "status": 201, + "headers": { + "Date": "Mon, 16 May 2022 21:08:53 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.apikeys", + "x-envoy-upstream-service-time": "1075", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717515d76586c-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "ok": true, + "key": "apikey-98d494672e2c47beaec43f4633411189", + "password": "54fcd98b4bb1206afb7d9be049e81234c768ab4d" + } + }, + "uuid": "544965f4-c99a-38ac-8b9d-b8ae4eafc952" + }, + { + "id": "cf012f70-bff3-3596-bc47-c1f4cf97212d", + "request": { + "url": "/_api/v2/db/testString/_security", + "method": "PUT", + "bodyPatterns": [ + { + "matchesJsonPath": "$.[?(@.cloudant == null || @.cloudant.key1 != null)]", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:08:54 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.db-security", + "x-envoy-upstream-service-time": "1461", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717591f00822a-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "cf012f70-bff3-3596-bc47-c1f4cf97212d" + }, + { + "id": "44f68031-9fad-3ed6-9871-d9e7c5fd396a", + "request": { + "url": "/_api/v2/user/activity_tracker/events", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:09:05 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.activity-tracker-event-types.read", + "x-envoy-upstream-service-time": "5165", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c71787be096fd7-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "types": [ + "data", + "management" + ] + } + }, + "uuid": "44f68031-9fad-3ed6-9871-d9e7c5fd396a" + }, + { + "id": "e42d0204-7e2b-3850-bab6-3188dad08068", + "request": { + "url": "/_api/v2/user/activity_tracker/events", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"types\": [\"management\", \"data\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:09:07 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.activity-tracker-event-types.write", + "x-envoy-upstream-service-time": "1396", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717a998cb5d80-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb1.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "e42d0204-7e2b-3850-bab6-3188dad08068" + }, + { + "id": "8593b1aa-6297-3120-a04e-c199e2808167", + "request": { + "url": "/_api/v2/user/capacity/databases", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Server": "Cloudant", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Backend": "bigblue", + "X-Couch-Request-ID": "686418ce", + "X-Cloudant-Request-Class": "unlimited", + "Date": "Wed, 29 Jan 2025 00:26:57 GMT", + "Via": "1.1 lb4.bigblue (Glum)", + "X-Frame-Options": "DENY", + "X-Cloudant-Action": "cloudantnosqldb.account-capacity-dbs.read", + "Strict-Transport-Security": "max-age=31536000", + "content-security-policy": "sandbox", + "Cache-Control": "must-revalidate", + "Content-Type": "application/json" + }, + "jsonBody": { + "current": { + "databases": { + "total": 200 + } + } + } + }, + "uuid": "8593b1aa-6297-3120-a04e-c199e2808167" + }, + { + "id": "f3eef08d-1cac-3c95-90bb-e1d95690c74b", + "request": { + "url": "/_api/v2/user/capacity/throughput", + "method": "PUT", + "bodyPatterns": [ + { + "matchesJsonPath": "$.blocks", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.capacity-throughput.write", + "x-envoy-upstream-service-time": "838", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c716dc9fa05a2e-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "current": { + "throughput": { + "blocks": 5, + "query": 25, + "read": 500, + "write": 250 + } + }, + "target": { + "throughput": { + "blocks": 10, + "query": 50, + "read": 1000, + "write": 500 + } + } + } + }, + "uuid": "f3eef08d-1cac-3c95-90bb-e1d95690c74b" + }, + { + "id": "472c4134-a11c-3c72-980c-85518316a338", + "request": { + "url": "/_api/v2/user/capacity/throughput", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:08:33 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.capacity-throughput.read", + "x-envoy-upstream-service-time": "1135", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c716d47ab17ffd-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "current": { + "throughput": { + "read": 20, + "write": 10, + "query": 5 + } + } + } + }, + "uuid": "472c4134-a11c-3c72-980c-85518316a338" + }, + { + "id": "620fd692-b6a6-3b64-967c-ffee174c2cff", + "request": { + "url": "/_api/v2/user/config/cors", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{\"allow_credentials\": true, \"enable_cors\": true, \"origins\": [ \"https://example.com\", \"https://www.example.com\" ]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "headers": { + "Date": "Fri, 20 May 2022 18:04:13 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.usercors", + "x-envoy-upstream-service-time": "2487", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70e6fe465b125962-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "620fd692-b6a6-3b64-967c-ffee174c2cff" + }, + { + "id": "a2e4e696-e631-33f8-b168-5015048cdad8", + "request": { + "url": "/_api/v2/user/config/cors", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:08:56 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.sapi.usercors", + "x-envoy-upstream-service-time": "1371", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717635b6d82ea-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb2.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "enable_cors": true, + "origins": [ + "https://example.com" + ], + "allow_credentials": false + } + }, + "uuid": "a2e4e696-e631-33f8-b168-5015048cdad8" + }, + { + "id": "8593b1aa-6297-3120-a04e-c199e2808167", + "request": { + "url": "/_api/v2/user/current/databases", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Server": "Cloudant", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Backend": "bigblue", + "X-Couch-Request-ID": "686418ce", + "X-Cloudant-Request-Class": "unlimited", + "Date": "Wed, 29 Jan 2025 00:26:57 GMT", + "Via": "1.1 lb4.bigblue (Glum)", + "X-Frame-Options": "DENY", + "X-Cloudant-Action": "cloudantnosqldb.account-current-dbs.read", + "Strict-Transport-Security": "max-age=31536000", + "content-security-policy": "sandbox", + "Cache-Control": "must-revalidate", + "Content-Type": "application/json" + }, + "jsonBody": { + "databases": { + "total": 42 + } + } + }, + "uuid": "8593b1aa-6297-3120-a04e-c199e2808167" + }, + { + "id": "8c38b725-a6ac-3f63-a723-9f4925ae23fd", + "request": { + "url": "/_api/v2/user/current/throughput", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Date": "Mon, 16 May 2022 21:09:09 GMT", + "Content-Type": "application/json", + "Cache-Control": "no-cache, no-store, must-revalidate", + "Vary": "Accept-Encoding", + "X-Cloudant-Action": "cloudantnosqldb.current-throughput.read", + "x-envoy-upstream-service-time": "1269", + "cf-cache-status": "DYNAMIC", + "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", + "Server": "cloudflare", + "cf-ray": "70c717b35e550660-IAD", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "sapi.lb1.bm-cc-us-east-05.cloudant.net", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "throughput": { + "read": 0, + "write": 0, + "query": 0 + } + } + }, + "uuid": "8c38b725-a6ac-3f63-a723-9f4925ae23fd" + }, + { + "id": "1caf7257-c094-3a41-92ad-a6e49a376615", + "request": { + "urlPath": "/_db_updates", + "method": "GET", + "queryParameters": { + "feed": { + "equalTo": "normal" + }, + "heartbeat": { + "equalTo": "1" + }, + "since": { + "equalTo": "0" + }, + "timeout": { + "equalTo": "60000" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "2d4a268c250238deeff1fe847741aca0", + "X-Cloudant-Action": "cloudantnosqldb.account-db-updates.read", + "X-Couch-Request-ID": "2d4a268c25", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + }, + "jsonBody": { + "last_seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0", + "results": [ + { + "dbname": "events", + "seq": "1-g1AAAAMFeJydkcENgjAUhquYePHqBN48EEBj4klXUOgAbSExDUJi8OwUrqDQJZyCJZhBqD8XE0Iiwulvmvf1e68vJITMToZPFj4X8SXY-3xjijC--ixKLMv-ns0oSEIUjxnhc0o9yUgTW_3GaojypVKZPBlsdMbdVFhbW6yd_15p2pwOG0SK77SuevcJSHP06rbILicgj0ul0t5OQBm_aV22yI5l1FAVTciR0ntfKzAXGOKJz-prBpYCQ7y1fg1wl8AQB0rzAW4MnCMeShUD3Bi4QGDTGrT8AMkPBk0", + "type": "created" + } + ] + } + }, + "uuid": "1caf7257-c094-3a41-92ad-a6e49a376615" + }, + { + "id": "0e3d6794-25ed-3bf2-90ea-34410b429c76", + "request": { + "url": "/_dbs_info", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"keys\": [\"products\", \"users\", \"orders\"]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "20e0a09fd367bbb1463ff32d6616f4e6", + "X-Cloudant-Action": "cloudantnosqldb.account-dbs-info.read", + "X-Couch-Request-ID": "20e0a09fd3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": [ + { + "key": "testdb", + "info": { + "db_name": "testdb", + "instance_start_time": "1652999321", + "purge_seq": "0-g1AAAAQXeJzLYWBgEMhgTmHQSElKzi9KdUhJMtRLytVNTtYtLdZNTSwu0TUw1UvOyS9NScwr0ctLLckB6mDKYwGSDB-A1H8gyEpkABmhiTCCeDMeQMx4DzUD4QwToo24ADHiPoYR5kQbcQBixHkMI4j3yAaIEfspCYwFEDPWUxAYEyBGzKcgMBogRvSTFRhJBUAyqZ7sVJGUANKfj9BPWiAkBYC0x2PTTkwAJDmAtPtj006U4w1A2u3J97wCSL8-2Z4XAGmXJ9fziQxJ_BC9WQB5BlMh", + "update_seq": "14-g1AAAAereJy908tNwzAYwHHT8jjSDeAIhxTbiWPnRDeADcCfH6qqPhBtz7ABbAAbwAawAWxAN4ANwI4jpbk1SG4OjhQl30_OPxkjhHrDrkYnGtTs1gw0kD5MEqWS5Twxcr5IMOur8Wyp5XTRn5rF2D3Rme66Ff240687RsOu7EzchQPLcJpp1mKct0_rmzfHVwH_9jgqcYazlGeizbzmzrON8c-Af9U4yWXGqGgxrmnzje33YH_UtmDCgCYtxv23-Guw32qbG4u5Ntso_hzwlxpXime8YNso_hjwp7XPrbAU22ILxe-D_bC2cWA5FjZqcbhxK9xV_3dVmyrCDI1bG649PGvAqSo01TJuabj08FUDNnmusSFRK8PAuxeVuxMKE0ssp3ELY--eN_Zrtdug4pELH3v4rIL3ShhEqhk1kQv3PHxUwfslTAtgTEDUwhLBYeM1C4GNkdBizugP-uNrDA", + "sizes": { + "file": 666707, + "external": 304, + "active": 12758 + }, + "props": {}, + "doc_del_count": 1, + "doc_count": 3, + "disk_format_version": 8, + "compact_running": false, + "cluster": { + "q": 16, + "n": 3, + "w": 2, + "r": 2 + } + } + } + ] + }, + "uuid": "0e3d6794-25ed-3bf2-90ea-34410b429c76" + }, + { + "id": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba", + "request": { + "url": "/_membership", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:31 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "fa692f7cfd6a091210084696d74c9e78", + "X-Cloudant-Action": "cloudantnosqldb.cluster-membership.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "all_nodes": [ + "dbcore@db1.bm-cc-us-east-05.cloudant.net", + "dbcore@db10.bm-cc-us-east-05.cloudant.net", + "dbcore@db11.bm-cc-us-east-05.cloudant.net", + "dbcore@db12.bm-cc-us-east-05.cloudant.net", + "dbcore@db2.bm-cc-us-east-05.cloudant.net", + "dbcore@db3.bm-cc-us-east-05.cloudant.net", + "dbcore@db4.bm-cc-us-east-05.cloudant.net", + "dbcore@db5.bm-cc-us-east-05.cloudant.net", + "dbcore@db6.bm-cc-us-east-05.cloudant.net", + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ], + "cluster_nodes": [ + "dbcore@db1.bm-cc-us-east-05.cloudant.net", + "dbcore@db10.bm-cc-us-east-05.cloudant.net", + "dbcore@db11.bm-cc-us-east-05.cloudant.net", + "dbcore@db12.bm-cc-us-east-05.cloudant.net", + "dbcore@db2.bm-cc-us-east-05.cloudant.net", + "dbcore@db3.bm-cc-us-east-05.cloudant.net", + "dbcore@db4.bm-cc-us-east-05.cloudant.net", + "dbcore@db5.bm-cc-us-east-05.cloudant.net", + "dbcore@db6.bm-cc-us-east-05.cloudant.net", + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ] + } + }, + "uuid": "2da72265-1cef-3bc6-bb1b-2cdeb811ceba" + }, + { + "id": "109ff4b5-4d2a-32b8-890d-f15cfe54173b", + "request": { + "urlPath": "/_replicator", + "method": "POST", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"source\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}, \"target\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:54:50 GMT", + "ETag": "W/\"22-257d246167d34fcc2ca07926ba0213d1\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/_replicator/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "ce157aeb0e62a81f05c0e8c9e4d24c55", + "X-Cloudant-Action": "cloudantnosqldb.replication.write", + "X-Couch-Request-ID": "ce157aeb0e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "1-257d246167d34fcc2ca07926ba0213d1" + } + }, + "uuid": "109ff4b5-4d2a-32b8-890d-f15cfe54173b" + }, + { + "id": "ea621c78-5215-34ac-94ce-95e13e1182bd", + "request": { + "url": "/_replicator/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:18:40 GMT", + "ETag": "\"2-2eb76179e2608844d7fab7a4ab67c5bf\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "a957f9a0e94e5cc392c318ddfd9530a1", + "X-Cloudant-Action": "cloudantnosqldb.replication.read", + "X-Couch-Request-ID": "a957f9a0e9", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)" + } + }, + "uuid": "ea621c78-5215-34ac-94ce-95e13e1182bd" + }, + { + "id": "ee208ab6-a73d-3325-b9b0-afcdaaaccab3", + "request": { + "urlPath": "/_replicator/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 19:04:39 GMT", + "ETag": "W/\"27-364238f68a4eb90d4e10ad0ca5ad7772\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "68250b09c2b37af95a2b3507bd887d90", + "X-Cloudant-Action": "cloudantnosqldb.replication.write", + "X-Couch-Request-ID": "68250b09c2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "3-364238f68a4eb90d4e10ad0ca5ad7772" + } + }, + "uuid": "ee208ab6-a73d-3325-b9b0-afcdaaaccab3" + }, + { + "id": "109ff4b5-4d2a-32b8-890d-f15cfe54173a", + "request": { + "urlPath": "/_replicator/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + }, + "new_edits": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"source\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}, \"target\": {\"url\": \"https://my-source-instance.cloudantnosqldb.appdomain.cloud.example/animaldb\"}}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:54:50 GMT", + "ETag": "W/\"22-257d246167d34fcc2ca07926ba0213d1\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/_replicator/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "ce157aeb0e62a81f05c0e8c9e4d24c55", + "X-Cloudant-Action": "cloudantnosqldb.replication.write", + "X-Couch-Request-ID": "ce157aeb0e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "1-257d246167d34fcc2ca07926ba0213d1" + } + }, + "uuid": "109ff4b5-4d2a-32b8-890d-f15cfe54173a" + }, + { + "id": "44eb7118-b9d0-38ee-8ada-9097415e6950", + "request": { + "urlPath": "/_replicator/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "deleted_conflicts": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + }, + "meta": { + "equalTo": "false" + }, + "rev": { + "equalTo": "testString" + }, + "revs": { + "equalTo": "false" + }, + "revs_info": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:20:06 GMT", + "ETag": "W/\"2-2eb76179e2608844d7fab7a4ab67c5bf\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "2211e195b24b7597aa72a5b7aa9bb756", + "X-Cloudant-Action": "cloudantnosqldb.replication.read", + "X-Couch-Request-ID": "2211e195b2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "_id": "testString", + "_rev": "2-2eb76179e2608844d7fab7a4ab67c5bf", + "source": { + "url": "testString" + }, + "target": { + "url": "testString" + }, + "owner": "iam-ServiceId-d3730bc8-88fb-4a35-9f1d-6e17f6cf369e", + "_replication_state": "failed", + "_replication_state_time": "2022-05-16T21:08:50Z", + "_replication_state_reason": "{error,{case_clause,{error,invalid_uri}}}" + } + }, + "uuid": "44eb7118-b9d0-38ee-8ada-9097415e6950" + }, + { + "id": "13d8a8e0-e54e-3e8f-9649-d902a9950f31", + "request": { + "url": "/_scheduler/docs?limit=0&skip=0&states=initializing", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:50 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "95a00aef1c8f1b5d2ccd575501f38e8a", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "95a00aef1c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 1, + "offset": 0, + "docs": [ + { + "database": "84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix/_replicator", + "doc_id": "e945ba14464aef7dd519ba36ae6f9466", + "id": null, + "source": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/animaldb-target/", + "target": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/animaldb/", + "state": "completed", + "error_count": 0, + "info": { + "revisions_checked": 15, + "missing_revisions_found": 15, + "docs_read": 15, + "docs_written": 15, + "changes_pending": null, + "doc_write_failures": 0, + "checkpointed_source_seq": "15-g1AAAAcaeJyt1MFNwzAUgGHTIiFOdAM4wiHFdmPHOdENYAPwsx2Vqk0Rbc-wAWwAG8AGsAFsQDeADYpTVyQ50CZuL4kUJf-nxM8ZIIRavaZGJxrU6NZ0NRDWhmGgVDAdB0aOJwEmbTUYTbVMJ-3UTAb2kYZEcDCfz_u9pmwM7YU9iIgxgDU6_gt1Vnc8VGjZIxwu4Z0FHCkBRIlSi25fPsrk05JsGAUFUHzlePswzuCzEiy5lFrSIhzWgnkVuJvB5yUYFOYCS_9FrgRfZPDlEkYLOCEmDIWF96epNsl1arRP-Sorj0pl2qGMJnjT8k1WviuVcRhzJfWK8pppWZTTXXtE9_Zk4w_5fpMMKGPKfymq448OfyoMYGSiiJsN9lx1_dnpL7muGO2EOPHfd9XxV4e_5d89hAg4Ft57j665u4C_O_wjxzmNRSi496LXwD8d_pXPc0woSUD8P8816jNX_87rSsSJYWQr9R9XL_4xATBwVWPV-r9_cTjG" + }, + "start_time": "2021-11-07T23:54:45Z", + "last_updated": "2021-11-07T23:54:49Z" + } + ] + } + }, + "uuid": "13d8a8e0-e54e-3e8f-9649-d902a9950f31" + }, + { + "id": "775f4f0a-3b8a-37e2-aa47-140285fb2b1c", + "request": { + "url": "/_scheduler/docs/_replicator/testString", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:50 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "2dd32790877ffef6279a3f9fe908836f", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "2dd3279087", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "database": "_replicator", + "doc_id": "testString", + "id": null, + "source": null, + "target": null, + "state": "failed", + "error_count": 1, + "info": { + "error": "{error,{case_clause,{error,invalid_uri}}}" + }, + "start_time": "2022-05-16T21:08:50Z", + "last_updated": "2022-05-16T21:08:50Z" + } + }, + "uuid": "775f4f0a-3b8a-37e2-aa47-140285fb2b1c" + }, + { + "id": "266af994-f5f5-31d5-bcda-15a9ea3c86b5", + "request": { + "url": "/_scheduler/docs/_replicator/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:22:17 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "da1acdc1a05b5d5bbaca269dca53b94d", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "da1acdc1a0", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)" + } + }, + "uuid": "266af994-f5f5-31d5-bcda-15a9ea3c86b5" + }, + { + "id": "5c158d49-97e6-3f2b-99ec-2f6629a13c77", + "request": { + "url": "/_scheduler/jobs?limit=25&skip=0", + "method": "GET" + }, + "response": { + "status": 200, + "jsonBody": { + "total_rows": 1, + "offset": 0, + "jobs": [ + { + "database": "_replicator", + "doc_id": "testString", + "history": [ + { + "timestamp": "2022-05-16T21:08:50Z", + "type": "started" + }, + { + "timestamp": "2022-05-16T21:08:50Z", + "type": "error" + } + ], + "id": "testString", + "info": { + "changes_pending": null, + "checkpointed_source_seq": "113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ", + "doc_write_failures": 0, + "docs_read": 2, + "docs_written": 2, + "missing_revisions_found": 0, + "revisions_checked": 2, + "source_seq": "2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", + "through_seq": "2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" + }, + "node": "node1@127.0.0.1", + "pid": "<0.1850.0>", + "source": "http://test.com/testString", + "start_time": "2022-05-16T21:08:50Z", + "target": "http://adm:*****@localhost:15984/testString/", + "user": null + } + ] + }, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 16:54:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "d97a5d3526ee45e215450a0abea76caf", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "d97a5d3526", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "5c158d49-97e6-3f2b-99ec-2f6629a13c77" + }, + { + "id": "e9f68b82-7693-38ea-bd6a-66227a0086bf", + "request": { + "url": "/_scheduler/jobs/testString", + "method": "GET" + }, + "response": { + "status": 200, + "jsonBody": { + "database": "_replicator", + "doc_id": "testString", + "history": [ + { + "timestamp": "2022-05-16T21:08:50Z", + "type": "started" + }, + { + "timestamp": "2022-05-16T21:08:50Z", + "type": "error" + } + ], + "id": "testString", + "info": { + "changes_pending": null, + "checkpointed_source_seq": "113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ", + "doc_write_failures": 0, + "docs_read": 2, + "docs_written": 2, + "missing_revisions_found": 0, + "revisions_checked": 2, + "source_seq": "2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", + "through_seq": "2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" + }, + "node": "node1@127.0.0.1", + "pid": "<0.1850.0>", + "source": "http://test.com/testString", + "start_time": "2022-05-16T21:08:50Z", + "target": "http://adm:*****@localhost:15984/testString/", + "user": null + }, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 17:07:47 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "7842b56965a4f079106b35134a6e7e7d", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "7842b56965", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "e9f68b82-7693-38ea-bd6a-66227a0086bf" + }, + { + "id": "e1623757-bf89-30e0-b209-1f5601bc039a", + "request": { + "url": "/_scheduler/jobs/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 17:06:24 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "397edf40473b25285c6c9048a9159f5d", + "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", + "X-Couch-Request-ID": "397edf4047", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "e1623757-bf89-30e0-b209-1f5601bc039a" + }, + { + "id": "1244a623-9af3-3200-b5cf-72605afcbcdc", + "request": { + "url": "/_search_analyze", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"analyzer\": \"english\", \"text\": \"running is fun\"}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:45 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "752119aa13519496f4b8ca931ac9805d", + "X-Cloudant-Action": "cloudantnosqldb.account-search-analyze.execute", + "X-Couch-Request-ID": "752119aa13", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "tokens": [ + "teststring" + ] + } + }, + "uuid": "1244a623-9af3-3200-b5cf-72605afcbcdc" + }, + { + "id": "7d66f494-6c33-3ad6-a9fb-478a37bdddb1", + "request": { + "url": "/_session", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "09b190ce0497173c7cd117d33f0cbce0", + "X-Cloudant-Action": "cloudantnosqldb.session.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "userCtx": { + "roles": [ + "_reader", + "_writer", + "_admin" + ], + "name": "iam-ServiceId-d3730bf4-80fx-4a35-9f1d-6e17f6cf369e" + }, + "ok": true, + "info": { + "authentication_handlers": [ + "iam", + "cookie", + "default", + "local" + ], + "authenticated": "iam", + "authentication_db": "bm-cc-us-east-05/users" + } + } + }, + "uuid": "7d66f494-6c33-3ad6-a9fb-478a37bdddb1" + }, + { + "id": "2dbb122f-e2d2-37ba-948d-dfb542bed417", + "request": { + "url": "/_up", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:00 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "54aa03b6b2f86864aeb66bb8880a7410", + "X-Cloudant-Action": "cloudantnosqldb.account-up.read", + "X-Couch-Request-ID": "54aa03b6b2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "status": "ok", + "seeds": {} + } + }, + "uuid": "2dbb122f-e2d2-37ba-948d-dfb542bed417" + }, + { + "id": "327b6531-390c-3921-8fa8-2d3a15a5c354", + "request": { + "url": "/_up", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:59 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "a3174645ff67c7323413c124304c3120", + "X-Cloudant-Action": "cloudantnosqldb.account-up.read", + "X-Couch-Request-ID": "a3174645ff", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "327b6531-390c-3921-8fa8-2d3a15a5c354" + }, + { + "id": "ff71d02c-9458-3cc5-8bda-10ef97e619e0", + "request": { + "url": "/_uuids?count=1", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "no-cache", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:31 GMT", + "ETag": "W/\"6QFC7LLFUJMXCK2CLNVW17C9T\"", + "Expires": "Mon, 01 Jan 1990 00:00:00 GMT", + "Pragma": "no-cache", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "7b3d88210d51e4558a56f0a18a17a185", + "X-Cloudant-Action": "cloudantnosqldb.account-uuids.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "uuids": [ + "4cf311226d91632bf1480e4edeac069e" + ] + } + }, + "uuid": "ff71d02c-9458-3cc5-8bda-10ef97e619e0" + }, + { + "id": "32a541c3-6915-3b1d-a8d8-26df21c8e3b4", + "request": { + "url": "/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5129cddfb161533246b92249c36bf908", + "X-Cloudant-Action": "cloudantnosqldb.database-info.read", + "X-Couch-Request-ID": "5129cddfb1", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "32a541c3-6915-3b1d-a8d8-26df21c8e3b4" + }, + { + "id": "28948775-8ce7-3d39-88ba-16ef4e7bf6f4", + "request": { + "url": "/testString/_all_docs/queries", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"queries\": [{}]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:36 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "1aa1063b6a539c0dfdc6fdc223e0e30e", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "1aa1063b6a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "results": [ + { + "total_rows": 2, + "offset": 0, + "rows": [ + { + "id": "_design/testString", + "key": "_design/testString", + "value": { + "rev": "5-be9ac99e964a971214f795dacceba0fe" + } + }, + { + "id": "testString", + "key": "testString", + "value": { + "rev": "6-80028e69ea6e259eba0b419c3750128b" + } + } + ] + } + ] + } + }, + "uuid": "28948775-8ce7-3d39-88ba-16ef4e7bf6f4" + }, + { + "id": "7be40bd0-8e36-3edd-a7b5-e45656e2e5ad", + "request": { + "url": "/testString/_all_docs", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:35 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "aeee0214122f14bdb09aaca920bfb854", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "aeee021412", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 2, + "offset": 0, + "rows": [ + { + "id": "_design/testString", + "key": "_design/testString", + "value": { + "rev": "5-be9ac99e964a971214f795dacceba0fe" + } + }, + { + "id": "testString", + "key": "testString", + "value": { + "rev": "6-80028e69ea6e259eba0b419c3750128b" + } + } + ] + } + }, + "uuid": "7be40bd0-8e36-3edd-a7b5-e45656e2e5ad" + }, + { + "id": "28b9ab32-ea1f-3dad-b95b-a7a4d85577a8", + "request": { + "url": "/testString/_bulk_docs", + "method": "POST", + "bodyPatterns": [ + { + "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:37 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3e01e9903d1dc1d839031298207d4698", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "x-cloudant-cost-write": "1", + "X-Couch-Request-ID": "3e01e9903d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": [ + { + "ok": true, + "id": "a40deaed41325036f37b18a5c48e5c5c", + "rev": "1-967a00dff5e02add41819138abb3284d" + } + ] + }, + "uuid": "28b9ab32-ea1f-3dad-b95b-a7a4d85577a8" + }, + { + "id": "74cf16a4-75b1-3914-a50d-014650c7140a", + "request": { + "urlPath": "/testString/_bulk_get", + "method": "POST", + "queryParameters": { + "attachments": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "revs": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"docs\": [{\"atts_since\": [\"1-99b02e08da151943c2dcb40090160bb8\"], \"id\": \"order00067\", \"rev\": \"3-917fa2381192822767f010b95b45325b\"}]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:37 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "e007ac087f2f353b5deac55d745bf37d", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "x-cloudant-cost-lookup": "1", + "X-Couch-Request-ID": "e007ac087f", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "results": [ + { + "id": "order00067", + "docs": [ + { + "error": { + "id": "order00067", + "rev": "3-917fa2381192822767f010b95b45325b", + "error": "not_found", + "reason": "missing" + } + } + ] + } + ] + } + }, + "uuid": "74cf16a4-75b1-3914-a50d-014650c7140a" + }, + { + "id": "020940d2-536c-36f7-9bf8-67b3b3fce208", + "request": { + "urlPath": "/testString/_changes", + "method": "POST", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "descending": { + "equalTo": "false" + }, + "feed": { + "equalTo": "normal" + }, + "filter": { + "equalTo": "testString" + }, + "heartbeat": { + "equalTo": "1" + }, + "include_docs": { + "equalTo": "false" + }, + "limit": { + "equalTo": "0" + }, + "seq_interval": { + "equalTo": "1" + }, + "since": { + "equalTo": "0" + }, + "style": { + "equalTo": "main_only" + }, + "timeout": { + "equalTo": "60000" + }, + "view": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "jsonBody": { + "results": [ + { + "seq": "1-g1AAAAT7eJzLYWBgEMhgTmHQTElKzi9KdUhJMjTSS8rVTU7WLS3WTU0sLtE1MNVLzskvTUnMK9HLSy3JAWphSmRI4v___39WIgNIswZcsyURepMEgGSSPDbtZsRoVwBp1wdpz2BOZMgF8tiTks1NU9OMSDAK1V5ivJxkALLXHuFsEoMsyQGk35_sUAsAaY8nO9QSQNrzUUItNTEl1dLAkrahVgCyt57sUMtjAZIMDUAKaEQ_WSEHMWICxIj5ZIUexIgFECPWg0KQERyCholmaUlpqTQNQYjdGyB276ckFA9AzDhPQShegBhxn4JQfAAx4j0iHSZbmAETYhIdQvEDxG5QWswCAAkkmjk", + "id": "testString", + "changes": [ + { + "rev": "1-967a00dff5e02add41819138abb3284d" + } + ] + }, + { + "seq": "2-g1AAAAZVeJy9lM9NwzAYxQ1F4kg3gCMcEtz8c3yiG8AG4M_-oqpKE0TTM2wAG8AGsAFsABvABnSDYGOJ1LckKL04kpX3fk_fs50TQsazkSInCmR5g1MFk8CHhSelt1p6KJaVR2Nf5uVKiaLyC6xyLdkVBA7qup7PRoIs9MZ-lFBOFetiZLDHf3_zFlQY6xUODVgQV560kR8Z-amTGySLMQs6WLncNsMCarhnTeyOw4ap0Z87uVWKEiQMPO8LA750wGHMMGDYwapHUVeGWzpcFAo55cMWdW24t72LKvb0Su70R1vcN9klywIeZMOWZeEPFv64cVIYC6NUDVqYZT9Z9rNh7_yyJyLJIMNBS7PsF8t-_U9xb9bjvckf80ghhNso7sPCP3u9bNbiy1p8bxy8NNG3BrYw_7Vlm4sz_wEJbgPy", + "id": "_design/testString", + "changes": [ + { + "rev": "1-7a60109c85ab05898824bb73aef71884" + } + ] + } + ], + "last_seq": "2-g1AAAAZVeJy9lM9NwzAYxQ1F4kg3gCMcEtz8c3yiG8AG4M_-oqpKE0TTM2wAG8AGsAFsABvABnSDYGOJ1LckKL04kpX3fk_fs50TQsazkSInCmR5g1MFk8CHhSelt1p6KJaVR2Nf5uVKiaLyC6xyLdkVBA7qup7PRoIs9MZ-lFBOFetiZLDHf3_zFlQY6xUODVgQV560kR8Z-amTGySLMQs6WLncNsMCarhnTeyOw4ap0Z87uVWKEiQMPO8LA750wGHMMGDYwapHUVeGWzpcFAo55cMWdW24t72LKvb0Su70R1vcN9klywIeZMOWZeEPFv64cVIYC6NUDVqYZT9Z9rNh7_yyJyLJIMNBS7PsF8t-_U9xb9bjvckf80ghhNso7sPCP3u9bNbiy1p8bxy8NNG3BrYw_7Vlm4sz_wEJbgPy", + "pending": 0 + }, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "ETag": "W/\"8DLU1VJV4CEKAI17LB0GT0N6O\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "404db768c41f8545f254f1dfd0ea5629", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "404db768c4", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + } + }, + "uuid": "020940d2-536c-36f7-9bf8-67b3b3fce208" + }, + { + "id": "461288f0-48dd-3060-9313-54cbccd47cad", + "request": { + "urlPath": "/testString/_design/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + }, + "new_edits": { + "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 21:27:49 GMT", + "ETag": "W/\"3-7144018200809db9cf3c818ad73db361\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/_design%2FtestString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "e124a1c51ad9305dc6b7d0c9b221b4e9", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "e124a1c51a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "_design/testString", + "rev": "3-7144018200809db9cf3c818ad73db361" + } + }, + "uuid": "461288f0-48dd-3060-9313-54cbccd47cad" + }, + { + "id": "b03a36c9-109f-32af-a3ce-fe7116672291", + "request": { + "url": "/testString/_design/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 20:45:03 GMT", + "ETag": "\"1-967a00dff5e02add41819138abb3284d\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "c44b096c253fb87b996ae27d08075657", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "c44b096c25", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "b03a36c9-109f-32af-a3ce-fe7116672291" + }, + { + "id": "fff55e78-260e-3b17-a8cf-1934e090287e", + "request": { + "urlPath": "/testString/_design/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "deleted_conflicts": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + }, + "meta": { + "equalTo": "false" + }, + "rev": { + "equalTo": "testString" + }, + "revs": { + "equalTo": "false" + }, + "revs_info": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 21:14:31 GMT", + "ETag": "W/\"1-967a00dff5e02add41819138abb3284d\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "c7fa2320139c35e187a736e478811ae0", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "c7fa232013", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "_id": "_design/testString", + "_rev": "1-967a00dff5e02add41819138abb3284d" + } + }, + "uuid": "fff55e78-260e-3b17-a8cf-1934e090287e" + }, + { + "id": "720ca71a-295f-3d91-aa44-a7dddf28f915", + "request": { + "url": "/testString/_design/testString/_info", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:39 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "fd54336e518033cf53162cba352a86bb", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "fd54336e51", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "name": "testString", + "view_index": { + "updates_pending": { + "minimum": 9, + "preferred": 7, + "total": 9 + }, + "waiting_commit": false, + "waiting_clients": 0, + "updater_running": false, + "update_seq": 0, + "sizes": { + "file": 816, + "external": 0, + "active": 0 + }, + "signature": "3e823c2a4383ac0c18d4e574135a5b08", + "purge_seq": 0, + "language": "javascript", + "compact_running": false, + "collator_versions": [ + "58.0.6.48" + ] + } + } + }, + "uuid": "720ca71a-295f-3d91-aa44-a7dddf28f915" + }, + { + "id": "8e817ede-8647-3ada-ab72-58dfc263fc30", + "request": { + "url": "/testString/_design/testString/_search/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"query\": \"name:Jane* AND active:True\"}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 15:49:53 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "9b54ed06009bf95d8137e21ebc705792", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "9b54ed0600", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 0, + "bookmark": "g2o", + "rows": [] + } + }, + "uuid": "8e817ede-8647-3ada-ab72-58dfc263fc30" + }, + { + "id": "bbecd8e4-e759-3d2a-959b-d5e9f94b7dd9", + "request": { + "url": "/testString/_design/testString/_search_disk_size/testString", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "X-Frame-Options": "DENY", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "Strict-Transport-Security": "max-age=31536000", + "Server": "Cloudant", + "Cache-Control": "must-revalidate", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Backend": "bigblue", + "X-Couch-Request-ID": "6b16a74e", + "X-Cloudant-Request-Class": "unlimited", + "Date": "Wed, 08 Jan 2025 17:25:47 GMT", + "Via": "1.1 lb3.bigblue (Glum)", + "Content-Type": "application/json" + }, + "jsonBody": { + "name": "_design/testString/testString", + "search_index": { + "disk_size": 11906 + } + } + }, + "uuid": "bbecd8e4-e759-3d2a-959b-d5e9f94b7dd9" + }, + { + "id": "e6c0db1b-cd2e-379e-b7a6-27ec75049831", + "request": { + "url": "/testString/_design/testString/_search_info/testString", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 15:53:44 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3404cc7ff86fd35a4b20916886f83157", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "3404cc7ff8", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "name": "_design/testString/testString", + "search_index": { + "signature": "61f0b78b3e5e995c781fdf4314be424d", + "pending_seq": 2, + "doc_del_count": 0, + "doc_count": 2, + "disk_size": 2919, + "committed_seq": 2 + } + } + }, + "uuid": "e6c0db1b-cd2e-379e-b7a6-27ec75049831" + }, + { + "id": "d3c833ba-4501-3b32-b148-5bd28a803971", + "request": { + "url": "/testString/_design/testString/_view/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 21:36:38 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "32896eea2831f2fd3e9a395511d1ad9d", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "32896eea28", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "testString", + "key": "testString", + "value": 1 + } + ] + } + }, + "uuid": "d3c833ba-4501-3b32-b148-5bd28a803971" + }, + { + "id": "c3486bd0-042f-355e-8981-2660f426fc78", + "request": { + "url": "/testString/_design/testString/_view/testString/queries", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"queries\": [{}]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 21:34:23 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3dcd8e06f37f2c9447847b215a34c7bc", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "3dcd8e06f3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "results": [ + { + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "testString", + "key": "testString", + "value": 1 + } + ] + } + ] + } + }, + "uuid": "c3486bd0-042f-355e-8981-2660f426fc78" + }, + { + "id": "4620004f-c409-3896-a6a9-8a2dacfa5356", + "request": { + "urlPath": "/testString/_design/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:45:39 GMT", + "ETag": "W/\"4-111f03850e4f2067647dcc724ded6355\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "30bea87f8ef003389fe71c1bdcd9d60c", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "30bea87f8e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "_design/testString", + "rev": "2-111f03850e4f2067647dcc724ded6355" + } + }, + "uuid": "4620004f-c409-3896-a6a9-8a2dacfa5356" + }, + { + "id": "e0812d78-e939-3d3b-b4d7-c0ec30388f56", + "request": { + "url": "/testString/_design_docs", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 24 May 2022 20:50:44 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "90a04990685e86a438d58f8341c53fbd", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "90a0499068", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "_design/testString", + "key": "_design/testString", + "value": { + "rev": "5-be9ac99e964a971214f795dacceba0fe" + } + } + ] + } + }, + "uuid": "e0812d78-e939-3d3b-b4d7-c0ec30388f56" + }, + { + "id": "30c2e356-94cd-3c5a-b5a0-2396b5bc4eaf", + "request": { + "url": "/testString/_design_docs/queries", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"queries\": [{}]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Tue, 24 May 2022 20:53:32 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "abf1f943184e48e3667be3cc7bfecd92", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "abf1f94318", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "results": [ + { + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "_design/testString", + "key": "_design/testString", + "value": { + "rev": "5-be9ac99e964a971214f795dacceba0fe" + } + } + ] + } + ] + } + }, + "uuid": "30c2e356-94cd-3c5a-b5a0-2396b5bc4eaf" + }, + { + "id": "83a8375b-20e0-36b2-ba07-cbc994140f3e", + "request": { + "url": "/testString/_explain", + "method": "POST", + "bodyPatterns": [ { - "database":"_replicator", - "doc_id":"testString", - "history":[ - {"timestamp":"2022-05-16T21:08:50Z","type":"started"}, - {"timestamp":"2022-05-16T21:08:50Z","type":"error"} + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"_id\", \"type\", \"name\", \"email\" ], \"limit\" : 3, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:45 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5db5f421aa87d09bf677dab0df8b409b", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "5db5f421aa", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "dbname": "account-bluemix/testString", + "index": { + "ddoc": null, + "name": "_all_docs", + "type": "special", + "def": { + "fields": [ + { + "_id": "asc" + } + ] + } + }, + "partitioned": "undefined", + "selector": { + "key1": { + "$eq": "testString" + } + }, + "opts": { + "use_index": [], + "bookmark": "nil", + "limit": 10000000000, + "skip": 0, + "sort": {}, + "fields": [ + "testString" ], - "id":"testString", - "info":{ - "changes_pending":null, - "checkpointed_source_seq":"113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ", - "doc_write_failures":0, - "docs_read":2, - "docs_written":2, - "missing_revisions_found":0, - "revisions_checked":2, - "source_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", - "through_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" + "partition": "", + "r": 1, + "conflicts": false, + "stale": false, + "update": true, + "stable": false, + "execution_stats": false + }, + "limit": 10000000000, + "skip": 0, + "fields": [ + "testString" + ], + "mrargs": { + "include_docs": true, + "view_type": "map", + "reduce": false, + "partition": null, + "start_key": null, + "end_key": "", + "direction": "fwd", + "stable": false, + "update": true, + "conflicts": "undefined" + } + } + }, + "uuid": "83a8375b-20e0-36b2-ba07-cbc994140f3e" + }, + { + "id": "e63e760d-4bad-31e3-865c-4d4e2c3ab28a", + "request": { + "url": "/testString/_find", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"_id\", \"type\", \"name\", \"email\" ], \"limit\" : 3, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:44 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "131553237ddf5d488049455ff3c78c24", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "131553237d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "docs": [], + "bookmark": "nil", + "warning": "No matching index found, create an index to optimize query time." + } + }, + "uuid": "e63e760d-4bad-31e3-865c-4d4e2c3ab28a" + }, + { + "id": "0aae4e1b-4552-3154-8b80-76bd1e4fe0a4", + "request": { + "urlPattern": "/testString/_index/_design/(.*)/json/(.*)", + "method": "DELETE" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:26:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "bdcc11a6e2426df69ea7f0dedeb61dc4", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "bdcc11a6e2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "0aae4e1b-4552-3154-8b80-76bd1e4fe0a4" + }, + { + "id": "8a7e9c07-5c90-37ff-a9ed-4374e25145ea", + "request": { + "url": "/testString/_index", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:24:06 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "fb5312b548be009f9658ad7343f24efb", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "fb5312b548", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 2, + "indexes": [ + { + "ddoc": null, + "name": "_all_docs", + "type": "special", + "def": { + "fields": [ + { + "_id": "asc" + } + ] + } }, - "node":"node1@127.0.0.1", - "pid":"<0.1850.0>", - "source":"http://test.com/testString", - "start_time":"2022-05-16T21:08:50Z", - "target":"http://adm:*****@localhost:15984/testString/", - "user":null + { + "ddoc": "_design/3fa64f0768edfd1dd7ec862c7415b3fe8138b393", + "name": "3fa64f0768edfd1dd7ec862c7415b3fe8138b393", + "type": "json", + "partitioned": false, + "def": { + "fields": [ + { + "_id": "asc" + } + ] + } + } + ] + } + }, + "uuid": "8a7e9c07-5c90-37ff-a9ed-4374e25145ea" + }, + { + "id": "6026c807-3ad5-3944-a4cc-6a4906aaefd3", + "request": { + "url": "/testString/_index", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"index\": {}}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 15:42:53 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "b4c0baceee481be0eb2174c4a9962c58", + "X-Cloudant-Action": "cloudantnosqldb.design-document.write", + "X-Couch-Request-ID": "b4c0baceee", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "query", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "result": "created", + "id": "_design/3fa64f0768edfd1dd7ec862c7415b3fe8138b393", + "name": "3fa64f0768edfd1dd7ec862c7415b3fe8138b393" + } + }, + "uuid": "6026c807-3ad5-3944-a4cc-6a4906aaefd3" + }, + { + "id": "c8bd56cb-8f5b-3521-80a9-75231b5a5069", + "request": { + "urlPath": "/testString/_local/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:32:13 GMT", + "ETag": "W/\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/_local%2FtestString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "6cb9599b2c12bc8ca784be001ad71f92", + "X-Cloudant-Action": "cloudantnosqldb.local-document.write", + "X-Couch-Request-ID": "6cb9599b2c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "_local/testString", + "rev": "0-1" + } + }, + "uuid": "c8bd56cb-8f5b-3521-80a9-75231b5a5069" + }, + { + "id": "e2fa7386-36e2-36f0-ad24-0b3e7ebd3585", + "request": { + "url": "/testString/_local/testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:34:22 GMT", + "ETag": "\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "0acbffcb1d8029d190789dddd3521397", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "0acbffcb1d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "e2fa7386-36e2-36f0-ad24-0b3e7ebd3585" + }, + { + "id": "825527a5-47ec-355d-b00a-0877fbb0a29e", + "request": { + "urlPath": "/testString/_local/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:08 GMT", + "ETag": "W/\"DKGUB9HWEX2KQNSCSMV0JG1KK\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "758b33bb54b870dde75c57382a6bc1b6", + "X-Cloudant-Action": "cloudantnosqldb.local-document.write", + "X-Couch-Request-ID": "758b33bb54", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "_local/testString", + "rev": "0-0" + } + }, + "uuid": "825527a5-47ec-355d-b00a-0877fbb0a29e" + }, + { + "id": "a169db5c-1dd0-3bd6-a373-5422ecfd1509", + "request": { + "urlPath": "/testString/_local/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:34:22 GMT", + "ETag": "W/\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "eb9e1ce6c4a1d44b41dea28aa5136d02", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "eb9e1ce6c4", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "_id": "_local/testString", + "_rev": "0-1" + } + }, + "uuid": "a169db5c-1dd0-3bd6-a373-5422ecfd1509" + }, + { + "id": "af6271d1-4985-3dc8-9662-501d6a81d30d", + "request": { + "url": "/testString/_partition/testString", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:19:26 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "9a31e19b4ed0ae92c12fdae6b2cfd5da", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "9a31e19b4e", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "db_name": "account-bluemix/testString", + "sizes": { + "active": 39, + "external": 2 + }, + "partition": "testString", + "doc_count": 1, + "doc_del_count": 0 + } + }, + "uuid": "af6271d1-4985-3dc8-9662-501d6a81d30d" + }, + { + "id": "2c580fc6-7377-38e3-8356-c7f2a36cad84", + "request": { + "url": "/testString/_partition/testString/_all_docs", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:20:22 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "3a686f700406d04e7fb1ace02dc471bc", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "3a686f7004", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "testString:testString", + "key": "testString:testString", + "value": { + "rev": "1-967a00dff5e02add41819138abb3284d" + } + } + ] + } + }, + "uuid": "2c580fc6-7377-38e3-8356-c7f2a36cad84" + }, + { + "id": "7d36c625-d941-34ba-99bb-519bd6ca923f", + "request": { + "url": "/testString/_partition/testString/_design/testString/_search/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"query\": \"name:Jane* AND active:True\"}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:15:39 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "17165e96850d9d0e13b1278163366b94", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "17165e9685", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 0, + "bookmark": "g2o", + "rows": [] + } + }, + "uuid": "7d36c625-d941-34ba-99bb-519bd6ca923f" + }, + { + "id": "ecaf4992-8865-3623-86d5-9181c46ed721", + "request": { + "url": "/testString/_partition/testString/_design/testString/_view/testString", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:23:18 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "690674ef064cae7a0cd532056e85622c", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "690674ef06", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "total_rows": 1, + "offset": 0, + "rows": [ + { + "id": "testString:testString", + "key": "testString:testString", + "value": 1 + } + ] + } + }, + "uuid": "ecaf4992-8865-3623-86d5-9181c46ed721" + }, + { + "id": "ca84624c-4bda-11ee-be56-0242ac120002", + "request": { + "url": "/testString/_partition/testString/_explain", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 05 Sep 2023 12:10:54 GMT", + "Server": "CouchDB/3.3.2 (Erlang OTP/24)", + "transaction-id": "5ebc08e24c058f8a9d9793c32c226bf3", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "5baeb05f80", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "dbname": "account-bluemix/testString", + "index": { + "ddoc": null, + "name": "_all_docs", + "type": "special", + "def": { + "fields": [ + { + "_id": "asc" + } + ] + } + }, + "partitioned": "undefined", + "selector": { + "key1": { + "$eq": "testString" + } + }, + "opts": { + "use_index": [], + "bookmark": "nil", + "limit": 10000000000, + "skip": 0, + "sort": {}, + "fields": [ + "testString" + ], + "partition": "testString", + "r": 1, + "conflicts": false, + "stale": false, + "update": true, + "stable": false, + "execution_stats": false + }, + "limit": 10000000000, + "skip": 0, + "fields": [ + "testString" + ], + "mrargs": { + "include_docs": true, + "view_type": "map", + "reduce": false, + "partition": "testString", + "start_key": null, + "end_key": "", + "direction": "fwd", + "stable": false, + "update": true, + "conflicts": "undefined" + } + } + }, + "uuid": "ca84624c-4bda-11ee-be56-0242ac120002" + }, + { + "id": "337c4338-3094-3c88-a44e-981e449b1d7a", + "request": { + "url": "/testString/_partition/testString/_find", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Thu, 19 May 2022 22:26:19 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5ebc08e24c058f8a9d9793c32c226bf3", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "5ebc08e24c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "docs": [], + "bookmark": "nil", + "warning": "No matching index found, create an index to optimize query time." + } + }, + "uuid": "337c4338-3094-3c88-a44e-981e449b1d7a" + }, + { + "id": "acadaa2a-bebd-3daf-987b-a8eacc2227e0", + "request": { + "url": "/testString/_revs_diff", + "method": "POST", + "bodyPatterns": [ + { + "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:40:13 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "295ee11482f22ffa973e81daf2613898", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "295ee11482", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "key1": { + "missing": [ + "1-testString" + ] + } + } + }, + "uuid": "acadaa2a-bebd-3daf-987b-a8eacc2227e0" + }, + { + "id": "60056468-bcb5-3b3f-9815-bf4c95c623b4", + "request": { + "url": "/testString/_security", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "5d8b354c95486f5a0f06200096ca5612", + "X-Cloudant-Action": "cloudantnosqldb.database-security.read", + "X-Couch-Request-ID": "5d8b354c95", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": {} + }, + "uuid": "60056468-bcb5-3b3f-9815-bf4c95c623b4" + }, + { + "id": "28ac8e52-0af2-37e5-b22e-558da950be34", + "request": { + "url": "/testString/_security", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:51 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "a3973a0f6fe6cba29ecb9647fae801f3", + "X-Cloudant-Action": "cloudantnosqldb.database-security.write", + "X-Couch-Request-ID": "a3973a0f6f", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "28ac8e52-0af2-37e5-b22e-558da950be34" + }, + { + "id": "b8c0e06d-17c2-3810-9377-7c219ebe3dd9", + "request": { + "url": "/testString/_shards", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:59 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "c7a84aa69921ef4072d42ec31b0d3db3", + "X-Cloudant-Action": "cloudantnosqldb.database-shards.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "shards": { + "00000000-0fffffff": [ + "dbcore@db1.bm-cc-us-east-05.cloudant.net", + "dbcore@db10.bm-cc-us-east-05.cloudant.net", + "dbcore@db12.bm-cc-us-east-05.cloudant.net" + ], + "10000000-1fffffff": [ + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ], + "20000000-2fffffff": [ + "dbcore@db4.bm-cc-us-east-05.cloudant.net", + "dbcore@db5.bm-cc-us-east-05.cloudant.net", + "dbcore@db6.bm-cc-us-east-05.cloudant.net" + ], + "30000000-3fffffff": [ + "dbcore@db11.bm-cc-us-east-05.cloudant.net", + "dbcore@db2.bm-cc-us-east-05.cloudant.net", + "dbcore@db3.bm-cc-us-east-05.cloudant.net" + ], + "40000000-4fffffff": [ + "dbcore@db1.bm-cc-us-east-05.cloudant.net", + "dbcore@db10.bm-cc-us-east-05.cloudant.net", + "dbcore@db12.bm-cc-us-east-05.cloudant.net" + ], + "50000000-5fffffff": [ + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ], + "60000000-6fffffff": [ + "dbcore@db4.bm-cc-us-east-05.cloudant.net", + "dbcore@db5.bm-cc-us-east-05.cloudant.net", + "dbcore@db6.bm-cc-us-east-05.cloudant.net" + ], + "70000000-7fffffff": [ + "dbcore@db11.bm-cc-us-east-05.cloudant.net", + "dbcore@db2.bm-cc-us-east-05.cloudant.net", + "dbcore@db3.bm-cc-us-east-05.cloudant.net" + ], + "80000000-8fffffff": [ + "dbcore@db1.bm-cc-us-east-05.cloudant.net", + "dbcore@db10.bm-cc-us-east-05.cloudant.net", + "dbcore@db12.bm-cc-us-east-05.cloudant.net" + ], + "90000000-9fffffff": [ + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ], + "a0000000-afffffff": [ + "dbcore@db4.bm-cc-us-east-05.cloudant.net", + "dbcore@db5.bm-cc-us-east-05.cloudant.net", + "dbcore@db6.bm-cc-us-east-05.cloudant.net" + ], + "b0000000-bfffffff": [ + "dbcore@db11.bm-cc-us-east-05.cloudant.net", + "dbcore@db2.bm-cc-us-east-05.cloudant.net", + "dbcore@db3.bm-cc-us-east-05.cloudant.net" + ], + "c0000000-cfffffff": [ + "dbcore@db1.bm-cc-us-east-05.cloudant.net", + "dbcore@db10.bm-cc-us-east-05.cloudant.net", + "dbcore@db12.bm-cc-us-east-05.cloudant.net" + ], + "d0000000-dfffffff": [ + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ], + "e0000000-efffffff": [ + "dbcore@db4.bm-cc-us-east-05.cloudant.net", + "dbcore@db5.bm-cc-us-east-05.cloudant.net", + "dbcore@db6.bm-cc-us-east-05.cloudant.net" + ], + "f0000000-ffffffff": [ + "dbcore@db11.bm-cc-us-east-05.cloudant.net", + "dbcore@db2.bm-cc-us-east-05.cloudant.net", + "dbcore@db3.bm-cc-us-east-05.cloudant.net" + ] + } + } + }, + "uuid": "b8c0e06d-17c2-3810-9377-7c219ebe3dd9" + }, + { + "id": "d20bae36-5d48-3bf4-b14d-e954b7869d55", + "request": { + "url": "/testString/_shards/testString", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "content-security-policy": "sandbox", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:59 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "b2f00c238f9bd4ffa701399e34d9bf54", + "X-Cloudant-Action": "cloudantnosqldb.database-shards.read", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "range": "10000000-1fffffff", + "nodes": [ + "dbcore@db7.bm-cc-us-east-05.cloudant.net", + "dbcore@db8.bm-cc-us-east-05.cloudant.net", + "dbcore@db9.bm-cc-us-east-05.cloudant.net" + ] + } + }, + "uuid": "d20bae36-5d48-3bf4-b14d-e954b7869d55" + }, + { + "id": "d317807f-250c-3abd-804d-34e98eebdad8", + "request": { + "urlPath": "/testString", + "method": "POST", + "queryParameters": { + "batch": { + "equalTo": "ok" + } + } + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 17:07:57 GMT", + "Location": "https://ACCOUNT.cloudant.com/testString/a27fe29f38cf3cf647d8575585706955", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "efbd92438c668c8d821a454cf4e27223", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "efbd92438c", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "a27fe29f38cf3cf647d8575585706955", + "rev": "1-967a00dff5e02add41819138abb3284d" + } + }, + "uuid": "d317807f-250c-3abd-804d-34e98eebdad8" + }, + { + "id": "a2bd99a8-d38d-3c23-8e98-40d6cd029ff1", + "request": { + "url": "/testString", + "method": "DELETE" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:09:10 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "992526e30a13656ec4e93001efa2eb7c", + "X-Cloudant-Action": "cloudantnosqldb.database.delete", + "X-Couch-Request-ID": "992526e30a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "a2bd99a8-d38d-3c23-8e98-40d6cd029ff1" + }, + { + "id": "660a0142-29dd-3918-a4aa-f77527e358c2", + "request": { + "url": "/testString", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:34 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "09ea19385a69e38e5ee30e9e87cb6062", + "X-Cloudant-Action": "cloudantnosqldb.database-info.read", + "X-Couch-Request-ID": "09ea19385a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "unlimited", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "update_seq": "5-g1AAAAereJy91M1NwzAYgGFDkTjSDeAIhwTHSfxzohvABuDPdlRVbYNoeoYNYAPYADaADWAD2AA2ABtXpL4lSG4OiRQl36PkjTNFCA3HA40ONaj6yow0kBRmiVLJcpEYuWgSXKZqWi-1nDfp3DRTe8f2fMfu0Zc9fNttMh5INLMndnNpqNJlj3GhTTvbH97-bG3FqTYCeowLbdHZfvP2e2sTJQpamB7jnH30d3HW_aW_ePzV4Vu_eCkKbSDvM--_xZ88_ryG84xkQm6g-IO3H1s7k7SCymyg-J2379vimrG84HoTxW88frv2qbOKCFLFLQ6Xdg_Xq_W9qo1pmQsetTZcOLcO_itG2qWNRdTScObc8_B_VjJDWOR1DSMHnwaw5kaBgsiFsYNPgsKEcsI1i1v4wLnHwQODYqWpSNzCQ-fuBy7DojBExS0sEewFakGxwO4tdx80-QEwjmuB", + "instance_start_time": "1637834313", + "db_name": "testdb", + "purge_seq": 0, + "sizes": { + "file": 240670, + "external": 79, + "active": 7240 + }, + "props": {}, + "doc_del_count": 0, + "doc_count": 5, + "disk_format_version": 8, + "compact_running": false, + "cluster": { + "q": 16, + "n": 3, + "w": 2, + "r": 2 + } + } + }, + "uuid": "660a0142-29dd-3918-a4aa-f77527e358c2" + }, + { + "id": "939b8665-cf55-3a05-a46d-c208bcc4ada6", + "request": { + "urlPath": "/testString", + "method": "PUT", + "queryParameters": { + "partitioned": { + "equalTo": "false" + }, + "q": { + "equalTo": "16" + } + } + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 16:56:10 GMT", + "Location": "https://account-bluemix.cloudant.com/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "06ec2ee90406a602224231b8ab7d19aa", + "X-Cloudant-Action": "cloudantnosqldb.database.create", + "X-Couch-Request-ID": "06ec2ee904", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "939b8665-cf55-3a05-a46d-c208bcc4ada6" + }, + { + "id": "33f0d8ac-56f3-3a18-9366-761dcb30158f", + "request": { + "urlPath": "/testString/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:31:45 GMT", + "ETag": "W/\"2-49754e12a5d2cbe03c4118bad6709779\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "6beab9bf70a274822c5bcf7dee330078", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "6beab9bf70", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "2-49754e12a5d2cbe03c4118bad6709779" + } + }, + "uuid": "33f0d8ac-56f3-3a18-9366-761dcb30158f" + }, + { + "id": "ae2f6256-c33c-3e1a-9ed6-d16762069a0c", + "request": { + "urlPath": "/testString/testString", + "method": "GET", + "queryParameters": { + "att_encoding_info": { + "equalTo": "false" + }, + "attachments": { + "equalTo": "false" + }, + "local_seq": { + "equalTo": "false" + }, + "deleted_conflicts": { + "equalTo": "false" + }, + "conflicts": { + "equalTo": "false" + }, + "latest": { + "equalTo": "false" + }, + "meta": { + "equalTo": "false" + }, + "rev": { + "equalTo": "testString" + }, + "revs": { + "equalTo": "false" + }, + "revs_info": { + "equalTo": "false" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 18 May 2022 17:09:08 GMT", + "ETag": "W/\"3-5570e8bbb34412db757c2df4bfa1099b\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "bb234d40f358cc0ee3e8317890e8f065", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "bb234d40f3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "_id": "testString", + "_rev": "3-5570e8bbb34412db757c2df4bfa1099b" + } + }, + "uuid": "ae2f6256-c33c-3e1a-9ed6-d16762069a0c" + }, + { + "id": "559c7479-f8d9-3c89-a91d-6f34122908ed", + "request": { + "url": "/testString/testString?latest=false&rev=testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 16 May 2022 21:08:35 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "845550d983dcdb781e95385d4f92d4af", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "845550d983", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" + } + }, + "uuid": "559c7479-f8d9-3c89-a91d-6f34122908ed" + }, + { + "id": "aed0b4bd-1c80-35b2-b8f9-7da76c4cda69", + "request": { + "url": "/testString/testString/testString?rev=testString", + "method": "GET" + }, + "response": { + "status": 200, + "body": "This is a mock file.", + "headers": { + "Accept-Ranges": "none", + "Cache-Control": "must-revalidate", + "Content-MD5": "Vtnbf/a1yLJ4pm/eEB6fHA==", + "content-security-policy": "sandbox", + "Content-Type": "application/octet-stream", + "Date": "Fri, 20 May 2022 18:27:25 GMT", + "ETag": "\"Vtnbf/a1yLJ4pm/eEB6fHA==\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "ecd7339c8a26c3ed107b5284eb15a76b", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "ecd7339c8a", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "aed0b4bd-1c80-35b2-b8f9-7da76c4cda69" + }, + { + "id": "efe03f6b-9784-3cd8-a4d3-ba2020661353", + "request": { + "url": "/testString/testString/testString?rev=testString", + "method": "PUT", + "bodyPatterns": [ + { + "equalTo": "This is a mock file." } ] }, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 16:54:51 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "d97a5d3526ee45e215450a0abea76caf", - "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", - "X-Couch-Request-ID": "d97a5d3526", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "5c158d49-97e6-3f2b-99ec-2f6629a13c77" - }, - { - "id": "e9f68b82-7693-38ea-bd6a-66227a0086bf", - "request": { - "url": "/_scheduler/jobs/testString", - "method": "GET" - }, - "response": { - "status": 200, - "jsonBody": { - "database":"_replicator", - "doc_id":"testString", - "history":[ - {"timestamp":"2022-05-16T21:08:50Z","type":"started"}, - {"timestamp":"2022-05-16T21:08:50Z","type":"error"} - ], - "id":"testString", - "info":{ - "changes_pending":null, - "checkpointed_source_seq":"113-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE01ygQLsZsYGqcamiZjKcRqRxwIkGRqA1H-oSbZgk1KMLCzTDE0wdWUBAF6HJIQ", - "doc_write_failures":0, - "docs_read":2, - "docs_written":2, - "missing_revisions_found":0, - "revisions_checked":2, - "source_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg", - "through_seq":"2-g1AAAACTeJzLYWBgYMpgTmHgz8tPSTV0MDQy1zMAQsMckEQiQ1L9____szKYE1lzgQLsBsZm5pZJJpjKcRqRxwIkGRqA1H-oSexgk4yMkhITjS0wdWUBADfEJBg" - }, - "node":"node1@127.0.0.1", - "pid":"<0.1850.0>", - "source":"http://test.com/testString", - "start_time":"2022-05-16T21:08:50Z", - "target":"http://adm:*****@localhost:15984/testString/", - "user":null - }, - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 17:07:47 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "7842b56965a4f079106b35134a6e7e7d", - "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", - "X-Couch-Request-ID": "7842b56965", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" - } - }, - "uuid": "e9f68b82-7693-38ea-bd6a-66227a0086bf" - }, - { - "id": "e1623757-bf89-30e0-b209-1f5601bc039a", - "request": { - "url": "/_scheduler/jobs/testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 17:06:24 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "397edf40473b25285c6c9048a9159f5d", - "X-Cloudant-Action": "cloudantnosqldb.replication-scheduler.read", - "X-Couch-Request-ID": "397edf4047", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" - } - }, - "uuid": "e1623757-bf89-30e0-b209-1f5601bc039a" - }, - { - "id": "1244a623-9af3-3200-b5cf-72605afcbcdc", - "request": { - "url": "/_search_analyze", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"analyzer\": \"english\", \"text\": \"running is fun\"}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"tokens\":[\"teststring\"]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:45 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "752119aa13519496f4b8ca931ac9805d", - "X-Cloudant-Action": "cloudantnosqldb.account-search-analyze.execute", - "X-Couch-Request-ID": "752119aa13", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "1244a623-9af3-3200-b5cf-72605afcbcdc" - }, - { - "id": "7d66f494-6c33-3ad6-a9fb-478a37bdddb1", - "request": { - "url": "/_session", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"userCtx\":{\"roles\":[\"_reader\",\"_writer\",\"_admin\"],\"name\":\"iam-ServiceId-d3730bf4-80fx-4a35-9f1d-6e17f6cf369e\"},\"ok\":true,\"info\":{\"authentication_handlers\":[\"iam\",\"cookie\",\"default\",\"local\"],\"authenticated\":\"iam\",\"authentication_db\":\"bm-cc-us-east-05/users\"}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:51 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "09b190ce0497173c7cd117d33f0cbce0", - "X-Cloudant-Action": "cloudantnosqldb.session.read", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "7d66f494-6c33-3ad6-a9fb-478a37bdddb1" - }, - { - "id": "2dbb122f-e2d2-37ba-948d-dfb542bed417", - "request": { - "url": "/_up", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"status\":\"ok\",\"seeds\":{}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:09:00 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "54aa03b6b2f86864aeb66bb8880a7410", - "X-Cloudant-Action": "cloudantnosqldb.account-up.read", - "X-Couch-Request-ID": "54aa03b6b2", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "2dbb122f-e2d2-37ba-948d-dfb542bed417" - }, - { - "id": "327b6531-390c-3921-8fa8-2d3a15a5c354", - "request": { - "url": "/_up", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:59 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "a3174645ff67c7323413c124304c3120", - "X-Cloudant-Action": "cloudantnosqldb.account-up.read", - "X-Couch-Request-ID": "a3174645ff", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "327b6531-390c-3921-8fa8-2d3a15a5c354" - }, - { - "id": "ff71d02c-9458-3cc5-8bda-10ef97e619e0", - "request": { - "url": "/_uuids?count=1", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"uuids\":[\"4cf311226d91632bf1480e4edeac069e\"]}", - "headers": { - "Cache-Control": "no-cache", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:31 GMT", - "ETag": "W/\"6QFC7LLFUJMXCK2CLNVW17C9T\"", - "Expires": "Mon, 01 Jan 1990 00:00:00 GMT", - "Pragma": "no-cache", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "7b3d88210d51e4558a56f0a18a17a185", - "X-Cloudant-Action": "cloudantnosqldb.account-uuids.read", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "ff71d02c-9458-3cc5-8bda-10ef97e619e0" - }, - { - "id": "32a541c3-6915-3b1d-a8d8-26df21c8e3b4", - "request": { - "url": "/testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "5129cddfb161533246b92249c36bf908", - "X-Cloudant-Action": "cloudantnosqldb.database-info.read", - "X-Couch-Request-ID": "5129cddfb1", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "32a541c3-6915-3b1d-a8d8-26df21c8e3b4" - }, - { - "id": "28948775-8ce7-3d39-88ba-16ef4e7bf6f4", - "request": { - "url": "/testString/_all_docs/queries", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"queries\": [{}]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"results\":[\n{\"total_rows\":2,\"offset\":0,\"rows\":[\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}},\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":{\"rev\":\"6-80028e69ea6e259eba0b419c3750128b\"}}\n]}\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:36 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "1aa1063b6a539c0dfdc6fdc223e0e30e", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "1aa1063b6a", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "28948775-8ce7-3d39-88ba-16ef4e7bf6f4" - }, - { - "id": "7be40bd0-8e36-3edd-a7b5-e45656e2e5ad", - "request": { - "url": "/testString/_all_docs", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":2,\"offset\":0,\"rows\":[\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}},\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":{\"rev\":\"6-80028e69ea6e259eba0b419c3750128b\"}}\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:35 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "aeee0214122f14bdb09aaca920bfb854", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "aeee021412", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "7be40bd0-8e36-3edd-a7b5-e45656e2e5ad" - }, - { - "id": "28b9ab32-ea1f-3dad-b95b-a7a4d85577a8", - "request": { - "url": "/testString/_bulk_docs", - "method": "POST", - "bodyPatterns": [ - { - "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "body": "[{\"ok\":true,\"id\":\"a40deaed41325036f37b18a5c48e5c5c\",\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}]", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:37 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "3e01e9903d1dc1d839031298207d4698", - "X-Cloudant-Action": "cloudantnosqldb.data-document.write", - "x-cloudant-cost-write": "1", - "X-Couch-Request-ID": "3e01e9903d", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "28b9ab32-ea1f-3dad-b95b-a7a4d85577a8" - }, - { - "id": "74cf16a4-75b1-3914-a50d-014650c7140a", - "request": { - "urlPath": "/testString/_bulk_get", - "method": "POST", - "queryParameters": { - "attachments": { - "equalTo": "false" - }, - "latest": { - "equalTo": "false" - }, - "revs": { - "equalTo": "false" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{\"docs\": [{\"atts_since\": [\"1-99b02e08da151943c2dcb40090160bb8\"], \"id\": \"order00067\", \"rev\": \"3-917fa2381192822767f010b95b45325b\"}]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"results\": [{\"id\": \"order00067\", \"docs\": [{\"error\":{\"id\":\"order00067\",\"rev\":\"3-917fa2381192822767f010b95b45325b\",\"error\":\"not_found\",\"reason\":\"missing\"}}]}]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:37 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "e007ac087f2f353b5deac55d745bf37d", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "x-cloudant-cost-lookup": "1", - "X-Couch-Request-ID": "e007ac087f", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "74cf16a4-75b1-3914-a50d-014650c7140a" - }, - { - "id": "020940d2-536c-36f7-9bf8-67b3b3fce208", - "request": { - "urlPath": "/testString/_changes", - "method": "POST", - "queryParameters": { - "att_encoding_info": { + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Fri, 20 May 2022 18:25:16 GMT", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/testString/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "4326af6ec28e12fcf8eca683ba57da8e", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "4326af6ec2", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "1-23085a965a5e50b32b00e57deb062932" + } + }, + "uuid": "efe03f6b-9784-3cd8-a4d3-ba2020661353" + }, + { + "id": "ecfbef48-33ff-30fe-b848-d09c6c472eac", + "request": { + "url": "/testString/testString/testString?rev=testString", + "method": "HEAD" + }, + "response": { + "status": 200, + "headers": { + "Accept-Ranges": "none", + "Cache-Control": "must-revalidate", + "Content-MD5": "Vtnbf/a1yLJ4pm/eEB6fHA==", + "content-security-policy": "sandbox", + "Content-Type": "application/octet-stream", + "Date": "Fri, 20 May 2022 18:26:53 GMT", + "ETag": "\"Vtnbf/a1yLJ4pm/eEB6fHA==\"", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "4e77768c5d87bc873bbcc11961504516", + "X-Cloudant-Action": "cloudantnosqldb.any-document.read", + "X-Couch-Request-ID": "4e77768c5d", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "lookup", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" + } + }, + "uuid": "ecfbef48-33ff-30fe-b848-d09c6c472eac" + }, + { + "id": "bf49e660-6802-3a7c-9975-5e451f4e1204", + "request": { + "urlPath": "/testString/testString/testString", + "method": "DELETE", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + } + } + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Mon, 23 May 2022 20:59:10 GMT", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "b00e9dd9c3835c3ca04049cc2c3deaeb", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "b00e9dd9c3", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" + }, + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "4-6705bb55c13a40bb465ab96fd810d996" + } + }, + "uuid": "bf49e660-6802-3a7c-9975-5e451f4e1204" + }, + { + "id": "5a60a196-eed3-33f2-9507-d6276639e89e", + "request": { + "urlPath": "/testString/testString", + "method": "PUT", + "queryParameters": { + "batch": { + "equalTo": "ok" + }, + "rev": { + "equalTo": "testString" + }, + "new_edits": { "equalTo": "false" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": false, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Wed, 25 May 2022 19:15:19 GMT", + "ETag": "W/\"6-80028e69ea6e259eba0b419c3750128b\"", + "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/testString", + "Server": "CouchDB/3.2.1 (Erlang OTP/20)", + "transaction-id": "0d39f720ff6eca60e344f22d000060c5", + "X-Cloudant-Action": "cloudantnosqldb.data-document.write", + "X-Couch-Request-ID": "0d39f720ff", + "X-Frame-Options": "DENY", + "Strict-Transport-Security": "max-age=31536000", + "X-Content-Type-Options": "nosniff", + "X-Cloudant-Request-Class": "write", + "X-Cloudant-Backend": "bm-cc-us-east-05", + "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", + "Vary": "Accept-Encoding" }, - "attachments": { - "equalTo": "false" - }, - "conflicts": { - "equalTo": "false" - }, - "descending": { - "equalTo": "false" - }, - "feed": { - "equalTo": "normal" - }, - "filter": { - "equalTo": "testString" - }, - "heartbeat": { - "equalTo": "1" - }, - "include_docs": { - "equalTo": "false" - }, - "limit": { - "equalTo": "0" - }, - "seq_interval": { - "equalTo": "1" - }, - "since": { - "equalTo": "0" - }, - "style": { - "equalTo": "main_only" - }, - "timeout": { - "equalTo": "60000" - }, - "view": { - "equalTo": "testString" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "results":[ - {"seq":"1-g1AAAAT7eJzLYWBgEMhgTmHQTElKzi9KdUhJMjTSS8rVTU7WLS3WTU0sLtE1MNVLzskvTUnMK9HLSy3JAWphSmRI4v___39WIgNIswZcsyURepMEgGSSPDbtZsRoVwBp1wdpz2BOZMgF8tiTks1NU9OMSDAK1V5ivJxkALLXHuFsEoMsyQGk35_sUAsAaY8nO9QSQNrzUUItNTEl1dLAkrahVgCyt57sUMtjAZIMDUAKaEQ_WSEHMWICxIj5ZIUexIgFECPWg0KQERyCholmaUlpqTQNQYjdGyB276ckFA9AzDhPQShegBhxn4JQfAAx4j0iHSZbmAETYhIdQvEDxG5QWswCAAkkmjk","id":"testString","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]}, - {"seq":"2-g1AAAAZVeJy9lM9NwzAYxQ1F4kg3gCMcEtz8c3yiG8AG4M_-oqpKE0TTM2wAG8AGsAFsABvABnSDYGOJ1LckKL04kpX3fk_fs50TQsazkSInCmR5g1MFk8CHhSelt1p6KJaVR2Nf5uVKiaLyC6xyLdkVBA7qup7PRoIs9MZ-lFBOFetiZLDHf3_zFlQY6xUODVgQV560kR8Z-amTGySLMQs6WLncNsMCarhnTeyOw4ap0Z87uVWKEiQMPO8LA750wGHMMGDYwapHUVeGWzpcFAo55cMWdW24t72LKvb0Su70R1vcN9klywIeZMOWZeEPFv64cVIYC6NUDVqYZT9Z9rNh7_yyJyLJIMNBS7PsF8t-_U9xb9bjvckf80ghhNso7sPCP3u9bNbiy1p8bxy8NNG3BrYw_7Vlm4sz_wEJbgPy","id":"_design/testString","changes":[{"rev":"1-7a60109c85ab05898824bb73aef71884"}]} - ], - "last_seq":"2-g1AAAAZVeJy9lM9NwzAYxQ1F4kg3gCMcEtz8c3yiG8AG4M_-oqpKE0TTM2wAG8AGsAFsABvABnSDYGOJ1LckKL04kpX3fk_fs50TQsazkSInCmR5g1MFk8CHhSelt1p6KJaVR2Nf5uVKiaLyC6xyLdkVBA7qup7PRoIs9MZ-lFBOFetiZLDHf3_zFlQY6xUODVgQV560kR8Z-amTGySLMQs6WLncNsMCarhnTeyOw4ap0Z87uVWKEiQMPO8LA750wGHMMGDYwapHUVeGWzpcFAo55cMWdW24t72LKvb0Su70R1vcN9klywIeZMOWZeEPFv64cVIYC6NUDVqYZT9Z9rNh7_yyJyLJIMNBS7PsF8t-_U9xb9bjvckf80ghhNso7sPCP3u9bNbiy1p8bxy8NNG3BrYw_7Vlm4sz_wEJbgPy", - "pending":0 - }, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "ETag": "W/\"8DLU1VJV4CEKAI17LB0GT0N6O\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "404db768c41f8545f254f1dfd0ea5629", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "404db768c4", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "020940d2-536c-36f7-9bf8-67b3b3fce208" - }, - { - "id": "461288f0-48dd-3060-9313-54cbccd47cad", - "request": { - "urlPath": "/testString/_design/testString", - "method": "PUT", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - }, - "new_edits": { - "equalTo": "false" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"_design/testString\",\"rev\":\"3-7144018200809db9cf3c818ad73db361\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 21:27:49 GMT", - "ETag": "W/\"3-7144018200809db9cf3c818ad73db361\"", - "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/_design%2FtestString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "e124a1c51ad9305dc6b7d0c9b221b4e9", - "X-Cloudant-Action": "cloudantnosqldb.design-document.write", - "X-Couch-Request-ID": "e124a1c51a", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "461288f0-48dd-3060-9313-54cbccd47cad" - }, - { - "id": "b03a36c9-109f-32af-a3ce-fe7116672291", - "request": { - "url": "/testString/_design/testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 20:45:03 GMT", - "ETag": "\"1-967a00dff5e02add41819138abb3284d\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "c44b096c253fb87b996ae27d08075657", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "c44b096c25", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "b03a36c9-109f-32af-a3ce-fe7116672291" - }, - { - "id": "fff55e78-260e-3b17-a8cf-1934e090287e", - "request": { - "urlPath": "/testString/_design/testString", - "method": "GET", - "queryParameters": { - "att_encoding_info": { - "equalTo": "false" - }, - "attachments": { - "equalTo": "false" - }, - "deleted_conflicts": { - "equalTo": "false" - }, - "conflicts": { - "equalTo": "false" - }, - "latest": { - "equalTo": "false" - }, - "local_seq": { - "equalTo": "false" - }, - "meta": { - "equalTo": "false" - }, - "rev": { - "equalTo": "testString" - }, - "revs": { - "equalTo": "false" - }, - "revs_info": { - "equalTo": "false" - } - } - }, - "response": { - "status": 200, - "body": "{\"_id\":\"_design/testString\",\"_rev\":\"1-967a00dff5e02add41819138abb3284d\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 21:14:31 GMT", - "ETag": "W/\"1-967a00dff5e02add41819138abb3284d\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "c7fa2320139c35e187a736e478811ae0", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "c7fa232013", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "fff55e78-260e-3b17-a8cf-1934e090287e" - }, - { - "id": "720ca71a-295f-3d91-aa44-a7dddf28f915", - "request": { - "url": "/testString/_design/testString/_info", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"name\":\"testString\",\"view_index\":{\"updates_pending\":{\"minimum\":9,\"preferred\":7,\"total\":9},\"waiting_commit\":false,\"waiting_clients\":0,\"updater_running\":false,\"update_seq\":0,\"sizes\":{\"file\":816,\"external\":0,\"active\":0},\"signature\":\"3e823c2a4383ac0c18d4e574135a5b08\",\"purge_seq\":0,\"language\":\"javascript\",\"compact_running\":false,\"collator_versions\":[\"58.0.6.48\"]}}", - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:39 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "fd54336e518033cf53162cba352a86bb", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "fd54336e51", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "720ca71a-295f-3d91-aa44-a7dddf28f915" - }, - { - "id": "8e817ede-8647-3ada-ab72-58dfc263fc30", - "request": { - "url": "/testString/_design/testString/_search/testString", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"query\": \"name:Jane* AND active:True\"}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":0,\"bookmark\":\"g2o\",\"rows\":[]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 15:49:53 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "9b54ed06009bf95d8137e21ebc705792", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "9b54ed0600", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.7)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "8e817ede-8647-3ada-ab72-58dfc263fc30" - }, - { - "id" : "bbecd8e4-e759-3d2a-959b-d5e9f94b7dd9", - "request" : { - "url" : "/testString/_design/testString/_search_disk_size/testString", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"name\":\"_design/testString/testString\",\"search_index\":{\"disk_size\":11906}}", - "headers" : { - "X-Frame-Options" : "DENY", - "X-Cloudant-Action" : "cloudantnosqldb.any-document.read", - "Strict-Transport-Security" : "max-age=31536000", - "Server" : "Cloudant", - "Cache-Control" : "must-revalidate", - "X-Content-Type-Options" : "nosniff", - "X-Cloudant-Backend" : "bigblue", - "X-Couch-Request-ID" : "6b16a74e", - "X-Cloudant-Request-Class" : "unlimited", - "Date" : "Wed, 08 Jan 2025 17:25:47 GMT", - "Via" : "1.1 lb3.bigblue (Glum)", - "Content-Type" : "application/json" - } - }, - "uuid" : "bbecd8e4-e759-3d2a-959b-d5e9f94b7dd9" - }, - { - "id": "e6c0db1b-cd2e-379e-b7a6-27ec75049831", - "request": { - "url": "/testString/_design/testString/_search_info/testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"name\":\"_design/testString/testString\",\"search_index\":{\"signature\":\"61f0b78b3e5e995c781fdf4314be424d\",\"pending_seq\":2,\"doc_del_count\":0,\"doc_count\":2,\"disk_size\":2919,\"committed_seq\":2}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 15:53:44 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "3404cc7ff86fd35a4b20916886f83157", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "3404cc7ff8", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.7)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "e6c0db1b-cd2e-379e-b7a6-27ec75049831" - }, - { - "id": "d3c833ba-4501-3b32-b148-5bd28a803971", - "request": { - "url": "/testString/_design/testString/_view/testString", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":1}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 21:36:38 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "32896eea2831f2fd3e9a395511d1ad9d", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "32896eea28", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "d3c833ba-4501-3b32-b148-5bd28a803971" - }, - { - "id": "c3486bd0-042f-355e-8981-2660f426fc78", - "request": { - "url": "/testString/_design/testString/_view/testString/queries", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"queries\": [{}]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"results\":[\r\n{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString\",\"key\":\"testString\",\"value\":1}\r\n]}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Thu, 19 May 2022 21:34:23 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "3dcd8e06f37f2c9447847b215a34c7bc", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "3dcd8e06f3", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "c3486bd0-042f-355e-8981-2660f426fc78" - }, - { - "id": "4620004f-c409-3896-a6a9-8a2dacfa5356", - "request": { - "urlPath": "/testString/_design/testString", - "method": "DELETE", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - } - } - }, - "response": { - "status": 200, - "body": "{\"ok\":true,\"id\":\"_design/testString\",\"rev\":\"2-111f03850e4f2067647dcc724ded6355\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 23 May 2022 20:45:39 GMT", - "ETag": "W/\"4-111f03850e4f2067647dcc724ded6355\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "30bea87f8ef003389fe71c1bdcd9d60c", - "X-Cloudant-Action": "cloudantnosqldb.design-document.write", - "X-Couch-Request-ID": "30bea87f8e", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "4620004f-c409-3896-a6a9-8a2dacfa5356" - }, - { - "id": "e0812d78-e939-3d3b-b4d7-c0ec30388f56", - "request": { - "url": "/testString/_design_docs", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 24 May 2022 20:50:44 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "90a04990685e86a438d58f8341c53fbd", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "90a0499068", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "e0812d78-e939-3d3b-b4d7-c0ec30388f56" - }, - { - "id": "30c2e356-94cd-3c5a-b5a0-2396b5bc4eaf", - "request": { - "url": "/testString/_design_docs/queries", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"queries\": [{}]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"results\":[\r\n{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"_design/testString\",\"key\":\"_design/testString\",\"value\":{\"rev\":\"5-be9ac99e964a971214f795dacceba0fe\"}}\r\n]}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Tue, 24 May 2022 20:53:32 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "abf1f943184e48e3667be3cc7bfecd92", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "abf1f94318", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "30c2e356-94cd-3c5a-b5a0-2396b5bc4eaf" - }, - { - "id": "83a8375b-20e0-36b2-ba07-cbc994140f3e", - "request": { - "url": "/testString/_explain", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"_id\", \"type\", \"name\", \"email\" ], \"limit\" : 3, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"dbname\":\"account-bluemix/testString\",\"index\":{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},\"partitioned\":\"undefined\",\"selector\":{\"key1\":{\"$eq\":\"testString\"}},\"opts\":{\"use_index\":[],\"bookmark\":\"nil\",\"limit\":10000000000,\"skip\":0,\"sort\":{},\"fields\":[\"testString\"],\"partition\":\"\",\"r\":1,\"conflicts\":false,\"stale\":false,\"update\":true,\"stable\":false,\"execution_stats\":false},\"limit\":10000000000,\"skip\":0,\"fields\":[\"testString\"],\"mrargs\":{\"include_docs\":true,\"view_type\":\"map\",\"reduce\":false,\"partition\":null,\"start_key\":null,\"end_key\":\"\",\"direction\":\"fwd\",\"stable\":false,\"update\":true,\"conflicts\":\"undefined\"}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:45 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "5db5f421aa87d09bf677dab0df8b409b", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "5db5f421aa", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "83a8375b-20e0-36b2-ba07-cbc994140f3e" - }, - { - "id": "e63e760d-4bad-31e3-865c-4d4e2c3ab28a", - "request": { - "url": "/testString/_find", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"bookmark\" : \"testString\", \"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"_id\", \"type\", \"name\", \"email\" ], \"limit\" : 3, \"r\" : 1, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"docs\":[\r\n],\r\n\"bookmark\": \"nil\",\r\n\"warning\": \"No matching index found, create an index to optimize query time.\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:44 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "131553237ddf5d488049455ff3c78c24", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "131553237d", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "e63e760d-4bad-31e3-865c-4d4e2c3ab28a" - }, - { - "id": "0aae4e1b-4552-3154-8b80-76bd1e4fe0a4", - "request": { - "urlPattern": "/testString/_index/_design/(.*)/json/(.*)", - "method": "DELETE" - }, - "response": { - "status": 200, - "body": "{\"ok\":true}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 23 May 2022 20:26:34 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "bdcc11a6e2426df69ea7f0dedeb61dc4", - "X-Cloudant-Action": "cloudantnosqldb.design-document.write", - "X-Couch-Request-ID": "bdcc11a6e2", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "0aae4e1b-4552-3154-8b80-76bd1e4fe0a4" - }, - { - "id": "8a7e9c07-5c90-37ff-a9ed-4374e25145ea", - "request": { - "url": "/testString/_index", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"total_rows\":2,\"indexes\":[{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},{\"ddoc\":\"_design/3fa64f0768edfd1dd7ec862c7415b3fe8138b393\",\"name\":\"3fa64f0768edfd1dd7ec862c7415b3fe8138b393\",\"type\":\"json\",\"partitioned\":false,\"def\":{\"fields\":[{\"_id\":\"asc\"}]}}]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 23 May 2022 20:24:06 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "fb5312b548be009f9658ad7343f24efb", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "fb5312b548", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "8a7e9c07-5c90-37ff-a9ed-4374e25145ea" - }, - { - "id": "6026c807-3ad5-3944-a4cc-6a4906aaefd3", - "request": { - "url": "/testString/_index", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"index\": {}}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"result\":\"created\",\"id\":\"_design/3fa64f0768edfd1dd7ec862c7415b3fe8138b393\",\"name\":\"3fa64f0768edfd1dd7ec862c7415b3fe8138b393\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 15:42:53 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "b4c0baceee481be0eb2174c4a9962c58", - "X-Cloudant-Action": "cloudantnosqldb.design-document.write", - "X-Couch-Request-ID": "b4c0baceee", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "query", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.7)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "6026c807-3ad5-3944-a4cc-6a4906aaefd3" - }, - { - "id": "c8bd56cb-8f5b-3521-80a9-75231b5a5069", - "request": { - "urlPath": "/testString/_local/testString", - "method": "PUT", - "queryParameters": { - "batch": { - "equalTo": "ok" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"_local/testString\",\"rev\":\"0-1\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 18:32:13 GMT", - "ETag": "W/\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", - "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/_local%2FtestString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "6cb9599b2c12bc8ca784be001ad71f92", - "X-Cloudant-Action": "cloudantnosqldb.local-document.write", - "X-Couch-Request-ID": "6cb9599b2c", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "c8bd56cb-8f5b-3521-80a9-75231b5a5069" - }, - { - "id": "e2fa7386-36e2-36f0-ad24-0b3e7ebd3585", - "request": { - "url": "/testString/_local/testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 18:34:22 GMT", - "ETag": "\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "0acbffcb1d8029d190789dddd3521397", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "0acbffcb1d", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" - } - }, - "uuid": "e2fa7386-36e2-36f0-ad24-0b3e7ebd3585" - }, - { - "id": "825527a5-47ec-355d-b00a-0877fbb0a29e", - "request": { - "urlPath": "/testString/_local/testString", - "method": "DELETE", - "queryParameters": { - "batch": { - "equalTo": "ok" - } - } - }, - "response": { - "status": 200, - "body": "{\"ok\":true,\"id\":\"_local/testString\",\"rev\":\"0-0\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:09:08 GMT", - "ETag": "W/\"DKGUB9HWEX2KQNSCSMV0JG1KK\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "758b33bb54b870dde75c57382a6bc1b6", - "X-Cloudant-Action": "cloudantnosqldb.local-document.write", - "X-Couch-Request-ID": "758b33bb54", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "825527a5-47ec-355d-b00a-0877fbb0a29e" - }, - { - "id": "a169db5c-1dd0-3bd6-a373-5422ecfd1509", - "request": { - "urlPath": "/testString/_local/testString", - "method": "GET", - "queryParameters": { - "att_encoding_info": { - "equalTo": "false" - }, - "attachments": { - "equalTo": "false" - }, - "local_seq": { - "equalTo": "false" - } - } - }, - "response": { - "status": 200, - "body": "{\"_id\":\"_local/testString\",\"_rev\":\"0-1\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 18:34:22 GMT", - "ETag": "W/\"5ZVXQYO7VLEOU0TL9VXDNP5PV\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "eb9e1ce6c4a1d44b41dea28aa5136d02", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "eb9e1ce6c4", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "a169db5c-1dd0-3bd6-a373-5422ecfd1509" - }, - { - "id": "af6271d1-4985-3dc8-9662-501d6a81d30d", - "request": { - "url": "/testString/_partition/testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"db_name\":\"account-bluemix/testString\",\"sizes\":{\"active\":39,\"external\":2},\"partition\":\"testString\",\"doc_count\":1,\"doc_del_count\":0}", - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Thu, 19 May 2022 22:19:26 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "9a31e19b4ed0ae92c12fdae6b2cfd5da", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "9a31e19b4e", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "af6271d1-4985-3dc8-9662-501d6a81d30d" - }, - { - "id": "2c580fc6-7377-38e3-8356-c7f2a36cad84", - "request": { - "url": "/testString/_partition/testString/_all_docs", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString:testString\",\"key\":\"testString:testString\",\"value\":{\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Thu, 19 May 2022 22:20:22 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "3a686f700406d04e7fb1ace02dc471bc", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "3a686f7004", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "2c580fc6-7377-38e3-8356-c7f2a36cad84" - }, - { - "id": "7d36c625-d941-34ba-99bb-519bd6ca923f", - "request": { - "url": "/testString/_partition/testString/_design/testString/_search/testString", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"query\": \"name:Jane* AND active:True\"}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":0,\"bookmark\":\"g2o\",\"rows\":[]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Thu, 19 May 2022 22:15:39 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "17165e96850d9d0e13b1278163366b94", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "17165e9685", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "7d36c625-d941-34ba-99bb-519bd6ca923f" - }, - { - "id": "ecaf4992-8865-3623-86d5-9181c46ed721", - "request": { - "url": "/testString/_partition/testString/_design/testString/_view/testString", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"total_rows\":1,\"offset\":0,\"rows\":[\r\n{\"id\":\"testString:testString\",\"key\":\"testString:testString\",\"value\":1}\r\n]}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Thu, 19 May 2022 22:23:18 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "690674ef064cae7a0cd532056e85622c", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "690674ef06", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "ecaf4992-8865-3623-86d5-9181c46ed721" - }, - { - "id": "ca84624c-4bda-11ee-be56-0242ac120002", - "request": { - "url": "/testString/_partition/testString/_explain", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"dbname\":\"account-bluemix/testString\",\"index\":{\"ddoc\":null,\"name\":\"_all_docs\",\"type\":\"special\",\"def\":{\"fields\":[{\"_id\":\"asc\"}]}},\"partitioned\":\"undefined\",\"selector\":{\"key1\":{\"$eq\":\"testString\"}},\"opts\":{\"use_index\":[],\"bookmark\":\"nil\",\"limit\":10000000000,\"skip\":0,\"sort\":{},\"fields\":[\"testString\"],\"partition\":\"testString\",\"r\":1,\"conflicts\":false,\"stale\":false,\"update\":true,\"stable\":false,\"execution_stats\":false},\"limit\":10000000000,\"skip\":0,\"fields\":[\"testString\"],\"mrargs\":{\"include_docs\":true,\"view_type\":\"map\",\"reduce\":false,\"partition\":\"testString\",\"start_key\":null,\"end_key\":\"\",\"direction\":\"fwd\",\"stable\":false,\"update\":true,\"conflicts\":\"undefined\"}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 05 Sep 2023 12:10:54 GMT", - "Server": "CouchDB/3.3.2 (Erlang OTP/24)", - "transaction-id": "5ebc08e24c058f8a9d9793c32c226bf3", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "5baeb05f80", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "ca84624c-4bda-11ee-be56-0242ac120002" - }, - { - "id": "337c4338-3094-3c88-a44e-981e449b1d7a", - "request": { - "url": "/testString/_partition/testString/_find", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"docs\":[\r\n],\r\n\"bookmark\": \"nil\",\r\n\"warning\": \"No matching index found, create an index to optimize query time.\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Thu, 19 May 2022 22:26:19 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "5ebc08e24c058f8a9d9793c32c226bf3", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "5ebc08e24c", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.6)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "337c4338-3094-3c88-a44e-981e449b1d7a" - }, - { - "id": "acadaa2a-bebd-3daf-987b-a8eacc2227e0", - "request": { - "url": "/testString/_revs_diff", - "method": "POST", - "bodyPatterns": [ - { - "matchesJsonPath": "$.[?(@ == null || @.key1 != null)]", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"key1\":{\"missing\":[\"1-testString\"]}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 18:40:13 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "295ee11482f22ffa973e81daf2613898", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "295ee11482", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "acadaa2a-bebd-3daf-987b-a8eacc2227e0" - }, - { - "id": "60056468-bcb5-3b3f-9815-bf4c95c623b4", - "request": { - "url": "/testString/_security", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:51 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "5d8b354c95486f5a0f06200096ca5612", - "X-Cloudant-Action": "cloudantnosqldb.database-security.read", - "X-Couch-Request-ID": "5d8b354c95", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "60056468-bcb5-3b3f-9815-bf4c95c623b4" - }, - { - "id": "28ac8e52-0af2-37e5-b22e-558da950be34", - "request": { - "url": "/testString/_security", - "method": "PUT", - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 200, - "body": "{\"ok\":true}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:51 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "a3973a0f6fe6cba29ecb9647fae801f3", - "X-Cloudant-Action": "cloudantnosqldb.database-security.write", - "X-Couch-Request-ID": "a3973a0f6f", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "28ac8e52-0af2-37e5-b22e-558da950be34" - }, - { - "id": "b8c0e06d-17c2-3810-9377-7c219ebe3dd9", - "request": { - "url": "/testString/_shards", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"shards\":{\"00000000-0fffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"10000000-1fffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"20000000-2fffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"30000000-3fffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"],\"40000000-4fffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"50000000-5fffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"60000000-6fffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"70000000-7fffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"],\"80000000-8fffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"90000000-9fffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"a0000000-afffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"b0000000-bfffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"],\"c0000000-cfffffff\":[\"dbcore@db1.bm-cc-us-east-05.cloudant.net\",\"dbcore@db10.bm-cc-us-east-05.cloudant.net\",\"dbcore@db12.bm-cc-us-east-05.cloudant.net\"],\"d0000000-dfffffff\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"],\"e0000000-efffffff\":[\"dbcore@db4.bm-cc-us-east-05.cloudant.net\",\"dbcore@db5.bm-cc-us-east-05.cloudant.net\",\"dbcore@db6.bm-cc-us-east-05.cloudant.net\"],\"f0000000-ffffffff\":[\"dbcore@db11.bm-cc-us-east-05.cloudant.net\",\"dbcore@db2.bm-cc-us-east-05.cloudant.net\",\"dbcore@db3.bm-cc-us-east-05.cloudant.net\"]}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:59 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "c7a84aa69921ef4072d42ec31b0d3db3", - "X-Cloudant-Action": "cloudantnosqldb.database-shards.read", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "b8c0e06d-17c2-3810-9377-7c219ebe3dd9" - }, - { - "id": "d20bae36-5d48-3bf4-b14d-e954b7869d55", - "request": { - "url": "/testString/_shards/testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"range\":\"10000000-1fffffff\",\"nodes\":[\"dbcore@db7.bm-cc-us-east-05.cloudant.net\",\"dbcore@db8.bm-cc-us-east-05.cloudant.net\",\"dbcore@db9.bm-cc-us-east-05.cloudant.net\"]}", - "headers": { - "Cache-Control": "must-revalidate", - "content-security-policy": "sandbox", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:59 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "b2f00c238f9bd4ffa701399e34d9bf54", - "X-Cloudant-Action": "cloudantnosqldb.database-shards.read", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "d20bae36-5d48-3bf4-b14d-e954b7869d55" - }, - { - "id": "d317807f-250c-3abd-804d-34e98eebdad8", - "request": { - "urlPath": "/testString", - "method": "POST", - "queryParameters": { - "batch": { - "equalTo": "ok" - } - } - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"a27fe29f38cf3cf647d8575585706955\",\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 17:07:57 GMT", - "Location": "https://ACCOUNT.cloudant.com/testString/a27fe29f38cf3cf647d8575585706955", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "efbd92438c668c8d821a454cf4e27223", - "X-Cloudant-Action": "cloudantnosqldb.data-document.write", - "X-Couch-Request-ID": "efbd92438c", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "d317807f-250c-3abd-804d-34e98eebdad8" - }, - { - "id": "a2bd99a8-d38d-3c23-8e98-40d6cd029ff1", - "request": { - "url": "/testString", - "method": "DELETE" - }, - "response": { - "status": 200, - "body": "{\"ok\":true}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:09:10 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "992526e30a13656ec4e93001efa2eb7c", - "X-Cloudant-Action": "cloudantnosqldb.database.delete", - "X-Couch-Request-ID": "992526e30a", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb1.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "a2bd99a8-d38d-3c23-8e98-40d6cd029ff1" - }, - { - "id": "660a0142-29dd-3918-a4aa-f77527e358c2", - "request": { - "url": "/testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "{\"update_seq\":\"5-g1AAAAereJy91M1NwzAYgGFDkTjSDeAIhwTHSfxzohvABuDPdlRVbYNoeoYNYAPYADaADWAD2AA2ABtXpL4lSG4OiRQl36PkjTNFCA3HA40ONaj6yow0kBRmiVLJcpEYuWgSXKZqWi-1nDfp3DRTe8f2fMfu0Zc9fNttMh5INLMndnNpqNJlj3GhTTvbH97-bG3FqTYCeowLbdHZfvP2e2sTJQpamB7jnH30d3HW_aW_ePzV4Vu_eCkKbSDvM--_xZ88_ryG84xkQm6g-IO3H1s7k7SCymyg-J2379vimrG84HoTxW88frv2qbOKCFLFLQ6Xdg_Xq_W9qo1pmQsetTZcOLcO_itG2qWNRdTScObc8_B_VjJDWOR1DSMHnwaw5kaBgsiFsYNPgsKEcsI1i1v4wLnHwQODYqWpSNzCQ-fuBy7DojBExS0sEewFakGxwO4tdx80-QEwjmuB\",\"instance_start_time\":\"1637834313\",\"db_name\":\"testdb\",\"purge_seq\":0,\"sizes\":{\"file\":240670,\"external\":79,\"active\":7240},\"props\":{},\"doc_del_count\":0,\"doc_count\":5,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":16,\"n\":3,\"w\":2,\"r\":2}}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:34 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "09ea19385a69e38e5ee30e9e87cb6062", - "X-Cloudant-Action": "cloudantnosqldb.database-info.read", - "X-Couch-Request-ID": "09ea19385a", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "unlimited", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "660a0142-29dd-3918-a4aa-f77527e358c2" - }, - { - "id": "939b8665-cf55-3a05-a46d-c208bcc4ada6", - "request": { - "urlPath": "/testString", - "method": "PUT", - "queryParameters": { - "partitioned": { - "equalTo": "false" - }, - "q": { - "equalTo": "16" - } - } - }, - "response": { - "status": 201, - "body": "{\"ok\":true}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 16:56:10 GMT", - "Location": "https://account-bluemix.cloudant.com/testString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "06ec2ee90406a602224231b8ab7d19aa", - "X-Cloudant-Action": "cloudantnosqldb.database.create", - "X-Couch-Request-ID": "06ec2ee904", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "939b8665-cf55-3a05-a46d-c208bcc4ada6" - }, - { - "id": "33f0d8ac-56f3-3a18-9366-761dcb30158f", - "request": { - "urlPath": "/testString/testString", - "method": "DELETE", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - } - } - }, - "response": { - "status": 200, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"2-49754e12a5d2cbe03c4118bad6709779\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 23 May 2022 20:31:45 GMT", - "ETag": "W/\"2-49754e12a5d2cbe03c4118bad6709779\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "6beab9bf70a274822c5bcf7dee330078", - "X-Cloudant-Action": "cloudantnosqldb.data-document.write", - "X-Couch-Request-ID": "6beab9bf70", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "33f0d8ac-56f3-3a18-9366-761dcb30158f" - }, - { - "id": "ae2f6256-c33c-3e1a-9ed6-d16762069a0c", - "request": { - "urlPath": "/testString/testString", - "method": "GET", - "queryParameters": { - "att_encoding_info": { - "equalTo": "false" - }, - "attachments": { - "equalTo": "false" - }, - "local_seq": { - "equalTo": "false" - }, - "deleted_conflicts": { - "equalTo": "false" - }, - "conflicts": { - "equalTo": "false" - }, - "latest": { - "equalTo": "false" - }, - "meta": { - "equalTo": "false" - }, - "rev": { - "equalTo": "testString" - }, - "revs": { - "equalTo": "false" - }, - "revs_info": { - "equalTo": "false" - } - } - }, - "response": { - "status": 200, - "body": "{\"_id\":\"testString\",\"_rev\":\"3-5570e8bbb34412db757c2df4bfa1099b\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 18 May 2022 17:09:08 GMT", - "ETag": "W/\"3-5570e8bbb34412db757c2df4bfa1099b\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "bb234d40f358cc0ee3e8317890e8f065", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "bb234d40f3", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "ae2f6256-c33c-3e1a-9ed6-d16762069a0c" - }, - { - "id": "559c7479-f8d9-3c89-a91d-6f34122908ed", - "request": { - "url": "/testString/testString?latest=false&rev=testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 16 May 2022 21:08:35 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "845550d983dcdb781e95385d4f92d4af", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "845550d983", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.101.5)" - } - }, - "uuid": "559c7479-f8d9-3c89-a91d-6f34122908ed" - }, - { - "id": "aed0b4bd-1c80-35b2-b8f9-7da76c4cda69", - "request": { - "url": "/testString/testString/testString?rev=testString", - "method": "GET" - }, - "response": { - "status": 200, - "body": "This is a mock file.", - "headers": { - "Accept-Ranges": "none", - "Cache-Control": "must-revalidate", - "Content-MD5": "Vtnbf/a1yLJ4pm/eEB6fHA==", - "content-security-policy": "sandbox", - "Content-Type": "application/octet-stream", - "Date": "Fri, 20 May 2022 18:27:25 GMT", - "ETag": "\"Vtnbf/a1yLJ4pm/eEB6fHA==\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "ecd7339c8a26c3ed107b5284eb15a76b", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "ecd7339c8a", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" - } - }, - "uuid": "aed0b4bd-1c80-35b2-b8f9-7da76c4cda69" - }, - { - "id": "efe03f6b-9784-3cd8-a4d3-ba2020661353", - "request": { - "url": "/testString/testString/testString?rev=testString", - "method": "PUT", - "bodyPatterns": [ - { - "equalTo": "This is a mock file." - } - ] - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"1-23085a965a5e50b32b00e57deb062932\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Fri, 20 May 2022 18:25:16 GMT", - "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/testString/testString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "4326af6ec28e12fcf8eca683ba57da8e", - "X-Cloudant-Action": "cloudantnosqldb.data-document.write", - "X-Couch-Request-ID": "4326af6ec2", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "efe03f6b-9784-3cd8-a4d3-ba2020661353" - }, - { - "id": "ecfbef48-33ff-30fe-b848-d09c6c472eac", - "request": { - "url": "/testString/testString/testString?rev=testString", - "method": "HEAD" - }, - "response": { - "status": 200, - "headers": { - "Accept-Ranges": "none", - "Cache-Control": "must-revalidate", - "Content-MD5": "Vtnbf/a1yLJ4pm/eEB6fHA==", - "content-security-policy": "sandbox", - "Content-Type": "application/octet-stream", - "Date": "Fri, 20 May 2022 18:26:53 GMT", - "ETag": "\"Vtnbf/a1yLJ4pm/eEB6fHA==\"", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "4e77768c5d87bc873bbcc11961504516", - "X-Cloudant-Action": "cloudantnosqldb.any-document.read", - "X-Couch-Request-ID": "4e77768c5d", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "lookup", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)" - } - }, - "uuid": "ecfbef48-33ff-30fe-b848-d09c6c472eac" - }, - { - "id": "bf49e660-6802-3a7c-9975-5e451f4e1204", - "request": { - "urlPath": "/testString/testString/testString", - "method": "DELETE", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - } - } - }, - "response": { - "status": 200, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"4-6705bb55c13a40bb465ab96fd810d996\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Mon, 23 May 2022 20:59:10 GMT", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "b00e9dd9c3835c3ca04049cc2c3deaeb", - "X-Cloudant-Action": "cloudantnosqldb.data-document.write", - "X-Couch-Request-ID": "b00e9dd9c3", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "bf49e660-6802-3a7c-9975-5e451f4e1204" - }, - { - "id": "5a60a196-eed3-33f2-9507-d6276639e89e", - "request": { - "urlPath": "/testString/testString", - "method": "PUT", - "queryParameters": { - "batch": { - "equalTo": "ok" - }, - "rev": { - "equalTo": "testString" - }, - "new_edits": { - "equalTo": "false" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": false, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "body": "{\"ok\":true,\"id\":\"testString\",\"rev\":\"2-80028e69ea6e259eba0b419c3750128b\"}", - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Wed, 25 May 2022 19:15:19 GMT", - "ETag": "W/\"6-80028e69ea6e259eba0b419c3750128b\"", - "Location": "https://84ab8038-d8f1-450c-9645-4d16b448eb31-bluemix.cloudant.com/testString/testString", - "Server": "CouchDB/3.2.1 (Erlang OTP/20)", - "transaction-id": "0d39f720ff6eca60e344f22d000060c5", - "X-Cloudant-Action": "cloudantnosqldb.data-document.write", - "X-Couch-Request-ID": "0d39f720ff", - "X-Frame-Options": "DENY", - "Strict-Transport-Security": "max-age=31536000", - "X-Content-Type-Options": "nosniff", - "X-Cloudant-Request-Class": "write", - "X-Cloudant-Backend": "bm-cc-us-east-05", - "Via": "1.1 lb2.bm-cc-us-east-05 (Glum/1.102.0)", - "Vary": "Accept-Encoding" - } - }, - "uuid": "5a60a196-eed3-33f2-9507-d6276639e89e" - } -]} + "jsonBody": { + "ok": true, + "id": "testString", + "rev": "2-80028e69ea6e259eba0b419c3750128b" + } + }, + "uuid": "5a60a196-eed3-33f2-9507-d6276639e89e" + } + ] +} diff --git a/stubs/mappings.json b/stubs/mappings.json index 25face60..2f927bd7 100644 --- a/stubs/mappings.json +++ b/stubs/mappings.json @@ -1,429 +1,533 @@ {"mappings":[{ - "id" : "4e7ecd46-9129-42a1-8899-985567444ad6", - "name" : "orders_example", - "request" : { - "url" : "/orders/example?rev=4-bf3f53fe029a70e6451e375ccd36599c", - "method" : "DELETE" - }, - "response" : { - "status" : 404, - "body" : "{\"error\":\"not_found\",\"reason\":\"deleted\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "750c2d635a", - "X-CouchDB-Body-Time" : "0" + "id": "4e7ecd46-9129-42a1-8899-985567444ad6", + "name": "orders_example", + "request": { + "url": "/orders/example?rev=4-bf3f53fe029a70e6451e375ccd36599c", + "method": "DELETE" + }, + "response": { + "status": 404, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "750c2d635a", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "error": "not_found", + "reason": "deleted" } }, - "uuid" : "4e7ecd46-9129-42a1-8899-985567444ad6", - "persistent" : true, - "insertionIndex" : 18 + "uuid": "4e7ecd46-9129-42a1-8899-985567444ad6", + "persistent": true, + "insertionIndex": 18 },{ - "id" : "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", - "name" : "orders_example", - "request" : { - "url" : "/orders/example?rev=2-4e2178e85cffb32d38ba4e451f6ca376", - "method" : "DELETE" - }, - "response" : { - "status" : 200, - "body" : "{\"ok\":true,\"id\":\"example\",\"rev\":\"3-4f1787d7a0520f825bd36822d7be627a\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"3-4f1787d7a0520f825bd36822d7be627a\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "1b41b9bfa1", - "X-CouchDB-Body-Time" : "0" + "id": "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", + "name": "orders_example", + "request": { + "url": "/orders/example?rev=2-4e2178e85cffb32d38ba4e451f6ca376", + "method": "DELETE" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"3-4f1787d7a0520f825bd36822d7be627a\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "1b41b9bfa1", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "3-4f1787d7a0520f825bd36822d7be627a" } }, - "uuid" : "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", - "persistent" : true, - "insertionIndex" : 17 + "uuid": "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", + "persistent": true, + "insertionIndex": 17 },{ - "id" : "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", - "name" : "orders_example", - "request" : { - "url" : "/orders/example", - "method" : "GET" - }, - "response" : { - "status" : 404, - "body" : "{\"error\":\"not_found\",\"reason\":\"deleted\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "403d112b46", - "X-CouchDB-Body-Time" : "0" + "id": "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 404, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "403d112b46", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "error": "not_found", + "reason": "deleted" } }, - "uuid" : "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", - "persistent" : true, - "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "scenario-2-orders-example-6", - "insertionIndex" : 16 + "uuid": "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-6", + "insertionIndex": 16 },{ - "id" : "9fa984ad-62e6-4e74-a0ee-a531711f5dba", - "name" : "orders_example", - "request" : { - "url" : "/orders/example?rev=3-4f1787d7a0520f825bd36822d7be627a", - "method" : "DELETE" - }, - "response" : { - "status" : 200, - "body" : "{\"ok\":true,\"id\":\"example\",\"rev\":\"4-bf3f53fe029a70e6451e375ccd36599c\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"4-bf3f53fe029a70e6451e375ccd36599c\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "1b41b9bfa1", - "X-CouchDB-Body-Time" : "0" + "id": "9fa984ad-62e6-4e74-a0ee-a531711f5dba", + "name": "orders_example", + "request": { + "url": "/orders/example?rev=3-4f1787d7a0520f825bd36822d7be627a", + "method": "DELETE" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"4-bf3f53fe029a70e6451e375ccd36599c\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "1b41b9bfa1", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "4-bf3f53fe029a70e6451e375ccd36599c" } }, - "uuid" : "9fa984ad-62e6-4e74-a0ee-a531711f5dba", - "persistent" : true, - "insertionIndex" : 15 + "uuid": "9fa984ad-62e6-4e74-a0ee-a531711f5dba", + "persistent": true, + "insertionIndex": 15 },{ - "id" : "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", - "name" : "orders_example", - "request" : { - "url" : "/orders/example", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"_id\":\"example\",\"_rev\":\"4-bf3f53fe029a70e6451e375ccd36599c\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"4-bf3f53fe029a70e6451e375ccd36599c\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "175d24412f", - "X-CouchDB-Body-Time" : "0" + "id": "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"4-bf3f53fe029a70e6451e375ccd36599c\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "175d24412f", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "4-bf3f53fe029a70e6451e375ccd36599c", + "name": "Bob Smith", + "address": "19 Front Street, Darlington, DL5 1TY" } }, - "uuid" : "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", - "persistent" : true, - "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "scenario-2-orders-example-5", - "newScenarioState" : "scenario-2-orders-example-6", - "insertionIndex" : 14 + "uuid": "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-5", + "newScenarioState": "scenario-2-orders-example-6", + "insertionIndex": 14 },{ - "id" : "9d0f096d-1d43-414f-8831-5e6e6abe7659", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "POST", - "bodyPatterns" : [ { - "equalToJson" : "{\"_id\":\"example\",\"_rev\":\"3-4f1787d7a0520f825bd36822d7be627a\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", - "ignoreArrayOrder" : true, - "ignoreExtraElements" : true - } ] - }, - "response" : { - "status" : 201, - "body" : "{\"ok\":true,\"id\":\"example\",\"rev\":\"4-bf3f53fe029a70e6451e375ccd36599c\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Location" : "http://localhost:5984/orders/example", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "32c3176598", - "X-CouchDB-Body-Time" : "0" + "id": "9d0f096d-1d43-414f-8831-5e6e6abe7659", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\":\"example\",\"_rev\":\"3-4f1787d7a0520f825bd36822d7be627a\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "32c3176598", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "4-bf3f53fe029a70e6451e375ccd36599c" } }, - "uuid" : "9d0f096d-1d43-414f-8831-5e6e6abe7659", - "persistent" : true, - "insertionIndex" : 13 + "uuid": "9d0f096d-1d43-414f-8831-5e6e6abe7659", + "persistent": true, + "insertionIndex": 13 },{ - "id" : "232b9d9d-1506-44a9-a11a-66639eb9250e", - "name" : "orders_example", - "request" : { - "url" : "/orders/example", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"_id\":\"example\",\"_rev\":\"3-4f1787d7a0520f825bd36822d7be627a\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"3-4f1787d7a0520f825bd36822d7be627a\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "4b23a37b39", - "X-CouchDB-Body-Time" : "0" + "id": "232b9d9d-1506-44a9-a11a-66639eb9250e", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"3-4f1787d7a0520f825bd36822d7be627a\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "4b23a37b39", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "3-4f1787d7a0520f825bd36822d7be627a", + "name": "Bob Smith", + "address": "19 Front Street, Darlington, DL5 1TY" } }, - "uuid" : "232b9d9d-1506-44a9-a11a-66639eb9250e", - "persistent" : true, - "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "scenario-2-orders-example-4", - "newScenarioState" : "scenario-2-orders-example-5", - "insertionIndex" : 12 + "uuid": "232b9d9d-1506-44a9-a11a-66639eb9250e", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-4", + "newScenarioState": "scenario-2-orders-example-5", + "insertionIndex": 12 },{ - "id" : "d2d672a9-90d5-4959-b7c6-cef7538fd233", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "POST", - "bodyPatterns" : [ { - "equalToJson" : "{\"_id\":\"example\",\"_rev\":\"2-4e2178e85cffb32d38ba4e451f6ca376\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", - "ignoreArrayOrder" : true, - "ignoreExtraElements" : true - } ] - }, - "response" : { - "status" : 201, - "body" : "{\"ok\":true,\"id\":\"example\",\"rev\":\"3-4f1787d7a0520f825bd36822d7be627a\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Location" : "http://localhost:5984/orders/example", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "260d229417", - "X-CouchDB-Body-Time" : "0" + "id": "d2d672a9-90d5-4959-b7c6-cef7538fd233", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\":\"example\",\"_rev\":\"2-4e2178e85cffb32d38ba4e451f6ca376\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "260d229417", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "3-4f1787d7a0520f825bd36822d7be627a" } }, - "uuid" : "d2d672a9-90d5-4959-b7c6-cef7538fd233", - "persistent" : true, - "insertionIndex" : 11 + "uuid": "d2d672a9-90d5-4959-b7c6-cef7538fd233", + "persistent": true, + "insertionIndex": 11 },{ - "id" : "b19304eb-3f50-4af2-b692-23847652a661", - "name" : "orders_example", - "request" : { - "url" : "/orders/example", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"_id\":\"example\",\"_rev\":\"2-4e2178e85cffb32d38ba4e451f6ca376\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"2-4e2178e85cffb32d38ba4e451f6ca376\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "fd177b95bf", - "X-CouchDB-Body-Time" : "0" + "id": "b19304eb-3f50-4af2-b692-23847652a661", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"2-4e2178e85cffb32d38ba4e451f6ca376\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "fd177b95bf", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:59.000Z" } }, - "uuid" : "b19304eb-3f50-4af2-b692-23847652a661", - "persistent" : true, - "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "scenario-2-orders-example-3", - "newScenarioState" : "scenario-2-orders-example-4", - "insertionIndex" : 10 + "uuid": "b19304eb-3f50-4af2-b692-23847652a661", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-3", + "newScenarioState": "scenario-2-orders-example-4", + "insertionIndex": 10 },{ - "id" : "61d277cc-c7e5-4390-8845-4276000c224e", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "POST", - "bodyPatterns" : [ { - "equalToJson" : "{\"_id\": \"example\", \"_rev\": \"1-1b403633540686aa32d013fda9041a5d\", \"name\": \"Bob Smith\", \"address\": \"19 Front Street, Darlington, DL5 1TY\"}", - "ignoreArrayOrder" : true, - "ignoreExtraElements" : true - } ] - }, - "response" : { - "status" : 201, - "body" : "{\"ok\":true,\"id\":\"example\",\"rev\":\"2-4e2178e85cffb32d38ba4e451f6ca376\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Location" : "http://localhost:5984/orders/example", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "ef31b7a04b", - "X-CouchDB-Body-Time" : "0" + "id": "61d277cc-c7e5-4390-8845-4276000c224e", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\": \"example\", \"_rev\": \"1-1b403633540686aa32d013fda9041a5d\", \"name\": \"Bob Smith\", \"address\": \"19 Front Street, Darlington, DL5 1TY\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "ef31b7a04b", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "2-4e2178e85cffb32d38ba4e451f6ca376" } }, - "uuid" : "61d277cc-c7e5-4390-8845-4276000c224e", - "persistent" : true, - "insertionIndex" : 9 + "uuid": "61d277cc-c7e5-4390-8845-4276000c224e", + "persistent": true, + "insertionIndex": 9 },{ - "id" : "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", - "name" : "orders_example", - "request" : { - "url" : "/orders/example", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"_id\":\"example\",\"_rev\":\"1-1b403633540686aa32d013fda9041a5d\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"1-1b403633540686aa32d013fda9041a5d\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "f9bef554c3", - "X-CouchDB-Body-Time" : "0" + "id": "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"1-1b403633540686aa32d013fda9041a5d\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "f9bef554c3", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:59.000Z" } }, - "uuid" : "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", - "persistent" : true, - "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "scenario-2-orders-example-2", - "newScenarioState" : "scenario-2-orders-example-3", - "insertionIndex" : 8 + "uuid": "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-2", + "newScenarioState": "scenario-2-orders-example-3", + "insertionIndex": 8 },{ - "id" : "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "PUT" - }, - "response" : { - "status" : 412, - "body" : "{\"error\":\"file_exists\",\"reason\":\"The database could not be created, the file already exists.\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "474375177b", - "X-CouchDB-Body-Time" : "0" + "id": "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", + "name": "orders", + "request": { + "url": "/orders", + "method": "PUT" + }, + "response": { + "status": 412, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "474375177b", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "error": "file_exists", + "reason": "The database could not be created, the file already exists." } }, - "uuid" : "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", - "persistent" : true, - "scenarioName" : "scenario-1-orders", - "requiredScenarioState" : "scenario-1-orders-2", - "insertionIndex" : 7 + "uuid": "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", + "persistent": true, + "scenarioName": "scenario-1-orders", + "requiredScenarioState": "scenario-1-orders-2", + "insertionIndex": 7 },{ - "id" : "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "POST", - "bodyPatterns" : [ { - "equalToJson" : "{\"_id\":\"example\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}", - "ignoreArrayOrder" : true, - "ignoreExtraElements" : true - } ] - }, - "response" : { - "status" : 201, - "body" : "{\"ok\":true,\"id\":\"example\",\"rev\":\"1-1b403633540686aa32d013fda9041a5d\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Location" : "http://localhost:5984/orders/example", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "1528aeb812", - "X-CouchDB-Body-Time" : "0" + "id": "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\":\"example\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "1528aeb812", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "1-1b403633540686aa32d013fda9041a5d" } }, - "uuid" : "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", - "persistent" : true, - "insertionIndex" : 6 + "uuid": "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", + "persistent": true, + "insertionIndex": 6 },{ - "id" : "05def288-5864-48e7-87ff-f7552a9dd1c2", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "PUT" - }, - "response" : { - "status" : 201, - "body" : "{\"ok\":true}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Location" : "http://localhost:5984/orders", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "141b3ba868", - "X-CouchDB-Body-Time" : "0" + "id": "05def288-5864-48e7-87ff-f7552a9dd1c2", + "name": "orders", + "request": { + "url": "/orders", + "method": "PUT" + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "141b3ba868", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true } }, - "uuid" : "05def288-5864-48e7-87ff-f7552a9dd1c2", - "persistent" : true, - "scenarioName" : "scenario-1-orders", - "requiredScenarioState" : "Started", - "newScenarioState" : "scenario-1-orders-2", - "insertionIndex" : 4 + "uuid": "05def288-5864-48e7-87ff-f7552a9dd1c2", + "persistent": true, + "scenarioName": "scenario-1-orders", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-orders-2", + "insertionIndex": 4 },{ - "id" : "af927fc5-341a-4f9d-9c48-83a57aa7b505", - "name" : "orders_example", - "request" : { - "url" : "/orders/example", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"_id\":\"example\",\"_rev\":\"1-1b403633540686aa32d013fda9041a5d\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag" : "\"1-1b403633540686aa32d013fda9041a5d\"", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "f9bef554c3", - "X-CouchDB-Body-Time" : "0" + "id": "af927fc5-341a-4f9d-9c48-83a57aa7b505", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"1-1b403633540686aa32d013fda9041a5d\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "f9bef554c3", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:59.000Z" } }, - "uuid" : "af927fc5-341a-4f9d-9c48-83a57aa7b505", - "persistent" : true, - "scenarioName" : "scenario-2-orders-example", - "requiredScenarioState" : "Started", - "newScenarioState" : "scenario-2-orders-example-2", - "insertionIndex" : 3 + "uuid": "af927fc5-341a-4f9d-9c48-83a57aa7b505", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-orders-example-2", + "insertionIndex": 3 },{ - "id" : "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", - "name" : "orders", - "request" : { - "url" : "/orders", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"db_name\":\"orders\",\"purge_seq\":\"0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4\",\"update_seq\":\"1-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEjlxqEtkSKoHK2DLAgCGPRlt\",\"sizes\":{\"file\":57751,\"external\":3450,\"active\":7355},\"props\":{},\"doc_del_count\":0,\"doc_count\":1,\"disk_format_version\":8,\"compact_running\":false,\"cluster\":{\"q\":2,\"n\":1,\"w\":1,\"r\":1},\"instance_start_time\":\"0\"}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "832fcf2ea2", - "X-CouchDB-Body-Time" : "0" + "id": "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", + "name": "orders", + "request": { + "url": "/orders", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "832fcf2ea2", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "db_name": "orders", + "purge_seq": "0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4", + "update_seq": "1-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEjlxqEtkSKoHK2DLAgCGPRlt", + "sizes": { + "file": 57751, + "external": 3450, + "active": 7355 + }, + "props": {}, + "doc_del_count": 0, + "doc_count": 1, + "disk_format_version": 8, + "compact_running": false, + "cluster": { + "q": 2, + "n": 1, + "w": 1, + "r": 1 + }, + "instance_start_time": "0" } }, - "uuid" : "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", - "persistent" : true, - "insertionIndex" : 2 + "uuid": "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", + "persistent": true, + "insertionIndex": 2 },{ - "id" : "50eb71a6-e709-4d04-aba8-861a4135cdb8", - "name" : "", - "request" : { - "url" : "/", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"couchdb\":\"Welcome\",\"version\":\"2.1.1\",\"git_sha\":\"03a77db6c\",\"uuid\":\"cffa3c2cc703d6caed7ec9a9f6d110e9\",\"features\":[\"access-ready\",\"partitioned\",\"pluggable-storage-engines\",\"reshard\",\"scheduler\"],\"vendor\":{\"name\":\"The Apache Software Foundation\"}}\n", - "headers" : { - "Cache-Control" : "must-revalidate", - "Content-Type" : "application/json", - "Date" : "Tue, 21 Jul 2020 07:58:57 GMT", - "Server" : "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID" : "b6cf47349d", - "X-CouchDB-Body-Time" : "0" + "id": "50eb71a6-e709-4d04-aba8-861a4135cdb8", + "name": "", + "request": { + "url": "/", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "b6cf47349d", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "couchdb": "Welcome", + "version": "2.1.1", + "git_sha": "03a77db6c", + "uuid": "cffa3c2cc703d6caed7ec9a9f6d110e9", + "features": [ + "access-ready", + "partitioned", + "pluggable-storage-engines", + "reshard", + "scheduler" + ], + "vendor": { + "name": "The Apache Software Foundation" + } } }, - "uuid" : "50eb71a6-e709-4d04-aba8-861a4135cdb8", - "persistent" : true, - "insertionIndex" : 1 + "uuid": "50eb71a6-e709-4d04-aba8-861a4135cdb8", + "persistent": true, + "insertionIndex": 1 }]} From db755dbd3338556aff2d466c856825e93246e39c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 09:27:32 +0000 Subject: [PATCH 426/669] build(deps): Bump actions/setup-python from 5.3.0 to 5.4.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.3.0 to 5.4.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/0b93645e9fea7318ecaed2b359559ac225c90a2b...42375524e23c412d93fb67b49958b491fce71c38) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5b3056cb..62474560 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.13 - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: '3.13' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5314d68d..e5865121 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python }} cache: 'pip' From b0c989fc7a3fc66a6a10abdb56d895a20269cbc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 09:42:33 +0000 Subject: [PATCH 427/669] build(deps): Bump github/codeql-action from 3.28.5 to 3.28.8 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.5 to 3.28.8. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4...dd746615b3b9d728a6a37ca2045b68ca76d4841a) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c41bcc02..127f55a9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 + uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 + uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 + uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 with: category: "/language:${{matrix.language}}" From d2c6494c0da2edd2d418cc6aa729811e8683e4e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:13:48 +0000 Subject: [PATCH 428/669] build(deps-dev): Bump coverage from 7.6.10 to 7.6.11 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.10 to 7.6.11. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.10...7.6.11) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7a30b2ff..a215b884 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.6 python_dotenv==1.0.1 pylint==3.3.4 # code coverage -coverage==7.6.10 +coverage==7.6.11 pytest-cov==6.0.0 From f90848b8b3c415c00fd59238643c56928218ba8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 09:11:39 +0000 Subject: [PATCH 429/669] build(deps): Bump github/codeql-action from 3.28.8 to 3.28.9 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.8 to 3.28.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/dd746615b3b9d728a6a37ca2045b68ca76d4841a...9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 127f55a9..ff064526 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 + uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 + uses: github/codeql-action/autobuild@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 + uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 with: category: "/language:${{matrix.language}}" From 194e32ba259926392f0d384329f54f1675e1823e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:57:01 +0000 Subject: [PATCH 430/669] build(deps-dev): Bump coverage from 7.6.11 to 7.6.12 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.11 to 7.6.12. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.11...7.6.12) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a215b884..f5578706 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.6 python_dotenv==1.0.1 pylint==3.3.4 # code coverage -coverage==7.6.11 +coverage==7.6.12 pytest-cov==6.0.0 From 24f75e59290a571be36ff41f1ae1e7df361a7e5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 17:31:17 +0000 Subject: [PATCH 431/669] build(deps): Bump myst-parser from 4.0.0 to 4.0.1 Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/executablebooks/MyST-Parser/compare/v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index ecc91de6..f10633bc 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -2,5 +2,5 @@ recommonmark==0.7.1 Sphinx==8.1.3 sphinx-autodoc2==0.5.0 -myst-parser==4.0.0 +myst-parser==4.0.1 sphinx-rtd-theme==3.0.2 From 5382008210d8c92d8192aac3d61190efa8f4ce51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:53:46 +0000 Subject: [PATCH 432/669] build(deps-dev): Bump flit from 3.10.1 to 3.11.0 Bumps [flit](https://github.com/pypa/flit) from 3.10.1 to 3.11.0. - [Changelog](https://github.com/pypa/flit/blob/main/doc/history.rst) - [Commits](https://github.com/pypa/flit/compare/3.10.1...3.11.0) --- updated-dependencies: - dependency-name: flit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f5578706..85795dd5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # build dependencies -flit==3.10.1 +flit==3.11.0 # test dependencies pytest==8.3.4 responses==0.25.6 From 28452761fcf247bca8257065bf00b488ef72dc22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 18:09:17 +0000 Subject: [PATCH 433/669] build(deps): Bump sphinx from 8.1.3 to 8.2.0 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.1.3 to 8.2.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.1.3...v8.2.0) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index f10633bc..89eadff7 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==8.1.3 +Sphinx==8.2.0 sphinx-autodoc2==0.5.0 myst-parser==4.0.1 sphinx-rtd-theme==3.0.2 From 8661f8b51d3d44d0c06ce1147d94d9322498ad36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:51:32 +0000 Subject: [PATCH 434/669] build(deps): Bump sphinx from 8.2.0 to 8.2.1 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.2.0 to 8.2.1. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/v8.2.1/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.2.0...v8.2.1) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 89eadff7..b3749317 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==8.2.0 +Sphinx==8.2.1 sphinx-autodoc2==0.5.0 myst-parser==4.0.1 sphinx-rtd-theme==3.0.2 From 1d8f682c81f326d59c0059fb444be9dbfafb750b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:44:41 +0000 Subject: [PATCH 435/669] feat(generated): update API definition to 1.0.0-dev0.1.27 Generated SDK source code using: - Generator version 3.101.0 - Specification version 1.0.0-dev0.1.27 - Automation (cloudant-sdks) version 0acdffd --- ibmcloudant/cloudant_v1.py | 321 +++++++++++++++++++++++++++ stubs/gen-its-mappings.json | 4 +- test/integration/test_cloudant_v1.py | 16 ++ test/unit/test_cloudant_v1.py | 214 ++++++++++++++++++ 4 files changed, 553 insertions(+), 2 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 768b6ab6..a96a339e 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -8195,6 +8195,80 @@ def post_activity_tracker_events( response = self.send(request, **kwargs) return response + def get_capacity_databases_information( + self, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve maximum allowed database count. + + Retrieves the maximum number of databases currently allowed in the instance. + + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `CapacityDatabasesInformation` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_capacity_databases_information', + ) + headers.update(sdk_headers) + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/_api/v2/user/capacity/databases' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) + return response + + def get_current_databases_information( + self, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve current database count. + + Retrieves the current number of databases that exist in the instance. + + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `CurrentDatabasesInformation` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_current_databases_information', + ) + headers.update(sdk_headers) + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/_api/v2/user/current/databases' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + ) + + response = self.send(request, **kwargs) + return response + def get_current_throughput_information( self, **kwargs, @@ -10358,6 +10432,132 @@ def __ne__(self, other: 'BulkGetResultItem') -> bool: return not self == other +class CapacityDatabasesInformation: + """ + Schema for information about maximum total database count. + + :param CapacityDatabasesInformationCurrent current: (optional) Schema for + information about the current database capacity. + """ + + def __init__( + self, + *, + current: Optional['CapacityDatabasesInformationCurrent'] = None, + ) -> None: + """ + Initialize a CapacityDatabasesInformation object. + + :param CapacityDatabasesInformationCurrent current: (optional) Schema for + information about the current database capacity. + """ + self.current = current + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CapacityDatabasesInformation': + """Initialize a CapacityDatabasesInformation object from a json dictionary.""" + args = {} + if (current := _dict.get('current')) is not None: + args['current'] = CapacityDatabasesInformationCurrent.from_dict(current) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CapacityDatabasesInformation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'current') and self.current is not None: + if isinstance(self.current, dict): + _dict['current'] = self.current + else: + _dict['current'] = self.current.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CapacityDatabasesInformation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CapacityDatabasesInformation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CapacityDatabasesInformation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CapacityDatabasesInformationCurrent: + """ + Schema for information about the current database capacity. + + :param DatabasesCountInformation databases: (optional) Schema for databases + count. + """ + + def __init__( + self, + *, + databases: Optional['DatabasesCountInformation'] = None, + ) -> None: + """ + Initialize a CapacityDatabasesInformationCurrent object. + + :param DatabasesCountInformation databases: (optional) Schema for databases + count. + """ + self.databases = databases + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CapacityDatabasesInformationCurrent': + """Initialize a CapacityDatabasesInformationCurrent object from a json dictionary.""" + args = {} + if (databases := _dict.get('databases')) is not None: + args['databases'] = DatabasesCountInformation.from_dict(databases) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CapacityDatabasesInformationCurrent object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'databases') and self.databases is not None: + if isinstance(self.databases, dict): + _dict['databases'] = self.databases + else: + _dict['databases'] = self.databases.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CapacityDatabasesInformationCurrent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CapacityDatabasesInformationCurrent') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CapacityDatabasesInformationCurrent') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CapacityThroughputInformation: """ Schema for information about the currently provisioned and target throughput capacity. @@ -10984,6 +11184,69 @@ def __ne__(self, other: 'CorsInformation') -> bool: return not self == other +class CurrentDatabasesInformation: + """ + Schema for information about the current database counts. + + :param DatabasesCountInformation databases: (optional) Schema for databases + count. + """ + + def __init__( + self, + *, + databases: Optional['DatabasesCountInformation'] = None, + ) -> None: + """ + Initialize a CurrentDatabasesInformation object. + + :param DatabasesCountInformation databases: (optional) Schema for databases + count. + """ + self.databases = databases + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CurrentDatabasesInformation': + """Initialize a CurrentDatabasesInformation object from a json dictionary.""" + args = {} + if (databases := _dict.get('databases')) is not None: + args['databases'] = DatabasesCountInformation.from_dict(databases) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CurrentDatabasesInformation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'databases') and self.databases is not None: + if isinstance(self.databases, dict): + _dict['databases'] = self.databases + else: + _dict['databases'] = self.databases.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CurrentDatabasesInformation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CurrentDatabasesInformation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CurrentDatabasesInformation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CurrentThroughputInformation: """ Schema for information about current consumption of a provisioned throughput capacity. @@ -11514,6 +11777,64 @@ def __ne__(self, other: 'DatabaseInformationProps') -> bool: return not self == other +class DatabasesCountInformation: + """ + Schema for databases count. + + :param int total: (optional) The total number of databases. + """ + + def __init__( + self, + *, + total: Optional[int] = None, + ) -> None: + """ + Initialize a DatabasesCountInformation object. + + :param int total: (optional) The total number of databases. + """ + self.total = total + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DatabasesCountInformation': + """Initialize a DatabasesCountInformation object from a json dictionary.""" + args = {} + if (total := _dict.get('total')) is not None: + args['total'] = total + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DatabasesCountInformation object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'total') and self.total is not None: + _dict['total'] = self.total + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this DatabasesCountInformation object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DatabasesCountInformation') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'DatabasesCountInformation') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class DbEvent: """ Schema for a database change event. diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 737cf1c6..d39f95f1 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -445,7 +445,7 @@ "uuid": "a2e4e696-e631-33f8-b168-5015048cdad8" }, { - "id": "8593b1aa-6297-3120-a04e-c199e2808167", + "id": "8593b1aa-6297-3120-a04e-c199e2808168", "request": { "url": "/_api/v2/user/current/databases", "method": "GET" @@ -473,7 +473,7 @@ } } }, - "uuid": "8593b1aa-6297-3120-a04e-c199e2808167" + "uuid": "8593b1aa-6297-3120-a04e-c199e2808168" }, { "id": "8c38b725-a6ac-3f63-a723-9f4925ae23fd", diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index c145881e..be039006 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -2033,6 +2033,22 @@ def test_post_activity_tracker_events(self): ok = response.get_result() assert ok is not None + @needscredentials + def test_get_capacity_databases_information(self): + response = self.cloudant_service.get_capacity_databases_information() + + assert response.get_status_code() == 200 + capacity_databases_information = response.get_result() + assert capacity_databases_information is not None + + @needscredentials + def test_get_current_databases_information(self): + response = self.cloudant_service.get_current_databases_information() + + assert response.get_status_code() == 200 + current_databases_information = response.get_result() + assert current_databases_information is not None + @needscredentials def test_get_current_throughput_information(self): response = self.cloudant_service.get_current_throughput_information() diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 04e53335..3b369a6c 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -13527,6 +13527,82 @@ def test_post_activity_tracker_events_value_error_with_retries(self): self.test_post_activity_tracker_events_value_error() +class TestGetCapacityDatabasesInformation: + """ + Test Class for get_capacity_databases_information + """ + + @responses.activate + def test_get_capacity_databases_information_all_params(self): + """ + get_capacity_databases_information() + """ + # Set up mock + url = preprocess_url('/_api/v2/user/capacity/databases') + mock_response = '{"current": {"databases": {"total": 0}}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.get_capacity_databases_information() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_capacity_databases_information_all_params_with_retries(self): + # Enable retries and run test_get_capacity_databases_information_all_params. + _service.enable_retries() + self.test_get_capacity_databases_information_all_params() + + # Disable retries and run test_get_capacity_databases_information_all_params. + _service.disable_retries() + self.test_get_capacity_databases_information_all_params() + + +class TestGetCurrentDatabasesInformation: + """ + Test Class for get_current_databases_information + """ + + @responses.activate + def test_get_current_databases_information_all_params(self): + """ + get_current_databases_information() + """ + # Set up mock + url = preprocess_url('/_api/v2/user/current/databases') + mock_response = '{"databases": {"total": 0}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.get_current_databases_information() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_current_databases_information_all_params_with_retries(self): + # Enable retries and run test_get_current_databases_information_all_params. + _service.enable_retries() + self.test_get_current_databases_information_all_params() + + # Disable retries and run test_get_current_databases_information_all_params. + _service.disable_retries() + self.test_get_current_databases_information_all_params() + + class TestGetCurrentThroughputInformation: """ Test Class for get_current_throughput_information @@ -14414,6 +14490,79 @@ def test_bulk_get_result_item_serialization(self): assert bulk_get_result_item_model_json2 == bulk_get_result_item_model_json +class TestModel_CapacityDatabasesInformation: + """ + Test Class for CapacityDatabasesInformation + """ + + def test_capacity_databases_information_serialization(self): + """ + Test serialization/deserialization for CapacityDatabasesInformation + """ + + # Construct dict forms of any model objects needed in order to build this model. + + databases_count_information_model = {} # DatabasesCountInformation + databases_count_information_model['total'] = 0 + + capacity_databases_information_current_model = {} # CapacityDatabasesInformationCurrent + capacity_databases_information_current_model['databases'] = databases_count_information_model + + # Construct a json representation of a CapacityDatabasesInformation model + capacity_databases_information_model_json = {} + capacity_databases_information_model_json['current'] = capacity_databases_information_current_model + + # Construct a model instance of CapacityDatabasesInformation by calling from_dict on the json representation + capacity_databases_information_model = CapacityDatabasesInformation.from_dict(capacity_databases_information_model_json) + assert capacity_databases_information_model != False + + # Construct a model instance of CapacityDatabasesInformation by calling from_dict on the json representation + capacity_databases_information_model_dict = CapacityDatabasesInformation.from_dict(capacity_databases_information_model_json).__dict__ + capacity_databases_information_model2 = CapacityDatabasesInformation(**capacity_databases_information_model_dict) + + # Verify the model instances are equivalent + assert capacity_databases_information_model == capacity_databases_information_model2 + + # Convert model instance back to dict and verify no loss of data + capacity_databases_information_model_json2 = capacity_databases_information_model.to_dict() + assert capacity_databases_information_model_json2 == capacity_databases_information_model_json + + +class TestModel_CapacityDatabasesInformationCurrent: + """ + Test Class for CapacityDatabasesInformationCurrent + """ + + def test_capacity_databases_information_current_serialization(self): + """ + Test serialization/deserialization for CapacityDatabasesInformationCurrent + """ + + # Construct dict forms of any model objects needed in order to build this model. + + databases_count_information_model = {} # DatabasesCountInformation + databases_count_information_model['total'] = 0 + + # Construct a json representation of a CapacityDatabasesInformationCurrent model + capacity_databases_information_current_model_json = {} + capacity_databases_information_current_model_json['databases'] = databases_count_information_model + + # Construct a model instance of CapacityDatabasesInformationCurrent by calling from_dict on the json representation + capacity_databases_information_current_model = CapacityDatabasesInformationCurrent.from_dict(capacity_databases_information_current_model_json) + assert capacity_databases_information_current_model != False + + # Construct a model instance of CapacityDatabasesInformationCurrent by calling from_dict on the json representation + capacity_databases_information_current_model_dict = CapacityDatabasesInformationCurrent.from_dict(capacity_databases_information_current_model_json).__dict__ + capacity_databases_information_current_model2 = CapacityDatabasesInformationCurrent(**capacity_databases_information_current_model_dict) + + # Verify the model instances are equivalent + assert capacity_databases_information_current_model == capacity_databases_information_current_model2 + + # Convert model instance back to dict and verify no loss of data + capacity_databases_information_current_model_json2 = capacity_databases_information_current_model.to_dict() + assert capacity_databases_information_current_model_json2 == capacity_databases_information_current_model_json + + class TestModel_CapacityThroughputInformation: """ Test Class for CapacityThroughputInformation @@ -14774,6 +14923,41 @@ def test_cors_information_serialization(self): assert cors_information_model_json2 == cors_information_model_json +class TestModel_CurrentDatabasesInformation: + """ + Test Class for CurrentDatabasesInformation + """ + + def test_current_databases_information_serialization(self): + """ + Test serialization/deserialization for CurrentDatabasesInformation + """ + + # Construct dict forms of any model objects needed in order to build this model. + + databases_count_information_model = {} # DatabasesCountInformation + databases_count_information_model['total'] = 0 + + # Construct a json representation of a CurrentDatabasesInformation model + current_databases_information_model_json = {} + current_databases_information_model_json['databases'] = databases_count_information_model + + # Construct a model instance of CurrentDatabasesInformation by calling from_dict on the json representation + current_databases_information_model = CurrentDatabasesInformation.from_dict(current_databases_information_model_json) + assert current_databases_information_model != False + + # Construct a model instance of CurrentDatabasesInformation by calling from_dict on the json representation + current_databases_information_model_dict = CurrentDatabasesInformation.from_dict(current_databases_information_model_json).__dict__ + current_databases_information_model2 = CurrentDatabasesInformation(**current_databases_information_model_dict) + + # Verify the model instances are equivalent + assert current_databases_information_model == current_databases_information_model2 + + # Convert model instance back to dict and verify no loss of data + current_databases_information_model_json2 = current_databases_information_model.to_dict() + assert current_databases_information_model_json2 == current_databases_information_model_json + + class TestModel_CurrentThroughputInformation: """ Test Class for CurrentThroughputInformation @@ -14975,6 +15159,36 @@ def test_database_information_props_serialization(self): assert database_information_props_model_json2 == database_information_props_model_json +class TestModel_DatabasesCountInformation: + """ + Test Class for DatabasesCountInformation + """ + + def test_databases_count_information_serialization(self): + """ + Test serialization/deserialization for DatabasesCountInformation + """ + + # Construct a json representation of a DatabasesCountInformation model + databases_count_information_model_json = {} + databases_count_information_model_json['total'] = 0 + + # Construct a model instance of DatabasesCountInformation by calling from_dict on the json representation + databases_count_information_model = DatabasesCountInformation.from_dict(databases_count_information_model_json) + assert databases_count_information_model != False + + # Construct a model instance of DatabasesCountInformation by calling from_dict on the json representation + databases_count_information_model_dict = DatabasesCountInformation.from_dict(databases_count_information_model_json).__dict__ + databases_count_information_model2 = DatabasesCountInformation(**databases_count_information_model_dict) + + # Verify the model instances are equivalent + assert databases_count_information_model == databases_count_information_model2 + + # Convert model instance back to dict and verify no loss of data + databases_count_information_model_json2 = databases_count_information_model.to_dict() + assert databases_count_information_model_json2 == databases_count_information_model_json + + class TestModel_DbEvent: """ Test Class for DbEvent From 4d430d6abb815442812eae10a1333cf4bf7e50fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:40:25 +0000 Subject: [PATCH 436/669] build(deps-dev): Bump pytest from 8.3.4 to 8.3.5 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.4 to 8.3.5. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.4...8.3.5) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 85795dd5..2653892f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.11.0 # test dependencies -pytest==8.3.4 +pytest==8.3.5 responses==0.25.6 python_dotenv==1.0.1 pylint==3.3.4 From 4bc090d2b24bee6c826ab243c8cafe70cb054537 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:19:21 +0000 Subject: [PATCH 437/669] build(deps): Bump sphinx from 8.2.1 to 8.2.3 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.2.1 to 8.2.3. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.2.1...v8.2.3) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index b3749317..c06ef99e 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==8.2.1 +Sphinx==8.2.3 sphinx-autodoc2==0.5.0 myst-parser==4.0.1 sphinx-rtd-theme==3.0.2 From 256b5e6e2533a53893e0bf9b55c74c5558106248 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 10:55:40 +0000 Subject: [PATCH 438/669] build(deps): Bump github/codeql-action from 3.28.9 to 3.28.10 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.28.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0...b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ff064526..b3ecc1e0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 + uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 + uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 + uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 with: category: "/language:${{matrix.language}}" From 6faf527f123760b2c43dc60f271b331f4e080ed4 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 10 Mar 2025 17:29:59 +0000 Subject: [PATCH 439/669] Update version 0.10.0 -> 0.10.1 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 8f100653..66df3736 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.0" +current_version = "0.10.1" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 4e19a727..3cb1e845 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.0 +# IBM Cloudant Python SDK Version 0.10.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.0" +pip install --upgrade "ibmcloudant>=0.10.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.0" +easy_install --upgrade "ibmcloudant>=0.10.1" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 42a10510..27771920 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.0' +__version__ = '0.10.1' diff --git a/pyproject.toml b/pyproject.toml index cbd39723..c0357c98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.0" +version = "0.10.1" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.22.1", From de0086bafb4c280d447e401ea0391c52daad1c51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:13:26 +0000 Subject: [PATCH 440/669] build(deps): Bump github/codeql-action from 3.28.10 to 3.28.11 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.10 to 3.28.11. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d...6bb031afdd8eb862ea3fc1848194185e076637e5) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b3ecc1e0..257211e6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 with: category: "/language:${{matrix.language}}" From 45f93f98516be864de119912d0732f4a62675447 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:29:42 +0000 Subject: [PATCH 441/669] build(deps): Bump ibm-cloud-sdk-core from 3.22.1 to 3.23.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.22.1 to 3.23.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.22.1...v3.23.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c0357c98..2dec4f86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.10.1" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.22.1", + "ibm_cloud_sdk_core==3.23.0", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 4d2ba6d1c35340d95b62604c9b419f534e624c35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 17:07:09 +0000 Subject: [PATCH 442/669] build(deps-dev): Bump responses from 0.25.6 to 0.25.7 Bumps [responses](https://github.com/getsentry/responses) from 0.25.6 to 0.25.7. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.6...0.25.7) --- updated-dependencies: - dependency-name: responses dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2653892f..f4efb8d4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.11.0 # test dependencies pytest==8.3.5 -responses==0.25.6 +responses==0.25.7 python_dotenv==1.0.1 pylint==3.3.4 # code coverage From db4af66df1390b169d4e5e879f053e0e41d17f8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:17:58 +0000 Subject: [PATCH 443/669] build(deps-dev): Bump coverage from 7.6.12 to 7.7.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.12 to 7.7.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.12...7.7.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f4efb8d4..341e21f2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.0.1 pylint==3.3.4 # code coverage -coverage==7.6.12 +coverage==7.7.0 pytest-cov==6.0.0 From c99683c33f682adf3371dd270dc0cb9a66660bc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 17:05:36 +0000 Subject: [PATCH 444/669] build(deps-dev): Bump pylint from 3.3.4 to 3.3.6 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.4 to 3.3.6. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.4...v3.3.6) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 341e21f2..228a86b9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.11.0 pytest==8.3.5 responses==0.25.7 python_dotenv==1.0.1 -pylint==3.3.4 +pylint==3.3.6 # code coverage coverage==7.7.0 pytest-cov==6.0.0 From 424013b1bc461fff8924becb60b90bdb392f5405 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 17:12:22 +0000 Subject: [PATCH 445/669] build(deps-dev): Bump coverage from 7.7.0 to 7.7.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.7.0 to 7.7.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.7.0...7.7.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 228a86b9..613a1c80 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.0.1 pylint==3.3.6 # code coverage -coverage==7.7.0 +coverage==7.7.1 pytest-cov==6.0.0 From 325eaba57c2af8c71fd60961e1e03929382e0b7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 18:20:25 +0000 Subject: [PATCH 446/669] build(deps): Bump github/codeql-action from 3.28.11 to 3.28.13 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.11 to 3.28.13. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/6bb031afdd8eb862ea3fc1848194185e076637e5...1b549b9259bda1cb5ddde3b41741a82a2d15a841) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 257211e6..5cf78b3f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 + uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 + uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 + uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 with: category: "/language:${{matrix.language}}" From 44a9c52068fd88cf58b37d11c788117ccfa7bac5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 17:41:37 +0000 Subject: [PATCH 447/669] build(deps-dev): Bump python-dotenv from 1.0.1 to 1.1.0 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.0.1 to 1.1.0. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.0.1...v1.1.0) --- updated-dependencies: - dependency-name: python-dotenv dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 613a1c80..2798717d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ flit==3.11.0 # test dependencies pytest==8.3.5 responses==0.25.7 -python_dotenv==1.0.1 +python_dotenv==1.1.0 pylint==3.3.6 # code coverage coverage==7.7.1 From b0236bddfb2f6852a2047df0b0c290ea5401a366 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:25:16 +0000 Subject: [PATCH 448/669] build(deps-dev): Bump flit from 3.11.0 to 3.12.0 Bumps [flit](https://github.com/pypa/flit) from 3.11.0 to 3.12.0. - [Changelog](https://github.com/pypa/flit/blob/main/doc/history.rst) - [Commits](https://github.com/pypa/flit/compare/3.11.0...3.12.0) --- updated-dependencies: - dependency-name: flit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2798717d..d503630d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # build dependencies -flit==3.11.0 +flit==3.12.0 # test dependencies pytest==8.3.5 responses==0.25.7 From b90a0018f7b8a56ade1359c2aa169e42093e3e85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 17:39:24 +0000 Subject: [PATCH 449/669] build(deps): Bump actions/setup-python from 5.4.0 to 5.5.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.4.0 to 5.5.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/42375524e23c412d93fb67b49958b491fce71c38...8d9ed9ac5c53483de85588cdf95a591a75ab9f55) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 62474560..0c8cf6e5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.13 - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: '3.13' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5865121..7dddba15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python }} cache: 'pip' From df557f18b50865ba753e538df987ac0ca99d1c4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 17:48:57 +0000 Subject: [PATCH 450/669] build(deps-dev): Bump coverage from 7.7.1 to 7.8.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.7.1 to 7.8.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.7.1...7.8.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d503630d..0985136c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.6 # code coverage -coverage==7.7.1 +coverage==7.8.0 pytest-cov==6.0.0 From 575a885c0759b57f680e06fd6b865ddae0615f86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:28:43 +0000 Subject: [PATCH 451/669] build(deps-dev): Bump pytest-cov from 6.0.0 to 6.1.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.0.0 to 6.1.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.0.0...v6.1.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.1.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0985136c..b730348a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.1.0 pylint==3.3.6 # code coverage coverage==7.8.0 -pytest-cov==6.0.0 +pytest-cov==6.1.0 From e351be055c2f48b1bb5025ab3e418cede4b9d145 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:14:41 +0000 Subject: [PATCH 452/669] build(deps): Bump github/codeql-action from 3.28.13 to 3.28.14 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.14. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/1b549b9259bda1cb5ddde3b41741a82a2d15a841...fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5cf78b3f..0cc236d3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + uses: github/codeql-action/init@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + uses: github/codeql-action/autobuild@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + uses: github/codeql-action/analyze@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 with: category: "/language:${{matrix.language}}" From 009acde4c892a643e4f016cafed149d0e9af1442 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 09:43:40 +0000 Subject: [PATCH 453/669] build(deps-dev): Bump pytest-cov from 6.1.0 to 6.1.1 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.1.0 to 6.1.1. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.1.0...v6.1.1) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.1.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b730348a..9692bd2d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.1.0 pylint==3.3.6 # code coverage coverage==7.8.0 -pytest-cov==6.1.0 +pytest-cov==6.1.1 From 892a82fd3ef94ad761d23ae836dcca3121754e18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 17:34:32 +0000 Subject: [PATCH 454/669] build(deps): Bump github/codeql-action from 3.28.14 to 3.28.15 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.14 to 3.28.15. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2...45775bd8235c68ba998cffa5171334d58593da47) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.15 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0cc236d3..4a6108d9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 + uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 + uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14 + uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 with: category: "/language:${{matrix.language}}" From 8be0fd7dce83a04c205345e44a05b552fbcd976a Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 8 Apr 2025 12:37:18 -0300 Subject: [PATCH 455/669] refactor(follower): use normal feed for one-off changes --- ibmcloudant/features/changes_follower.py | 19 ++++++++++------ test/unit/features/test_changes_follower.py | 25 +++++++++++++++++++-- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/ibmcloudant/features/changes_follower.py b/ibmcloudant/features/changes_follower.py index 144d244c..004afce2 100644 --- a/ibmcloudant/features/changes_follower.py +++ b/ibmcloudant/features/changes_follower.py @@ -293,7 +293,7 @@ def __init__( ) -> None: self.options = kwargs self.limit = self.options.get('limit') - self._set_defaults() + self._set_defaults(_Mode.FINITE) self.service = service self.error_tolerance = error_tolerance self._iter = None @@ -358,11 +358,16 @@ def options(self, value: Dict): raise ValueError(error_fmt.format(invalid_opts_list, class_name)) self._options = value - def _set_defaults(self, limit: int = None): - defaults = { - 'feed': PostChangesEnums.Feed.LONGPOLL, - 'timeout': _LONGPOLL_TIMEOUT, - } + def _set_defaults(self, mode: _Mode, limit: int = None): + if mode == _Mode.FINITE: + defaults = { + 'feed': PostChangesEnums.Feed.NORMAL + } + elif mode == _Mode.LISTEN: + defaults = { + 'feed': PostChangesEnums.Feed.LONGPOLL, + 'timeout': _LONGPOLL_TIMEOUT, + } if limit is not None: self.logger.debug(f'Applying changes limit {limit}') defaults['limit'] = limit @@ -445,7 +450,7 @@ def _run(self, mode: _Mode): if self.limit is not None: batch_size = self.limit if self.limit < batch_size else batch_size - self._set_defaults(batch_size) + self._set_defaults(mode, batch_size) changes_caller = functools.partial( self.service.post_changes, **self.options ) diff --git a/test/unit/features/test_changes_follower.py b/test/unit/features/test_changes_follower.py index 11fed59e..e31a6d17 100644 --- a/test/unit/features/test_changes_follower.py +++ b/test/unit/features/test_changes_follower.py @@ -112,6 +112,16 @@ def test_validate_options_multiple_invalid_cases(self): def test_set_defaults(self): follower = ChangesFollower(self.client, db="db", **self.kwarg_valid) + expected = { + "feed": PostChangesEnums.Feed.NORMAL, + "timeout": None, + } + for opt, val in expected.items(): + self.assertEqual(follower.options.get(opt), val) + + def test_set_defaults_listen(self): + follower = ChangesFollower(self.client, db="db", **self.kwarg_valid) + follower._set_defaults(_Mode.LISTEN) expected = { "feed": PostChangesEnums.Feed.LONGPOLL, "timeout": _LONGPOLL_TIMEOUT, @@ -121,7 +131,18 @@ def test_set_defaults(self): def test_set_defaults_with_limit(self): follower = ChangesFollower(self.client, db="db", **self.kwarg_valid) - follower._set_defaults(limit=12) + follower._set_defaults(_Mode.FINITE, limit=12) + expected = { + "feed": PostChangesEnums.Feed.NORMAL, + "timeout": None, + "limit": 12, + } + for opt, val in expected.items(): + self.assertEqual(follower.options.get(opt), val) + + def test_set_defaults_listen_with_limit(self): + follower = ChangesFollower(self.client, db="db", **self.kwarg_valid) + follower._set_defaults(_Mode.LISTEN, limit=12) expected = { "feed": PostChangesEnums.Feed.LONGPOLL, "timeout": _LONGPOLL_TIMEOUT, @@ -133,7 +154,7 @@ def test_set_defaults_with_limit(self): def test_set_defaults_with_kwarg_limit(self): kwarg = {**self.kwarg_valid, **{"limit": 24}} follower = ChangesFollower(self.client, db="db", **kwarg) - follower._set_defaults(limit=12) + follower._set_defaults(_Mode.LISTEN, limit=12) self.assertEqual(follower.options.get("limit"), 12) From cca908b5ab1055e580a919559ccba781d54040aa Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:00:34 +0000 Subject: [PATCH 456/669] feat(generated): update API definition to 1.0.0-dev0.1.28 Generated SDK source code using: - Generator version 3.104.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 51f3769 --- ibmcloudant/cloudant_v1.py | 42 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index a96a339e..01c51570 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -8110,9 +8110,9 @@ def get_activity_tracker_events( **kwargs, ) -> DetailedResponse: """ - Retrieve Activity Tracker events information. + Retrieve activity tracking events information. - Check event types that are being sent to IBM Cloud Activity Tracker for the IBM + Check event types sent to IBM Cloud Activity Tracker Event Routing for the IBM Cloudant instance. :param dict headers: A `dict` containing the request headers @@ -8149,13 +8149,13 @@ def post_activity_tracker_events( **kwargs, ) -> DetailedResponse: """ - Modify Activity Tracker events configuration. + Modify activity tracking events configuration. - Configure event types that are being sent to IBM Cloud Activity Tracker for the - IBM Cloudant instance. + Configure event types sent to IBM Cloud Activity Tracker Event Routing for the IBM + Cloudant instance. - :param List[str] types: An array of event types that are being sent to IBM - Cloud Activity Tracker for the IBM Cloudant instance. "management" is a + :param List[str] types: An array of event types sent to IBM Cloud Activity + Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -9146,10 +9146,10 @@ class TypeEnum(str, Enum): class ActivityTrackerEvents: """ - Schema for Activity Tracker events. + Schema for activity tracking events. - :param List[str] types: An array of event types that are being sent to IBM Cloud - Activity Tracker for the IBM Cloudant instance. "management" is a required + :param List[str] types: An array of event types sent to IBM Cloud Activity + Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array. """ @@ -9160,8 +9160,8 @@ def __init__( """ Initialize a ActivityTrackerEvents object. - :param List[str] types: An array of event types that are being sent to IBM - Cloud Activity Tracker for the IBM Cloudant instance. "management" is a + :param List[str] types: An array of event types sent to IBM Cloud Activity + Tracker Event Routing for the IBM Cloudant instance. "management" is a required element of this array. """ self.types = types @@ -9637,26 +9637,28 @@ class NameEnum(str, Enum): CLASSIC = 'classic' EMAIL = 'email' KEYWORD = 'keyword' + PERFIELD = 'perfield' SIMPLE = 'simple' + SIMPLE_ASCIIFOLDING = 'simple_asciifolding' STANDARD = 'standard' WHITESPACE = 'whitespace' ARABIC = 'arabic' ARMENIAN = 'armenian' BASQUE = 'basque' - BULGARIAN = 'bulgarian' BRAZILIAN = 'brazilian' + BULGARIAN = 'bulgarian' CATALAN = 'catalan' - CJK = 'cjk' CHINESE = 'chinese' + CJK = 'cjk' CZECH = 'czech' DANISH = 'danish' DUTCH = 'dutch' ENGLISH = 'english' FINNISH = 'finnish' FRENCH = 'french' + GALICIAN = 'galician' GERMAN = 'german' GREEK = 'greek' - GALICIAN = 'galician' HINDI = 'hindi' HUNGARIAN = 'hungarian' INDONESIAN = 'indonesian' @@ -9674,7 +9676,6 @@ class NameEnum(str, Enum): SWEDISH = 'swedish' THAI = 'thai' TURKISH = 'turkish' - PERFIELD = 'perfield' @@ -9784,26 +9785,28 @@ class NameEnum(str, Enum): CLASSIC = 'classic' EMAIL = 'email' KEYWORD = 'keyword' + PERFIELD = 'perfield' SIMPLE = 'simple' + SIMPLE_ASCIIFOLDING = 'simple_asciifolding' STANDARD = 'standard' WHITESPACE = 'whitespace' ARABIC = 'arabic' ARMENIAN = 'armenian' BASQUE = 'basque' - BULGARIAN = 'bulgarian' BRAZILIAN = 'brazilian' + BULGARIAN = 'bulgarian' CATALAN = 'catalan' - CJK = 'cjk' CHINESE = 'chinese' + CJK = 'cjk' CZECH = 'czech' DANISH = 'danish' DUTCH = 'dutch' ENGLISH = 'english' FINNISH = 'finnish' FRENCH = 'french' + GALICIAN = 'galician' GERMAN = 'german' GREEK = 'greek' - GALICIAN = 'galician' HINDI = 'hindi' HUNGARIAN = 'hungarian' INDONESIAN = 'indonesian' @@ -9821,7 +9824,6 @@ class NameEnum(str, Enum): SWEDISH = 'swedish' THAI = 'thai' TURKISH = 'turkish' - PERFIELD = 'perfield' From 72874adc05f5927109a37dc0aac43e48c56703d3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:04:44 +0000 Subject: [PATCH 457/669] Update version 0.10.1 -> 0.10.2 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 66df3736..7898d5a4 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.1" +current_version = "0.10.2" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 3cb1e845..7064fddc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.1 +# IBM Cloudant Python SDK Version 0.10.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.1" +pip install --upgrade "ibmcloudant>=0.10.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.1" +easy_install --upgrade "ibmcloudant>=0.10.2" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.1/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 27771920..25250990 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.1' +__version__ = '0.10.2' diff --git a/pyproject.toml b/pyproject.toml index 2dec4f86..7fc6524b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.1" +version = "0.10.2" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.23.0", From d4f06e97c6b22bf25901c1b013c03aab7dccf2b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 18:24:50 +0000 Subject: [PATCH 458/669] build(deps): Bump actions/setup-python from 5.5.0 to 5.6.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/8d9ed9ac5c53483de85588cdf95a591a75ab9f55...a26af69be951a213d495a4c3e4e4022e16d87065) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 5.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0c8cf6e5..6b396971 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.13 - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.13' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7dddba15..3beb15d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 4a1ca8fb98e7e2d8e22ec1226c9486c145dfb2e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 18:44:23 +0000 Subject: [PATCH 459/669] build(deps): Bump github/codeql-action from 3.28.15 to 3.28.16 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.15 to 3.28.16. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/45775bd8235c68ba998cffa5171334d58593da47...28deaeda66b76a05916b6923827895f2b14ab387) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.16 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4a6108d9..579bb0ce 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 + uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 + uses: github/codeql-action/autobuild@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 + uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 with: category: "/language:${{matrix.language}}" From 4f6a7fa34ec033f1c932e914406b4ad47056ae2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 17:59:41 +0000 Subject: [PATCH 460/669] build(deps): Bump github/codeql-action from 3.28.16 to 3.28.17 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.28.17. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/28deaeda66b76a05916b6923827895f2b14ab387...60168efe1c415ce0f5521ea06d5c2062adbeed1b) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.17 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 579bb0ce..5183e255 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 + uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 + uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 + uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 with: category: "/language:${{matrix.language}}" From aa41c420ff8a9b6e55cb076a11b7754ca8c68921 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 07:39:16 +0000 Subject: [PATCH 461/669] build(deps-dev): Bump pylint from 3.3.6 to 3.3.7 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.6 to 3.3.7. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.6...v3.3.7) --- updated-dependencies: - dependency-name: pylint dependency-version: 3.3.7 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9692bd2d..b9255cc7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==8.3.5 responses==0.25.7 python_dotenv==1.1.0 -pylint==3.3.6 +pylint==3.3.7 # code coverage coverage==7.8.0 pytest-cov==6.1.1 From 85f21455618e1fa0e5703565ec2414ea606879b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 17:45:07 +0000 Subject: [PATCH 462/669] build(deps): Bump github/codeql-action from 3.28.17 to 3.28.18 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.17 to 3.28.18. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/60168efe1c415ce0f5521ea06d5c2062adbeed1b...ff0a06e83cb2de871e5a09832bc6a81e7276941f) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.18 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5183e255..98e3cee8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 + uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 + uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17 + uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 with: category: "/language:${{matrix.language}}" From badc1742a9a1f12b18ac1bd85dd6b64f2eb6155f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 17:44:43 +0000 Subject: [PATCH 463/669] build(deps-dev): Bump coverage from 7.8.0 to 7.8.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.8.0 to 7.8.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.8.0...7.8.1) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.8.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b9255cc7..64f0138b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.7 # code coverage -coverage==7.8.0 +coverage==7.8.1 pytest-cov==6.1.1 From 3c996fe9501455e64a7a9e5455279fad792cce5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 May 2025 17:49:05 +0000 Subject: [PATCH 464/669] build(deps-dev): Bump coverage from 7.8.1 to 7.8.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.8.1 to 7.8.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.8.1...7.8.2) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.8.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 64f0138b..4010f816 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.7 # code coverage -coverage==7.8.1 +coverage==7.8.2 pytest-cov==6.1.1 From fa2e6134e8865885922ec93255646994f377f542 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 17:30:27 +0000 Subject: [PATCH 465/669] build(deps): Bump ibm-cloud-sdk-core from 3.23.0 to 3.24.1 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.23.0 to 3.24.1. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.23.0...v3.24.1) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 3.24.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7fc6524b..db922303 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.10.2" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.23.0", + "ibm_cloud_sdk_core==3.24.1", "requests>=2.32.2,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From c03822c4549b40b2f603d245f9b6ecfc8092e486 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 18:01:12 +0000 Subject: [PATCH 466/669] build(deps-dev): Bump pytest from 8.3.5 to 8.4.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.5 to 8.4.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.5...8.4.0) --- updated-dependencies: - dependency-name: pytest dependency-version: 8.4.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4010f816..024e42b6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==8.3.5 +pytest==8.4.0 responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.7 From e2a1335da7bc85ca9f24b7c1198f61f4e14bb1b0 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:24:15 +0000 Subject: [PATCH 467/669] Update version 0.10.2 -> 0.10.3 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 7898d5a4..95934c1d 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.2" +current_version = "0.10.3" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 7064fddc..3ca6a3d3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.2 +# IBM Cloudant Python SDK Version 0.10.3 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.2" +pip install --upgrade "ibmcloudant>=0.10.3" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.2" +easy_install --upgrade "ibmcloudant>=0.10.3" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.2/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 25250990..86b99105 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.2' +__version__ = '0.10.3' diff --git a/pyproject.toml b/pyproject.toml index db922303..6b1a6d44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.2" +version = "0.10.3" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.1", From 080409bdd09c797f1764a71e938c05c4abee0d97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:40:48 +0000 Subject: [PATCH 468/669] build(deps): Bump github/codeql-action from 3.28.18 to 3.28.19 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.18 to 3.28.19. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/ff0a06e83cb2de871e5a09832bc6a81e7276941f...fca7ace96b7d713c7035871441bd52efbe39e27e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.19 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 98e3cee8..9e61864a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/autobuild@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 with: category: "/language:${{matrix.language}}" From 98085ecc52c63047286a97d25947b804fd0011be Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 10 Jun 2025 16:18:53 +0100 Subject: [PATCH 469/669] build(deps): requests>=2.32.4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6b1a6d44..bde817ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "0.10.3" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.1", - "requests>=2.32.2,<3.0.0", + "requests>=2.32.4,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", ] From b3b7f0d653ef85c7fd89f4e797896ddb704f28e2 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 11 Jun 2025 08:53:47 +0000 Subject: [PATCH 470/669] Update version 0.10.3 -> 0.10.4 --- .bumpversion.toml | 2 +- README.md | 18 +++++++++--------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 95934c1d..49eac5e4 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.3" +current_version = "0.10.4" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 3ca6a3d3..3662b7cb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.3 +# IBM Cloudant Python SDK Version 0.10.4 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -111,13 +111,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.3" +pip install --upgrade "ibmcloudant>=0.10.4" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.3" +easy_install --upgrade "ibmcloudant>=0.10.4" ``` ## Using the SDK @@ -571,7 +571,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#examples-for-python). ### Error handling @@ -761,7 +761,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/examples#postchanges) instead of the follower. +write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges) instead of the follower. #### Error suppression @@ -796,7 +796,7 @@ The follower is not optimized for some use cases and it is not recommended to us * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/examples#postchanges). +may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges). #### Checkpointing @@ -987,7 +987,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1017,8 +1017,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.3/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 86b99105..9724eda9 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.3' +__version__ = '0.10.4' diff --git a/pyproject.toml b/pyproject.toml index bde817ca..fc846336 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.3" +version = "0.10.4" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.1", From 0a610f6bfc71e903bccc5580686aaaab7647c7c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 17:22:05 +0000 Subject: [PATCH 471/669] build(deps-dev): Bump coverage from 7.8.2 to 7.9.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.8.2 to 7.9.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.8.2...7.9.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.9.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 024e42b6..29921027 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.7 # code coverage -coverage==7.8.2 +coverage==7.9.0 pytest-cov==6.1.1 From fe0f6ccc39d98e8297a2a61bbc7dba88f6807c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 09:08:10 +0000 Subject: [PATCH 472/669] build(deps): Bump ibm-cloud-sdk-core from 3.24.1 to 3.24.2 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.24.1 to 3.24.2. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.24.1...v3.24.2) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 3.24.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fc846336..55f7deaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.10.4" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.24.1", + "ibm_cloud_sdk_core==3.24.2", "requests>=2.32.4,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 928ceda32752f1a2685008ef1d13f224b6c8ede2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 10:38:01 +0000 Subject: [PATCH 473/669] build(deps-dev): Bump pytest-cov from 6.1.1 to 6.2.1 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.1.1 to 6.2.1. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.1.1...v6.2.1) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.2.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 29921027..5fcbe8fa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.1.0 pylint==3.3.7 # code coverage coverage==7.9.0 -pytest-cov==6.1.1 +pytest-cov==6.2.1 From 44aa8b04f9194197d94a7e048277e885ce4662e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 17:18:25 +0000 Subject: [PATCH 474/669] build(deps-dev): Bump coverage from 7.9.0 to 7.9.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.9.0 to 7.9.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.9.0...7.9.1) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.9.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5fcbe8fa..bce9668a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.7 # code coverage -coverage==7.9.0 +coverage==7.9.1 pytest-cov==6.2.1 From b9cc426ee1c93d7f81ee6dcab2dfc6b1d2900bd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 19:21:24 +0000 Subject: [PATCH 475/669] build(deps): Bump github/codeql-action from 3.28.19 to 3.29.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.19 to 3.29.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/fca7ace96b7d713c7035871441bd52efbe39e27e...ce28f5bb42b7a9f2c824e633a3f6ee835bab6858) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9e61864a..a11b703c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 + uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 + uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 + uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 with: category: "/language:${{matrix.language}}" From 6c6538a72f02b90525441fcb411b819e62a07dfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:24:52 +0000 Subject: [PATCH 476/669] build(deps-dev): Bump pytest from 8.4.0 to 8.4.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.0 to 8.4.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.4.0...8.4.1) --- updated-dependencies: - dependency-name: pytest dependency-version: 8.4.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bce9668a..e962c8f3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==8.4.0 +pytest==8.4.1 responses==0.25.7 python_dotenv==1.1.0 pylint==3.3.7 From 5f72f21e9bd873c01865be4f797f2c9a9b9e5bee Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 24 Jun 2025 17:33:36 +0000 Subject: [PATCH 477/669] docs(generated): add AI code policy to contributing guide Generated SDK source code using: - Generator version 3.105.1 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 61fe65e --- .github/CODEOWNERS | 1 + AI_CODE_POLICY.md | 10 ++++++++++ CONTRIBUTING.md | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 AI_CODE_POLICY.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 72be677e..a5de3a3a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,6 +6,7 @@ .github/dependabot.yml @IBM/cloudant-sdks .github/pull_request_template.md @IBM/cloudant-sdks .whitesource @IBM/cloudant-sdks +AI_CODE_POLICY.md @IBM/cloudant-sdks CODE_OF_CONDUCT.md @IBM/cloudant-sdks CONTRIBUTING.md @IBM/cloudant-sdks Jenkinsfile @IBM/cloudant-sdks diff --git a/AI_CODE_POLICY.md b/AI_CODE_POLICY.md new file mode 100644 index 00000000..58d83510 --- /dev/null +++ b/AI_CODE_POLICY.md @@ -0,0 +1,10 @@ +# Policy on submitting AI-generated code to IBM Open Source software projects (v.1.0) + +Although IBM does not generally prohibit AI-generated code (“AI Code”) from being contributed to IBM- maintained Open Source software projects (“IBM Projects”), any such contributions should comply with this policy (“Policy”). This Policy applies to contributions to IBM Projects made by IBMers and non-IBMers alike. + +AI Code can create potential copyright infringement issues for an IBM Project if it is substantially similar to code used to train the generative AI model (“Training Code”) that outputs the AI Code. As a result, IBM asks that contributors comply with the following guidance when deciding whether it is appropriate to submit a piece of AI Code to an IBM Project: + +1. Only use a generative AI tool (“AI Tool”) with functionality specifically designed to mitigate the risk of AI Code that is substantially similar to Training Code, either by trying to (a) filter AI Code that is substantially similar to Training Code or (b) identify AI Code that is substantially similar to the Training Code such that the contributor can identify and comply with the Training Code’s license, including its notice and attribution requirements. You must ensure the mitigation functionality is enabled during your use of the AI Tool. +2. Ensure that the terms and conditions of the generative AI tool (“AI Tool”) (a) allow its AI Code to be used for external Open Source development and (b) are consistent with submitting the AI Code under the IBM Project’s Developer Certificate of Origin (DCO) or Contributor License Agreement (CLA), including enabling it to be used by the IBM Project under its Open Source license. +3. Review and understand the terms of the DCO or CLA specific to the IBM Project and ensure that contribution of the AI Code complies with such terms or other applicable project guidance. If the AI Tool indicates the AI Code is substantially similar to Training Code, comply with the license requirements of the Training Code’s license (including notice and attribution terms) when contributing the AI Code to the IBM Project, and only submit if its license is compatible with the IBM Project license. +4. As a best practice, if your contribution to this project contains AI Code, indicate so with a pair of inline comment tags that note the beginning and end of the AI Code content that identify the AI Tool used (including version if applicable). For example, if you modified a file and your contribution contains AI Code, include a comment before the AI-generated content such as “// Begin modifications with assistance from AI Tool [X v.Y] ” paired with a comment after the content “// End modifications with assistance from AI Tool [X v.Y].” If you have substantially altered the file using an AI tool, we recommend adding a comment in the file header (“// this file has been modified with the assistance of AI Tool [X v.Y]”). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a83b20e..75d7bc9b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,8 @@ are often inappropriate and we may need to make changes to the specification instead. Please, first [look at the list of files](.github/CODEOWNERS) that _should not_ be modified. +Before submitting your pull request, please ensure you've reviewed and adhere to our [AI policy](AI_CODE_POLICY.md). + # General Information For general guidance on contributing to this project, please see the [general guidance for contributing](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/CONTRIBUTING_python.md). From b47966dcc5f953cc7a817868941c509eef5a475b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 18:40:34 +0000 Subject: [PATCH 478/669] build(deps-dev): Bump python-dotenv from 1.1.0 to 1.1.1 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.1.0...v1.1.1) --- updated-dependencies: - dependency-name: python-dotenv dependency-version: 1.1.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e962c8f3..6f902795 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ flit==3.12.0 # test dependencies pytest==8.4.1 responses==0.25.7 -python_dotenv==1.1.0 +python_dotenv==1.1.1 pylint==3.3.7 # code coverage coverage==7.9.1 From cd2bbbb39f03919f52f72fcb56608bc944993c73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 20:46:09 +0000 Subject: [PATCH 479/669] build(deps): Bump github/codeql-action from 3.29.0 to 3.29.2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.0 to 3.29.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/ce28f5bb42b7a9f2c824e633a3f6ee835bab6858...181d5eefc20863364f96762470ba6f862bdef56b) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a11b703c..a3c119fc 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 + uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 + uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0 + uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 with: category: "/language:${{matrix.language}}" From 759308e78d9e239474df89f41be379468393d0d0 Mon Sep 17 00:00:00 2001 From: Kornel-Toth Date: Tue, 1 Jul 2025 18:06:50 +0200 Subject: [PATCH 480/669] feat: pagination (#819) * feat: add pagination interfaces * feat: base pager implementation * fix: make pages immutable * feat: _KeyPager overrides * test: mock client update * test: _BasePager tests * fix: clean up * feat: update default page size to 200 * feat: reusable get_all * feat: _KeyPager * feat: _BookmarkPager * refactor: pagination entry point factory API * refactor: renames * test: updates for new entry point and renames * chore: remove TODO comment * feat: add pagination option validation * fix: use Sequence type for interfaces * fix: add missing type * fix: opts deletion error * fix: return from all docs _get_next_page_options * test: extract common page mocks * test: add pagination operation tests * test: share error code * test: add pagination error tests * docs: pagination examples docs: pagination examples * fix: Optional[str] for python 3.9 * test: itertools.batched fix for older versions --------- Co-authored-by: Rich Ellis Co-authored-by: Richard Ellis --- ibmcloudant/__init__.py | 1 + ibmcloudant/features/pagination.py | 435 ++++++++++++++++++ .../pagination/all_docs_pagination.py | 60 +++ .../pagination/design_docs_pagination.py | 59 +++ .../features/pagination/find_pagination.py | 62 +++ .../partition_all_docs_pagination.py | 60 +++ .../pagination/partition_find_pagination.py | 62 +++ .../pagination/partition_search_pagination.py | 58 +++ .../pagination/partition_view_pagination.py | 62 +++ .../features/pagination/search_pagination.py | 57 +++ .../features/pagination/view_pagination.py | 56 +++ test/unit/features/conftest.py | 205 +++++++-- test/unit/features/test_pagination_base.py | 405 ++++++++++++++++ .../unit/features/test_pagination_bookmark.py | 124 +++++ test/unit/features/test_pagination_key.py | 181 ++++++++ .../features/test_pagination_operations.py | 193 ++++++++ .../test_pagination_option_validation.py | 57 +++ 17 files changed, 2109 insertions(+), 28 deletions(-) create mode 100644 ibmcloudant/features/pagination.py create mode 100644 test/examples/src/features/pagination/all_docs_pagination.py create mode 100644 test/examples/src/features/pagination/design_docs_pagination.py create mode 100644 test/examples/src/features/pagination/find_pagination.py create mode 100644 test/examples/src/features/pagination/partition_all_docs_pagination.py create mode 100644 test/examples/src/features/pagination/partition_find_pagination.py create mode 100644 test/examples/src/features/pagination/partition_search_pagination.py create mode 100644 test/examples/src/features/pagination/partition_view_pagination.py create mode 100644 test/examples/src/features/pagination/search_pagination.py create mode 100644 test/examples/src/features/pagination/view_pagination.py create mode 100644 test/unit/features/test_pagination_base.py create mode 100644 test/unit/features/test_pagination_bookmark.py create mode 100644 test/unit/features/test_pagination_key.py create mode 100644 test/unit/features/test_pagination_operations.py create mode 100644 test/unit/features/test_pagination_option_validation.py diff --git a/ibmcloudant/__init__.py b/ibmcloudant/__init__.py index 650d39da..1ce2afa9 100644 --- a/ibmcloudant/__init__.py +++ b/ibmcloudant/__init__.py @@ -23,6 +23,7 @@ from .couchdb_session_token_manager import CouchDbSessionTokenManager from .cloudant_v1 import CloudantV1 from .features.changes_follower import ChangesFollower +from .features.pagination import Pager, PagerType, Pagination # sdk-core's __construct_authenticator works with a long switch-case so monkey-patching is required get_authenticator.__construct_authenticator = new_construct_authenticator diff --git a/ibmcloudant/features/pagination.py b/ibmcloudant/features/pagination.py new file mode 100644 index 00000000..ce97cde9 --- /dev/null +++ b/ibmcloudant/features/pagination.py @@ -0,0 +1,435 @@ +# coding: utf-8 +# © Copyright IBM Corporation 2025. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" + Feature for paginating requests. + + Import :class:`~ibmcloudant.Pagination` and :class:`~ibmcloudant.PagerType` + from :mod:`ibmcloudant`. + Use :meth:`Pagination.new_pagination` to create a :class:`Pagination` + for the specific :class:`PagerType` operation and options. +""" + +from abc import abstractmethod +from collections.abc import Callable, Iterable, Iterator, Sequence +from enum import auto, Enum +from functools import partial +from types import MappingProxyType +from typing import Generic, Optional, Protocol, TypeVar + +from ibm_cloud_sdk_core import DetailedResponse +from ibmcloudant.cloudant_v1 import CloudantV1,\ + AllDocsResult, DocsResultRow, Document, FindResult, SearchResult, SearchResultRow, ViewResult, ViewResultRow + +# Type variable for the result +R = TypeVar('R', AllDocsResult, FindResult, SearchResult, ViewResult) +# Type variable for the items +I = TypeVar('I', DocsResultRow, Document, SearchResultRow, ViewResultRow) +# Type variable for the key in key based paging +K = TypeVar('K') + +_MAX_LIMIT = 200 +_MIN_LIMIT = 1 + +class PagerType(Enum): + """ + Enumeration of the available Pager types + """ + + POST_ALL_DOCS = auto() + POST_DESIGN_DOCS = auto() + POST_FIND = auto() + POST_PARTITION_ALL_DOCS = auto() + POST_PARTITION_FIND = auto() + POST_PARTITION_SEARCH = auto() + POST_PARTITION_VIEW = auto() + POST_SEARCH = auto() + POST_VIEW = auto() + +class Pager(Protocol[I]): + """ + Protocol for pagination of Cloudant operations. + + Use Pager.new_pager to create a new pager for one of + the operation types in PagerType. + """ + + @abstractmethod + def has_next(self) -> bool: + """ + returns False if there are no more pages + """ + + raise NotImplementedError() + + @abstractmethod + def get_next(self) -> Sequence[I]: + """ + returns the next page of results + """ + + raise NotImplementedError() + + @abstractmethod + def get_all(self) -> Sequence[I]: + """ + returns all the pages of results in single list + """ + + raise NotImplementedError() + +class Pagination: + """ + Entry point for the pagination features. + + Use :meth:`Pagination.new_pagination` to create a :class:`Pagination` + instance for the specific :class:`PagerType` operation and options. + + Then create a Pager or Iterable using one of the functions: + * :meth:`pager` - for an IBM Cloud SDK style Pager + * :meth:`pages` - for a page Iterable + * :meth:`rows` - for a row Iterable + """ + + def __init__(self, client: CloudantV1, type: PagerType, opts: dict): + self._client = client + self._operation_type = type + self._initial_opts = dict(opts) + + def pager(self) -> Pager[I]: + """ + Create a new IBM Cloud SDK style Pager. + This type is useful for retrieving one page at a time from a function call. + """ + + return _IteratorPager(self.pages) + + def pages(self) -> Iterable[Sequence[I]]: + """ + Create a new Iterable for all the pages. + This type is useful for handling pages in a for loop. + + for page in Pagination.new_pagination(client, **opts).pages(): + ... + """ + + return self._operation_type(self._client, self._initial_opts) + + def rows(self) -> Iterable[I]: + """ + Create a new Iterable for all the rows from all the pages. + This type is useful for handling rows in a for loop. + + for row in Pagination.new_pagination(client, **opts).rows(): + ... + """ + + for page in self.pages(): + yield from page + + @classmethod + def _validate_limit(cls, opts: dict): + limit: int | None = opts.get('limit') + # For None case the valid default limit of _MAX_LIMIT will be applied later + if limit is not None: + if limit > _MAX_LIMIT: + raise ValueError(f'The provided limit {limit} exceeds the maximum page size value of {_MAX_LIMIT}.') + if limit < _MIN_LIMIT: + raise ValueError(f'The provided limit {limit} is lower than the minimum page size value of {_MIN_LIMIT}.') + + @classmethod + def _validate_options_absent(cls, invalid_opts: Sequence[str], opts: dict): + # for each invalid_opts entry check if it is present in opts dict + for invalid_opt in invalid_opts: + if invalid_opt in opts: + raise ValueError(f"The option '{invalid_opt}' is invalid when using pagination.") + + @classmethod + def new_pagination(cls, client:CloudantV1, type: PagerType, **kwargs): + """ + Create a new Pagination. + client: CloudantV1 - the Cloudant service client + type: PagerType - the operation type to paginate + kwargs: dict - the options for the operation + """ + + # Validate the limit + cls._validate_limit(kwargs) + if type == PagerType.POST_ALL_DOCS: + cls._validate_options_absent(('keys',), kwargs) + return Pagination(client, _AllDocsPageIterator, kwargs) + if type == PagerType.POST_DESIGN_DOCS: + cls._validate_options_absent(('keys',), kwargs) + return Pagination(client, _DesignDocsPageIterator, kwargs) + if type == PagerType.POST_FIND: + return Pagination(client, _FindPageIterator, kwargs) + if type == PagerType.POST_PARTITION_ALL_DOCS: + cls._validate_options_absent(('keys',), kwargs) + return Pagination(client, _AllDocsPartitionPageIterator, kwargs) + if type == PagerType.POST_PARTITION_FIND: + return Pagination(client, _FindPartitionPageIterator, kwargs) + if type == PagerType.POST_PARTITION_SEARCH: + return Pagination(client, _SearchPartitionPageIterator, kwargs) + if type == PagerType.POST_PARTITION_VIEW: + cls._validate_options_absent(('keys',), kwargs) + return Pagination(client, _ViewPartitionPageIterator, kwargs) + if type == PagerType.POST_SEARCH: + cls._validate_options_absent(('counts', 'group_field', 'group_limit', 'group_sort', 'ranges',), kwargs) + return Pagination(client, _SearchPageIterator, kwargs) + if type == PagerType.POST_VIEW: + cls._validate_options_absent(('keys',), kwargs) + return Pagination(client, _ViewPageIterator, kwargs) + +class _IteratorPagerState(Enum): + NEW = auto() + GET_NEXT = auto() + GET_ALL = auto() + CONSUMED = auto() + +class _IteratorPager(Pager[I]): + + _state_mixed_msg = 'This pager has been consumed, use a new Pager.' + _state_consumed_msg = 'Cannot mix get_all() and get_next() use only one method or make a new Pager.' + + def __init__(self, iterable_func: Callable[[], Iterator[Sequence[I]]]): + self._iterable_func: Callable[[], Iterator[Sequence[I]]] = iterable_func + self._iterator: Iterator[Sequence[I]] = iter(self._iterable_func()) + self._state: _IteratorPagerState = _IteratorPagerState.NEW + + def has_next(self) -> bool: + """ + returns False if there are no more pages + """ + + return self._iterator._has_next + + def get_next(self) -> Sequence[I]: + """ + returns the next page of results + """ + self._check_state(mode=_IteratorPagerState.GET_NEXT) + page: Sequence[I] = next(self._iterator) + if not self._iterator._has_next: + self._state = _IteratorPagerState.CONSUMED + return page + + def get_all(self) -> Sequence[I]: + """ + returns all the pages of results in single list + """ + + self._check_state(mode=_IteratorPagerState.GET_ALL) + all_items: list[I] = [] + for page in self._iterable_func(): + all_items.extend(page) + self._state = _IteratorPagerState.CONSUMED + return (*all_items,) + + def _check_state(self, mode: _IteratorPagerState): + if self._state == mode: + return + if self._state == _IteratorPagerState.NEW: + self._state = mode + return + if self._state == _IteratorPagerState.CONSUMED: + raise Exception(_IteratorPager._state_consumed_msg) + raise Exception(_IteratorPager._state_mixed_msg) + +class _BasePageIterator(Iterator[Sequence[I]]): + + def __init__(self, + client: CloudantV1, + operation: Callable[..., DetailedResponse], + page_opts: list[str], + opts: dict): + self._client: CloudantV1 = client + self._has_next: bool = True + # split the opts into fixed and page parts based on page_opts + self._next_page_opts: dict = {} + fixed_opts: dict = dict(opts) + # Get the page size and set the limit acoordingly + self._page_size: int = self._page_size_from_opts_limit(fixed_opts) + fixed_opts['limit'] = self._page_size + # Remove the options that change per page + for k in page_opts: + if v := fixed_opts.pop(k, None): + self._next_page_opts[k] = v + fixed_opts = MappingProxyType(fixed_opts) + # Partial method with the fixed ops + self._next_request_function: Callable[..., DetailedResponse] = partial(operation, **fixed_opts) + + def __iter__(self) -> Iterator[Sequence[I]]: + return self + + def __next__(self) -> Sequence[I]: + if self._has_next: + return (*self._next_request(),) + raise StopIteration() + + def _next_request(self) -> list[I]: + response: DetailedResponse = self._next_request_function(**self._next_page_opts) + result: dict = response.get_result() + typed_result: R = self._result_converter()(result) + items: list[I] = self._items(typed_result) + if len(items) < self._page_size: + self._has_next = False + else: + self._next_page_opts = self._get_next_page_options(typed_result) + return items + + def _page_size_from_opts_limit(self, opts:dict) -> int: + return opts.get('limit', _MAX_LIMIT) + + @abstractmethod + def _result_converter(self) -> Callable[[dict], R]: + raise NotImplementedError() + + @abstractmethod + def _items(self, result: R) -> list[I]: + raise NotImplementedError() + + @abstractmethod + def _get_next_page_options(self, result: R) -> dict: + raise NotImplementedError() + +class _KeyPageIterator(_BasePageIterator, Generic[K]): + + def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], opts: dict): + super().__init__(client, operation, ['start_key', 'start_key_doc_id'], opts) + self._boundary_failure: Optional[str] = None + + def _next_request(self) -> list[I]: + if self._boundary_failure is not None: + raise Exception(self._boundary_failure) + items: list[I] = super()._next_request() + if self._has_next: + last_item: I = items.pop() + if len(items) > 0: + # Get, but don't remove the last item from the list + penultimate_item: I = items[-1] + self._boundary_failure: Optional[str] = self.check_boundary(penultimate_item, last_item) + return items + + def _get_next_page_options(self, result: R) -> dict: + # last item is used for next page options + last_item = self._items(result)[-1] + return { + 'start_key': last_item.key, + 'start_key_doc_id': last_item.id, + } + + def _items(self, result: R) -> list[I]: + return result.rows + + def _page_size_from_opts_limit(self, opts:dict) -> int: + return super()._page_size_from_opts_limit(opts) + 1 + + @abstractmethod + def check_boundary(self, penultimate_item: I, last_item: I) -> Optional[str]: + raise NotImplementedError() + +class _BookmarkPageIterator(_BasePageIterator): + + def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], opts: dict): + super().__init__(client, operation, ['bookmark'], opts) + + def _get_next_page_options(self, result: R) -> dict: + return {'bookmark': result.bookmark} + +class _AllDocsBasePageIterator(_KeyPageIterator[str]): + + def _result_converter(self) -> Callable[[dict], AllDocsResult]: + return AllDocsResult.from_dict + + def _get_next_page_options(self, result: R) -> dict: + # Remove start_key_doc_id for all_docs paging + opts: dict = super()._get_next_page_options(result) + del opts['start_key_doc_id'] + return opts + + def check_boundary(self, penultimate_item: I, last_item: I) -> Optional[str]: + # IDs are always unique in _all_docs pagers so return None + return None + +class _AllDocsPageIterator(_AllDocsBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_all_docs, opts) + +class _AllDocsPartitionPageIterator(_AllDocsBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_partition_all_docs, opts) + +class _DesignDocsPageIterator(_AllDocsBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_design_docs, opts) + +class _FindBasePageIterator(_BookmarkPageIterator): + + def _items(self, result: FindResult): + return result.docs + + def _result_converter(self): + return FindResult.from_dict + +class _FindPageIterator(_FindBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_find, opts) + +class _FindPartitionPageIterator(_FindBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_partition_find, opts) + +class _SearchBasePageIterator(_BookmarkPageIterator): + + def _items(self, result: SearchResult): + return result.rows + + def _result_converter(self): + return SearchResult.from_dict + +class _SearchPageIterator(_SearchBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_search, opts) + +class _SearchPartitionPageIterator(_SearchBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_partition_search, opts) + +class _ViewBasePageIterator(_KeyPageIterator[any]): + + def _result_converter(self): + return ViewResult.from_dict + + def check_boundary(self, penultimate_item: I, last_item: I) -> Optional[str]: + if penultimate_item.id == (boundary_id := last_item.id) \ + and penultimate_item.key == (boundary_key := last_item.key): + return f'Cannot paginate on a boundary containing identical keys {boundary_key} and document IDs {boundary_id}' + return None + +class _ViewPageIterator(_ViewBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_view, opts) + +class _ViewPartitionPageIterator(_ViewBasePageIterator): + + def __init__(self, client: CloudantV1, opts: dict): + super().__init__(client, client.post_partition_view, opts) diff --git a/test/examples/src/features/pagination/all_docs_pagination.py b/test/examples/src/features/pagination/all_docs_pagination.py new file mode 100644 index 00000000..d1765b98 --- /dev/null +++ b/test/examples/src/features/pagination/all_docs_pagination.py @@ -0,0 +1,60 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'orders', # example database name + 'limit': 50, # limit option sets the page size, + 'start_key': 'abc' # start from example doc ID abc +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_ALL_DOCS, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/design_docs_pagination.py b/test/examples/src/features/pagination/design_docs_pagination.py new file mode 100644 index 00000000..244f03ac --- /dev/null +++ b/test/examples/src/features/pagination/design_docs_pagination.py @@ -0,0 +1,59 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'shoppers', # example database name + 'limit': 50 # limit option sets the page size +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_DESIGN_DOCS, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/find_pagination.py b/test/examples/src/features/pagination/find_pagination.py new file mode 100644 index 00000000..a7b1dae4 --- /dev/null +++ b/test/examples/src/features/pagination/find_pagination.py @@ -0,0 +1,62 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'shoppers', # example database name + 'limit': 50, # limit option sets the page size + 'fields': ['_id', 'type', 'name', 'email'], # return these fields + 'selector': {'email_verified': True}, # select docs with verified emails + 'sort': [{'email': 'desc'}] # sort descending by email +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_FIND, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/partition_all_docs_pagination.py b/test/examples/src/features/pagination/partition_all_docs_pagination.py new file mode 100644 index 00000000..662b95c5 --- /dev/null +++ b/test/examples/src/features/pagination/partition_all_docs_pagination.py @@ -0,0 +1,60 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'events', # example database name + 'limit': 50, # limit option sets the page size + 'partition_key': 'ns1HJS13AMkK', # query only this partition +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_PARTITION_ALL_DOCS, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/partition_find_pagination.py b/test/examples/src/features/pagination/partition_find_pagination.py new file mode 100644 index 00000000..035d680b --- /dev/null +++ b/test/examples/src/features/pagination/partition_find_pagination.py @@ -0,0 +1,62 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'events', # example database name + 'limit': 50, # limit option sets the page size + 'partition_key': 'ns1HJS13AMkK', # query only this partition + 'fields': ['productId', 'eventType', 'date'], # return these fields + 'selector': {'userId': 'abc123'} # select documents with "userId" field equal to "abc123" +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_PARTITION_FIND, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/partition_search_pagination.py b/test/examples/src/features/pagination/partition_search_pagination.py new file mode 100644 index 00000000..134ab4dd --- /dev/null +++ b/test/examples/src/features/pagination/partition_search_pagination.py @@ -0,0 +1,58 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'events', # example database name + 'limit': 50, # limit option sets the page size + 'partition_key': 'ns1HJS13AMkK', # query only this partition + 'ddoc': 'checkout', # use the allUsers design document + 'index': 'findByDate', # search in this index + 'query': 'date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]' # Lucene search query +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_PARTITION_SEARCH, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/partition_view_pagination.py b/test/examples/src/features/pagination/partition_view_pagination.py new file mode 100644 index 00000000..26e70dd1 --- /dev/null +++ b/test/examples/src/features/pagination/partition_view_pagination.py @@ -0,0 +1,62 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'events', # example database name + 'limit': 50, # limit option sets the page size + 'partition_key': 'ns1HJS13AMkK', # query only this partition + 'ddoc': 'checkout', # use the checkout design document + 'view': 'byProductId' # the view to use +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_PARTITION_VIEW, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/search_pagination.py b/test/examples/src/features/pagination/search_pagination.py new file mode 100644 index 00000000..efc3b0e0 --- /dev/null +++ b/test/examples/src/features/pagination/search_pagination.py @@ -0,0 +1,57 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'shoppers', # example database name + 'limit': 50, # limit option sets the page size + 'ddoc': 'allUsers', # use the allUsers design document + 'index': 'activeUsers', # search in this index + 'query': 'name:Jane* AND active:True' # Lucene search query +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_SEARCH, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/examples/src/features/pagination/view_pagination.py b/test/examples/src/features/pagination/view_pagination.py new file mode 100644 index 00000000..a0d21495 --- /dev/null +++ b/test/examples/src/features/pagination/view_pagination.py @@ -0,0 +1,56 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +# an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 + +# Initialize service +service = CloudantV1.new_instance() + +# Setup options +opts = { + 'db': 'shoppers', # example database name + 'limit': 50, # limit option sets the page size + 'ddoc': 'allUsers', # use the allUsers design document + 'view': 'getVerifiedEmails' # the view to use +} + +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_VIEW, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time + +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass + +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass + +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page + +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass diff --git a/test/unit/features/conftest.py b/test/unit/features/conftest.py index d591e3de..dab13b99 100644 --- a/test/unit/features/conftest.py +++ b/test/unit/features/conftest.py @@ -18,6 +18,7 @@ Shared tests' fixtures """ +from typing import Sequence import unittest import pytest import os @@ -27,15 +28,22 @@ from threading import Timer import itertools +from itertools import islice from requests import codes from requests.exceptions import ConnectionError +from ibm_cloud_sdk_core import ApiException, DetailedResponse + from ibmcloudant.cloudant_v1 import ( + AllDocsResult, CloudantV1, + FindResult, PostChangesEnums, ChangesResult, ChangesResultItem, + SearchResult, + ViewResult, ) from ibmcloudant.features.changes_follower import ( @@ -43,6 +51,7 @@ _BATCH_SIZE, _Mode, ) +from ibmcloudant.features.pagination import PagerType @pytest.fixture(scope='class') @@ -106,8 +115,7 @@ def limits(request): _BATCH_SIZE + 123, ] - -class ChangesFollowerBaseCase(unittest.TestCase): +class MockClientBaseCase(unittest.TestCase): @classmethod def setUpClass(cls): # Setup client env config @@ -117,6 +125,40 @@ def setUpClass(cls): service_name='TEST_SERVICE', ) + def make_error_tuple(self, error: str) -> tuple[any]: + if error == 'bad_io': + return (200, {}, ConnectionError('peer reset')) + elif error == 'bad_json': + return (200, {}, '{') + else: + return ( + codes[error], + {}, + json.dumps({'error': error}), + ) + + def make_error(self, error: str) -> dict[str:any]: + error_tuple = self.make_error_tuple(error) + if error == 'bad_io': + return {'body': error_tuple[2]} + else: + return { + 'status': error_tuple[0], + 'content_type': 'application/json', + 'body': error_tuple[2], + } + + def make_error_exception(self, error: str) -> Exception: + error_dict = self.make_error(error) + if error == 'bad_io': + return error_dict['body'] + elif error == 'bad_json': + return ApiException(code=error_dict['status'], + message='Error processing the HTTP response',) + return ApiException(error_dict['status']) + +class ChangesFollowerBaseCase(MockClientBaseCase): + def prepare_mock_changes( self, batches=0, @@ -134,16 +176,7 @@ def __call__(self, request): if self._return_error: self._return_error = False error = next(self._errors) - if error == 'bad_io': - return (200, {}, ConnectionError('peer reset')) - elif error == 'bad_json': - return (200, {}, '{') - else: - return ( - codes[error], - {}, - json.dumps({'error': error}), - ) + return self.make_error_tuple(error) # this stands for "large" seq in empty result case last_seq = f'{batches * _BATCH_SIZE}-abcdef' pending = 0 @@ -199,22 +232,7 @@ def __call__(self, request): def prepare_mock_with_error(self, error: str): _base_url = os.environ.get('TEST_SERVER_URL', 'http://localhost:5984') url = _base_url + '/db/_changes' - if error == 'bad_io': - return responses.post(url, body=ConnectionError('peer reset')) - elif error == 'bad_json': - return responses.post( - url, - status=200, - content_type='application/json', - body='{', - ) - else: - return responses.post( - url, - status=codes[error], - content_type='application/json', - json={'error': error}, - ) + return responses.post(url, **self.make_error(error)) def runner(self, follower, mode, timeout=1, stop_after=0): """ @@ -240,3 +258,134 @@ def main(): return counter return main() + +class PaginationMockSupport: + all_docs_pagers: Sequence[PagerType] = ( + PagerType.POST_ALL_DOCS, + PagerType.POST_DESIGN_DOCS, + PagerType.POST_PARTITION_ALL_DOCS + ) + view_pagers: Sequence[PagerType] = ( + PagerType.POST_VIEW, + PagerType.POST_PARTITION_VIEW + ) + # the key pager types (n+1 paging) + key_pagers: Sequence[PagerType] = all_docs_pagers + view_pagers + find_pagers: Sequence[PagerType] = ( + PagerType.POST_FIND, + PagerType.POST_PARTITION_FIND) + search_pagers: Sequence[PagerType] = ( + PagerType.POST_SEARCH, + PagerType.POST_PARTITION_SEARCH) + + # Map of pager type to a tuple of patch function name, result wrapper lambda, result row lambda + operation_map: dict[PagerType:str] = { + PagerType.POST_ALL_DOCS: 'ibmcloudant.cloudant_v1.CloudantV1.post_all_docs', + PagerType.POST_DESIGN_DOCS: 'ibmcloudant.cloudant_v1.CloudantV1.post_design_docs', + PagerType.POST_FIND: 'ibmcloudant.cloudant_v1.CloudantV1.post_find', + PagerType.POST_PARTITION_ALL_DOCS: 'ibmcloudant.cloudant_v1.CloudantV1.post_partition_all_docs', + PagerType.POST_PARTITION_FIND: 'ibmcloudant.cloudant_v1.CloudantV1.post_partition_find', + PagerType.POST_PARTITION_SEARCH: 'ibmcloudant.cloudant_v1.CloudantV1.post_partition_search', + PagerType.POST_PARTITION_VIEW: 'ibmcloudant.cloudant_v1.CloudantV1.post_partition_view', + PagerType.POST_SEARCH: 'ibmcloudant.cloudant_v1.CloudantV1.post_search', + PagerType.POST_VIEW: 'ibmcloudant.cloudant_v1.CloudantV1.post_view' + } + + def make_wrapper(pager_type: PagerType, total: int, rows: Sequence) -> dict[str:any]: + if pager_type in PaginationMockSupport.key_pagers: + return {'total_rows': total, 'rows': rows} + else: + bkmk = 'emptypagebookmark' + last_row = rows[-1] if len(rows) > 0 else None + if pager_type in PaginationMockSupport.find_pagers: + return {'bookmark': last_row['_id'] if last_row else bkmk, 'docs': rows} + elif pager_type in PaginationMockSupport.search_pagers: + return {'bookmark': last_row['id'] if last_row else bkmk, 'total_rows': total, 'rows': rows} + else: + raise Exception('Unknown pager type, fail test.') + + def make_row(pager_type: PagerType, i: int) -> dict[str:any]: + id = f'testdoc{i}' + rev = f'1-abc{i}' + if pager_type in PaginationMockSupport.key_pagers: + if pager_type in (PagerType.POST_VIEW, PagerType.POST_PARTITION_VIEW): + key = i + value = 1 + else: + key = id + value = {'rev': rev} + return {'id': id, 'key': key, 'value': value} + elif pager_type in PaginationMockSupport.find_pagers: + return {'_id':id, '_rev': rev, 'testfield': i} + elif pager_type in PaginationMockSupport.search_pagers: + return {'fields':{}, 'id': id} + else: + raise Exception('Unknown pager type, fail test.') + +class PaginationMockResponse: + """ + Test class for mocking page responses. + """ + def __init__(self, + total_items: int, + page_size: int, + pager_type: PagerType + ): + self.total_items: int = total_items + self.page_size: int = page_size + self.pages = self.generator() + self.pager_type: PagerType = pager_type + self.plus_one_paging: bool = self.pager_type in PaginationMockSupport.key_pagers + self.expected_pages: list[list] = [] + + # for compatibility with python <= 3.12 + def batched(self, iterable, n): + """Batch data into tuples of length n. The last batch may be shorter.""" + it = iter(iterable) + while True: + batch = tuple(islice(it, n)) + if not batch: + break + yield batch + + def generator(self): + for page in self.batched(range(0, self.total_items), self.page_size): + rows = [PaginationMockSupport.make_row(self.pager_type, i) for i in page] + if self.plus_one_paging: + # Add an n+1 row for key based paging if more pages + if (n_plus_one := page[-1] + 1) < self.total_items: + rows.append(PaginationMockSupport.make_row(self.pager_type, n_plus_one)) + yield DetailedResponse(response=PaginationMockSupport.make_wrapper(self.pager_type, self.total_items, rows)) + yield DetailedResponse(response=PaginationMockSupport.make_wrapper(self.pager_type, self.total_items, [])) + + def convert_result(self, result: dict) -> Sequence: + if self.pager_type in PaginationMockSupport.all_docs_pagers: + return AllDocsResult.from_dict(result).rows + elif self.pager_type in PaginationMockSupport.find_pagers: + return FindResult.from_dict(result).docs + elif self.pager_type in PaginationMockSupport.search_pagers: + return SearchResult.from_dict(result).rows + elif self.pager_type in PaginationMockSupport.view_pagers: + return ViewResult.from_dict(result).rows + + def get_next_page(self, **kwargs): + # return next(self.pages) + # ignore kwargs + # get next page + page = next(self.pages) + # convert to an expected page + rows = self.convert_result(page.get_result()) + if len(rows) > self.page_size and self.plus_one_paging: + self.expected_pages.append(rows[:-1]) + else: + self.expected_pages.append(rows) + return page + + def get_expected_page(self, page: int) -> list: + return self.expected_pages[page - 1] + + def all_expected_items(self) -> list: + all_items: list = [] + for page in self.expected_pages: + all_items.extend(page) + return all_items diff --git a/test/unit/features/test_pagination_base.py b/test/unit/features/test_pagination_base.py new file mode 100644 index 00000000..9a3caa29 --- /dev/null +++ b/test/unit/features/test_pagination_base.py @@ -0,0 +1,405 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2025. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from collections.abc import Callable +from typing import Iterable +from unittest.mock import Mock, patch +from ibmcloudant.cloudant_v1 import ViewResult, ViewResultRow +from ibmcloudant.features.pagination import _BasePageIterator, _IteratorPager, Pager, PagerType, Pagination +from conftest import MockClientBaseCase, PaginationMockResponse + +class BasePageMockResponses(PaginationMockResponse): + """ + Test class for mocking page responses. + """ + def __init__(self, total_items: int, page_size: int): + super().__init__(total_items, page_size, PagerType.POST_VIEW) + # This test uses View structures, but doesn't do n+1 like a view/key pager + # Override plus_one_paging to accommodate this weird hybrid + self.plus_one_paging = False + +class TestPageIterator(_BasePageIterator): + """ + A test subclass of the _BasePager under test. + """ + operation: Callable = None + page_keys: list[str] = [] + + def __init__(self, client, opts): + super().__init__(client, TestPageIterator.operation or client.post_view, TestPageIterator.page_keys, opts) + + def _result_converter(self) -> Callable[[dict], ViewResult]: + return lambda d: ViewResult.from_dict(d) + + def _items(self, result: ViewResult) -> tuple[ViewResultRow]: + return result.rows + + def _get_next_page_options(self, result: ViewResult) -> dict: + if len(result.rows ) == 0: + self.assertFail("Test failure: tried to setNextPageOptions on empty page.") + else: + return {'start_key': result.rows[-1].key} + +class TestBasePageIterator(MockClientBaseCase): + def test_init(self): + operation = self.client.post_view + opts = {'db': 'test', 'limit': 20} + page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + # Assert client is set + self.assertEqual(page_iterator._client, self.client, 'The supplied client should be set.') + # Assert operation is set + self.assertIsNotNone(page_iterator._next_request_function, 'The operation function should be set.') + # Assert partial function parts are as expected + self.assertEqual(page_iterator._next_request_function.func, operation, 'The partial function should be the operation.') + self.assertEqual(page_iterator._next_request_function.keywords, opts, 'The partial function kwargs should be the options.') + + def test_partial_options(self): + static_opts = {'db': 'test', 'limit': 20, 'baz': 'faz'} + page_opts = {'foo': 'boo', 'bar': 'far'} + opts = {**static_opts, **page_opts} + # Use page_opts.keys() to pass the list of names for page options + with patch('test_pagination_base.TestPageIterator.page_keys', page_opts.keys()): + page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + # Assert partial function has only static opts + self.assertEqual(page_iterator._next_request_function.keywords, static_opts, 'The partial function kwargs should be only the static options.') + # Assert next page options + self.assertEqual(page_iterator._next_page_opts, page_opts, 'The next page options should match the expected.') + + def test_default_page_size(self): + opts = {'db': 'test'} + page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + # Assert the default page size + expected_page_size = 200 + self.assertEqual(page_iterator._page_size, expected_page_size, 'The default page size should be set.') + self.assertEqual(page_iterator._next_request_function.keywords, opts | {'limit': expected_page_size}, 'The default page size should be present in the options.') + + def test_limit_page_size(self): + opts = {'db': 'test', 'limit': 42} + page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + # Assert the provided page size + expected_page_size = 42 + self.assertEqual(page_iterator._page_size, expected_page_size, 'The default page size should be set.') + self.assertEqual(page_iterator._next_request_function.keywords, opts | {'limit': expected_page_size}, 'The default page size should be present in the options.') + + def test_has_next_initially_true(self): + opts = {'limit': 1} + page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + # Assert _has_next + self.assertTrue(page_iterator._has_next, '_has_next should initially return True.') + + def test_has_next_true_for_result_equal_to_limit(self): + page_size = 1 + # Init with mock that returns only a single row + with patch('test_pagination_base.TestPageIterator.operation', BasePageMockResponses(1, page_size).get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + # Get first page with 1 result + next(page_iterator) + # Assert _has_next + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + + def test_has_next_false_for_result_less_than_limit(self): + page_size = 1 + # Init with mock that returns zero rows + with patch('test_pagination_base.TestPageIterator.operation', BasePageMockResponses(0, page_size).get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + # Get first page with 0 result + next(page_iterator) + # Assert _has_next + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + def test_next_first_page(self): + page_size = 25 + # Mock that returns one page of 25 items + mock = BasePageMockResponses(page_size, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + # Get first page + actual_page: list[ViewResultRow] = next(page_iterator) + # Assert first page + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), "The actual page should match the expected page") + + def test_next_two_pages(self): + page_size = 3 + # Mock that returns two pages of 3 items + mock = BasePageMockResponses(2*page_size, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + # Get first page + actual_page_1: list[ViewResultRow] = next(page_iterator) + # Assert first page + self.assertSequenceEqual(actual_page_1, mock.get_expected_page(1), "The actual page should match the expected page") + # Assert has_next + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + # Get second page + actual_page_2: list[ViewResultRow] = next(page_iterator) + # Assert first page + self.assertSequenceEqual(actual_page_2, mock.get_expected_page(2), "The actual page should match the expected page") + # Assert has_next, True since page is not smaller than limit + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + + def test_next_until_empty(self): + page_size = 3 + # Mock that returns 3 pages of 3 items + mock = BasePageMockResponses(3*page_size, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + page_count = 0 + actual_items = [] + while page_iterator._has_next: + page_count += 1 + page = next(page_iterator) + # Assert each page is the same or smaller than the limit to confirm all results not in one page + self.assertTrue(len(page) <= page_size, "The actual page size should be the expected page size.") + actual_items.extend(page) + self.assertSequenceEqual(actual_items, mock.all_expected_items(), "The results should match all the pages.") + self.assertEqual(page_count, len(mock.expected_pages), "There should be the correct number of pages.") + + def test_next_until_smaller(self): + page_size = 3 + # Mock that returns 3 pages of 3 items, then 1 more page with 1 item + mock = BasePageMockResponses(3*page_size + 1, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + page_count = 0 + actual_items = [] + while page_iterator._has_next: + page_count += 1 + page = next(page_iterator) + # Assert each page is the same or smaller than the limit to confirm all results not in one page + self.assertTrue(len(page) <= page_size, "The actual page size should be the expected page size.") + actual_items.extend(page) + self.assertSequenceEqual(actual_items, mock.all_expected_items(), "The results should match all the pages.") + self.assertEqual(page_count, len(mock.expected_pages), "There should be the correct number of pages.") + + def test_next_exception(self): + page_size = 2 + # Mock that returns one page of one item + mock = BasePageMockResponses(page_size - 1, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + # Get first and only page + actual_page: list[ViewResultRow] = next(page_iterator) + # Assert page + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), "The actual page should match the expected page") + # Assert _has_next now False + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + # Assert StopIteraton on get_next() + with self.assertRaises(StopIteration): + next(page_iterator) + + def test_pages_immutable(self): + page_size = 1 + mock = BasePageMockResponses(page_size, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + # Get page + actual_page: list[ViewResultRow] = next(page_iterator) + # Assert immutable tuple type + self.assertIsInstance(actual_page, tuple) + + def test_set_next_page_options(self): + page_size = 1 + mock = BasePageMockResponses(5*page_size, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + self.assertIsNone(page_iterator._next_page_opts.get('start_key'), "The start key should intially be None.") + # Since we use a page size of 1, each next page options key, is the same as the element from the page and the page count + page_count = 0 + while page_iterator._has_next: + page = next(page_iterator) + if page_iterator._has_next: + self.assertEqual(page_count, page_iterator._next_page_opts.get('start_key'), "The key should increment per page.") + else: + self.assertEqual(page_count - 1, page_iterator._next_page_opts.get('start_key'), "The options should not be set for the final page.") + page_count += 1 + + def test_next_resumes_after_error(self): + page_size = 1 + mock = BasePageMockResponses(3*page_size, page_size) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = TestPageIterator( + self.client, + {'limit': page_size}) + self.assertIsNone(page_iterator._next_page_opts.get('start_key'), "The start key should intially be None.") + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), "The actual page should match the expected page") + self.assertEqual(0, page_iterator._next_page_opts.get('start_key'), "The start_key should be 0 for the second page.") + with patch('ibmcloudant.features.pagination._BasePageIterator._next_request', Exception('test exception')): + with self.assertRaises(Exception): + next(page_iterator) + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + self.assertEqual(0, page_iterator._next_page_opts.get('start_key'), "The start_key should still be 0 for the second page.") + second_page = next(page_iterator) + self.assertSequenceEqual(second_page, mock.get_expected_page(2), "The actual page should match the expected page") + self.assertTrue(page_iterator._has_next, '_has_next should return False.') + + + def test_pages_iterable(self): + page_size = 23 + mock = BasePageMockResponses(3*page_size-1, page_size) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + # Check pages are iterable + page_number = 0 + for page in pagination.pages(): + page_number += 1 + self.assertSequenceEqual(page, mock.get_expected_page(page_number), "The actual page should match the expected page") + # Asser the correct number of pages + self.assertEqual(page_number, 3, 'There should have been 3 pages.') + + def test_rows_iterable(self): + page_size = 23 + mock = BasePageMockResponses(3*page_size-1, page_size) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + actual_items = [] + # Check rows are iterable + for row in pagination.rows(): + actual_items.append(row) + self.assertSequenceEqual(actual_items, mock.all_expected_items(), "The actual rows should match the expected rows.") + + def test_as_pager_get_next_first_page(self): + page_size = 7 + # Mock that returns two pages of 7 items + mock = BasePageMockResponses(2*page_size, page_size) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pager = pagination.pager() + # Get first page + actual_page: list[ViewResultRow] = pager.get_next() + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), "The actual page should match the expected page") + + def test_as_pager_get_all(self): + page_size = 11 + # Mock that returns 6 pages of 11 items, then 1 more page with 5 items + mock = BasePageMockResponses(71, page_size) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pager: Pager[ViewResultRow] = pagination.pager() + actual_items = pager.get_all() + self.assertSequenceEqual(actual_items, mock.all_expected_items(), "The results should match all the pages.") + # Assert consumed state prevents calling again + with self.assertRaises(Exception, msg=_IteratorPager._state_consumed_msg): + pager.get_all() + + def test_as_pager_get_all_restarts_after_error(self): + page_size = 1 + mock = BasePageMockResponses(2*page_size, page_size) + first_page = mock.get_next_page() + # mock response order + # first page, error, first page replay, second page + mockmock = Mock(side_effect=[ + first_page, + Exception('test exception'), + first_page, + mock.get_next_page() + ]) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mockmock): + pager = pagination.pager() + with self.assertRaises(Exception): + pager.get_all() + self.assertSequenceEqual(pager.get_all(), mock.all_expected_items(), "The results should match all the pages.") + + def test_as_pager_get_next_get_all_throws(self): + page_size = 11 + # Mock that returns 6 pages of 11 items, then 1 more page with 5 items + mock = BasePageMockResponses(71, page_size) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pager: Pager[ViewResultRow] = pagination.pager() + first_page = pager.get_next() + self.assertSequenceEqual(first_page, mock.get_expected_page(1), "The actual page should match the expected page") + # Assert throws + with self.assertRaises(Exception, msg=_IteratorPager._state_mixed_msg): + pager.get_all() + # Assert second page ok + self.assertSequenceEqual(pager.get_next(), mock.get_expected_page(2), "The actual page should match the expected page") + + def test_as_pager_get_all_get_next_throws(self): + page_size = 1 + mock = BasePageMockResponses(2*page_size, page_size) + first_page = mock.get_next_page() + # mock response order + # first page, error, first page replay, second page + mockmock = Mock(side_effect=[ + first_page, + Exception('test exception') + ]) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mockmock): + pager = pagination.pager() + # Stop get all part way through so it isn't consumed when we call get Next + with self.assertRaises(Exception): + pager.get_all() + # Assert calling get_next() throws + with self.assertRaises(Exception, msg=_IteratorPager._state_mixed_msg): + pager.get_next() + + def test_as_pager_get_next_resumes_after_error(self): + page_size = 1 + mock = BasePageMockResponses(2*page_size, page_size) + # mock response order + # first page, error, second page + mockmock = Mock(side_effect=[ + mock.get_next_page(), + Exception('test exception'), + mock.get_next_page() + ]) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mockmock): + pager = pagination.pager() + # Assert first page + self.assertSequenceEqual(pager.get_next(), mock.get_expected_page(1), "The actual page should match the expected page") + with self.assertRaises(Exception): + pager.get_next() + # Assert second page after error + self.assertSequenceEqual(pager.get_next(), mock.get_expected_page(2), "The actual page should match the expected page") + + def test_as_pager_get_next_until_consumed(self): + page_size = 7 + # Mock that returns two pages of 7 items + mock = BasePageMockResponses(2*page_size, page_size) + pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pager = pagination.pager() + page_count = 0 + while pager.has_next(): + page_count += 1 + self.assertSequenceEqual(pager.get_next(), mock.get_expected_page(page_count), "The actual page should match the expected page") + # Note 3 because third page is empty + self.assertEqual(page_count, 3, 'There should be the expected number of pages.') + # Assert consumed state prevents calling again + with self.assertRaises(Exception, msg=_IteratorPager._state_consumed_msg): + pager.get_next() diff --git a/test/unit/features/test_pagination_bookmark.py b/test/unit/features/test_pagination_bookmark.py new file mode 100644 index 00000000..7ad4c952 --- /dev/null +++ b/test/unit/features/test_pagination_bookmark.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2025. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from collections.abc import Callable, Iterator +from unittest.mock import patch +from ibmcloudant.cloudant_v1 import SearchResult, SearchResultRow +from ibmcloudant.features.pagination import _BookmarkPageIterator, PagerType, Pagination +from conftest import MockClientBaseCase, PaginationMockResponse + +class BookmarkTestPageIterator(_BookmarkPageIterator): + """ + A test subclass of the _BookmarkPager under test. + """ + operation: Callable = None + boundary_func: Callable = lambda p,l: None + + def __init__(self, client, opts): + super().__init__(client, BookmarkTestPageIterator.operation or client.post_view, opts) + + def _result_converter(self) -> Callable[[dict], SearchResult]: + return lambda d: SearchResult.from_dict(d) + + def _items(self, result: SearchResult) -> tuple[SearchResultRow]: + return result.rows + +class BookmarkPaginationMockResponses(PaginationMockResponse): + """ + Test class for mocking page responses. + """ + def __init__(self, total_items: int, page_size: int): + super().__init__(total_items, page_size, PagerType.POST_SEARCH) + +class TestBookmarkPageIterator(MockClientBaseCase): + + # Test page size default + def test_default_page_size(self): + page_iterator: Iterator[tuple[SearchResultRow]] = BookmarkTestPageIterator(self.client, {}) + # Assert the limit default as page size + self.assertEqual(page_iterator._page_size, 200, 'The page size should be one more than the default limit.') + + # Test page size limit + def test_limit_page_size(self): + page_iterator: Iterator[tuple[SearchResultRow]] = BookmarkTestPageIterator(self.client, {'limit': 42}) + # Assert the limit provided as page size + self.assertEqual(page_iterator._page_size, 42, 'The page size should be one more than the default limit.') + + # Test all items on page when no more pages + def test_get_next_page_less_than_limit(self): + page_size = 21 + mock = BookmarkPaginationMockResponses(page_size - 1, page_size) + with patch('test_pagination_bookmark.BookmarkTestPageIterator.operation', mock.get_next_page): + page_iterator = BookmarkTestPageIterator(self.client, {'limit': page_size}) + # Get and assert first page + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), 'The actual page should match the expected page') + # Assert page size + self.assertEqual(len(actual_page), page_size - 1, 'The actual page size should match the expected page size.') + # Assert has_next False because n+1 limit is 1 more than user page size + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + # Test correct items on page when limit + def test_get_next_page_equal_to_limit(self): + page_size = 14 + mock = BookmarkPaginationMockResponses(page_size, page_size) + with patch('test_pagination_bookmark.BookmarkTestPageIterator.operation', mock.get_next_page): + page_iterator = BookmarkTestPageIterator(self.client, {'limit': page_size}) + # Get and assert first page + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), 'The actual page should match the expected page.') + # Assert page size + self.assertEqual(len(actual_page), page_size, 'The actual page size should match the expected page size.') + # Assert has_next True + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + # Assert bookmark + self.assertEqual(page_iterator._next_page_opts['bookmark'], f'testdoc{page_size - 1}', 'The bookmark should be one less than the page size.') + # Get and assert second page + second_page = next(page_iterator) + # Note row keys are zero indexed so page size - 1 + self.assertEqual(len(second_page), 0, "The second page should be empty.") + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + # Test correct items on page when n+more + def test_get_next_page_greater_than_limit(self): + page_size = 7 + mock = BookmarkPaginationMockResponses(page_size+2, page_size) + with patch('test_pagination_bookmark.BookmarkTestPageIterator.operation', mock.get_next_page): + page_iterator = BookmarkTestPageIterator(self.client, {'limit': page_size}) + # Get and assert first page + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), 'The actual page should match the expected page.') + # Assert page size + self.assertEqual(len(actual_page), page_size, 'The actual page size should match the expected page size.') + # Assert has_next True + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + # Get and assert second page + second_page = next(page_iterator) + self.assertEqual(len(second_page), 2 , 'The second page should have two items.') + # Note row keys are zero indexed so n+1 element that is first item on second page matches page size + self.assertEqual(second_page[0].id, f'testdoc{page_size}', 'The first item key on the second page should match the page size number.') + self.assertSequenceEqual(second_page, mock.get_expected_page(2), "The actual page should match the expected page") + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + # Test getting all items + def test_get_all(self): + page_size = 3 + mock = BookmarkPaginationMockResponses(page_size*12, page_size) + pagination = Pagination(self.client, BookmarkTestPageIterator, {'limit': page_size}) + with patch('test_pagination_bookmark.BookmarkTestPageIterator.operation', mock.get_next_page): + pager = pagination.pager() + # Get and assert all items + self.assertSequenceEqual(pager.get_all(), mock.all_expected_items(), 'The results should match all the pages.') diff --git a/test/unit/features/test_pagination_key.py b/test/unit/features/test_pagination_key.py new file mode 100644 index 00000000..16faf35f --- /dev/null +++ b/test/unit/features/test_pagination_key.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2025. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from collections.abc import Callable, Iterator +from unittest.mock import Mock, patch +from ibm_cloud_sdk_core import DetailedResponse +from ibmcloudant.cloudant_v1 import ViewResult, ViewResultRow +from ibmcloudant.features.pagination import _KeyPageIterator, PagerType, Pagination +from conftest import MockClientBaseCase, PaginationMockResponse + +class KeyTestPageIterator(_KeyPageIterator): + """ + A test subclass of the _KeyPager under test. + """ + operation: Callable = None + boundary_func: Callable = lambda p,l: None + + def __init__(self, client, opts): + super().__init__(client, KeyTestPageIterator.operation or client.post_view, opts) + + def _result_converter(self) -> Callable[[dict], ViewResult]: + return lambda d: ViewResult.from_dict(d) + + def _items(self, result: ViewResult) -> tuple[ViewResultRow]: + return result.rows + + def _get_next_page_options(self, result: ViewResult) -> dict: + if len(result.rows ) == 0: + self.assertFail("Test failure: tried to setNextPageOptions on empty page.") + else: + return {'start_key': result.rows[-1].key} + + def check_boundary(self, penultimate_item, last_item): + return KeyTestPageIterator.boundary_func(penultimate_item, last_item) + +class KeyPaginationMockResponses(PaginationMockResponse): + """ + Test class for mocking page responses. + """ + def __init__(self, total_items: int, page_size: int): + super().__init__(total_items, page_size, PagerType.POST_VIEW) + +class TestKeyPageIterator(MockClientBaseCase): + + # Test page size default (+1) + def test_default_page_size(self): + page_iterator: Iterator[tuple[ViewResultRow]] = KeyTestPageIterator(self.client, {}) + # Assert the limit default as page size + self.assertEqual(page_iterator._page_size, 201, 'The page size should be one more than the default limit.') + + # Test page size limit (+1) + def test_limit_page_size(self): + page_iterator: Iterator[tuple[ViewResultRow]] = KeyTestPageIterator(self.client, {'limit': 42}) + # Assert the limit provided as page size + self.assertEqual(page_iterator._page_size, 43, 'The page size should be one more than the default limit.') + + # Test all items on page when no more pages + def test_get_next_page_less_than_limit(self): + page_size = 21 + mock = KeyPaginationMockResponses(page_size, page_size) + with patch('test_pagination_key.KeyTestPageIterator.operation', mock.get_next_page): + page_iterator = KeyTestPageIterator(self.client, {'limit': page_size}) + # Get and assert first page + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), 'The actual page should match the expected page') + # Assert page size + self.assertEqual(len(actual_page), page_size, 'The actual page size should match the expected page size.') + # Assert has_next False because n+1 limit is 1 more than user page size + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + # Test correct items on page when n+1 + def test_get_next_page_equal_to_limit(self): + page_size = 14 + mock = KeyPaginationMockResponses(page_size+1, page_size) + with patch('test_pagination_key.KeyTestPageIterator.operation', mock.get_next_page): + page_iterator = KeyTestPageIterator(self.client, {'limit': page_size}) + # Get and assert first page + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), 'The actual page should match the expected page.') + # Assert page size + self.assertEqual(len(actual_page), page_size, 'The actual page size should match the expected page size.') + # Assert has_next True + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + # Get and assert second page + second_page = next(page_iterator) + self.assertEqual(len(second_page), 1 , 'The second page should have one item.') + # Note row keys are zero indexed so n+1 element that is first item on second page matches page size + self.assertEqual(second_page[0].key, page_size, 'The first item key on the second page should match the page size number.') + self.assertSequenceEqual(second_page, mock.get_expected_page(2), "The actual page should match the expected page") + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + # Test correct items on page when n+more + def test_get_next_page_greater_than_limit(self): + page_size = 7 + mock = KeyPaginationMockResponses(page_size+2, page_size) + with patch('test_pagination_key.KeyTestPageIterator.operation', mock.get_next_page): + page_iterator = KeyTestPageIterator(self.client, {'limit': page_size}) + # Get and assert first page + actual_page = next(page_iterator) + self.assertSequenceEqual(actual_page, mock.get_expected_page(1), 'The actual page should match the expected page.') + # Assert page size + self.assertEqual(len(actual_page), page_size, 'The actual page size should match the expected page size.') + # Assert has_next True + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + # Get and assert second page + second_page = next(page_iterator) + self.assertEqual(len(second_page), 2 , 'The second page should have two items.') + # Note row keys are zero indexed so n+1 element that is first item on second page matches page size + self.assertEqual(second_page[0].key, page_size, 'The first item key on the second page should match the page size number.') + self.assertSequenceEqual(second_page, mock.get_expected_page(2), "The actual page should match the expected page") + self.assertFalse(page_iterator._has_next, '_has_next should return False.') + + # Test getting all items + def test_get_all(self): + page_size = 3 + mock = KeyPaginationMockResponses(page_size*12, page_size) + pagination = Pagination(self.client, KeyTestPageIterator, {'limit': page_size}) + with patch('test_pagination_key.KeyTestPageIterator.operation', mock.get_next_page): + pager = pagination.pager() + # Get and assert all items + self.assertSequenceEqual(pager.get_all(), mock.all_expected_items(), 'The results should match all the pages.') + + def test_no_boundary_check_by_default(self): + mock_rows = [ + {'id': '1', 'key': 1, 'value': 1}, + {'id': '1', 'key': 1, 'value': 1} + ] + expected_rows = ViewResult.from_dict({'rows': mock_rows}).rows + mockmock = Mock(return_value=DetailedResponse(response={'rows': mock_rows})) + with patch('test_pagination_key.KeyTestPageIterator.operation', mockmock): + page_iterator = KeyTestPageIterator(self.client, {'limit': 1}) + # Get and assert page + self.assertSequenceEqual(next(page_iterator), (expected_rows[0],)) + + def test_boundary_failure_throws_on_get_next(self): + mock_rows = [ + {'id': '1', 'key': 1, 'value': 1}, + {'id': '1', 'key': 1, 'value': 1} + ] + expected_rows = ViewResult.from_dict({'rows': mock_rows}).rows + mockmock = Mock(return_value=DetailedResponse(response={'rows': mock_rows})) + with patch('test_pagination_key.KeyTestPageIterator.operation', mockmock): + page_iterator = KeyTestPageIterator(self.client, {'limit': 1}) + with patch( + 'test_pagination_key.KeyTestPageIterator.boundary_func', + lambda p,l: 'test error' if p.id == l.id and p.key == l.key else None): + # Get and assert page + self.assertSequenceEqual(next(page_iterator), (expected_rows[0],)) + # Assert has_next True + self.assertTrue(page_iterator._has_next, '_has_next should return True.') + with self.assertRaises(Exception): + next(page_iterator) + + def test_no_boundary_check_when_no_items_left(self): + mock_rows = [ + {'id': '1', 'key': 1, 'value': 1} + ] + expected_rows = ViewResult.from_dict({'rows': mock_rows}).rows + mockmock = Mock(return_value=DetailedResponse(response={'rows': mock_rows})) + with patch('test_pagination_key.KeyTestPageIterator.operation', mockmock): + page_iterator = KeyTestPageIterator(self.client, {'limit': 1}) + with patch( + 'test_pagination_key.KeyTestPageIterator.boundary_func', + Exception('Check boundary should not be called.')): + # Get and assert page if boundary is checked, will raise exception + self.assertSequenceEqual(next(page_iterator), (expected_rows[0],)) + # Assert has_next False + self.assertFalse(page_iterator._has_next, '_has_next should return True.') diff --git a/test/unit/features/test_pagination_operations.py b/test/unit/features/test_pagination_operations.py new file mode 100644 index 00000000..16383431 --- /dev/null +++ b/test/unit/features/test_pagination_operations.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2025. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from unittest.mock import patch + +import pytest +from conftest import MockClientBaseCase, PaginationMockSupport, PaginationMockResponse +from ibmcloudant.features.pagination import _MAX_LIMIT, Pager, PagerType, Pagination + +@pytest.mark.usefixtures("errors") +class TestPaginationOperations(MockClientBaseCase): + + test_page_size = 10 + # tuples of test parameters + # total items, page size + page_sets = ( + (0, test_page_size), + (1, test_page_size), + (test_page_size - 1, test_page_size), + (test_page_size, test_page_size), + (test_page_size + 1, test_page_size), + (3 * test_page_size, test_page_size), + (3 * test_page_size + 1, test_page_size), + (4 * test_page_size - 1, test_page_size), + ) + + def get_expected_pages(self, total: int, page_size: int, pager_type: PagerType) -> int: + full_pages = total // page_size + partial_pages = 0 if (total % page_size == 0) else 1 + expected_pages = full_pages + partial_pages + # Need at least 1 empty page to know there are no more results + # if not ending on a partial page, except if the first page or + # using n+1 paging (because an exact user page is a partial real page). + if partial_pages == 0 and (expected_pages == 0 or pager_type not in PaginationMockSupport.key_pagers): + expected_pages += 1; # Will get at least 1 empty page + return expected_pages + + def test_pager(self): + for pager_type in PagerType: + with self.subTest(pager_type): + for page_set in self.page_sets: + with self.subTest(page_set): + actual_items: set = set() + actual_item_count: int = 0 + actual_page_count: int = 0 + expected_items_count: int = page_set[0] + page_size: int = page_set[1] + expected_page_count: int = self.get_expected_pages(expected_items_count, page_size, pager_type) + with patch(PaginationMockSupport.operation_map[pager_type], PaginationMockResponse(expected_items_count, page_size, pager_type).get_next_page): + pager: Pager = Pagination.new_pagination(self.client, pager_type, limit=page_size).pager() + while(pager.has_next()): + page = pager.get_next() + actual_page_count += 1 + actual_item_count += len(page) + for row in page: + if pager_type in (PagerType.POST_FIND, PagerType.POST_PARTITION_FIND): + id = row._id + else: + id = row.id + actual_items.add(id) + self.assertEqual(actual_page_count, expected_page_count, 'There should be the expected number of pages.') + self.assertEqual(actual_item_count, expected_items_count, 'There should be the expected number of items.') + self.assertEqual(len(actual_items), expected_items_count, 'The items should be unique.') + + def test_pages(self): + for pager_type in PagerType: + with self.subTest(pager_type): + for page_set in self.page_sets: + with self.subTest(page_set): + actual_items: set = set() + actual_item_count: int = 0 + actual_page_count: int = 0 + expected_items_count: int = page_set[0] + page_size: int = page_set[1] + expected_page_count: int = self.get_expected_pages(expected_items_count, page_size, pager_type) + with patch(PaginationMockSupport.operation_map[pager_type], PaginationMockResponse(expected_items_count, page_size, pager_type).get_next_page): + for page in Pagination.new_pagination(self.client, pager_type, limit=page_size).pages(): + actual_page_count += 1 + actual_item_count += len(page) + for row in page: + if pager_type in (PagerType.POST_FIND, PagerType.POST_PARTITION_FIND): + id = row._id + else: + id = row.id + actual_items.add(id) + self.assertEqual(actual_page_count, expected_page_count, 'There should be the expected number of pages.') + self.assertEqual(actual_item_count, expected_items_count, 'There should be the expected number of items.') + self.assertEqual(len(actual_items), expected_items_count, 'The items should be unique.') + + def test_rows(self): + for pager_type in PagerType: + with self.subTest(pager_type): + for page_set in self.page_sets: + with self.subTest(page_set): + actual_items: set = set() + actual_item_count: int = 0 + expected_items_count: int = page_set[0] + page_size: int = page_set[1] + with patch(PaginationMockSupport.operation_map[pager_type], PaginationMockResponse(expected_items_count, page_size, pager_type).get_next_page): + for row in Pagination.new_pagination(self.client, pager_type, limit=page_size).rows(): + actual_item_count += 1 + if pager_type in (PagerType.POST_FIND, PagerType.POST_PARTITION_FIND): + id = row._id + else: + id = row.id + actual_items.add(id) + self.assertEqual(actual_item_count, expected_items_count, 'There should be the expected number of items.') + self.assertEqual(len(actual_items), expected_items_count, 'The items should be unique.') + + def test_pager_errors(self): + page_size = _MAX_LIMIT + for pager_type in PagerType: + with self.subTest(pager_type): + for error in (*self.terminal_errors, *self.transient_errors): + expected_exception = self.make_error_exception(error) + with self.subTest(error): + # mock responses + mock_pages = PaginationMockResponse(2*page_size, page_size, pager_type) + mock_first_page = mock_pages.get_next_page() + mock_second_page = mock_pages.get_next_page() + mock_third_page = mock_pages.get_next_page() # empty + for responses in ( + # first sub-test, error on first page + (expected_exception, mock_first_page, mock_second_page, mock_third_page), + # second sub-test error on second page + (mock_first_page, expected_exception, mock_second_page, mock_third_page), + ): + with patch(PaginationMockSupport.operation_map[pager_type], side_effect=iter(responses)): + pager: Pager = Pagination.new_pagination(self.client, pager_type, limit=page_size).pager() + expect_exception_on_page: int = responses.index(expected_exception) + 1 + actual_page_count: int = 0 + while (pager.has_next()): + actual_page_count += 1 + if actual_page_count == expect_exception_on_page: + with self.assertRaises(type(expected_exception), msg='There should be an exception while paging.'): + pager.get_next() + else: + pager.get_next() + + def test_pages_errors(self): + page_size = _MAX_LIMIT + for pager_type in PagerType: + with self.subTest(pager_type): + for error in (*self.terminal_errors, *self.transient_errors): + expected_exception = self.make_error_exception(error) + with self.subTest(error): + for responses in ( + # first sub-test, error on first page + (expected_exception,), + # second sub-test error on second page + (PaginationMockResponse(2*page_size, page_size, pager_type).get_next_page(), expected_exception), + ): + with patch(PaginationMockSupport.operation_map[pager_type], side_effect=iter(responses)): + actual_page_count: int = 0 + expected_page_count: int = len(responses) - 1 + with self.assertRaises(type(expected_exception), msg='There should be an exception while paging.'): + for page in Pagination.new_pagination(self.client, pager_type, limit=page_size).pages(): + actual_page_count += 1 + self.assertEqual(actual_page_count, expected_page_count, 'Should have got the correct number of pages before error.') + + def test_rows_errors(self): + page_size = _MAX_LIMIT + for pager_type in PagerType: + with self.subTest(pager_type): + for error in (*self.terminal_errors, *self.transient_errors): + expected_exception = self.make_error_exception(error) + with self.subTest(error): + for responses in ( + # first sub-test, error on first page + (expected_exception,), + # second sub-test error on second page + (PaginationMockResponse(2*page_size, page_size, pager_type).get_next_page(), expected_exception), + ): + with patch(PaginationMockSupport.operation_map[pager_type], side_effect=iter(responses)): + actual_item_count: int = 0 + expected_item_count: int = page_size * (len(responses) - 1) + with self.assertRaises(type(expected_exception), msg='There should be an exception while paging.'): + for row in Pagination.new_pagination(self.client, pager_type, limit=page_size).rows(): + actual_item_count += 1 + self.assertEqual(actual_item_count, expected_item_count, 'Should have got the correct number of items before error.') diff --git a/test/unit/features/test_pagination_option_validation.py b/test/unit/features/test_pagination_option_validation.py new file mode 100644 index 00000000..c694262d --- /dev/null +++ b/test/unit/features/test_pagination_option_validation.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +# © Copyright IBM Corporation 2025. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from unittest import TestCase +from ibmcloudant.features.pagination import _MIN_LIMIT, _MAX_LIMIT, PagerType, Pagination + +class TestPaginationOptionValidation(TestCase): + + all_doc_paginations = (PagerType.POST_ALL_DOCS, PagerType.POST_PARTITION_ALL_DOCS, PagerType.POST_DESIGN_DOCS) + find_paginations = (PagerType.POST_PARTITION_FIND, PagerType.POST_FIND) + search_paginations = (PagerType.POST_SEARCH, PagerType.POST_PARTITION_SEARCH) + view_paginations = (PagerType.POST_PARTITION_VIEW, PagerType.POST_VIEW) + view_like_paginations = (*all_doc_paginations, *view_paginations) + all_paginations = (*find_paginations, *search_paginations, *view_like_paginations) + + def test_valid_limits(self): + test_limits = (_MIN_LIMIT, _MAX_LIMIT - 1, _MAX_LIMIT, None) + for limit in test_limits: + for pager_type in self.all_paginations: + with self.subTest(pager_type): + try: + Pagination.new_pagination(None, pager_type, limit=limit) + except ValueError: + self.fail('There should be no ValueError for valid limits.') + + def test_invalid_limits(self): + test_limits = (_MIN_LIMIT - 1, _MAX_LIMIT + 1) + for limit in test_limits: + for pager_type in self.all_paginations: + with self.subTest(pager_type): + with self.assertRaises(ValueError, msg='There should be a ValueError for invalid limits.'): + Pagination.new_pagination(None, pager_type, limit=limit) + + def test_keys_value_error_for_view_like(self): + for pager_type in self.view_like_paginations: + with self.subTest(pager_type): + with self.assertRaises(ValueError, msg=f'There should be a ValueError for {pager_type} with keys.'): + Pagination.new_pagination(None, pager_type, keys=['a','b','c']) + + def test_facet_value_errors_for_search(self): + for invalid_opt in ('counts', 'group_field', 'group_limit', 'group_sort', 'ranges',): + with self.subTest(invalid_opt): + with self.assertRaises(ValueError, msg=f'There should be a ValueError for search with option {invalid_opt}.'): + Pagination.new_pagination(None, PagerType.POST_SEARCH, **{invalid_opt: 'test value'}) From bcc57fe32ede96ed464212deaeb1c5faa5200491 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 2 Jul 2025 08:28:50 +0000 Subject: [PATCH 481/669] docs(generated): update auth information Generated SDK source code using: - Generator version 3.105.1 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 0e9362b --- README.md | 60 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 3662b7cb..58a5c466 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ to avoid surprises. - [IAM API key authentication](#iam-api-key-authentication) - [IAM Trusted profile (container) authentication](#iam-trusted-profile-container-authentication) - [IAM Trusted profile (VPC) authentication](#iam-trusted-profile-vpc-authentication) + - [IAM Trusted profile (assume identity) authentication](#iam-trusted-profile-assume-identity-authentication) - [Session cookie authentication](#session-cookie-authentication) + [Authentication with external configuration](#authentication-with-external-configuration) + [Programmatic authentication](#programmatic-authentication) @@ -141,47 +142,41 @@ Examples for other configuration methods are available by following the provided This library requires credentials to authenticate with IBM Cloudant. These credentials may be: -* IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`) +* IBM Cloud IAM credentials (with authentication types `CONTAINER`, `VPC`, `IAMASSUME` and `IAM`) * [IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai) user, service ID or trusted profile credentials - that have been granted access to the IBM Cloud Cloudant resource instance. + that have access granted to the IBM Cloud Cloudant resource instance. * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance. -* Username and password credentials (can be used with authentication types `COUCHDB_SESSION` and `BASIC`) +* Username and password credentials (with authentication types `COUCHDB_SESSION` and `BASIC`) * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`. - * IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (i.e. username and password) for instances not in IBM Cloud. + * IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (username and password) for instances not in IBM Cloud. * IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys). -For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types -must be used. - -This table summarizes the available authentication types. -The authentication types are listed in order of recommendation, preferably use the authentication type -from the first row in the table that is compatible with your environment. - | Authentication type | Recommended for | `AUTH_TYPE` | Description | | --- | --- | --- | --- | -| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| IAM Trusted Profiles ([assume identity](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-assume)) | Cloudant | `IAMASSUME` | Exchanges an IAM API key for an IAM `access_token` (same as `IAM` auth type).
Uses that initial token to obtain a second `access_token` from IAM with the assumed identity information.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | +| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-apikey) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | | [Session cookie](#session-cookie-authentication) | [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication)
(legacy credentials & instances without IAM)

[Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication) | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | | [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication)
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | | [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication)
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | | [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | -The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`. +The default authentication type for the SDK is `CONTAINER` unless supplying `APIKEY` configuration, which changes the default authentication type to `IAM`. #### Authentication with environment variables -The default service name is `CLOUDANT` so `CLOUDANT_` prefixed names are used in these examples. +The default service name is `CLOUDANT` so these examples use `CLOUDANT_` prefixed names. -Any custom service name prefix can be used as long as the matching name is used to instantiate the SDK client -and the same prefix is used for all configuration options. +Any custom service name prefix is valid, provided it matches the name used to instantiate the SDK client +and applied to all configuration options. ##### IAM API key authentication For Cloudant *IAM API key authentication*, set the following environmental variables by replacing the `` and `` with your proper [service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set -`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when an `APIKEY` is set. +`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`. ```bash CLOUDANT_URL= @@ -199,7 +194,8 @@ CLOUDANT_URL= CLOUDANT_IAM_PROFILE_ID= ``` -Alternatively a profile name may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_NAME`. +Alternatives to `CLOUDANT_IAM_PROFILE_ID`: +* `CLOUDANT_IAM_PROFILE_NAME` ##### IAM Trusted profile (VPC) authentication @@ -212,7 +208,24 @@ CLOUDANT_URL= CLOUDANT_IAM_PROFILE_ID= ``` -Alternatively a profile CRN may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_CRN`. +Alternatives to `CLOUDANT_IAM_PROFILE_ID`: +* `CLOUDANT_IAM_PROFILE_CRN` +* No profile information (uses the default trusted profile linked to the compute resource) + +##### IAM Trusted profile (assume identity) authentication + +For Cloudant *IAM Trusted profile assume authentication*, set the following environmental variables by +replacing the `` and `` with your values. + +```bash +CLOUDANT_AUTH_TYPE=IAMASSUME +CLOUDANT_URL= +CLOUDANT_IAM_PROFILE_ID= +``` + +Alternatives to `CLOUDANT_IAM_PROFILE_ID`: +* `CLOUDANT_IAM_PROFILE_CRN` +* `CLOUDANT_IAM_PROFILE_NAME` *and* `CLOUDANT_IAM_ACCOUNT_ID` (ID of the account that contains the named trusted profile) ##### Session cookie authentication @@ -229,11 +242,10 @@ CLOUDANT_PASSWORD= #### Authentication with external configuration -To use an external configuration file, the +For more information about using an external configuration file, see the related documentation in [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#authentication-with-external-configuration), or the -[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration) -will guide you. +[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration). #### Programmatic authentication From cc21de0ab9559cea0276f63c4c3b03dc6c0e82a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 17:02:02 +0000 Subject: [PATCH 482/669] build(deps-dev): Bump coverage from 7.9.1 to 7.9.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.9.1 to 7.9.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.9.1...7.9.2) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.9.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 6f902795..14dfe671 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.1 pylint==3.3.7 # code coverage -coverage==7.9.1 +coverage==7.9.2 pytest-cov==6.2.1 From 40badbc1cc12df058baf9e4f852cbbb47cc1247b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 8 Jul 2025 08:59:55 +0000 Subject: [PATCH 483/669] ci(generated): dependabot for gh-pages action Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 8c72ce4 --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f866c334..fe6c93d1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,3 +14,11 @@ updates: pull-request-branch-name: separator: "-" # Custom settings + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + target-branch: "gh-pages" + pull-request-branch-name: + separator: "-" + From 0e0e78880b617181547bf952bc924536591e8be0 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 9 Jul 2025 16:18:44 +0000 Subject: [PATCH 484/669] docs(generated): remove beta from changes follower Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version eb3f950 --- README.md | 90 +++++++++++++++++++++++++++---------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 58a5c466..87167e09 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ to avoid surprises. * [Raw IO](#raw-io) * [Model classes vs dictionaries](#model-classes-vs-dictionaries) * [Further resources](#further-resources) - * [Changes feed follower (beta)](#changes-feed-follower-beta) + * [Changes feed follower](#changes-feed-follower) + [Introduction](#introduction) + [Modes of operation](#modes-of-operation) + [Configuring the changes follower](#configuring-the-changes-follower) + [Error suppression](#error-suppression) + [Follower operation](#follower-operation) - + [Checkpointing](#checkpointing) + + [Checkpoints](#checkpoints) + [Code examples](#code-examples-1) - [Initializing a changes follower](#initializing-a-changes-follower) - [Starting the changes follower](#starting-the-changes-follower) @@ -95,7 +95,7 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](#changes-feed-follower-beta) (beta) +- Built-in [Changes feed follower](#changes-feed-follower) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -725,13 +725,13 @@ print(response) - [Cloudant blog](https://blog.cloudant.com/): Many useful articles about how to optimize Cloudant for common problems. -### Changes feed follower (beta) +### Changes feed follower #### Introduction -The SDK provides a changes feed follower utility (currently beta). +The SDK provides a changes feed follower utility. This helper utility connects to the `_changes` endpoint and returns the individual change items. -It removes some of the complexity of using the `_changes` endpoint by setting some options automatically +It removes some complexity of using the `_changes` endpoint by setting some options automatically and providing error suppression and retries. *Tip: the changes feed often does not meet user expectations or assumptions.* @@ -743,18 +743,18 @@ to get a better understanding of the limitations and suitable use-cases before u There are two modes of operation: * Start mode - * Fetches the changes from the supplied `since` sequence (by default the feed will start from `now`). + * Fetches the changes from the supplied `since` sequence (in this mode follower defaults to reading the feed from `now`). * Fetches all available changes and then continues listening for new changes indefinitely unless encountering an end condition. * An example use case for this mode is event driven workloads. * Start one-off mode - * Fetches the changes from the supplied `since` sequence (by default the feed will start from the beginning). + * Fetches the changes from the supplied `since` sequence (in this mode follower defaults to reading the feed from the beginning). * Fetches all available changes and then stops when either there are no further changes pending or encountering an end condition. * An example use case for this mode is ETL style workloads. #### Configuring the changes follower The SDK's model of changes feed options is also used to configure the follower. -However, a subset of the options are invalid as they are configured internally by the implementation. +However, a subset of the options used internally by the follower implementation are invalid. Supplying these options when instantiating the follower causes an error. The invalid options are: * `descending` @@ -762,33 +762,33 @@ The invalid options are: * `heartbeat` * `lastEventId` - use `since` instead * `timeout` -* Only the value of `_selector` is permitted for the `filter` option. This restriction is because selector - based filters perform better than JavaScript backed filters. Configuring a non-selector based filter will - cause the follower to error. +* Follower permits only the value `_selector` for the `filter` option. This restriction is because selector + based filters perform better than JavaScript backed filters. Configuring a non-selector based filter + causes the follower to error. -Note that the `limit` parameter will terminate the follower at the given number of changes in either +Note that the `limit` parameter terminates the follower at the given number of changes in either operating mode. -The changes follower requires the client to have HTTP timeouts of at least 1 minute and will error during +The changes follower requires the client to have HTTP timeouts of at least 1 minute and errors during instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. -For use-cases where these configuration limitations are deemed too restrictive then it is recommended to -write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges) instead of the follower. +For use-cases where these configuration limitations are too restrictive then write code to use the SDK's +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges) instead of the follower. #### Error suppression -By default, the changes follower will suppress transient errors indefinitely and attempt to run to completion or listen forever as +By default, the changes follower suppresses transient errors indefinitely and attempts to run to completion or listen forever as dictated by the operating mode. -For applications where that is not desirable an optional error tolerance duration may be specified to control the time since -the last successful response that transient errors will be suppressed. This can be used, for example, by applications as a grace period +For applications where that is not desirable configure the optional error tolerance duration. This controls the time since +the last successful response that the follower suppresses transient errors. An example usage is an application grace period before reporting an error and requiring intervention. There are some additional points to consider for error suppression: -* Errors considered terminal, for example, the database not existing or invalid credentials are never suppressed and will error immediately. -* The error suppression duration is not guaranteed to fire immediately after lapsing and should be considered a minimum suppression time. -* The changes follower will back-off between retries and as such may remain paused for a short while after the transient errors have resolved. -* If the underlying SDK client used to initialize the follower also has retries configured then errors could be suppressed for significantly - longer than the follower's configured error tolerance duration depending on the configuration options. +* Errors considered terminal, for example, the database not existing or invalid credentials are never suppressed and error immediately. +* The error suppression duration is not guaranteed to fire immediately after lapsing and is a minimum suppression time. +* The changes follower backs-off between retries and as such may remain paused for a short while after the transient errors have resolved. +* If the underlying SDK client used to initialize the follower also has retries configured then suppression of errors may last + significantly longer than the follower's configured error tolerance duration depending on the specific options. #### Follower operation @@ -797,41 +797,41 @@ For both modes: * A terminal error (HTTP codes `400`, `401`, `403` `404`). * Transient errors occur for longer than the error tolerance duration. Transient errors are all other HTTP status codes and connection errors. * The number of changes received reaches the configured `limit`. - * The feed is terminated early by calling stop. + * The application calls stop to terminate the feed early. -As is true for the `_changes` endpoint change items have *at least once* delivery and an individual item -may be received multiple times. When using the follower change items may be repeated even within a limited -number of changes (i.e. using the `limit` option) this is a minor difference from using `limit` on the HTTP native API. +As is true for the `_changes` endpoint change items have *at least once* delivery and callers may receive +an individual item multiple times. When using the follower change items may repeat even within a limited +number of changes (that is using the `limit` option) this is a minor difference from using `limit` on the HTTP native API. The follower is not optimized for some use cases and it is not recommended to use it in cases where: * Setting `include_docs` and larger document sizes (for example > 10 kiB). -* The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up). +* The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these cases use-case specific control over the number of change requests made and the content size of the responses -may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges). +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges) +for specific control over the number of change requests made and the content size of the responses. -#### Checkpointing +#### Checkpoints -The changes follower does not checkpoint since it has no information about whether a change item has been -processed by the consuming application after being received. It is the application developer's responsibility +The changes follower does not checkpoint since it has no information about whether the consuming application +has processed a change item after delivery. It is the application developer's responsibility to store the sequence IDs to have appropriate checkpoints and to re-initialize the follower with the required `since` value after, for example, the application restarts. -The frequency and conditions for checkpointing are application specific and some applications may be tolerant -of dropped changes. This section is intended only to provide general guidance on how to avoid missing changes. +The frequency and conditions for checkpoints are application specific and some applications may be tolerant +of dropped changes. This section provides only general guidance on how to avoid missing changes. -To guarantee processing of all changes the sequence ID from a change item must not be persisted until *after* -the processing of the change item by the application has completed. As indicated previously change items are -delivered *at least once* so application code must be able to handle repeated changes already and it is +To guarantee processing of all changes do not persist the sequence ID from a change item until *after* +the processing of the change item by the application has completed. As indicated previously change item +delivery is *at least once* so application code must be able to handle repeated changes already. It is preferable to restart from an older `since` value and receive changes again than risk missing them. -The sequence IDs are available on each change item by default, but may be omitted from some change items when -using the `seq_interval` configuration option. Infrequent sequence IDs may improve performance by reducing -the amount of data that needs to be transferred, but the trade-off is that more changes will be repeated if -it is necessary to resume the changes follower. +The sequence IDs are available on each change item by default. However, the server omits sequence IDs from +some change items when using the `seq_interval` configuration option. +Infrequent sequence IDs may improve performance by reducing the amount of data transfer and server load, +but the tradeoff is repeating more changes if it is necessary to resume the changes follower. -Extreme care should be taken with persisting sequences if choosing to process change items in parallel as there -is a considerable risk of missing changes on a restart if the sequence is recorded out of order. +Take extreme care persisting sequences if choosing to process change items in parallel as there +is a considerable risk of missing changes on a restart if the recorded sequence is out of order. #### Code examples From ee947e94deb4de118c8fdeb23488b9732f563bab Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 14 Jul 2025 09:22:44 +0100 Subject: [PATCH 485/669] chore: update secrets baseline --- .secrets.baseline | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 7b09c496..193d3f8c 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "stubs/.+\\.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2024-03-12T17:52:40Z", + "generated_at": "2025-07-14T08:17:25Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -78,18 +78,11 @@ ], "results": { "Jenkinsfile": [ - { - "hashed_secret": "dd7c0356e7bfc571546237209d7fa15319e25cfa", - "is_secret": false, - "is_verified": false, - "line_number": 33, - "type": "Secret Keyword", - "verified_result": null - }, { "hashed_secret": "bb589d0621e5472f470fa3425a234c74b1e202e8", + "is_secret": false, "is_verified": false, - "line_number": 304, + "line_number": 303, "type": "Secret Keyword", "verified_result": null } @@ -99,7 +92,7 @@ "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed", "is_secret": false, "is_verified": false, - "line_number": 214, + "line_number": 183, "type": "Secret Keyword", "verified_result": null } @@ -107,22 +100,25 @@ "examples/README.md": [ { "hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd", + "is_secret": false, "is_verified": false, - "line_number": 337, + "line_number": 375, "type": "Secret Keyword", "verified_result": null }, { "hashed_secret": "68416db59b46c60492505e00404d757825cd918f", + "is_secret": false, "is_verified": false, - "line_number": 339, + "line_number": 377, "type": "Secret Keyword", "verified_result": null }, { "hashed_secret": "665f9d90d71be71ec9a1f352f320e93136770392", + "is_secret": false, "is_verified": false, - "line_number": 343, + "line_number": 381, "type": "Secret Keyword", "verified_result": null } @@ -130,6 +126,7 @@ "examples/snippets/putReplicationDocument/example_request.py": [ { "hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd", + "is_secret": false, "is_verified": false, "line_number": 11, "type": "Secret Keyword", @@ -149,18 +146,35 @@ "test/integration/test_cloudant_v1.py": [ { "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", + "is_secret": false, "is_verified": false, - "line_number": 1507, + "line_number": 1642, "type": "Secret Keyword", "verified_result": null + }, + { + "hashed_secret": "166b7db1d38ae47816b3840e6187b7a2631e04a8", + "is_secret": false, + "is_verified": false, + "line_number": 1685, + "type": "Base64 High Entropy String", + "verified_result": null } ], "test/unit/test_cloudant_v1.py": [ + { + "hashed_secret": "166b7db1d38ae47816b3840e6187b7a2631e04a8", + "is_secret": false, + "is_verified": false, + "line_number": 10664, + "type": "Base64 High Entropy String", + "verified_result": null + }, { "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 16178, + "line_number": 17086, "type": "Secret Keyword", "verified_result": null } From c6de71670641fcd71227fc5d44cac1b329ff19f2 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:40:12 +0000 Subject: [PATCH 486/669] docs(generated): pagination feature readme Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 6519883 --- README.md | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 264 insertions(+) diff --git a/README.md b/README.md index 87167e09..c7fd1575 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,21 @@ to avoid surprises. * [Process continuous changes](#process-continuous-changes) * [Process one-off changes](#process-one-off-changes) - [Stopping the changes follower](#stopping-the-changes-follower) + * [Pagination (beta)](#pagination-beta) + + [Introduction](#introduction-1) + + [Limitations](#limitations) + + [Capacity considerations](#capacity-considerations) + + [Available operations](#available-operations) + + [Creating a pagination](#creating-a-pagination) + - [Initialize the service](#initialize-the-service) + - [Set the options](#set-the-options) + - [Create the pagination](#create-the-pagination) + + [Using pagination](#using-pagination) + - [Iterate pages](#iterate-pages) + - [Iterate rows](#iterate-rows) + - [Pager](#pager) + * [Get each page from a pager](#get-each-page-from-a-pager) + * [Get all results from a pager](#get-all-results-from-a-pager) - [Questions](#questions) - [Issues](#issues) - [Versioning and LTS support](#versioning-and-lts-support) @@ -96,6 +111,7 @@ project: - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. - Built-in [Changes feed follower](#changes-feed-follower) +- Built-in [Pagination](#pagination-beta) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -986,6 +1002,254 @@ for changes_item in changes_items: changes_follower.stop() ``` +### Pagination (beta) + +#### Introduction + +The pagination feature (currently beta) accepts options for a single operation and automatically +creates the multiple requests to the server necessary to page through the results a fixed number at a time. + +Pagination is a best-practice to break apart large queries into multiple server requests. +This has a number of advantages: +* Keeping requests within server imposed limits, for example + * `200` max results for text search + * `2000` max results for partitioned queries +* Fetching only the necessary data, for example + * User finds required result on first page, no need to continue fetching results +* Reducing the duration of any individual query + * Reduce risk of query timing out on the server + * Reduce risk of network request timeouts + +#### Limitations + +Limitations of pagination: +* Forward only, no backwards paging +* Limitations on `_all_docs` and `_design_docs` operations + * No pagination for `key` option. + There is no need to paginate as IDs are unique and this returns only a single row. + This is better achieved with a single document get request. + * No pagination for `keys` option. +* Limitations on `_view` operations + * No pagination for `key` option. Pass the same `key` as a start and end key instead. + * No pagination for `keys` option. + * Views that emit multiple identical keys (with the same or different values) + from the same document cannot paginate if those key rows with the same ID + span a page boundary. + The pagination feature detects this condition and an error occurs. + It may be possible to workaround using a different page size. +* Limitations on `_search` operations + * No pagination of grouped results. + * No pagination of faceted `counts` or `ranges` results. + +#### Capacity considerations + +Pagination can make many requests rapidly from a single program call. + +For IBM Cloudant take care to ensure you have appropriate plan capacity +in place to avoid consuming all the permitted requests. +If there is no remaining plan allowance and retries are not enabled or insufficient +then a `429 Too Many Requests` error occurs. + +#### Available operations + +Pagination is available for these operations: +* Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/AllDocsPagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_all_docs_pagination.py) +* Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/design_docs_pagination.py) +* Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_find_pagination.py) +* Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_search_pagination.py) +* Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_view_pagination.py) + +The examples presented in this `README` are for all documents in a partition. +The links in the list are to equivalent examples for each of the other available operations. + +#### Creating a pagination + +Make a new pagination from a client, `PagerType` for the operation +and the options for the chosen operation. +Use the `limit` option to configure the page size (default and maximum `200`). + +Imports required for these examples: + +
+Python: + +```py +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 +``` + +
+ +##### Initialize the service + +
+Python: + +```py +# Initialize service +service = CloudantV1.new_instance() +``` + +
+ +##### Set the options + +
+Python: + +```py +# Setup options +opts = { + 'db': 'events', # example database name + 'limit': 50, # limit option sets the page size + 'partition_key': 'ns1HJS13AMkK', # query only this partition +} +``` + +
+ +##### Create the pagination + +
+Python: + +```py +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_PARTITION_ALL_DOCS, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time +``` + +
+ +#### Using pagination + +Once you have a pagination factory there are multiple options available. + +* Iterate pages +* Iterate rows +* Get each page from a pager +* Get all results from a pager + +All the paging styles produce equivalent results and make identical page requests. +The style of paging to choose depends on the use case requirements +in particular whether to process a page at a time or a row at a time. + +The pagination factory is reusable and can repeatedly produce new instances +of the same or different pagination styles for the same operation options. + +Here are examples for each paging style. + +##### Iterate pages + +Iterating pages is ideal for using an iterable for loop to process a page at a time. + +
+Python: + +```py +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass +``` + +
+ +##### Iterate rows + +Iterating rows is ideal for using an iterable for loop to process a result row at a time. + +
+Python: + +```py +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass +``` + +
+ +##### Pager + +The pager style is similar to other [IBM Cloud SDKs](https://github.com/IBM/ibm-cloud-sdk-common?tab=readme-ov-file#pagination). +Users familiar with that style of pagination may find using them preferable +to the native language style iterators. + +In the Cloudant SDKs these pagers are single use and traverse the complete set of pages once and only once. +After exhaustion they cannot be re-used, simply create a new one from the pagination factory if needed. + +Pagers are only valid for one of either page at a time or getting all results. +For example, calling for the next page then calling for all results causes an error. + +###### Get each page from a pager + +This is useful for calling to retrieve one page at a time, for example, +in a user interface with a "next page" interaction. + +If calling for the next page errors, it is valid to call for the next page again +to continue paging. + +
+Python: + +```py +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.get_next(): + page = pager.get_next() + # Do something with page +``` + +
+ +###### Get all results from a pager + +This is useful to retrieve all results in a single call. +However, this approach requires sufficient memory for the entire collection of results. +So although it may be convenient for small result sets generally prefer iterating pages +or rows with the other paging styles, especially for large result sets. + +If calling for all the results errors, then calling for all the results again restarts the pagination. + +
+Python: + +```py +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass +``` + +
+ ## Questions If you are having difficulties using this SDK or have a question about the From a7ac1f8b6e88bc039dba38ce439f57a7d1ae48e0 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 14 Jul 2025 11:54:56 +0100 Subject: [PATCH 487/669] docs: fix pagination example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7fd1575..481437a6 100644 --- a/README.md +++ b/README.md @@ -1217,7 +1217,7 @@ to continue paging. # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page ``` From 005c36b73d57ac1d11550d923c8178ee4af014a8 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:16:33 +0000 Subject: [PATCH 488/669] ci(generated): add detect secrets stage Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 22d13ad --- Jenkinsfile | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index be7cf2e6..3660ded9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,6 +19,12 @@ pipeline { ARTIFACTORY_URL_DOWN = "${Artifactory.server('taas-artifactory').getUrl()}" } stages { + stage('Detect Secrets') { + steps { + detectSecrets() + } + } + stage('Init') { steps { script { diff --git a/README.md b/README.md index 481437a6..c7fd1575 100644 --- a/README.md +++ b/README.md @@ -1217,7 +1217,7 @@ to continue paging. # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.has_next(): +if pager.get_next(): page = pager.get_next() # Do something with page ``` From 61459d7ec82ae5404adafd609895d23c2e238ca5 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 14 Jul 2025 14:19:35 +0100 Subject: [PATCH 489/669] chore: update secrets baseline --- .secrets.baseline | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 193d3f8c..d72f77c9 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "stubs/.+\\.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2025-07-14T08:17:25Z", + "generated_at": "2025-07-14T13:18:50Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -92,7 +92,7 @@ "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed", "is_secret": false, "is_verified": false, - "line_number": 183, + "line_number": 199, "type": "Secret Keyword", "verified_result": null } From 0275a7b0f1c5c6a7dc19387c63b88afaf9c5753b Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 14 Jul 2025 14:19:44 +0100 Subject: [PATCH 490/669] docs: fix gen revert of pagination example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7fd1575..481437a6 100644 --- a/README.md +++ b/README.md @@ -1217,7 +1217,7 @@ to continue paging. # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page ``` From 72c146f30f44b3150d57ac02f609b4c40048255c Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 10 Jul 2025 13:21:39 +0100 Subject: [PATCH 491/669] docs: correct pager has_next examples --- test/examples/src/features/pagination/all_docs_pagination.py | 2 +- test/examples/src/features/pagination/design_docs_pagination.py | 2 +- test/examples/src/features/pagination/find_pagination.py | 2 +- .../src/features/pagination/partition_all_docs_pagination.py | 2 +- .../src/features/pagination/partition_find_pagination.py | 2 +- .../src/features/pagination/partition_search_pagination.py | 2 +- .../src/features/pagination/partition_view_pagination.py | 2 +- test/examples/src/features/pagination/search_pagination.py | 2 +- test/examples/src/features/pagination/view_pagination.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/examples/src/features/pagination/all_docs_pagination.py b/test/examples/src/features/pagination/all_docs_pagination.py index d1765b98..3373f3cd 100644 --- a/test/examples/src/features/pagination/all_docs_pagination.py +++ b/test/examples/src/features/pagination/all_docs_pagination.py @@ -45,7 +45,7 @@ # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/design_docs_pagination.py b/test/examples/src/features/pagination/design_docs_pagination.py index 244f03ac..7e7ed6c7 100644 --- a/test/examples/src/features/pagination/design_docs_pagination.py +++ b/test/examples/src/features/pagination/design_docs_pagination.py @@ -44,7 +44,7 @@ # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/find_pagination.py b/test/examples/src/features/pagination/find_pagination.py index a7b1dae4..26b2d337 100644 --- a/test/examples/src/features/pagination/find_pagination.py +++ b/test/examples/src/features/pagination/find_pagination.py @@ -47,7 +47,7 @@ # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/partition_all_docs_pagination.py b/test/examples/src/features/pagination/partition_all_docs_pagination.py index 662b95c5..6a4c3ecc 100644 --- a/test/examples/src/features/pagination/partition_all_docs_pagination.py +++ b/test/examples/src/features/pagination/partition_all_docs_pagination.py @@ -45,7 +45,7 @@ # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/partition_find_pagination.py b/test/examples/src/features/pagination/partition_find_pagination.py index 035d680b..db3aacb9 100644 --- a/test/examples/src/features/pagination/partition_find_pagination.py +++ b/test/examples/src/features/pagination/partition_find_pagination.py @@ -47,7 +47,7 @@ # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/partition_search_pagination.py b/test/examples/src/features/pagination/partition_search_pagination.py index 134ab4dd..fdcd448e 100644 --- a/test/examples/src/features/pagination/partition_search_pagination.py +++ b/test/examples/src/features/pagination/partition_search_pagination.py @@ -47,7 +47,7 @@ # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/partition_view_pagination.py b/test/examples/src/features/pagination/partition_view_pagination.py index 26e70dd1..df9143cc 100644 --- a/test/examples/src/features/pagination/partition_view_pagination.py +++ b/test/examples/src/features/pagination/partition_view_pagination.py @@ -47,7 +47,7 @@ # Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/search_pagination.py b/test/examples/src/features/pagination/search_pagination.py index efc3b0e0..5b352973 100644 --- a/test/examples/src/features/pagination/search_pagination.py +++ b/test/examples/src/features/pagination/search_pagination.py @@ -46,7 +46,7 @@ # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page diff --git a/test/examples/src/features/pagination/view_pagination.py b/test/examples/src/features/pagination/view_pagination.py index a0d21495..dbd265da 100644 --- a/test/examples/src/features/pagination/view_pagination.py +++ b/test/examples/src/features/pagination/view_pagination.py @@ -45,7 +45,7 @@ # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() -if pager.get_next(): +if pager.has_next(): page = pager.get_next() # Do something with page From 80e9a333484771eff71b1886246df342f8ae8730 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 15 Jul 2025 12:47:29 +0000 Subject: [PATCH 492/669] test(generated): make test value more obviously fake Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 610f5b9 --- stubs/gen-its-mappings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index d39f95f1..dc148f99 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -132,8 +132,8 @@ }, "jsonBody": { "ok": true, - "key": "apikey-98d494672e2c47beaec43f4633411189", - "password": "54fcd98b4bb1206afb7d9be049e81234c768ab4d" + "key": "apikey-00112233445566778899aabbccddeeff", + "password": "0000112233445566778899aaabbbcccdddeeefff" } }, "uuid": "544965f4-c99a-38ac-8b9d-b8ae4eafc952" From 3fe61916f2710ca6db09b28f28f8f72a09b9cb3a Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 10 Jul 2025 13:23:32 +0100 Subject: [PATCH 493/669] fix: correct pager state error messages --- ibmcloudant/features/pagination.py | 4 ++-- test/unit/features/test_pagination_base.py | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ibmcloudant/features/pagination.py b/ibmcloudant/features/pagination.py index ce97cde9..bc71c952 100644 --- a/ibmcloudant/features/pagination.py +++ b/ibmcloudant/features/pagination.py @@ -199,8 +199,8 @@ class _IteratorPagerState(Enum): class _IteratorPager(Pager[I]): - _state_mixed_msg = 'This pager has been consumed, use a new Pager.' - _state_consumed_msg = 'Cannot mix get_all() and get_next() use only one method or make a new Pager.' + _state_consumed_msg = 'This pager has been consumed, use a new Pager.' + _state_mixed_msg = 'Cannot mix get_all() and get_next() use only one method or make a new Pager.' def __init__(self, iterable_func: Callable[[], Iterator[Sequence[I]]]): self._iterable_func: Callable[[], Iterator[Sequence[I]]] = iterable_func diff --git a/test/unit/features/test_pagination_base.py b/test/unit/features/test_pagination_base.py index 9a3caa29..77d2a16f 100644 --- a/test/unit/features/test_pagination_base.py +++ b/test/unit/features/test_pagination_base.py @@ -15,6 +15,7 @@ # limitations under the License. from collections.abc import Callable +from re import escape from typing import Iterable from unittest.mock import Mock, patch from ibmcloudant.cloudant_v1 import ViewResult, ViewResultRow @@ -310,7 +311,7 @@ def test_as_pager_get_all(self): actual_items = pager.get_all() self.assertSequenceEqual(actual_items, mock.all_expected_items(), "The results should match all the pages.") # Assert consumed state prevents calling again - with self.assertRaises(Exception, msg=_IteratorPager._state_consumed_msg): + with self.assertRaisesRegex(Exception, escape(_IteratorPager._state_consumed_msg)): pager.get_all() def test_as_pager_get_all_restarts_after_error(self): @@ -332,7 +333,7 @@ def test_as_pager_get_all_restarts_after_error(self): pager.get_all() self.assertSequenceEqual(pager.get_all(), mock.all_expected_items(), "The results should match all the pages.") - def test_as_pager_get_next_get_all_throws(self): + def test_as_pager_get_next_get_all_raises(self): page_size = 11 # Mock that returns 6 pages of 11 items, then 1 more page with 5 items mock = BasePageMockResponses(71, page_size) @@ -341,13 +342,13 @@ def test_as_pager_get_next_get_all_throws(self): pager: Pager[ViewResultRow] = pagination.pager() first_page = pager.get_next() self.assertSequenceEqual(first_page, mock.get_expected_page(1), "The actual page should match the expected page") - # Assert throws - with self.assertRaises(Exception, msg=_IteratorPager._state_mixed_msg): + # Assert raises + with self.assertRaisesRegex(Exception, escape(_IteratorPager._state_mixed_msg)): pager.get_all() # Assert second page ok self.assertSequenceEqual(pager.get_next(), mock.get_expected_page(2), "The actual page should match the expected page") - def test_as_pager_get_all_get_next_throws(self): + def test_as_pager_get_all_get_next_raises(self): page_size = 1 mock = BasePageMockResponses(2*page_size, page_size) first_page = mock.get_next_page() @@ -363,8 +364,8 @@ def test_as_pager_get_all_get_next_throws(self): # Stop get all part way through so it isn't consumed when we call get Next with self.assertRaises(Exception): pager.get_all() - # Assert calling get_next() throws - with self.assertRaises(Exception, msg=_IteratorPager._state_mixed_msg): + # Assert calling get_next() raises + with self.assertRaisesRegex(Exception, escape(_IteratorPager._state_mixed_msg)): pager.get_next() def test_as_pager_get_next_resumes_after_error(self): @@ -401,5 +402,5 @@ def test_as_pager_get_next_until_consumed(self): # Note 3 because third page is empty self.assertEqual(page_count, 3, 'There should be the expected number of pages.') # Assert consumed state prevents calling again - with self.assertRaises(Exception, msg=_IteratorPager._state_consumed_msg): + with self.assertRaisesRegex(Exception, escape(_IteratorPager._state_consumed_msg)): pager.get_next() From 41f4794e1f1b3f538d7e3a9d75401333181f8dbb Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 10 Jul 2025 16:23:02 +0100 Subject: [PATCH 494/669] fix: make key param invalid for view-like paging --- ibmcloudant/features/pagination.py | 16 +++++++++++-- .../test_pagination_option_validation.py | 24 +++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/ibmcloudant/features/pagination.py b/ibmcloudant/features/pagination.py index bc71c952..120474cc 100644 --- a/ibmcloudant/features/pagination.py +++ b/ibmcloudant/features/pagination.py @@ -41,6 +41,8 @@ _MAX_LIMIT = 200 _MIN_LIMIT = 1 +_DOCS_KEY_ERROR = "No need to paginate as 'key' returns a single result for an ID." +_VIEW_KEY_ERROR = "Use 'start_key' and 'end_key' instead." class PagerType(Enum): """ @@ -148,12 +150,17 @@ def _validate_limit(cls, opts: dict): if limit < _MIN_LIMIT: raise ValueError(f'The provided limit {limit} is lower than the minimum page size value of {_MIN_LIMIT}.') + @classmethod + def _validate_option_absent(cls, invalid_opt: str, opts: dict, message_suffix: Optional[str]=None): + # check if the invalid_opt is present in opts dict + if invalid_opt in opts: + raise ValueError(f"The option '{invalid_opt}' is invalid when using pagination.{' ' + message_suffix if message_suffix else ''}") + @classmethod def _validate_options_absent(cls, invalid_opts: Sequence[str], opts: dict): # for each invalid_opts entry check if it is present in opts dict for invalid_opt in invalid_opts: - if invalid_opt in opts: - raise ValueError(f"The option '{invalid_opt}' is invalid when using pagination.") + cls._validate_option_absent(invalid_opt, opts) @classmethod def new_pagination(cls, client:CloudantV1, type: PagerType, **kwargs): @@ -167,14 +174,17 @@ def new_pagination(cls, client:CloudantV1, type: PagerType, **kwargs): # Validate the limit cls._validate_limit(kwargs) if type == PagerType.POST_ALL_DOCS: + cls._validate_option_absent('key', kwargs, _DOCS_KEY_ERROR) cls._validate_options_absent(('keys',), kwargs) return Pagination(client, _AllDocsPageIterator, kwargs) if type == PagerType.POST_DESIGN_DOCS: + cls._validate_option_absent('key', kwargs, _DOCS_KEY_ERROR) cls._validate_options_absent(('keys',), kwargs) return Pagination(client, _DesignDocsPageIterator, kwargs) if type == PagerType.POST_FIND: return Pagination(client, _FindPageIterator, kwargs) if type == PagerType.POST_PARTITION_ALL_DOCS: + cls._validate_option_absent('key', kwargs, _DOCS_KEY_ERROR) cls._validate_options_absent(('keys',), kwargs) return Pagination(client, _AllDocsPartitionPageIterator, kwargs) if type == PagerType.POST_PARTITION_FIND: @@ -182,12 +192,14 @@ def new_pagination(cls, client:CloudantV1, type: PagerType, **kwargs): if type == PagerType.POST_PARTITION_SEARCH: return Pagination(client, _SearchPartitionPageIterator, kwargs) if type == PagerType.POST_PARTITION_VIEW: + cls._validate_option_absent('key', kwargs, _VIEW_KEY_ERROR) cls._validate_options_absent(('keys',), kwargs) return Pagination(client, _ViewPartitionPageIterator, kwargs) if type == PagerType.POST_SEARCH: cls._validate_options_absent(('counts', 'group_field', 'group_limit', 'group_sort', 'ranges',), kwargs) return Pagination(client, _SearchPageIterator, kwargs) if type == PagerType.POST_VIEW: + cls._validate_option_absent('key', kwargs, _VIEW_KEY_ERROR) cls._validate_options_absent(('keys',), kwargs) return Pagination(client, _ViewPageIterator, kwargs) diff --git a/test/unit/features/test_pagination_option_validation.py b/test/unit/features/test_pagination_option_validation.py index c694262d..c2716425 100644 --- a/test/unit/features/test_pagination_option_validation.py +++ b/test/unit/features/test_pagination_option_validation.py @@ -15,7 +15,7 @@ # limitations under the License. from unittest import TestCase -from ibmcloudant.features.pagination import _MIN_LIMIT, _MAX_LIMIT, PagerType, Pagination +from ibmcloudant.features.pagination import _DOCS_KEY_ERROR, _MIN_LIMIT, _MAX_LIMIT, _VIEW_KEY_ERROR, PagerType, Pagination class TestPaginationOptionValidation(TestCase): @@ -39,19 +39,35 @@ def test_valid_limits(self): def test_invalid_limits(self): test_limits = (_MIN_LIMIT - 1, _MAX_LIMIT + 1) for limit in test_limits: + if (limit == _MIN_LIMIT -1): + msg_regex = f'The provided limit {limit} is lower than the minimum page size value of 1.' + elif (limit == _MAX_LIMIT + 1): + msg_regex= f'The provided limit {limit} exceeds the maximum page size value of 200.' for pager_type in self.all_paginations: with self.subTest(pager_type): - with self.assertRaises(ValueError, msg='There should be a ValueError for invalid limits.'): + with self.assertRaisesRegex(ValueError, msg_regex): Pagination.new_pagination(None, pager_type, limit=limit) def test_keys_value_error_for_view_like(self): for pager_type in self.view_like_paginations: with self.subTest(pager_type): - with self.assertRaises(ValueError, msg=f'There should be a ValueError for {pager_type} with keys.'): + with self.assertRaisesRegex(ValueError, 'The option \'keys\' is invalid when using pagination.'): Pagination.new_pagination(None, pager_type, keys=['a','b','c']) def test_facet_value_errors_for_search(self): for invalid_opt in ('counts', 'group_field', 'group_limit', 'group_sort', 'ranges',): with self.subTest(invalid_opt): - with self.assertRaises(ValueError, msg=f'There should be a ValueError for search with option {invalid_opt}.'): + with self.assertRaisesRegex(ValueError, f'The option \'{invalid_opt}\' is invalid when using pagination.'): Pagination.new_pagination(None, PagerType.POST_SEARCH, **{invalid_opt: 'test value'}) + + def test_key_value_error_for_docs(self): + for pager_type in self.all_doc_paginations: + with self.subTest(pager_type): + with self.assertRaisesRegex(ValueError, f'The option \'key\' is invalid when using pagination. {_DOCS_KEY_ERROR}'): + Pagination.new_pagination(None, pager_type, key='a') + + def test_key_value_error_for_views(self): + for pager_type in self.view_paginations: + with self.subTest(pager_type): + with self.assertRaisesRegex(ValueError, f'The option \'key\' is invalid when using pagination. {_VIEW_KEY_ERROR}'): + Pagination.new_pagination(None, pager_type, key={}) From 5cd552bf1d059cff3c0ee358ba727f49483514e5 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 10 Jul 2025 17:15:45 +0100 Subject: [PATCH 495/669] test: fix default operation for bookmark test --- test/unit/features/test_pagination_bookmark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/features/test_pagination_bookmark.py b/test/unit/features/test_pagination_bookmark.py index 7ad4c952..e9ede072 100644 --- a/test/unit/features/test_pagination_bookmark.py +++ b/test/unit/features/test_pagination_bookmark.py @@ -28,7 +28,7 @@ class BookmarkTestPageIterator(_BookmarkPageIterator): boundary_func: Callable = lambda p,l: None def __init__(self, client, opts): - super().__init__(client, BookmarkTestPageIterator.operation or client.post_view, opts) + super().__init__(client, BookmarkTestPageIterator.operation or client.post_search, opts) def _result_converter(self) -> Callable[[dict], SearchResult]: return lambda d: SearchResult.from_dict(d) From 5197442685c0cd256e38d5b5eea53bf0576785a4 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 10 Jul 2025 17:16:31 +0100 Subject: [PATCH 496/669] fix: remove skip from subsequent pages --- ibmcloudant/features/pagination.py | 14 ++++++++++---- test/unit/features/test_pagination_operations.py | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ibmcloudant/features/pagination.py b/ibmcloudant/features/pagination.py index 120474cc..3ef485c5 100644 --- a/ibmcloudant/features/pagination.py +++ b/ibmcloudant/features/pagination.py @@ -263,7 +263,7 @@ class _BasePageIterator(Iterator[Sequence[I]]): def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], - page_opts: list[str], + page_opts: Sequence[str], opts: dict): self._client: CloudantV1 = client self._has_next: bool = True @@ -318,7 +318,7 @@ def _get_next_page_options(self, result: R) -> dict: class _KeyPageIterator(_BasePageIterator, Generic[K]): def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], opts: dict): - super().__init__(client, operation, ['start_key', 'start_key_doc_id'], opts) + super().__init__(client, operation, ('skip', 'start_key', 'start_key_doc_id',), opts) self._boundary_failure: Optional[str] = None def _next_request(self) -> list[I]: @@ -353,8 +353,8 @@ def check_boundary(self, penultimate_item: I, last_item: I) -> Optional[str]: class _BookmarkPageIterator(_BasePageIterator): - def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], opts: dict): - super().__init__(client, operation, ['bookmark'], opts) + def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], opts: dict, extra_page_opts:Sequence[str]=()): + super().__init__(client, operation, ('bookmark',) + extra_page_opts, opts) def _get_next_page_options(self, result: R) -> dict: return {'bookmark': result.bookmark} @@ -391,6 +391,12 @@ def __init__(self, client: CloudantV1, opts: dict): class _FindBasePageIterator(_BookmarkPageIterator): + def __init__(self, client: CloudantV1, operation: Callable[..., DetailedResponse], opts: dict): + # Find requests allow skip, but it should only be used on the first request. + # Since we don't want it on subsequent page requests we need to exclude it from + # fixed opts used for the partial function. + super().__init__(client, operation, opts, extra_page_opts=('skip',)) + def _items(self, result: FindResult): return result.docs diff --git a/test/unit/features/test_pagination_operations.py b/test/unit/features/test_pagination_operations.py index 16383431..e1b90c81 100644 --- a/test/unit/features/test_pagination_operations.py +++ b/test/unit/features/test_pagination_operations.py @@ -191,3 +191,17 @@ def test_rows_errors(self): for row in Pagination.new_pagination(self.client, pager_type, limit=page_size).rows(): actual_item_count += 1 self.assertEqual(actual_item_count, expected_item_count, 'Should have got the correct number of items before error.') + + # Test skip omitted from subsequent page requests + # Applies to key pagers and find pagers + def test_skip_removed_for_subsquent_page(self): + page_size = 14 + for pager_type in (PaginationMockSupport.key_pagers + PaginationMockSupport.find_pagers): + with self.subTest(pager_type): + with patch(PaginationMockSupport.operation_map[pager_type], PaginationMockResponse(2*page_size, page_size, pager_type).get_next_page): + pager = Pagination.new_pagination(self.client, pager_type, limit=page_size, skip=1).pager() + # Assert first page has skip option + self.assertEqual(pager._iterator._next_page_opts['skip'], 1, 'The skip option should be 1 for the first page') + pager.get_next() + # Assert second page has no skip option + self.assertIsNone(pager._iterator._next_page_opts.get('skip'), 'The skip option should be absent for the next page') From 6074af49f2bdf02db46c382f33f2721c854ffe9c Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 15 Jul 2025 15:38:39 +0100 Subject: [PATCH 497/669] chore: update secrets baseline --- .secrets.baseline | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index d72f77c9..040b9a95 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -1,9 +1,9 @@ { "exclude": { - "files": "stubs/.+\\.json|^.secrets.baseline$", - "lines": null + "files": "^.secrets.baseline$", + "lines": "(?i)^\\s*\"(?:transaction|x-couch-request|x-request)-id\": \"[^\"]+\",?$|^\\s*\"(?:last_|update_|purge_|checkpointed_source_|source_|through_)?seq\": \"[^\"]+\",?$|^\\s*\"(?:doc_)?id\": \"[^\"]+\",?$|^\\s*\"(?:signature|name|uuid)\": \"[^\"]+\",?$" }, - "generated_at": "2025-07-14T13:18:50Z", + "generated_at": "2025-07-15T14:37:41Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -82,7 +82,7 @@ "hashed_secret": "bb589d0621e5472f470fa3425a234c74b1e202e8", "is_secret": false, "is_verified": false, - "line_number": 303, + "line_number": 309, "type": "Secret Keyword", "verified_result": null } @@ -143,6 +143,32 @@ "verified_result": null } ], + "stubs/gen-its-mappings.json": [ + { + "hashed_secret": "f1d68726fe147018f28a80efd621b43580196979", + "is_secret": false, + "is_verified": false, + "line_number": 136, + "type": "Hex High Entropy String", + "verified_result": null + }, + { + "hashed_secret": "f1d68726fe147018f28a80efd621b43580196979", + "is_secret": false, + "is_verified": false, + "line_number": 136, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "870cc58f071983f7977b829365dc77509ab1056f", + "is_secret": false, + "is_verified": false, + "line_number": 1363, + "type": "Hex High Entropy String", + "verified_result": null + } + ], "test/integration/test_cloudant_v1.py": [ { "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", From 54881af9172a5121289fb0056075edd95181bb85 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:27:43 +0000 Subject: [PATCH 498/669] Update version 0.10.4 -> 0.10.5 --- .bumpversion.toml | 2 +- README.md | 36 ++++++++++++++++++------------------ ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 49eac5e4..6c477d39 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.4" +current_version = "0.10.5" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 481437a6..04fba0dc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.4 +# IBM Cloudant Python SDK Version 0.10.5 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -128,13 +128,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.4" +pip install --upgrade "ibmcloudant>=0.10.5" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.4" +easy_install --upgrade "ibmcloudant>=0.10.5" ``` ## Using the SDK @@ -599,7 +599,7 @@ You have deleted the document. #### Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#examples-for-python). ### Error handling @@ -789,7 +789,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) instead of the follower. #### Error suppression @@ -823,7 +823,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. #### Checkpoints @@ -1055,22 +1055,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/AllDocsPagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/AllDocsPagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. @@ -1263,7 +1263,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -1293,8 +1293,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.4/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 9724eda9..b2a50104 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.4' +__version__ = '0.10.5' diff --git a/pyproject.toml b/pyproject.toml index 55f7deaa..6162f600 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.4" +version = "0.10.5" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 423e114f696e5671dd9830539c6aad45cdb28519 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:01:32 +0000 Subject: [PATCH 499/669] build(deps): Bump github/codeql-action from 3.29.2 to 3.29.3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.2 to 3.29.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/181d5eefc20863364f96762470ba6f862bdef56b...d6bbdef45e766d081b84a2def353b0055f728d3e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a3c119fc..6d050b35 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + uses: github/codeql-action/autobuild@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 with: category: "/language:${{matrix.language}}" From 6e546ecaa554a02500dc26a526a20208958048f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:17:57 +0000 Subject: [PATCH 500/669] build(deps-dev): Bump coverage from 7.9.2 to 7.10.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.9.2 to 7.10.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.9.2...7.10.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 14dfe671..7e60dad9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.1 pylint==3.3.7 # code coverage -coverage==7.9.2 +coverage==7.10.0 pytest-cov==6.2.1 From 5df5a67bf54c9bffb8ae8ab13246d658293e2e17 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:42:02 +0000 Subject: [PATCH 501/669] fix(generated): use correct setters/constants in postIndex examples Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version dfe7806 --- examples/README.md | 2 +- .../snippets/postIndex/example_request_using_text_type_index.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/README.md b/examples/README.md index 0018942f..9673e113 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1405,7 +1405,7 @@ service = CloudantV1.new_instance() # Type "text" index fields require an object with a name and type properties for the field. index_field = IndexField( name="address", - type="string" + type=IndexField.TypeEnum.STRING ) index = IndexDefinition( fields=[index_field] diff --git a/examples/snippets/postIndex/example_request_using_text_type_index.py b/examples/snippets/postIndex/example_request_using_text_type_index.py index 0d085675..6c3e21f8 100644 --- a/examples/snippets/postIndex/example_request_using_text_type_index.py +++ b/examples/snippets/postIndex/example_request_using_text_type_index.py @@ -6,7 +6,7 @@ # Type "text" index fields require an object with a name and type properties for the field. index_field = IndexField( name="address", - type="string" + type=IndexField.TypeEnum.STRING ) index = IndexDefinition( fields=[index_field] From 2705cf1917a7745989dd6416a0f7e6e3273e8078 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 09:41:40 +0200 Subject: [PATCH 502/669] build(deps-dev): Bump coverage from 7.10.0 to 7.10.1 (#836) Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.0 to 7.10.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.0...7.10.1) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kornel-Toth --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7e60dad9..64e8386a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.1 pylint==3.3.7 # code coverage -coverage==7.10.0 +coverage==7.10.1 pytest-cov==6.2.1 From 451d92ae5d564ded0008f2eb4e2d40127e215084 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 19:58:01 +0000 Subject: [PATCH 503/669] build(deps): Bump github/codeql-action from 3.29.3 to 3.29.4 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.3 to 3.29.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/d6bbdef45e766d081b84a2def353b0055f728d3e...4e828ff8d448a8a6e532957b1811f387a63867e8) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6d050b35..dc36efda 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 with: category: "/language:${{matrix.language}}" From 6a66f782052280c91d3e378c53ce2b83ff5bce8f Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 30 Jul 2025 16:20:03 +0000 Subject: [PATCH 504/669] ci(generated): skip staging/gauge on tag builds Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version f153831 --- Jenkinsfile | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3660ded9..5912adae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,12 +68,18 @@ pipeline { environment { scannerHome = tool 'SonarQubeScanner' } - // Scanning runs on dependabot core update and non-dependabot branches + // Scanning runs on PRs (except dependabot for non-core updates) and primary branch when { anyOf { - branch pattern: /^dependabot.*(?i)(ibm)[\.-].+sdk-core.*$/, comparator: 'REGEXP' - not { - branch 'dependabot*' + changeRequest() + expression { env.BRANCH_IS_PRIMARY } + } + not { + allOf { + changeRequest branch: 'dependabot*', comparator: 'GLOB' + not { + changeRequest branch: /^dependabot.*(?i)(ibm)[\.-].+sdk-core.*$/, comparator: 'REGEXP' + } } } } @@ -82,6 +88,11 @@ pipeline { } } stage('Publish[staging]') { + when { + not { + buildingTag() + } + } environment { STAGE_ROOT = "${ARTIFACTORY_URL_UP}/api/" } @@ -105,6 +116,11 @@ pipeline { } } stage('Run Gauge tests') { + when { + not { + buildingTag() + } + } steps { script { buildResults = null @@ -270,7 +286,7 @@ void defaultInit() { scanCode = { withSonarQubeEnv(installationName: 'SonarQubeServer') { - sh "${scannerHome}/bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.exclusions=examples/**" + sh "${scannerHome}/bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${libName}-sdk -Dsonar.exclusions=examples/**" } } } From 89b8f9401297433df2a0362e27c463c330ee0fa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 23:50:42 +0000 Subject: [PATCH 505/669] build(deps): Bump github/codeql-action from 3.29.4 to 3.29.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.4 to 3.29.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/4e828ff8d448a8a6e532957b1811f387a63867e8...51f77329afa6477de8c49fc9c7046c15b9a4e79d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index dc36efda..8af417e6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4 + uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: category: "/language:${{matrix.language}}" From af479bbcdf4685b953a55a4a1383c09cda77d9c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 08:43:11 +0000 Subject: [PATCH 506/669] build(deps-dev): Bump coverage from 7.10.1 to 7.10.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.1 to 7.10.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.1...7.10.2) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 64e8386a..3342ec27 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.1 pylint==3.3.7 # code coverage -coverage==7.10.1 +coverage==7.10.2 pytest-cov==6.2.1 From 5a6a44af90925d2c0186d3a98af8da7c6568429c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 02:44:13 +0000 Subject: [PATCH 507/669] build(deps): Bump github/codeql-action from 3.29.7 to 3.29.8 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.7 to 3.29.8. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/51f77329afa6477de8c49fc9c7046c15b9a4e79d...76621b61decf072c1cee8dd1ce2d2a82d33c17ed) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8af417e6..7e5acc01 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Initialize CodeQL - uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 + uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 + uses: github/codeql-action/autobuild@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 + uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 with: category: "/language:${{matrix.language}}" From 052bfda14c09036ee0ae0ee3ebb90e427fc1ae2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 09:42:33 +0000 Subject: [PATCH 508/669] build(deps-dev): Bump pylint from 3.3.7 to 3.3.8 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.7...v3.3.8) --- updated-dependencies: - dependency-name: pylint dependency-version: 3.3.8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3342ec27..e7838529 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==8.4.1 responses==0.25.7 python_dotenv==1.1.1 -pylint==3.3.7 +pylint==3.3.8 # code coverage coverage==7.10.2 pytest-cov==6.2.1 From f8e0261eb8126c6d9121650bf4ea3d3053fec679 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 12:29:52 +0000 Subject: [PATCH 509/669] build(deps-dev): Bump coverage from 7.10.2 to 7.10.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.2 to 7.10.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.2...7.10.3) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7838529..277f4cb6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.7 python_dotenv==1.1.1 pylint==3.3.8 # code coverage -coverage==7.10.2 +coverage==7.10.3 pytest-cov==6.2.1 From fb842f1cf783d0c6e300b021f83bcc921d9812ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 14:39:30 +0000 Subject: [PATCH 510/669] build(deps-dev): Bump responses from 0.25.7 to 0.25.8 Bumps [responses](https://github.com/getsentry/responses) from 0.25.7 to 0.25.8. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.7...0.25.8) --- updated-dependencies: - dependency-name: responses dependency-version: 0.25.8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 277f4cb6..62c0d3d1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.12.0 # test dependencies pytest==8.4.1 -responses==0.25.7 +responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.8 # code coverage From 2d10da0d68a6cfe0cdf589df30734924ce92381f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 09:15:20 +0000 Subject: [PATCH 511/669] build(deps): Bump actions/checkout from 4.2.2 to 5.0.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/11bd71901bbe5b1630ceea73d27597364c9af683...08c6903cd8c0fde910a37f88322edcfb5dd907a8) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7e5acc01..395416e1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6b396971..6a5f1ee7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: Setup python 3.13 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3beb15d5..3c686fac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From 25b79b3e3bfc809813a03fcd88ba1dfd76c74811 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 15 Aug 2025 10:09:29 +0000 Subject: [PATCH 512/669] docs(generated): move long sections to docs folder Generated SDK source code using: - Generator version 3.107.0 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 19f3a13 --- .github/CODEOWNERS | 5 + README.md | 1000 +------------------------------------- docs/Authentication.md | 161 ++++++ docs/Changes_Follower.md | 281 +++++++++++ docs/Examples.md | 327 +++++++++++++ docs/Pagination.md | 267 ++++++++++ docs/README.md | 11 + 7 files changed, 1079 insertions(+), 973 deletions(-) create mode 100644 docs/Authentication.md create mode 100644 docs/Changes_Follower.md create mode 100644 docs/Examples.md create mode 100644 docs/Pagination.md create mode 100644 docs/README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a5de3a3a..369b19d4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -14,6 +14,11 @@ KNOWN_ISSUES.md @IBM/cloudant-sdks LICENSE @IBM/cloudant-sdks README.md @IBM/cloudant-sdks SECURITY.md @IBM/cloudant-sdks +docs/Authentication.md @IBM/cloudant-sdks +docs/Changes_Follower.md @IBM/cloudant-sdks +docs/Examples.md @IBM/cloudant-sdks +docs/Pagination.md @IBM/cloudant-sdks +docs/README.md @IBM/cloudant-sdks scripts/publish_buildinfo.sh @IBM/cloudant-sdks scripts/pydoc/generate-index-html.sh @IBM/cloudant-sdks scripts/pydoc/publish-doc.sh @IBM/cloudant-sdks diff --git a/README.md b/README.md index 04fba0dc..1f39bb4f 100644 --- a/README.md +++ b/README.md @@ -25,57 +25,13 @@ to avoid surprises. - [Installation](#installation) - [Using the SDK](#using-the-sdk) * [Authentication](#authentication) - + [Authentication with environment variables](#authentication-with-environment-variables) - - [IAM API key authentication](#iam-api-key-authentication) - - [IAM Trusted profile (container) authentication](#iam-trusted-profile-container-authentication) - - [IAM Trusted profile (VPC) authentication](#iam-trusted-profile-vpc-authentication) - - [IAM Trusted profile (assume identity) authentication](#iam-trusted-profile-assume-identity-authentication) - - [Session cookie authentication](#session-cookie-authentication) - + [Authentication with external configuration](#authentication-with-external-configuration) - + [Programmatic authentication](#programmatic-authentication) * [Automatic retries](#automatic-retries) * [Request timeout configuration](#request-timeout-configuration) * [Code examples](#code-examples) - + [1. Create a database and add a document](#1-create-a-database-and-add-a-document) - + [2. Retrieve information from an existing database](#2-retrieve-information-from-an-existing-database) - + [3. Update your previously created document](#3-update-your-previously-created-document) - + [4. Delete your previously created document](#4-delete-your-previously-created-document) - + [Further code examples](#further-code-examples) * [Error handling](#error-handling) * [Raw IO](#raw-io) * [Model classes vs dictionaries](#model-classes-vs-dictionaries) * [Further resources](#further-resources) - * [Changes feed follower](#changes-feed-follower) - + [Introduction](#introduction) - + [Modes of operation](#modes-of-operation) - + [Configuring the changes follower](#configuring-the-changes-follower) - + [Error suppression](#error-suppression) - + [Follower operation](#follower-operation) - + [Checkpoints](#checkpoints) - + [Code examples](#code-examples-1) - - [Initializing a changes follower](#initializing-a-changes-follower) - - [Starting the changes follower](#starting-the-changes-follower) - * [Start mode for continuous listening](#start-mode-for-continuous-listening) - * [Start mode for one-off fetching](#start-mode-for-one-off-fetching) - - [Processing changes](#processing-changes) - * [Process continuous changes](#process-continuous-changes) - * [Process one-off changes](#process-one-off-changes) - - [Stopping the changes follower](#stopping-the-changes-follower) - * [Pagination (beta)](#pagination-beta) - + [Introduction](#introduction-1) - + [Limitations](#limitations) - + [Capacity considerations](#capacity-considerations) - + [Available operations](#available-operations) - + [Creating a pagination](#creating-a-pagination) - - [Initialize the service](#initialize-the-service) - - [Set the options](#set-the-options) - - [Create the pagination](#create-the-pagination) - + [Using pagination](#using-pagination) - - [Iterate pages](#iterate-pages) - - [Iterate rows](#iterate-rows) - - [Pager](#pager) - * [Get each page from a pager](#get-each-page-from-a-pager) - * [Get all results from a pager](#get-all-results-from-a-pager) - [Questions](#questions) - [Issues](#issues) - [Versioning and LTS support](#versioning-and-lts-support) @@ -110,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](#changes-feed-follower) -- Built-in [Pagination](#pagination-beta) (beta) +- Built-in [Changes feed follower](./docs/Changes_Follower.md) +- Built-in [Pagination](./docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -142,135 +98,38 @@ easy_install --upgrade "ibmcloudant>=0.10.5" For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md) documentation. This library requires configuration with a service URL and -[Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) to authenticate with your +[Cloudant service credentials][service-credentials] to authenticate with your account. There are several ways to **set** these authentication properties: -1. As [environment variables](#authentication-with-environment-variables) -2. The [programmatic approach](#programmatic-authentication) -3. With an [external credentials file](#authentication-with-external-configuration) +1. As [environment variables](./docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](./docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](./docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication +Consult the [authentication document](./docs/Authentication.md) +for comprehensive details of all the available authentication methods and how to configure them with environment settings +or programmatically. -This library requires credentials to authenticate with IBM Cloudant. These credentials may be: -* IBM Cloud IAM credentials (with authentication types `CONTAINER`, `VPC`, `IAMASSUME` and `IAM`) - * [IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai) user, service ID or trusted profile credentials - that have access granted to the IBM Cloud Cloudant resource instance. - * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance. -* Username and password credentials (with authentication types `COUCHDB_SESSION` and `BASIC`) - * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`. - * IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (username and password) for instances not in IBM Cloud. - * IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys). - -| Authentication type | Recommended for | `AUTH_TYPE` | Description | -| --- | --- | --- | --- | -| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| IAM Trusted Profiles ([assume identity](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-assume)) | Cloudant | `IAMASSUME` | Exchanges an IAM API key for an IAM `access_token` (same as `IAM` auth type).
Uses that initial token to obtain a second `access_token` from IAM with the assumed identity information.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-apikey) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization: Bearer ` header to each HTTP request.
Automatically renews the access token when needed. | -| [Session cookie](#session-cookie-authentication) | [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication)
(legacy credentials & instances without IAM)

[Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication) | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | -| [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication)
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer ` to each HTTP request.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | -| [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication)
(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic ` header to each HTTP request. | -| [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | - -The default authentication type for the SDK is `CONTAINER` unless supplying `APIKEY` configuration, which changes the default authentication type to `IAM`. - -#### Authentication with environment variables - -The default service name is `CLOUDANT` so these examples use `CLOUDANT_` prefixed names. - -Any custom service name prefix is valid, provided it matches the name used to instantiate the SDK client -and applied to all configuration options. - -##### IAM API key authentication - -For Cloudant *IAM API key authentication*, set the following environmental variables by -replacing the `` and `` with your proper -[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set -`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`. - -```bash -CLOUDANT_URL= -CLOUDANT_APIKEY= -``` - -##### IAM Trusted profile (container) authentication - -For Cloudant *IAM Trusted profile compute resource container authentication*, set the following environmental variables by -replacing the `` and `` with your values. There is no need to set -`CLOUDANT_AUTH_TYPE` to `CONTAINER` because it is the default. - -```bash -CLOUDANT_URL= -CLOUDANT_IAM_PROFILE_ID= -``` - -Alternatives to `CLOUDANT_IAM_PROFILE_ID`: -* `CLOUDANT_IAM_PROFILE_NAME` - -##### IAM Trusted profile (VPC) authentication - -For Cloudant *IAM Trusted profile compute resource vpc authentication*, set the following environmental variables by -replacing the `` and `` with your values. - -```bash -CLOUDANT_AUTH_TYPE=VPC -CLOUDANT_URL= -CLOUDANT_IAM_PROFILE_ID= -``` - -Alternatives to `CLOUDANT_IAM_PROFILE_ID`: -* `CLOUDANT_IAM_PROFILE_CRN` -* No profile information (uses the default trusted profile linked to the compute resource) - -##### IAM Trusted profile (assume identity) authentication - -For Cloudant *IAM Trusted profile assume authentication*, set the following environmental variables by -replacing the `` and `` with your values. - -```bash -CLOUDANT_AUTH_TYPE=IAMASSUME -CLOUDANT_URL= -CLOUDANT_IAM_PROFILE_ID= +Quick start for Cloudant with an IAM API key: +```sh +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL # use your own Cloudant public or private URL +CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key ``` -Alternatives to `CLOUDANT_IAM_PROFILE_ID`: -* `CLOUDANT_IAM_PROFILE_CRN` -* `CLOUDANT_IAM_PROFILE_NAME` *and* `CLOUDANT_IAM_ACCOUNT_ID` (ID of the account that contains the named trusted profile) - -##### Session cookie authentication - -For `COUCHDB_SESSION` authentication, set the following environmental variables -by replacing the ``, `` and `` with your proper -[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). - -```bash +Quick start for Apache CouchDB with a username/password session: +```sh CLOUDANT_AUTH_TYPE=COUCHDB_SESSION -CLOUDANT_URL= -CLOUDANT_USERNAME= -CLOUDANT_PASSWORD= +CLOUDANT_URL=http://~replaceWithYourUniqueHost~.example:5984 # use your CouchDB URL +CLOUDANT_USERNAME=username # replace with your username +CLOUDANT_PASSWORD=password # replace with your password ``` -#### Authentication with external configuration - -For more information about using an external configuration file, see the related documentation in -[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#authentication-with-external-configuration), -or the -[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration). - -#### Programmatic authentication - -To learn more about how to use programmatic authentication, see the related -documentation in the -[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#programmatic-authentication) -or in the -[Python SDK Core document](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md) about authentication. - ### Automatic retries The SDK supports a generalized retry feature that can automatically retry on common errors. @@ -286,318 +145,21 @@ The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common#configuring-re ### Code examples -The following code examples -[authenticate with the environment variables](#authentication-with-environment-variables). - -#### 1. Create a database and add a document - -**Note:** This example code assumes that `orders` database does not exist in your account. - -This example code creates `orders` database and adds a new document "example" -into it. To connect, you must set your environment variables with -the *service url*, *authentication type* and *authentication credentials* -of your Cloudant service. - -Cloudant environment variable naming starts with a *service name* prefix that identifies your service. -By default, this is `CLOUDANT`, see the settings in the -[authentication with environment variables section](#authentication-with-environment-variables). - -If you would like to rename your Cloudant service from `CLOUDANT`, -you must use your defined service name as the prefix for all Cloudant related environment variables. - -Once the environment variables are set, you can try out the code examples. - -```py -from ibm_cloud_sdk_core import ApiException -from ibmcloudant.cloudant_v1 import CloudantV1, Document - -# 1. Create a client with `CLOUDANT` default service name ============= -client = CloudantV1.new_instance() - -# 2. Create a database ================================================ -example_db_name = "orders" - -# Try to create database if it doesn't exist -try: - put_database_result = client.put_database( - db=example_db_name - ).get_result() - if put_database_result["ok"]: - print(f'"{example_db_name}" database created.') -except ApiException as ae: - if ae.status_code == 412: - print(f'Cannot create "{example_db_name}" database, ' + - 'it already exists.') - -# 3. Create a document ================================================ -# Create a document object with "example" id -example_doc_id = "example" -# Setting `id` for the document is optional when "post_document" -# function is used for CREATE. When `id` is not provided the server -# will generate one for your document. -example_document: Document = Document(id=example_doc_id) - -# Add "name" and "joined" fields to the document -example_document.name = "Bob Smith" -example_document.joined = "2019-01-24T10:42:59.000Z" - -# Save the document in the database with "post_document" function -create_document_response = client.post_document( - db=example_db_name, - document=example_document -).get_result() - -# ===================================================================== -# Note: saving the document can also be done with the "put_document" -# function. In this case `doc_id` is required for a CREATE operation: -""" -create_document_response = client.put_document( - db=example_db_name, - doc_id=example_doc_id, - document=example_document -).get_result() -""" -# ===================================================================== - -# Keeping track of the revision number of the document object -# is necessary for further UPDATE/DELETE operations: -example_document.rev = create_document_response["rev"] -print(f'You have created the document:\n{example_document}') -``` - -When you run the code, you see a result similar to the following output. - -```text -"orders" database created. -You have created the document: -{ - "_id": "example", - "_rev": "1-1b403633540686aa32d013fda9041a5d", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:99.000Z" -} -``` - -#### 2. Retrieve information from an existing database - -**Note**: This example code assumes that you have created both the `orders` -database and the `example` document by -[running the previous example code](#1-create-a-database-and-add-a-document) -successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' -database or 'example' document was not found." - -
-Gather database information example - -```py -import json - -from ibmcloudant.cloudant_v1 import CloudantV1 - -# 1. Create a client with `CLOUDANT` default service name ============ -client = CloudantV1.new_instance() - -# 2. Get server information =========================================== -server_information = client.get_server_information( -).get_result() - -print(f'Server Version: {server_information["version"]}') - -# 3. Get database information for "orders" ========================== -db_name = "orders" - -db_information = client.get_database_information( - db=db_name -).get_result() - -# 4. Show document count in database ================================== -document_count = db_information["doc_count"] - -print(f'Document count in \"{db_information["db_name"]}\" ' - f'database is {document_count}.') - -# 5. Get "example" document out of the database by document id ============ -document_example = client.get_document( - db=db_name, - doc_id="example" -).get_result() - -print(f'Document retrieved from database:\n' - f'{json.dumps(document_example, indent=2)}') -``` - -
-When you run the code, you see a result similar to the following output. - -```text -Server Version: 2.1.1 -Document count in "orders" database is 1. -Document retrieved from database: -{ - "_id": "example", - "_rev": "1-1b403633540686aa32d013fda9041a5d", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:99.000Z" -} -``` - -#### 3. Update your previously created document - -**Note**: This example code assumes that you have created both the `orders` -database and the `example` document by -[running the previous example code](#1-create-a-database-and-add-a-document) -successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders' -database or 'example' document was not found." - -
-Update code example +Quick start example to list all databases (assumes environment variable [authentication](#authentication)): ```py -import json - -from ibm_cloud_sdk_core import ApiException +# section: code from ibmcloudant.cloudant_v1 import CloudantV1 -# 1. Create a client with `CLOUDANT` default service name ============= -client = CloudantV1.new_instance() - -# 2. Update the document ============================================== -example_db_name = "orders" -example_doc_id = "example" - -# Try to get the document if it previously existed in the database -try: - document = client.get_document( - db=example_db_name, - doc_id=example_doc_id - ).get_result() - - # ================================================================= - # Note: for response byte stream use: - """ - document_as_byte_stream = client.get_document_as_stream( - db=example_db_name, - doc_id=example_doc_id - ).get_result() - """ - # ================================================================= - - # Add Bob Smith's address to the document - document["address"] = "19 Front Street, Darlington, DL5 1TY" - - # Remove the joined property from document object - if "joined" in document: - document.pop("joined") - - # Update the document in the database - update_document_response = client.post_document( - db=example_db_name, - document=document - ).get_result() - - # ================================================================= - # Note 1: for request byte stream use: - """ - update_document_response = client.post_document( - db=example_db_name, - document=document_as_byte_stream - ).get_result() - """ - # ================================================================= - - # ================================================================= - # Note 2: updating the document can also be done with the - # "put_document" function. `doc_id` and `rev` are required for an - # UPDATE operation, but `rev` can be provided in the document - # object as `_rev` too: - """ - update_document_response = client.put_document( - db=example_db_name, - doc_id=example_doc_id, # doc_id is a required parameter - rev=document["_rev"], - document=document # _rev in the document object CAN replace above `rev` parameter - ).get_result() - """ - # ================================================================= - - # Keeping track of the latest revision number of the document - # object is necessary for further UPDATE/DELETE operations: - document["_rev"] = update_document_response["rev"] - print(f'You have updated the document:\n' + - json.dumps(document, indent=2)) - -except ApiException as ae: - if ae.status_code == 404: - print('Cannot delete document because either ' + - f'"{example_db_name}" database or "{example_doc_id}" ' + - 'document was not found.') -``` - -
-When you run the code, you see a result similar to the following output. - -```text -{ - "_id": "example", - "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", - "name": "Bob Smith", - "address": "19 Front Street, Darlington, DL5 1TY" -} -``` - -#### 4. Delete your previously created document - -**Note**: This example code assumes that you have created both the `orders` -database and the `example` document by -[running the previous example code](#1-create-a-database-and-add-a-document) -successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' -database or 'example' document was not found." - -
-Delete code example - -```py -from ibm_cloud_sdk_core import ApiException -from ibmcloudant.cloudant_v1 import CloudantV1 - -# 1. Create a client with `CLOUDANT` default service name ============= -client = CloudantV1.new_instance() - -# 2. Delete the document ============================================== -example_db_name = "orders" -example_doc_id = "example" - -# Try to get the document if it previously existed in the database -try: - document = client.get_document( - db=example_db_name, - doc_id=example_doc_id - ).get_result() - - delete_document_response = client.delete_document( - db=example_db_name, - doc_id=example_doc_id, # `doc_id` is required for DELETE - rev=document["_rev"] # `rev` is required for DELETE - ).get_result() - - if delete_document_response["ok"]: - print('You have deleted the document.') - -except ApiException as ae: - if ae.status_code == 404: - print('Cannot delete document because either ' + - f'"{example_db_name}" database or "{example_doc_id}"' + - 'document was not found.') -``` +service = CloudantV1.new_instance() -
-When you run the code, you see the following output. +response = service.get_all_dbs().get_result() -```text -You have deleted the document. +print(response) ``` -#### Further code examples +[More tutorial examples](./docs/Examples.md) for creating a database +and document create, read, update and delete operations. For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#examples-for-python). @@ -622,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](#3-update-your-previously-created-document) section +The [update document](./docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -732,6 +294,7 @@ print(response) ### Further resources +- [Cloudant Python SDK feature docs](./docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -741,515 +304,6 @@ print(response) - [Cloudant blog](https://blog.cloudant.com/): Many useful articles about how to optimize Cloudant for common problems. -### Changes feed follower - -#### Introduction - -The SDK provides a changes feed follower utility. -This helper utility connects to the `_changes` endpoint and returns the individual change items. -It removes some complexity of using the `_changes` endpoint by setting some options automatically -and providing error suppression and retries. - -*Tip: the changes feed often does not meet user expectations or assumptions.* - -Consult the [Cloudant changes feed FAQ](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) -to get a better understanding of the limitations and suitable use-cases before using the changes feed in your application. - -#### Modes of operation - -There are two modes of operation: -* Start mode - * Fetches the changes from the supplied `since` sequence (in this mode follower defaults to reading the feed from `now`). - * Fetches all available changes and then continues listening for new changes indefinitely unless encountering an end condition. - * An example use case for this mode is event driven workloads. -* Start one-off mode - * Fetches the changes from the supplied `since` sequence (in this mode follower defaults to reading the feed from the beginning). - * Fetches all available changes and then stops when either there are no further changes pending or encountering an end condition. - * An example use case for this mode is ETL style workloads. - -#### Configuring the changes follower - -The SDK's model of changes feed options is also used to configure the follower. -However, a subset of the options used internally by the follower implementation are invalid. -Supplying these options when instantiating the follower causes an error. -The invalid options are: -* `descending` -* `feed` -* `heartbeat` -* `lastEventId` - use `since` instead -* `timeout` -* Follower permits only the value `_selector` for the `filter` option. This restriction is because selector - based filters perform better than JavaScript backed filters. Configuring a non-selector based filter - causes the follower to error. - -Note that the `limit` parameter terminates the follower at the given number of changes in either -operating mode. - -The changes follower requires the client to have HTTP timeouts of at least 1 minute and errors during -instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. - -For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) instead of the follower. - -#### Error suppression - -By default, the changes follower suppresses transient errors indefinitely and attempts to run to completion or listen forever as -dictated by the operating mode. -For applications where that is not desirable configure the optional error tolerance duration. This controls the time since -the last successful response that the follower suppresses transient errors. An example usage is an application grace period -before reporting an error and requiring intervention. - -There are some additional points to consider for error suppression: -* Errors considered terminal, for example, the database not existing or invalid credentials are never suppressed and error immediately. -* The error suppression duration is not guaranteed to fire immediately after lapsing and is a minimum suppression time. -* The changes follower backs-off between retries and as such may remain paused for a short while after the transient errors have resolved. -* If the underlying SDK client used to initialize the follower also has retries configured then suppression of errors may last - significantly longer than the follower's configured error tolerance duration depending on the specific options. - -#### Follower operation - -For both modes: -* The end conditions are: - * A terminal error (HTTP codes `400`, `401`, `403` `404`). - * Transient errors occur for longer than the error tolerance duration. Transient errors are all other HTTP status codes and connection errors. - * The number of changes received reaches the configured `limit`. - * The application calls stop to terminate the feed early. - -As is true for the `_changes` endpoint change items have *at least once* delivery and callers may receive -an individual item multiple times. When using the follower change items may repeat even within a limited -number of changes (that is using the `limit` option) this is a minor difference from using `limit` on the HTTP native API. - -The follower is not optimized for some use cases and it is not recommended to use it in cases where: -* Setting `include_docs` and larger document sizes (for example > 10 kiB). -* The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). - -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) -for specific control over the number of change requests made and the content size of the responses. - -#### Checkpoints - -The changes follower does not checkpoint since it has no information about whether the consuming application -has processed a change item after delivery. It is the application developer's responsibility -to store the sequence IDs to have appropriate checkpoints and to re-initialize the follower with the required -`since` value after, for example, the application restarts. - -The frequency and conditions for checkpoints are application specific and some applications may be tolerant -of dropped changes. This section provides only general guidance on how to avoid missing changes. - -To guarantee processing of all changes do not persist the sequence ID from a change item until *after* -the processing of the change item by the application has completed. As indicated previously change item -delivery is *at least once* so application code must be able to handle repeated changes already. It is -preferable to restart from an older `since` value and receive changes again than risk missing them. - -The sequence IDs are available on each change item by default. However, the server omits sequence IDs from -some change items when using the `seq_interval` configuration option. -Infrequent sequence IDs may improve performance by reducing the amount of data transfer and server load, -but the tradeoff is repeating more changes if it is necessary to resume the changes follower. - -Take extreme care persisting sequences if choosing to process change items in parallel as there -is a considerable risk of missing changes on a restart if the recorded sequence is out of order. - -#### Code examples - -##### Initializing a changes follower -```py -import ChangesFollower -from ibmcloudant.cloudant_v1 import CloudantV1 - -client = CloudantV1.new_instance() - -cf_params = { - 'db': 'example', # Required: the database name. - 'limit': 100, # Optional: return only 100 changes (including duplicates). - 'since': '3-g1AG3...' # Optional: start from this sequence ID (e.g. with a value read from persistent storage). -} - -changes_follower = ChangesFollower( - service=client, # Required: the Cloudant service client instance. - error_tolerance=10000, # Optional: suppress transient errors for at least 10 seconds before terminating. - **cf_params # Required: changes feed configuration options dict. -) -``` - -##### Starting the changes follower - -###### Start mode for continuous listening -```py -import Iterable - -from ibmcloudant import ChangesFollower -from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem - -client = CloudantV1.new_instance() - -changes_follower = ChangesFollower( - service=client, - **{'db': 'example'}) - -changes_items: Iterable[ChangesResultItem] = changes_follower.start() -# Note: iterable will not do anything until it is iterated -# Create a for loop to iterate over the flow of changes -# for changes_item in changes_items: ... -``` - -###### Start mode for one-off fetching -```py -import Iterable - -from ibmcloudant import ChangesFollower -from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem - -client = CloudantV1.new_instance() - -changes_follower = ChangesFollower( - service=client, - **{'db': 'example'}) - -changes_items: Iterable[ChangesResultItem] = changes_follower.start_one_off() -# Note: iterable will not do anything until it is iterated -# Create a for loop to iterate over the flow of changes -# for changes_item in changes_items: ... -``` - -##### Processing changes - -###### Process continuous changes -```py -import ChangesFollower -from ibmcloudant.cloudant_v1 import CloudantV1 - -client = CloudantV1.new_instance() - -# Start from a previously persisted seq -# Normally this would be read by the app from persistent storage -# e.g. previously_persisted_seq = your_app_persistence_read_func() -previously_persisted_seq = '3-g1AG3...' -changes_follower = ChangesFollower( - service=client, - **{'db': 'example', 'since': previously_persisted_seq}) - -changes_items = changes_follower.start() -for changes_item in changes_items: - # do something with changes - print(changes_item.id) - for change in changes_item.changes: - print(change.rev) - # when change item processing is complete app can store seq - seq = changes_item.seq - # write seq to persistent storage for use as since if required to resume later - # e.g. your_app_persistence_write_func(seq) - # keep processing changes until the application is terminated or some other stop condition is reached - -# Note: iterator above is blocking, code here will be unreachable -# until the iteration is stopped or another stop condition is reached. -# For long running followers careful consideration should be made of where to call stop on the iterator. -``` - -###### Process one-off changes -```py -import ChangesFollower -from ibmcloudant.cloudant_v1 import CloudantV1 - -client = CloudantV1.new_instance() - -# Start from a previously persisted seq -# Normally this would be read by the app from persistent storage -# e.g. previously_persisted_seq = your_app_persistence_read_func() -previously_persisted_seq = '3-g1AG3...' -changes_follower = ChangesFollower( - service=client, - **{'db': 'example', 'since': previously_persisted_seq}) - -changes_items = changes_follower.start_one_off() -for changes_item in changes_items: - # do something with changes - print(changes_item.id) - for change in changes_item.changes: - print(change.rev) - # when change item processing is complete app can store seq - seq = changes_item.seq - # write seq to persistent storage for use as since if required to resume later - # e.g. your_app_persistence_write_func(seq) - -# Note: iterator above is blocking, code here will be unreachable -# until all changes are processed (or another stop condition is reached). -``` - -##### Stopping the changes follower -```py -import ChangesFollower -from ibmcloudant.cloudant_v1 import CloudantV1 - -client = CloudantV1.new_instance() -changes_follower = ChangesFollower( - service=client, - **{'db': 'example'}) -changes_items = changes_follower.start() - -for changes_item in changes_items: - # Option 1: call stop after some condition - # Note that since the iterator is blocking at least one item - # must be returned from it to reach to this point. - # Additional changes may be processed before the iterator stops. - changes_follower.stop() - -# Option 2: call stop method when you want to end the continuous loop from -# outside the iterator. For example, you've put the changes follower in a -# separate thread and need to call stop on the main thread. -# Note: in this context the call must be made from a different thread because -# code immediately following the iterator is unreachable until the iterator -# has stopped. -changes_follower.stop() -``` - -### Pagination (beta) - -#### Introduction - -The pagination feature (currently beta) accepts options for a single operation and automatically -creates the multiple requests to the server necessary to page through the results a fixed number at a time. - -Pagination is a best-practice to break apart large queries into multiple server requests. -This has a number of advantages: -* Keeping requests within server imposed limits, for example - * `200` max results for text search - * `2000` max results for partitioned queries -* Fetching only the necessary data, for example - * User finds required result on first page, no need to continue fetching results -* Reducing the duration of any individual query - * Reduce risk of query timing out on the server - * Reduce risk of network request timeouts - -#### Limitations - -Limitations of pagination: -* Forward only, no backwards paging -* Limitations on `_all_docs` and `_design_docs` operations - * No pagination for `key` option. - There is no need to paginate as IDs are unique and this returns only a single row. - This is better achieved with a single document get request. - * No pagination for `keys` option. -* Limitations on `_view` operations - * No pagination for `key` option. Pass the same `key` as a start and end key instead. - * No pagination for `keys` option. - * Views that emit multiple identical keys (with the same or different values) - from the same document cannot paginate if those key rows with the same ID - span a page boundary. - The pagination feature detects this condition and an error occurs. - It may be possible to workaround using a different page size. -* Limitations on `_search` operations - * No pagination of grouped results. - * No pagination of faceted `counts` or `ranges` results. - -#### Capacity considerations - -Pagination can make many requests rapidly from a single program call. - -For IBM Cloudant take care to ensure you have appropriate plan capacity -in place to avoid consuming all the permitted requests. -If there is no remaining plan allowance and retries are not enabled or insufficient -then a `429 Too Many Requests` error occurs. - -#### Available operations - -Pagination is available for these operations: -* Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) - and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/AllDocsPagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_all_docs_pagination.py) -* Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/design_docs_pagination.py) -* Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) - and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_find_pagination.py) -* Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) - and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_search_pagination.py) -* Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) - and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_view_pagination.py) - -The examples presented in this `README` are for all documents in a partition. -The links in the list are to equivalent examples for each of the other available operations. - -#### Creating a pagination - -Make a new pagination from a client, `PagerType` for the operation -and the options for the chosen operation. -Use the `limit` option to configure the page size (default and maximum `200`). - -Imports required for these examples: - -
-Python: - -```py -from ibmcloudant import Pager, Pagination, PagerType -from ibmcloudant.cloudant_v1 import CloudantV1 -``` - -
- -##### Initialize the service - -
-Python: - -```py -# Initialize service -service = CloudantV1.new_instance() -``` - -
- -##### Set the options - -
-Python: - -```py -# Setup options -opts = { - 'db': 'events', # example database name - 'limit': 50, # limit option sets the page size - 'partition_key': 'ns1HJS13AMkK', # query only this partition -} -``` - -
- -##### Create the pagination - -
-Python: - -```py -# Create pagination -pagination = Pagination.new_pagination( - service, PagerType.POST_PARTITION_ALL_DOCS, **opts) -# pagination can be reused without side-effects as a factory for iterables or pagers -# options are fixed at pagination creation time -``` - -
- -#### Using pagination - -Once you have a pagination factory there are multiple options available. - -* Iterate pages -* Iterate rows -* Get each page from a pager -* Get all results from a pager - -All the paging styles produce equivalent results and make identical page requests. -The style of paging to choose depends on the use case requirements -in particular whether to process a page at a time or a row at a time. - -The pagination factory is reusable and can repeatedly produce new instances -of the same or different pagination styles for the same operation options. - -Here are examples for each paging style. - -##### Iterate pages - -Iterating pages is ideal for using an iterable for loop to process a page at a time. - -
-Python: - -```py -# Option: iterate pages -# Ideal for using a for loop with each page. -# Each call to pages() returns a fresh iterator that can be traversed once. -for page in pagination.pages(): - # Do something with page - pass -``` - -
- -##### Iterate rows - -Iterating rows is ideal for using an iterable for loop to process a result row at a time. - -
-Python: - -```py -# Option: iterate rows -# Ideal for using a for loop with each row. -# Each call to rows() returns a fresh iterator that can be traversed once. -for row in pagination.rows(): - # Do something with row - pass -``` - -
- -##### Pager - -The pager style is similar to other [IBM Cloud SDKs](https://github.com/IBM/ibm-cloud-sdk-common?tab=readme-ov-file#pagination). -Users familiar with that style of pagination may find using them preferable -to the native language style iterators. - -In the Cloudant SDKs these pagers are single use and traverse the complete set of pages once and only once. -After exhaustion they cannot be re-used, simply create a new one from the pagination factory if needed. - -Pagers are only valid for one of either page at a time or getting all results. -For example, calling for the next page then calling for all results causes an error. - -###### Get each page from a pager - -This is useful for calling to retrieve one page at a time, for example, -in a user interface with a "next page" interaction. - -If calling for the next page errors, it is valid to call for the next page again -to continue paging. - -
-Python: - -```py -# Option: use pager next page -# For retrieving one page at a time with a method call. -pager: Pager = pagination.pager() -if pager.has_next(): - page = pager.get_next() - # Do something with page -``` - -
- -###### Get all results from a pager - -This is useful to retrieve all results in a single call. -However, this approach requires sufficient memory for the entire collection of results. -So although it may be convenient for small result sets generally prefer iterating pages -or rows with the other paging styles, especially for large result sets. - -If calling for all the results errors, then calling for all the results again restarts the pagination. - -
-Python: - -```py -# Option: use pager all results -# For retrieving all result rows in a single list -# Note: all result rows may be very large! -# Preferably use iterables instead of get_all for memory efficiency with large result sets. -all_pager: Pager = pagination.pager() -all_rows = all_pager.get_all() -for page in all_rows: - # Do something with row - pass -``` - -
- ## Questions If you are having difficulties using this SDK or have a question about the diff --git a/docs/Authentication.md b/docs/Authentication.md new file mode 100644 index 00000000..a7295781 --- /dev/null +++ b/docs/Authentication.md @@ -0,0 +1,161 @@ +# Authentication + + +
+Table of Contents + + +- [Authenticators](#authenticators) +- [Authentication with environment variables](#authentication-with-environment-variables) + * [IAM API key authentication](#iam-api-key-authentication) + * [IAM Trusted profile (container) authentication](#iam-trusted-profile-container-authentication) + * [IAM Trusted profile (VPC) authentication](#iam-trusted-profile-vpc-authentication) + * [IAM Trusted profile (assume identity) authentication](#iam-trusted-profile-assume-identity-authentication) + * [Session cookie authentication](#session-cookie-authentication) + * [Bearer token authentication](#bearer-token-authentication) + * [Basic authentication](#basic-authentication) +- [Authentication with external configuration](#authentication-with-external-configuration) +- [Programmatic authentication](#programmatic-authentication) +
+ +## Authenticators + +This library requires credentials to authenticate with IBM Cloudant. These credentials may be: +* IBM Cloud IAM credentials (with authentication types `CONTAINER`, `VPC`, `IAMASSUME` and `IAM`) + * [IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai) user, service ID or trusted profile credentials + that have access granted to the IBM Cloud Cloudant resource instance. + * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance. +* Username and password credentials (with authentication types `COUCHDB_SESSION` and `BASIC`) + * [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`. + * IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (username and password) for instances not in IBM Cloud. + * IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys). + +| Authentication type | Recommended for | `AUTH_TYPE` | Description | +| --- | --- | --- | --- | +| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | +| IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | +| IAM Trusted Profiles ([assume identity](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-assume)) | Cloudant | `IAMASSUME` | Exchanges an IAM API key for an IAM `access_token` (same as `IAM` auth type).
Uses that initial token to obtain a second `access_token` from IAM with the assumed identity information.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | +| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-apikey) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | +| [Session cookie](#session-cookie-authentication) | [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication)
(legacy credentials & instances without IAM)

[Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication) | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.
Adds `Cookie` header and content to each HTTP request.
Automatically renews session when needed. | +| [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication)
(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization` header to each HTTP request with the bearer token.
No token management or renewal.
Also compatible with IAM access tokens managed independently of the SDK. | +| [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication)
(if cookies are not enabled) | `BASIC` | Adds an `Authorization` header to each HTTP request with the base64 encoded basic credentials. | +| [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. | + +The default authentication type for the SDK is `CONTAINER` unless supplying `APIKEY` configuration, which changes the default authentication type to `IAM`. + +## Authentication with environment variables + +The default service name is `CLOUDANT` so these examples use `CLOUDANT_` prefixed names. + +Any custom service name prefix is valid, provided it matches the name used to instantiate the SDK client +and applied to all configuration options. + +### IAM API key authentication + +For Cloudant *IAM API key authentication*, set the following environmental variables by +amending the values with your own +[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set +`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`. + +```sh +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key +``` + +### IAM Trusted profile (container) authentication + +For Cloudant *IAM Trusted profile compute resource container authentication*, set the following environmental variables, +amending with your own correct values. There is no need to set +`CLOUDANT_AUTH_TYPE` to `CONTAINER` because it is the default. + +```sh +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID +``` + +Alternatives to `CLOUDANT_IAM_PROFILE_ID`: +* `CLOUDANT_IAM_PROFILE_NAME` + +### IAM Trusted profile (VPC) authentication + +For Cloudant *IAM Trusted profile compute resource vpc authentication*, set the following environmental variables, +amending with your own correct values. + +```sh +CLOUDANT_AUTH_TYPE=VPC +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID +``` + +Alternatives to `CLOUDANT_IAM_PROFILE_ID`: +* `CLOUDANT_IAM_PROFILE_CRN` +* No profile information (uses the default trusted profile linked to the compute resource) + +### IAM Trusted profile (assume identity) authentication + +For Cloudant *IAM Trusted profile assume authentication*, set the following environmental variables, +amending with your own correct values. + +```sh +CLOUDANT_AUTH_TYPE=IAMASSUME +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID +``` + +Alternatives to `CLOUDANT_IAM_PROFILE_ID`: +* `CLOUDANT_IAM_PROFILE_CRN` +* `CLOUDANT_IAM_PROFILE_NAME` *and* `CLOUDANT_IAM_ACCOUNT_ID` (ID of the account that contains the named trusted profile) + +### Session cookie authentication + +For `COUCHDB_SESSION` authentication, set the following environmental variables +amending with your own [service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). + +```sh +CLOUDANT_AUTH_TYPE=COUCHDB_SESSION +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_USERNAME=username # replace with your Cloudant legacy username +CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM) +``` + +### Bearer token authentication + +Preferably use IAM authentication methods to automatically manage bearer tokens. + +For *bearer token authentication*, set the following environmental variables, +amending with your own correct values. + +```sh +CLOUDANT_AUTH_TYPE=BEARERTOKEN +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_BEARER_TOKEN=A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c # replace with your bearer token +``` + +### Basic authentication + +Preferably use [session cookie authentication](#session-cookie-authentication) instead. + +To use *basic HTTP authentication* set the following environmental variables, +amending with your own correct values. + +```sh +CLOUDANT_AUTH_TYPE=BASIC +CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_USERNAME=username # replace with your Cloudant legacy username +CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM) +``` + +## Authentication with external configuration + +For more information about using an external configuration file, see the related documentation in +[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#authentication-with-external-configuration), +or the +[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration). + +## Programmatic authentication + +To learn more about how to use programmatic authentication, see the related +documentation in the +[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#programmatic-authentication) +or in the +[Python SDK Core document](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md) about authentication. diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md new file mode 100644 index 00000000..792f7069 --- /dev/null +++ b/docs/Changes_Follower.md @@ -0,0 +1,281 @@ +# Changes feed follower + +
+Table of Contents + + +- [Introduction](#introduction) +- [Modes of operation](#modes-of-operation) +- [Configuring the changes follower](#configuring-the-changes-follower) +- [Error suppression](#error-suppression) +- [Follower operation](#follower-operation) +- [Checkpoints](#checkpoints) +- [Code examples](#code-examples) + * [Initializing a changes follower](#initializing-a-changes-follower) + * [Starting the changes follower](#starting-the-changes-follower) + + [Start mode for continuous listening](#start-mode-for-continuous-listening) + + [Start mode for one-off fetching](#start-mode-for-one-off-fetching) + * [Processing changes](#processing-changes) + + [Process continuous changes](#process-continuous-changes) + + [Process one-off changes](#process-one-off-changes) + * [Stopping the changes follower](#stopping-the-changes-follower) +
+ +## Introduction + +The SDK provides a changes feed follower utility. +This helper utility connects to the `_changes` endpoint and returns the individual change items. +It removes some complexity of using the `_changes` endpoint by setting some options automatically +and providing error suppression and retries. + +*Tip: the changes feed often does not meet user expectations or assumptions.* + +Consult the [Cloudant changes feed FAQ](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) +to get a better understanding of the limitations and suitable use-cases before using the changes feed in your application. + +## Modes of operation + +There are two modes of operation: +* Start mode + * Fetches the changes from the supplied `since` sequence (in this mode follower defaults to reading the feed from `now`). + * Fetches all available changes and then continues listening for new changes indefinitely unless encountering an end condition. + * An example use case for this mode is event driven workloads. +* Start one-off mode + * Fetches the changes from the supplied `since` sequence (in this mode follower defaults to reading the feed from the beginning). + * Fetches all available changes and then stops when either there are no further changes pending or encountering an end condition. + * An example use case for this mode is ETL style workloads. + +## Configuring the changes follower + +The SDK's model of changes feed options is also used to configure the follower. +However, it is invalid to configure some options used internally by the follower implementation. +Supplying these options when instantiating the follower causes an error. +The invalid options are: +* `descending` +* `feed` +* `heartbeat` +* `lastEventId` - use `since` instead +* `timeout` +* Follower permits only the value of `_selector` for the `filter` option. This restriction is because selector + based filters perform better than JavaScript backed filters. Configuring a non-selector based filter + causes the follower to error. + +Note that the `limit` parameter terminates the follower at the given number of changes in either +operating mode. + +The changes follower requires the client to have HTTP timeouts of at least 1 minute and errors during +instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. + +For use-cases where these configuration limitations are too restrictive then write code to use the SDK's +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) instead of the follower. + +## Error suppression + +By default, the changes follower suppresses transient errors indefinitely and attempts to run to completion or listen forever as +dictated by the operating mode. +For applications where that is not desirable configure the optional error tolerance duration. This controls the time since +the last successful response that the follower suppresses transient errors. An example usage is an application grace period +before reporting an error and requiring intervention. + +There are some additional points to consider for error suppression: +* Errors considered terminal, for example, the database not existing or invalid credentials are never suppressed and error immediately. +* The error suppression duration is not guaranteed to fire immediately after lapsing and is a minimum suppression time. +* The changes follower backs-off between retries and as such may remain paused for a short while after the transient errors have resolved. +* If the underlying SDK client used to initialize the follower also has retries configured then suppression of errors may last + significantly longer than the follower's configured error tolerance duration depending on the specific options. + +## Follower operation + +For both modes: +* The end conditions are: + * A terminal error (HTTP codes `400`, `401`, `403` `404`). + * Transient errors occur for longer than the error tolerance duration. Transient errors are all other HTTP status codes and connection errors. + * The number of changes received reaches the configured `limit`. + * The application calls stop to terminate the feed early. + +As is true for the `_changes` endpoint change items have *at least once* delivery and callers may receive +an individual item multiple times. When using the follower change items may repeat even within a limited +number of changes (that is using the `limit` option) this is a minor difference from using `limit` on the HTTP native API. + +The follower is not optimized for some use cases and it is not recommended to use it in cases where: +* Setting `include_docs` and larger document sizes (for example > 10 kiB). +* The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). + +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) +for specific control over the number of change requests made and the content size of the responses. + +## Checkpoints + +The changes follower does not checkpoint since it has no information about whether the consuming application +has processed a change item after delivery. It is the application developer's responsibility +to store the sequence IDs to have appropriate checkpoints and to re-initialize the follower with the required +`since` value after, for example, the application restarts. + +The frequency and conditions for checkpoints are application specific and some applications may be tolerant +of dropped changes. This section provides only general guidance on how to avoid missing changes. + +To guarantee processing of all changes do not persist the sequence ID from a change item until *after* +the processing of the change item by the application has completed. As indicated previously change item +delivery is *at least once* so application code must be able to handle repeated changes already. It is +preferable to restart from an older `since` value and receive changes again than risk missing them. + +The sequence IDs are available on each change item by default. However, the server omits sequence IDs from +some change items when using the `seq_interval` configuration option. +Infrequent sequence IDs may improve performance by reducing the amount of data transfer and server load, +but the tradeoff is repeating more changes if it is necessary to resume the changes follower. + +Take extreme care persisting sequences if choosing to process change items in parallel as there +is a considerable risk of missing changes on a restart if the recorded sequence is out of order. + +## Code examples + +### Initializing a changes follower +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +cf_params = { + 'db': 'example', # Required: the database name. + 'limit': 100, # Optional: return only 100 changes (including duplicates). + 'since': '3-g1AG3...' # Optional: start from this sequence ID (e.g. with a value read from persistent storage). +} + +changes_follower = ChangesFollower( + service=client, # Required: the Cloudant service client instance. + error_tolerance=10000, # Optional: suppress transient errors for at least 10 seconds before terminating. + **cf_params # Required: changes feed configuration options dict. +) +``` + +### Starting the changes follower + +#### Start mode for continuous listening +```py +import Iterable + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem + +client = CloudantV1.new_instance() + +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) + +changes_items: Iterable[ChangesResultItem] = changes_follower.start() +# Note: iterable will not do anything until it is iterated +# Create a for loop to iterate over the flow of changes +# for changes_item in changes_items: ... +``` + +#### Start mode for one-off fetching +```py +import Iterable + +from ibmcloudant import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1, ChangesResultItem + +client = CloudantV1.new_instance() + +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) + +changes_items: Iterable[ChangesResultItem] = changes_follower.start_one_off() +# Note: iterable will not do anything until it is iterated +# Create a for loop to iterate over the flow of changes +# for changes_item in changes_items: ... +``` + +### Processing changes + +#### Process continuous changes +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +# Start from a previously persisted seq +# Normally this would be read by the app from persistent storage +# e.g. previously_persisted_seq = your_app_persistence_read_func() +previously_persisted_seq = '3-g1AG3...' +changes_follower = ChangesFollower( + service=client, + **{'db': 'example', 'since': previously_persisted_seq}) + +changes_items = changes_follower.start() +for changes_item in changes_items: + # do something with changes + print(changes_item.id) + for change in changes_item.changes: + print(change.rev) + # when change item processing is complete app can store seq + seq = changes_item.seq + # write seq to persistent storage for use as since if required to resume later + # e.g. your_app_persistence_write_func(seq) + # keep processing changes until the application is terminated or some other stop condition is reached + +# Note: iterator above is blocking, code here will be unreachable +# until the iteration is stopped or another stop condition is reached. +# For long running followers careful consideration should be made of where to call stop on the iterator. +``` + +#### Process one-off changes +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() + +# Start from a previously persisted seq +# Normally this would be read by the app from persistent storage +# e.g. previously_persisted_seq = your_app_persistence_read_func() +previously_persisted_seq = '3-g1AG3...' +changes_follower = ChangesFollower( + service=client, + **{'db': 'example', 'since': previously_persisted_seq}) + +changes_items = changes_follower.start_one_off() +for changes_item in changes_items: + # do something with changes + print(changes_item.id) + for change in changes_item.changes: + print(change.rev) + # when change item processing is complete app can store seq + seq = changes_item.seq + # write seq to persistent storage for use as since if required to resume later + # e.g. your_app_persistence_write_func(seq) + +# Note: iterator above is blocking, code here will be unreachable +# until all changes are processed (or another stop condition is reached). +``` + +### Stopping the changes follower +```py +import ChangesFollower +from ibmcloudant.cloudant_v1 import CloudantV1 + +client = CloudantV1.new_instance() +changes_follower = ChangesFollower( + service=client, + **{'db': 'example'}) +changes_items = changes_follower.start() + +for changes_item in changes_items: + # Option 1: call stop after some condition + # Note that since the iterator is blocking at least one item + # must be returned from it to reach to this point. + # Additional changes may be processed before the iterator stops. + changes_follower.stop() + +# Option 2: call stop method when you want to end the continuous loop from +# outside the iterator. For example, you've put the changes follower in a +# separate thread and need to call stop on the main thread. +# Note: in this context the call must be made from a different thread because +# code immediately following the iterator is unreachable until the iterator +# has stopped. +changes_follower.stop() +``` diff --git a/docs/Examples.md b/docs/Examples.md new file mode 100644 index 00000000..2018aef1 --- /dev/null +++ b/docs/Examples.md @@ -0,0 +1,327 @@ +# Code examples + +
+Table of Contents + + +- [1. Create a database and add a document](#1-create-a-database-and-add-a-document) +- [2. Retrieve information from an existing database](#2-retrieve-information-from-an-existing-database) +- [3. Update your previously created document](#3-update-your-previously-created-document) +- [4. Delete your previously created document](#4-delete-your-previously-created-document) +- [Further code examples](#further-code-examples) +
+ +The following code examples +[authenticate with the environment variables](Authentication.md#authentication-with-environment-variables). + +## 1. Create a database and add a document + +**Note:** This example code assumes that `orders` database does not exist in your account. + +This example code creates `orders` database and adds a new document "example" +into it. To connect, you must set your environment variables with +the *service url*, *authentication type* and *authentication credentials* +of your Cloudant service. + +Cloudant environment variable naming starts with a *service name* prefix that identifies your service. +By default, this is `CLOUDANT`, see the settings in the +[authentication with environment variables section](Authentication.md#authentication-with-environment-variables). + +If you would like to rename your Cloudant service from `CLOUDANT`, +you must use your defined service name as the prefix for all Cloudant related environment variables. + +Once the environment variables are set, you can try out the code examples. + +```py +from ibm_cloud_sdk_core import ApiException +from ibmcloudant.cloudant_v1 import CloudantV1, Document + +# 1. Create a client with `CLOUDANT` default service name ============= +client = CloudantV1.new_instance() + +# 2. Create a database ================================================ +example_db_name = "orders" + +# Try to create database if it doesn't exist +try: + put_database_result = client.put_database( + db=example_db_name + ).get_result() + if put_database_result["ok"]: + print(f'"{example_db_name}" database created.') +except ApiException as ae: + if ae.status_code == 412: + print(f'Cannot create "{example_db_name}" database, ' + + 'it already exists.') + +# 3. Create a document ================================================ +# Create a document object with "example" id +example_doc_id = "example" +# Setting `id` for the document is optional when "post_document" +# function is used for CREATE. When `id` is not provided the server +# will generate one for your document. +example_document: Document = Document(id=example_doc_id) + +# Add "name" and "joined" fields to the document +example_document.name = "Bob Smith" +example_document.joined = "2019-01-24T10:42:59.000Z" + +# Save the document in the database with "post_document" function +create_document_response = client.post_document( + db=example_db_name, + document=example_document +).get_result() + +# ===================================================================== +# Note: saving the document can also be done with the "put_document" +# function. In this case `doc_id` is required for a CREATE operation: +""" +create_document_response = client.put_document( + db=example_db_name, + doc_id=example_doc_id, + document=example_document +).get_result() +""" +# ===================================================================== + +# Keeping track of the revision number of the document object +# is necessary for further UPDATE/DELETE operations: +example_document.rev = create_document_response["rev"] +print(f'You have created the document:\n{example_document}') +``` + +When you run the code, you see a result similar to the following output. + +```text +"orders" database created. +You have created the document: +{ + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:99.000Z" +} +``` + +## 2. Retrieve information from an existing database + +**Note**: This example code assumes that you have created both the `orders` +database and the `example` document by +[running the previous example code](#1-create-a-database-and-add-a-document) +successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' +database or 'example' document was not found." + +
+Gather database information example + +```py +import json + +from ibmcloudant.cloudant_v1 import CloudantV1 + +# 1. Create a client with `CLOUDANT` default service name ============ +client = CloudantV1.new_instance() + +# 2. Get server information =========================================== +server_information = client.get_server_information( +).get_result() + +print(f'Server Version: {server_information["version"]}') + +# 3. Get database information for "orders" ========================== +db_name = "orders" + +db_information = client.get_database_information( + db=db_name +).get_result() + +# 4. Show document count in database ================================== +document_count = db_information["doc_count"] + +print(f'Document count in \"{db_information["db_name"]}\" ' + f'database is {document_count}.') + +# 5. Get "example" document out of the database by document id ============ +document_example = client.get_document( + db=db_name, + doc_id="example" +).get_result() + +print(f'Document retrieved from database:\n' + f'{json.dumps(document_example, indent=2)}') +``` + +
+When you run the code, you see a result similar to the following output. + +```text +Server Version: 2.1.1 +Document count in "orders" database is 1. +Document retrieved from database: +{ + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:99.000Z" +} +``` + +## 3. Update your previously created document + +**Note**: This example code assumes that you have created both the `orders` +database and the `example` document by +[running the previous example code](#1-create-a-database-and-add-a-document) +successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders' +database or 'example' document was not found." + +
+Update code example + +```py +import json + +from ibm_cloud_sdk_core import ApiException +from ibmcloudant.cloudant_v1 import CloudantV1 + +# 1. Create a client with `CLOUDANT` default service name ============= +client = CloudantV1.new_instance() + +# 2. Update the document ============================================== +example_db_name = "orders" +example_doc_id = "example" + +# Try to get the document if it previously existed in the database +try: + document = client.get_document( + db=example_db_name, + doc_id=example_doc_id + ).get_result() + + # ================================================================= + # Note: for response byte stream use: + """ + document_as_byte_stream = client.get_document_as_stream( + db=example_db_name, + doc_id=example_doc_id + ).get_result() + """ + # ================================================================= + + # Add Bob Smith's address to the document + document["address"] = "19 Front Street, Darlington, DL5 1TY" + + # Remove the joined property from document object + if "joined" in document: + document.pop("joined") + + # Update the document in the database + update_document_response = client.post_document( + db=example_db_name, + document=document + ).get_result() + + # ================================================================= + # Note 1: for request byte stream use: + """ + update_document_response = client.post_document( + db=example_db_name, + document=document_as_byte_stream + ).get_result() + """ + # ================================================================= + + # ================================================================= + # Note 2: updating the document can also be done with the + # "put_document" function. `doc_id` and `rev` are required for an + # UPDATE operation, but `rev` can be provided in the document + # object as `_rev` too: + """ + update_document_response = client.put_document( + db=example_db_name, + doc_id=example_doc_id, # doc_id is a required parameter + rev=document["_rev"], + document=document # _rev in the document object CAN replace above `rev` parameter + ).get_result() + """ + # ================================================================= + + # Keeping track of the latest revision number of the document + # object is necessary for further UPDATE/DELETE operations: + document["_rev"] = update_document_response["rev"] + print(f'You have updated the document:\n' + + json.dumps(document, indent=2)) + +except ApiException as ae: + if ae.status_code == 404: + print('Cannot delete document because either ' + + f'"{example_db_name}" database or "{example_doc_id}" ' + + 'document was not found.') +``` + +
+When you run the code, you see a result similar to the following output. + +```text +{ + "_id": "example", + "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", + "name": "Bob Smith", + "address": "19 Front Street, Darlington, DL5 1TY" +} +``` + +## 4. Delete your previously created document + +**Note**: This example code assumes that you have created both the `orders` +database and the `example` document by +[running the previous example code](#1-create-a-database-and-add-a-document) +successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' +database or 'example' document was not found." + +
+Delete code example + +```py +from ibm_cloud_sdk_core import ApiException +from ibmcloudant.cloudant_v1 import CloudantV1 + +# 1. Create a client with `CLOUDANT` default service name ============= +client = CloudantV1.new_instance() + +# 2. Delete the document ============================================== +example_db_name = "orders" +example_doc_id = "example" + +# Try to get the document if it previously existed in the database +try: + document = client.get_document( + db=example_db_name, + doc_id=example_doc_id + ).get_result() + + delete_document_response = client.delete_document( + db=example_db_name, + doc_id=example_doc_id, # `doc_id` is required for DELETE + rev=document["_rev"] # `rev` is required for DELETE + ).get_result() + + if delete_document_response["ok"]: + print('You have deleted the document.') + +except ApiException as ae: + if ae.status_code == 404: + print('Cannot delete document because either ' + + f'"{example_db_name}" database or "{example_doc_id}"' + + 'document was not found.') +``` + +
+When you run the code, you see the following output. + +```text +You have deleted the document. +``` + +## Further code examples + +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md new file mode 100644 index 00000000..c4a96469 --- /dev/null +++ b/docs/Pagination.md @@ -0,0 +1,267 @@ +# Pagination + +
+Table of Contents + + +- [Introduction](#introduction) +- [Limitations](#limitations) +- [Capacity considerations](#capacity-considerations) +- [Available operations](#available-operations) +- [Creating a pagination](#creating-a-pagination) + * [Initialize the service](#initialize-the-service) + * [Set the options](#set-the-options) + * [Create the pagination](#create-the-pagination) +- [Using pagination](#using-pagination) + * [Iterate pages](#iterate-pages) + * [Iterate rows](#iterate-rows) + * [Pager](#pager) + + [Get each page from a pager](#get-each-page-from-a-pager) + + [Get all results from a pager](#get-all-results-from-a-pager) +
+ +## Introduction + +The pagination feature (currently beta) accepts options for a single operation and automatically +creates the multiple requests to the server necessary to page through the results a fixed number at a time. + +Pagination is a best-practice to break apart large queries into multiple server requests. +This has a number of advantages: +* Keeping requests within server imposed limits, for example + * `200` max results for text search + * `2000` max results for partitioned queries +* Fetching only the necessary data, for example + * User finds required result on first page, no need to continue fetching results +* Reducing the duration of any individual query + * Reduce risk of query timing out on the server + * Reduce risk of network request timeouts + +## Limitations + +Limitations of pagination: +* Forward only, no backwards paging +* Limitations on `_all_docs` and `_design_docs` operations + * No pagination for `key` option. + There is no need to paginate as IDs are unique and this returns only a single row. + This is better achieved with a single document get request. + * No pagination for `keys` option. +* Limitations on `_view` operations + * No pagination for `key` option. Pass the same `key` as a start and end key instead. + * No pagination for `keys` option. + * Views that emit multiple identical keys (with the same or different values) + from the same document cannot paginate if those key rows with the same ID + span a page boundary. + The pagination feature detects this condition and an error occurs. + It may be possible to workaround using a different page size. +* Limitations on `_search` operations + * No pagination of grouped results. + * No pagination of faceted `counts` or `ranges` results. + +## Capacity considerations + +Pagination can make many requests rapidly from a single program call. + +For IBM Cloudant take care to ensure you have appropriate plan capacity +in place to avoid consuming all the permitted requests. +If there is no remaining plan allowance and retries are not enabled or insufficient +then a `429 Too Many Requests` error occurs. + +## Available operations + +Pagination is available for these operations: +* Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/AllDocsPagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_all_docs_pagination.py) +* Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/design_docs_pagination.py) +* Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_find_pagination.py) +* Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_search_pagination.py) +* Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) + and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_view_pagination.py) + +The examples presented in this `README` are for all documents in a partition. +The links in the list are to equivalent examples for each of the other available operations. + +## Creating a pagination + +Make a new pagination from a client, `PagerType` for the operation +and the options for the chosen operation. +Use the `limit` option to configure the page size (default and maximum `200`). + +Imports required for these examples: + +
+Python: + +```py +from ibmcloudant import Pager, Pagination, PagerType +from ibmcloudant.cloudant_v1 import CloudantV1 +``` + +
+ +### Initialize the service + +
+Python: + +```py +# Initialize service +service = CloudantV1.new_instance() +``` + +
+ +### Set the options + +
+Python: + +```py +# Setup options +opts = { + 'db': 'events', # example database name + 'limit': 50, # limit option sets the page size + 'partition_key': 'ns1HJS13AMkK', # query only this partition +} +``` + +
+ +### Create the pagination + +
+Python: + +```py +# Create pagination +pagination = Pagination.new_pagination( + service, PagerType.POST_PARTITION_ALL_DOCS, **opts) +# pagination can be reused without side-effects as a factory for iterables or pagers +# options are fixed at pagination creation time +``` + +
+ +## Using pagination + +Once you have a pagination factory there are multiple options available. + +* Iterate pages +* Iterate rows +* Get each page from a pager +* Get all results from a pager + +All the paging styles produce equivalent results and make identical page requests. +The style of paging to choose depends on the use case requirements +in particular whether to process a page at a time or a row at a time. + +The pagination factory is reusable and can repeatedly produce new instances +of the same or different pagination styles for the same operation options. + +Here are examples for each paging style. + +### Iterate pages + +Iterating pages is ideal for using an iterable for loop to process a page at a time. + +
+Python: + +```py +# Option: iterate pages +# Ideal for using a for loop with each page. +# Each call to pages() returns a fresh iterator that can be traversed once. +for page in pagination.pages(): + # Do something with page + pass +``` + +
+ +### Iterate rows + +Iterating rows is ideal for using an iterable for loop to process a result row at a time. + +
+Python: + +```py +# Option: iterate rows +# Ideal for using a for loop with each row. +# Each call to rows() returns a fresh iterator that can be traversed once. +for row in pagination.rows(): + # Do something with row + pass +``` + +
+ +### Pager + +The pager style is similar to other [IBM Cloud SDKs](https://github.com/IBM/ibm-cloud-sdk-common?tab=readme-ov-file#pagination). +Users familiar with that style of pagination may find using them preferable +to the native language style iterators. + +In the Cloudant SDKs these pagers are single use and traverse the complete set of pages once and only once. +After exhaustion they cannot be re-used, simply create a new one from the pagination factory if needed. + +Pagers are only valid for one of either page at a time or getting all results. +For example, calling for the next page then calling for all results causes an error. + +#### Get each page from a pager + +This is useful for calling to retrieve one page at a time, for example, +in a user interface with a "next page" interaction. + +If calling for the next page errors, it is valid to call for the next page again +to continue paging. + +
+Python: + +```py +# Option: use pager next page +# For retrieving one page at a time with a method call. +pager: Pager = pagination.pager() +if pager.has_next(): + page = pager.get_next() + # Do something with page +``` + +
+ +#### Get all results from a pager + +This is useful to retrieve all results in a single call. +However, this approach requires sufficient memory for the entire collection of results. +So although it may be convenient for small result sets generally prefer iterating pages +or rows with the other paging styles, especially for large result sets. + +If calling for all the results errors, then calling for all the results again restarts the pagination. + +
+Python: + +```py +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. +all_pager: Pager = pagination.pager() +all_rows = all_pager.get_all() +for page in all_rows: + # Do something with row + pass +``` + +
diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..b047e288 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,11 @@ +# IBM Cloudant Python SDK Version 0.10.5 Detailed Documentation + +## Table of Contents + +### [Authentication](Authentication.md) + +### [Changes Follower](Changes_Follower.md) + +### [Examples](Examples.md) + +### [Pagination](Pagination.md) From efdc6e7e201baf6a238d2eac72b343f4dcef6a1a Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 15 Aug 2025 11:15:45 +0100 Subject: [PATCH 513/669] chore: update secrets baseline --- .secrets.baseline | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 040b9a95..1ec428be 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "^.secrets.baseline$", "lines": "(?i)^\\s*\"(?:transaction|x-couch-request|x-request)-id\": \"[^\"]+\",?$|^\\s*\"(?:last_|update_|purge_|checkpointed_source_|source_|through_)?seq\": \"[^\"]+\",?$|^\\s*\"(?:doc_)?id\": \"[^\"]+\",?$|^\\s*\"(?:signature|name|uuid)\": \"[^\"]+\",?$" }, - "generated_at": "2025-07-15T14:37:41Z", + "generated_at": "2025-08-15T10:14:15Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -82,17 +82,27 @@ "hashed_secret": "bb589d0621e5472f470fa3425a234c74b1e202e8", "is_secret": false, "is_verified": false, - "line_number": 309, + "line_number": 325, "type": "Secret Keyword", "verified_result": null } ], "README.md": [ { - "hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed", + "hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a", "is_secret": false, "is_verified": false, - "line_number": 199, + "line_number": 122, + "type": "Secret Keyword", + "verified_result": null + } + ], + "docs/Authentication.md": [ + { + "hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a", + "is_secret": false, + "is_verified": false, + "line_number": 62, "type": "Secret Keyword", "verified_result": null } From a04a6ce51b53464d25dc99675e81e9696ee96889 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 01:47:42 +0000 Subject: [PATCH 514/669] build(deps): Bump github/codeql-action from 3.29.8 to 3.29.10 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.8 to 3.29.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/76621b61decf072c1cee8dd1ce2d2a82d33c17ed...96f518a34f7a870018057716cc4d7a5c014bd61c) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 395416e1..3d1c1ad0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 + uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 + uses: github/codeql-action/autobuild@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5 + uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5 with: category: "/language:${{matrix.language}}" From c7ad0ac48e3371c348d964f4649ec43cf41fa194 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 12:46:52 +0000 Subject: [PATCH 515/669] build(deps-dev): Bump coverage from 7.10.3 to 7.10.4 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.3 to 7.10.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.3...7.10.4) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.4 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 62c0d3d1..3ea7fa52 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.8 # code coverage -coverage==7.10.3 +coverage==7.10.4 pytest-cov==6.2.1 From 23bf641f818f865053dce6eeff11accaf463bda3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:55:42 +0000 Subject: [PATCH 516/669] feat(generated): update generator to 3.107.1 Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version adbff72 --- ibmcloudant/cloudant_v1.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 01c51570..af92973a 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -13915,7 +13915,7 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': if (conflicts := _dict.get('conflicts')) is not None: args['conflicts'] = conflicts else: - raise ValueError('Required property \'conflicts\' not present in ExplainResultMrArgs JSON') + args['conflicts'] = None if (direction := _dict.get('direction')) is not None: args['direction'] = direction else: @@ -13923,7 +13923,7 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': if (end_key := _dict.get('end_key')) is not None: args['end_key'] = end_key else: - raise ValueError('Required property \'end_key\' not present in ExplainResultMrArgs JSON') + args['end_key'] = None if (include_docs := _dict.get('include_docs')) is not None: args['include_docs'] = include_docs else: @@ -13931,7 +13931,7 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': if (partition := _dict.get('partition')) is not None: args['partition'] = partition else: - raise ValueError('Required property \'partition\' not present in ExplainResultMrArgs JSON') + args['partition'] = None if (reduce := _dict.get('reduce')) is not None: args['reduce'] = reduce else: @@ -13945,7 +13945,7 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResultMrArgs': if (update := _dict.get('update')) is not None: args['update'] = update else: - raise ValueError('Required property \'update\' not present in ExplainResultMrArgs JSON') + args['update'] = None if (view_type := _dict.get('view_type')) is not None: args['view_type'] = view_type else: @@ -14131,7 +14131,7 @@ def from_dict(cls, _dict: Dict) -> 'ExplainResultOpts': if (sort := _dict.get('sort')) is not None: args['sort'] = sort else: - raise ValueError('Required property \'sort\' not present in ExplainResultOpts JSON') + args['sort'] = None if (stable := _dict.get('stable')) is not None: args['stable'] = stable else: @@ -14347,7 +14347,7 @@ def from_dict(cls, _dict: Dict) -> 'IndexAnalysis': if (covering := _dict.get('covering')) is not None: args['covering'] = covering else: - raise ValueError('Required property \'covering\' not present in IndexAnalysis JSON') + args['covering'] = None if (ranking := _dict.get('ranking')) is not None: args['ranking'] = ranking else: @@ -14990,7 +14990,7 @@ def from_dict(cls, _dict: Dict) -> 'IndexInformation': if (ddoc := _dict.get('ddoc')) is not None: args['ddoc'] = ddoc else: - raise ValueError('Required property \'ddoc\' not present in IndexInformation JSON') + args['ddoc'] = None if (def_ := _dict.get('def')) is not None: args['def_'] = IndexDefinition.from_dict(def_) else: @@ -17157,11 +17157,11 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerDocument': if (id := _dict.get('id')) is not None: args['id'] = id else: - raise ValueError('Required property \'id\' not present in SchedulerDocument JSON') + args['id'] = None if (info := _dict.get('info')) is not None: args['info'] = SchedulerInfo.from_dict(info) else: - raise ValueError('Required property \'info\' not present in SchedulerDocument JSON') + args['info'] = None if (last_updated := _dict.get('last_updated')) is not None: args['last_updated'] = string_to_datetime(last_updated) else: @@ -17494,7 +17494,7 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerJob': if (info := _dict.get('info')) is not None: args['info'] = SchedulerInfo.from_dict(info) else: - raise ValueError('Required property \'info\' not present in SchedulerJob JSON') + args['info'] = None if (node := _dict.get('node')) is not None: args['node'] = node else: @@ -17502,7 +17502,7 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerJob': if (pid := _dict.get('pid')) is not None: args['pid'] = pid else: - raise ValueError('Required property \'pid\' not present in SchedulerJob JSON') + args['pid'] = None if (source := _dict.get('source')) is not None: args['source'] = source else: @@ -17518,7 +17518,7 @@ def from_dict(cls, _dict: Dict) -> 'SchedulerJob': if (user := _dict.get('user')) is not None: args['user'] = user else: - raise ValueError('Required property \'user\' not present in SchedulerJob JSON') + args['user'] = None return cls(**args) @classmethod @@ -19579,7 +19579,7 @@ def from_dict(cls, _dict: Dict) -> 'UserContext': if (name := _dict.get('name')) is not None: args['name'] = name else: - raise ValueError('Required property \'name\' not present in UserContext JSON') + args['name'] = None if (roles := _dict.get('roles')) is not None: args['roles'] = roles else: @@ -20221,11 +20221,11 @@ def from_dict(cls, _dict: Dict) -> 'ViewResultRow': if (key := _dict.get('key')) is not None: args['key'] = key else: - raise ValueError('Required property \'key\' not present in ViewResultRow JSON') + args['key'] = None if (value := _dict.get('value')) is not None: args['value'] = value else: - raise ValueError('Required property \'value\' not present in ViewResultRow JSON') + args['value'] = None return cls(**args) @classmethod From 18ddd3a3a3da9b86314d2715f08887a7b38735bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 07:34:10 +0000 Subject: [PATCH 517/669] build(deps-dev): Bump coverage from 7.10.4 to 7.10.5 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.4 to 7.10.5. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.4...7.10.5) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3ea7fa52..7f5c33ac 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.8 # code coverage -coverage==7.10.4 +coverage==7.10.5 pytest-cov==6.2.1 From e426288c3fe6d2ce9965a526ef9e558f8cea4536 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 07:05:30 +0000 Subject: [PATCH 518/669] build(deps): Bump github/codeql-action from 3.29.10 to 3.29.11 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.10 to 3.29.11. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/96f518a34f7a870018057716cc4d7a5c014bd61c...3c3833e0f8c1c83d449a7478aa59c036a9165498) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.29.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3d1c1ad0..eab47045 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5 + uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5 + uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5 + uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5 with: category: "/language:${{matrix.language}}" From 9aceca007cbea108b6e90fa664424c7b10be663c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 27 Aug 2025 09:06:43 +0000 Subject: [PATCH 519/669] Update version 0.10.5 -> 0.10.6 --- .bumpversion.toml | 2 +- README.md | 14 +++++++------- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 6c477d39..307e5000 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.5" +current_version = "0.10.6" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 1f39bb4f..c0e1286f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.5 +# IBM Cloudant Python SDK Version 0.10.6 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.5" +pip install --upgrade "ibmcloudant>=0.10.6" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.5" +easy_install --upgrade "ibmcloudant>=0.10.6" ``` ## Using the SDK @@ -161,7 +161,7 @@ print(response) [More tutorial examples](./docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#examples-for-python). ### Error handling @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/LICENSE). diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index b2a50104..78565dca 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.5' +__version__ = '0.10.6' diff --git a/pyproject.toml b/pyproject.toml index 6162f600..d99aba62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.5" +version = "0.10.6" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 0fee4cbc0ef3b16f1e3ce3a5407f12b2780686c3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:48:00 +0000 Subject: [PATCH 520/669] docs(generated): link to current release tag docs folder Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version ba36195 --- README.md | 18 +++++++++--------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c0e1286f..e807f3d3 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](./docs/Changes_Follower.md) -- Built-in [Pagination](./docs/Pagination.md) (beta) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](./docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](./docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](./docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](./docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,7 +158,7 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](./docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Examples.md) for creating a database and document create, read, update and delete operations. For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#examples-for-python). @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](./docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](./docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index 792f7069..cb9b0b55 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index 2018aef1..15f08d66 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -324,4 +324,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index c4a96469..42a64a7e 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/AllDocsPagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/AllDocsPagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.5/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index b047e288..721593d7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.10.5 Detailed Documentation +# IBM Cloudant Python SDK Version 0.10.6 Detailed Documentation ## Table of Contents From 18f1d526c2119bf003b2b63601b96ba640feaad8 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 28 Aug 2025 14:28:02 +0100 Subject: [PATCH 521/669] ci: configure version bump for docs sub-folder --- .bumpversion.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.bumpversion.toml b/.bumpversion.toml index 307e5000..141e7abf 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -28,3 +28,9 @@ replace = "version = \"{new_version}\"" filename = "README.md" search = "{current_version}" replace = "{new_version}" + +[[tool.bumpversion.files]] +glob = "docs/*.md" +ignore_missing_version = true +search = "{current_version}" +replace = "{new_version}" From 1a4884b3e9f46eb642ae7db338ba02c68b79c5c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 17:02:37 +0000 Subject: [PATCH 522/669] build(deps-dev): Bump coverage from 7.10.5 to 7.10.6 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.5 to 7.10.6. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.5...7.10.6) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.6 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7f5c33ac..3b012c5d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.8 # code coverage -coverage==7.10.5 +coverage==7.10.6 pytest-cov==6.2.1 From 9e726de48565a911e9951110da2e5909e64451d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:42:15 +0000 Subject: [PATCH 523/669] build(deps): Bump github/codeql-action from 3.29.11 to 3.30.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.11 to 3.30.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/3c3833e0f8c1c83d449a7478aa59c036a9165498...2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.30.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index eab47045..e26caf3f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5 + uses: github/codeql-action/init@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5 + uses: github/codeql-action/autobuild@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5 + uses: github/codeql-action/analyze@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5 with: category: "/language:${{matrix.language}}" From 29968904040b290fa4c646edfda8cb923b6fe386 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:01:36 +0000 Subject: [PATCH 524/669] build(deps-dev): Bump pytest from 8.4.1 to 8.4.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.1 to 8.4.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.4.1...8.4.2) --- updated-dependencies: - dependency-name: pytest dependency-version: 8.4.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3b012c5d..7b152f68 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==8.4.1 +pytest==8.4.2 responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.8 From a6a2ca9719152bba9ae3309abc84afd4dc3a3a46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 17:53:51 +0000 Subject: [PATCH 525/669] build(deps-dev): Bump pytest-cov from 6.2.1 to 6.3.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.2.1 to 6.3.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.2.1...v6.3.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 6.3.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7b152f68..a1da13df 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.1.1 pylint==3.3.8 # code coverage coverage==7.10.6 -pytest-cov==6.2.1 +pytest-cov==6.3.0 From 4d03394603c4db0e025db2b284c65bfee32e230d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:57:50 +0000 Subject: [PATCH 526/669] build(deps): Bump github/codeql-action from 3.30.0 to 3.30.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.0 to 3.30.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d...f1f6e5f6af878fb37288ce1c627459e94dbf7d01) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.30.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e26caf3f..6aa73d20 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5 + uses: github/codeql-action/init@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5 + uses: github/codeql-action/autobuild@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5 + uses: github/codeql-action/analyze@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5 with: category: "/language:${{matrix.language}}" From 6f8bbe61e8f182c5472dbb339a3e0e0a1a13f787 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 09:19:29 +0000 Subject: [PATCH 527/669] build(deps): Bump actions/setup-python from 5.6.0 to 6.0.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.6.0 to 6.0.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/a26af69be951a213d495a4c3e4e4022e16d87065...e797f83bcb11b83ae66e0230d6156d7c80228e7c) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6a5f1ee7..04561f10 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.13 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: '3.13' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c686fac..b9eec8ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 904cc8937de94a83e62ae9f4a3871e3606570043 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:01:51 +0000 Subject: [PATCH 528/669] build(deps-dev): Bump pytest-cov from 6.3.0 to 7.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 6.3.0 to 7.0.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.3.0...v7.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 7.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a1da13df..1bbf7b79 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.1.1 pylint==3.3.8 # code coverage coverage==7.10.6 -pytest-cov==6.3.0 +pytest-cov==7.0.0 From 0a4a7da04a79ad3e3aad33c121e960618d63b20c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 12 Sep 2025 09:45:30 +0000 Subject: [PATCH 529/669] Update version 0.10.6 -> 0.10.7 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 141e7abf..e20eec9b 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.6" +current_version = "0.10.7" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index e807f3d3..5f1fd6c5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.6 +# IBM Cloudant Python SDK Version 0.10.7 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Pagination.md) (beta) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.6" +pip install --upgrade "ibmcloudant>=0.10.7" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.6" +easy_install --upgrade "ibmcloudant>=0.10.7" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index cb9b0b55..cdfaea39 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index 15f08d66..ba47d93a 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -324,4 +324,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 42a64a7e..7e9fe26b 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/AllDocsPagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/AllDocsPagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.6/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index 721593d7..d74c309a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.10.6 Detailed Documentation +# IBM Cloudant Python SDK Version 0.10.7 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 78565dca..860f3d42 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.6' +__version__ = '0.10.7' diff --git a/pyproject.toml b/pyproject.toml index d99aba62..95da9ab5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.6" +version = "0.10.7" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 8b7249b7abe91c6b11a30e782d2a5c2a13a7d1f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 18:04:34 +0000 Subject: [PATCH 530/669] build(deps): Bump github/codeql-action from 3.30.1 to 3.30.3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.1 to 3.30.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f1f6e5f6af878fb37288ce1c627459e94dbf7d01...192325c86100d080feab897ff886c34abd4c83a3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.30.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6aa73d20..5f5eaed4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5 + uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5 + uses: github/codeql-action/autobuild@192325c86100d080feab897ff886c34abd4c83a3 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5 + uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.29.5 with: category: "/language:${{matrix.language}}" From 1b52784c40f6fe5db2cef9985b00da8b683a0a2b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 23 Sep 2025 08:22:20 +0000 Subject: [PATCH 531/669] chore(generated): mend stage Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 60a9b0e --- Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5912adae..e79bd67e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,6 +64,7 @@ pipeline { } } } + stage('SonarQube analysis') { environment { scannerHome = tool 'SonarQubeScanner' @@ -87,6 +88,7 @@ pipeline { scanCode() } } + stage('Publish[staging]') { when { not { @@ -115,6 +117,7 @@ pipeline { } } } + stage('Run Gauge tests') { when { not { @@ -154,6 +157,19 @@ pipeline { } } } + + stage('Mend scan') { + when { + expression { env.BRANCH_IS_PRIMARY } + } + environment { + WS_PROJECTNAME="cloudant-${libName}-sdk" + } + steps { + mendScan() + } + } + stage('Update version and tag') { when { beforeAgent true From 06042f6e1cf00ad9a71233c6c29e472782338ff8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 17:05:57 +0000 Subject: [PATCH 532/669] build(deps-dev): Bump coverage from 7.10.6 to 7.10.7 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.6 to 7.10.7. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.6...7.10.7) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.10.7 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1bbf7b79..3d774e38 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.8 # code coverage -coverage==7.10.6 +coverage==7.10.7 pytest-cov==7.0.0 From 9f619cb0177c956e12461e06d6c4811d6e7c9f9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:18:43 +0000 Subject: [PATCH 533/669] build(deps): Bump github/codeql-action from 3.30.3 to 3.30.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.3 to 3.30.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/192325c86100d080feab897ff886c34abd4c83a3...3599b3baa15b485a2e49ef411a7a4bb2452e7f93) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.30.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5f5eaed4..f0760ded 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.29.5 + uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@192325c86100d080feab897ff886c34abd4c83a3 # v3.29.5 + uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.29.5 + uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5 with: category: "/language:${{matrix.language}}" From 236ffc4b100fd488a978298cafdfeaaf68800bee Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:48:46 +0000 Subject: [PATCH 534/669] docs(generated): replace placeholder values in examples Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 14e653f --- README.md | 4 +-- docs/Authentication.md | 20 ++++++------ examples/README.md | 32 +++++++++---------- .../deleteAttachment/example_request.py | 2 +- .../deleteDatabase/example_request.py | 2 +- .../deleteDesignDocument/example_request.py | 2 +- .../deleteDocument/example_request.py | 2 +- .../example_request.py | 2 +- .../example_request_delete_documents.py | 4 +-- ...ernative_example_request_for_atts_since.py | 2 +- .../snippets/postBulkGet/example_request.py | 4 +-- .../snippets/postRevsDiff/example_request.py | 6 ++-- .../putReplicationDocument/example_request.py | 6 ++-- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 5f1fd6c5..1ddff212 100644 --- a/README.md +++ b/README.md @@ -118,14 +118,14 @@ or programmatically. Quick start for Cloudant with an IAM API key: ```sh -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL # use your own Cloudant public or private URL +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key ``` Quick start for Apache CouchDB with a username/password session: ```sh CLOUDANT_AUTH_TYPE=COUCHDB_SESSION -CLOUDANT_URL=http://~replaceWithYourUniqueHost~.example:5984 # use your CouchDB URL +CLOUDANT_URL=https://~replace-with-your-unique-host~.example:6984 # use your CouchDB URL CLOUDANT_USERNAME=username # replace with your username CLOUDANT_PASSWORD=password # replace with your password ``` diff --git a/docs/Authentication.md b/docs/Authentication.md index a7295781..9709a6ce 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -58,7 +58,7 @@ amending the values with your own `CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`. ```sh -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key ``` @@ -69,8 +69,8 @@ amending with your own correct values. There is no need to set `CLOUDANT_AUTH_TYPE` to `CONTAINER` because it is the default. ```sh -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL -CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID ``` Alternatives to `CLOUDANT_IAM_PROFILE_ID`: @@ -83,8 +83,8 @@ amending with your own correct values. ```sh CLOUDANT_AUTH_TYPE=VPC -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL -CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID ``` Alternatives to `CLOUDANT_IAM_PROFILE_ID`: @@ -98,8 +98,8 @@ amending with your own correct values. ```sh CLOUDANT_AUTH_TYPE=IAMASSUME -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL -CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID ``` Alternatives to `CLOUDANT_IAM_PROFILE_ID`: @@ -113,7 +113,7 @@ amending with your own [service credentials](https://cloud.ibm.com/docs/Cloudant ```sh CLOUDANT_AUTH_TYPE=COUCHDB_SESSION -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL CLOUDANT_USERNAME=username # replace with your Cloudant legacy username CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM) ``` @@ -127,7 +127,7 @@ amending with your own correct values. ```sh CLOUDANT_AUTH_TYPE=BEARERTOKEN -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL CLOUDANT_BEARER_TOKEN=A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c # replace with your bearer token ``` @@ -140,7 +140,7 @@ amending with your own correct values. ```sh CLOUDANT_AUTH_TYPE=BASIC -CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL +CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL CLOUDANT_USERNAME=username # replace with your Cloudant legacy username CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM) ``` diff --git a/examples/README.md b/examples/README.md index 9673e113..dd2db2cf 100644 --- a/examples/README.md +++ b/examples/README.md @@ -308,7 +308,7 @@ service = CloudantV1.new_instance() response = service.delete_replication_document( doc_id='repldoc-example', -rev='3-a0ccbdc6fe95b4184f9031d086034d85' +rev='1-00000000000000000000000000000000' ).get_result() print(response) @@ -368,18 +368,18 @@ from ibmcloudant.cloudant_v1 import CloudantV1, ReplicationDocument, Replication service = CloudantV1.new_instance() source_db = ReplicationDatabase( - url='/animaldb' + url='https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb' ) target_auth_iam = ReplicationDatabaseAuthIam( - api_key='' + api_key='a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3' #use your own IAM API key ) target_auth = ReplicationDatabaseAuth( iam=target_auth_iam ) target_db = ReplicationDatabase( auth=target_auth, - url='/animaldb-target' + url='https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target' ) replication_document = ReplicationDocument( @@ -586,7 +586,7 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() -response = service.delete_database(db='').get_result() +response = service.delete_database(db='products').get_result() print(response) ``` @@ -797,12 +797,12 @@ service = CloudantV1.new_instance() event_doc_1 = Document( _id="ns1HJS13AMkK:0007241142412418284", - _rev="1-5005d65514fe9e90f8eccf174af5dd64", + _rev="1-00000000000000000000000000000000", _deleted=True, ) event_doc_2 = Document( _id="H8tDIwfadxp9:0007241142412418285", - _rev="1-2d7810b054babeda4812b3924428d6d6", + _rev="1-00000000000000000000000000000000", _deleted=True, ) @@ -873,10 +873,10 @@ service = CloudantV1.new_instance() doc_id = 'order00067' bulk_get_doc_1 = BulkGetQueryDocument( id=doc_id, - rev='3-917fa2381192822767f010b95b45325b') + rev='3-22222222222222222222222222222222') bulk_get_doc_2 = BulkGetQueryDocument( id=doc_id, - rev='4-a5be949eeb7296747cc271766e9a498b') + rev='4-33333333333333333333333333333333') response = service.post_bulk_get( db='orders', @@ -915,7 +915,7 @@ service = CloudantV1.new_instance() bulk_get_doc = BulkGetQueryDocument( id='order00058', - atts_since=['1-99b02e08da151943c2dcb40090160bb8']) + atts_since=['1-00000000000000000000000000000000']) response = service.post_bulk_get( db='orders', docs=[bulk_get_doc] @@ -977,7 +977,7 @@ service = CloudantV1.new_instance() response = service.delete_design_document( db='products', ddoc='appliances', - rev='1-98e6a25b3b45df62e7d47095ac15b16a' + rev='1-00000000000000000000000000000000' ).get_result() print(response) @@ -1681,9 +1681,9 @@ service = CloudantV1.new_instance() revs_diff = DocumentRevisions( order00077=[ - "<1-missing-revision>", - "<2-missing-revision>", - "<3-possible-ancestor-revision>" + "1-00000000000000000000000000000000", # missing revision + "2-11111111111111111111111111111111", # missing revision + "3-22222222222222222222222222222222" # possible ancestor revision ] ) @@ -1804,7 +1804,7 @@ service = CloudantV1.new_instance() response = service.delete_document( db='orders', doc_id='order00058', - rev='1-99b02e08da151943c2dcb40090160bb8' + rev='1-00000000000000000000000000000000' ).get_result() print(response) @@ -1898,7 +1898,7 @@ response = service.delete_attachment( db='products', doc_id='1000042', attachment_name='product_details.txt', - rev='4-1a0d1cd6f40472509e9aac646183736a' + rev='4-33333333333333333333333333333333' ).get_result() print(response) diff --git a/examples/snippets/deleteAttachment/example_request.py b/examples/snippets/deleteAttachment/example_request.py index dc2c3a2c..1d4edd2b 100644 --- a/examples/snippets/deleteAttachment/example_request.py +++ b/examples/snippets/deleteAttachment/example_request.py @@ -7,7 +7,7 @@ db='products', doc_id='1000042', attachment_name='product_details.txt', - rev='4-1a0d1cd6f40472509e9aac646183736a' + rev='4-33333333333333333333333333333333' ).get_result() print(response) diff --git a/examples/snippets/deleteDatabase/example_request.py b/examples/snippets/deleteDatabase/example_request.py index 0ca7bc37..77f7c021 100644 --- a/examples/snippets/deleteDatabase/example_request.py +++ b/examples/snippets/deleteDatabase/example_request.py @@ -3,6 +3,6 @@ service = CloudantV1.new_instance() -response = service.delete_database(db='').get_result() +response = service.delete_database(db='products').get_result() print(response) diff --git a/examples/snippets/deleteDesignDocument/example_request.py b/examples/snippets/deleteDesignDocument/example_request.py index bc175eb4..af0aa41f 100644 --- a/examples/snippets/deleteDesignDocument/example_request.py +++ b/examples/snippets/deleteDesignDocument/example_request.py @@ -6,7 +6,7 @@ response = service.delete_design_document( db='products', ddoc='appliances', - rev='1-98e6a25b3b45df62e7d47095ac15b16a' + rev='1-00000000000000000000000000000000' ).get_result() print(response) diff --git a/examples/snippets/deleteDocument/example_request.py b/examples/snippets/deleteDocument/example_request.py index ee64b47a..e3ccea00 100644 --- a/examples/snippets/deleteDocument/example_request.py +++ b/examples/snippets/deleteDocument/example_request.py @@ -6,7 +6,7 @@ response = service.delete_document( db='orders', doc_id='order00058', - rev='1-99b02e08da151943c2dcb40090160bb8' + rev='1-00000000000000000000000000000000' ).get_result() print(response) diff --git a/examples/snippets/deleteReplicationDocument/example_request.py b/examples/snippets/deleteReplicationDocument/example_request.py index 9e2d91ff..a3325376 100644 --- a/examples/snippets/deleteReplicationDocument/example_request.py +++ b/examples/snippets/deleteReplicationDocument/example_request.py @@ -5,7 +5,7 @@ response = service.delete_replication_document( doc_id='repldoc-example', -rev='3-a0ccbdc6fe95b4184f9031d086034d85' +rev='1-00000000000000000000000000000000' ).get_result() print(response) diff --git a/examples/snippets/postBulkDocs/example_request_delete_documents.py b/examples/snippets/postBulkDocs/example_request_delete_documents.py index c70a8e80..09ffeece 100644 --- a/examples/snippets/postBulkDocs/example_request_delete_documents.py +++ b/examples/snippets/postBulkDocs/example_request_delete_documents.py @@ -5,12 +5,12 @@ event_doc_1 = Document( _id="ns1HJS13AMkK:0007241142412418284", - _rev="1-5005d65514fe9e90f8eccf174af5dd64", + _rev="1-00000000000000000000000000000000", _deleted=True, ) event_doc_2 = Document( _id="H8tDIwfadxp9:0007241142412418285", - _rev="1-2d7810b054babeda4812b3924428d6d6", + _rev="1-00000000000000000000000000000000", _deleted=True, ) diff --git a/examples/snippets/postBulkGet/alternative_example_request_for_atts_since.py b/examples/snippets/postBulkGet/alternative_example_request_for_atts_since.py index b9d77083..0811db87 100644 --- a/examples/snippets/postBulkGet/alternative_example_request_for_atts_since.py +++ b/examples/snippets/postBulkGet/alternative_example_request_for_atts_since.py @@ -5,7 +5,7 @@ bulk_get_doc = BulkGetQueryDocument( id='order00058', - atts_since=['1-99b02e08da151943c2dcb40090160bb8']) + atts_since=['1-00000000000000000000000000000000']) response = service.post_bulk_get( db='orders', docs=[bulk_get_doc] diff --git a/examples/snippets/postBulkGet/example_request.py b/examples/snippets/postBulkGet/example_request.py index e161518a..ad88c649 100644 --- a/examples/snippets/postBulkGet/example_request.py +++ b/examples/snippets/postBulkGet/example_request.py @@ -6,10 +6,10 @@ doc_id = 'order00067' bulk_get_doc_1 = BulkGetQueryDocument( id=doc_id, - rev='3-917fa2381192822767f010b95b45325b') + rev='3-22222222222222222222222222222222') bulk_get_doc_2 = BulkGetQueryDocument( id=doc_id, - rev='4-a5be949eeb7296747cc271766e9a498b') + rev='4-33333333333333333333333333333333') response = service.post_bulk_get( db='orders', diff --git a/examples/snippets/postRevsDiff/example_request.py b/examples/snippets/postRevsDiff/example_request.py index 970c1a96..5dd6092f 100644 --- a/examples/snippets/postRevsDiff/example_request.py +++ b/examples/snippets/postRevsDiff/example_request.py @@ -5,9 +5,9 @@ revs_diff = DocumentRevisions( order00077=[ - "<1-missing-revision>", - "<2-missing-revision>", - "<3-possible-ancestor-revision>" + "1-00000000000000000000000000000000", # missing revision + "2-11111111111111111111111111111111", # missing revision + "3-22222222222222222222222222222222" # possible ancestor revision ] ) diff --git a/examples/snippets/putReplicationDocument/example_request.py b/examples/snippets/putReplicationDocument/example_request.py index 0083d909..0c2d92dc 100644 --- a/examples/snippets/putReplicationDocument/example_request.py +++ b/examples/snippets/putReplicationDocument/example_request.py @@ -4,18 +4,18 @@ service = CloudantV1.new_instance() source_db = ReplicationDatabase( - url='/animaldb' + url='https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb' ) target_auth_iam = ReplicationDatabaseAuthIam( - api_key='' + api_key='a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3' #use your own IAM API key ) target_auth = ReplicationDatabaseAuth( iam=target_auth_iam ) target_db = ReplicationDatabase( auth=target_auth, - url='/animaldb-target' + url='https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target' ) replication_document = ReplicationDocument( From e35666854c5a5b6d572e512881c66b46f171a4b4 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 3 Oct 2025 10:47:38 +0100 Subject: [PATCH 535/669] chore: update secrets baseline --- .secrets.baseline | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 1ec428be..e75f570f 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "^.secrets.baseline$", "lines": "(?i)^\\s*\"(?:transaction|x-couch-request|x-request)-id\": \"[^\"]+\",?$|^\\s*\"(?:last_|update_|purge_|checkpointed_source_|source_|through_)?seq\": \"[^\"]+\",?$|^\\s*\"(?:doc_)?id\": \"[^\"]+\",?$|^\\s*\"(?:signature|name|uuid)\": \"[^\"]+\",?$" }, - "generated_at": "2025-08-15T10:14:15Z", + "generated_at": "2025-10-03T09:46:18Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -82,7 +82,7 @@ "hashed_secret": "bb589d0621e5472f470fa3425a234c74b1e202e8", "is_secret": false, "is_verified": false, - "line_number": 325, + "line_number": 341, "type": "Secret Keyword", "verified_result": null } @@ -109,7 +109,15 @@ ], "examples/README.md": [ { - "hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd", + "hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a", + "is_secret": false, + "is_verified": false, + "line_number": 375, + "type": "Base64 High Entropy String", + "verified_result": null + }, + { + "hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a", "is_secret": false, "is_verified": false, "line_number": 375, @@ -135,7 +143,15 @@ ], "examples/snippets/putReplicationDocument/example_request.py": [ { - "hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd", + "hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a", + "is_secret": false, + "is_verified": false, + "line_number": 11, + "type": "Base64 High Entropy String", + "verified_result": null + }, + { + "hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a", "is_secret": false, "is_verified": false, "line_number": 11, @@ -216,7 +232,7 @@ } ] }, - "version": "0.13.1+ibm.62.dss", + "version": "0.13.1+ibm.64.dss", "word_list": { "file": null, "hash": null From e52806cbdd359ad9510e9cfea8424019b0cedc59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:01:35 +0000 Subject: [PATCH 536/669] build(deps-dev): Bump pylint from 3.3.8 to 3.3.9 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.8 to 3.3.9. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.8...v3.3.9) --- updated-dependencies: - dependency-name: pylint dependency-version: 3.3.9 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3d774e38..da9bedd5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==8.4.2 responses==0.25.8 python_dotenv==1.1.1 -pylint==3.3.8 +pylint==3.3.9 # code coverage coverage==7.10.7 pytest-cov==7.0.0 From e7c6ae23c9fb462807aaf1c2f936895ed600f735 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 07:15:47 +0000 Subject: [PATCH 537/669] build(deps): Bump github/codeql-action from 3.30.5 to 3.30.6 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.5 to 3.30.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/3599b3baa15b485a2e49ef411a7a4bb2452e7f93...64d10c13136e1c5bce3e5fbde8d4906eeaafc885) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.30.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f0760ded..812b747a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5 + uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5 + uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5 + uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 with: category: "/language:${{matrix.language}}" From 2c98a76ae0c3f36f3f81a88261a89af10be51d12 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Mon, 6 Oct 2025 16:16:56 -0300 Subject: [PATCH 538/669] fix: disable_ssl_verification impl for CouchDbSessionAuthenticator --- ibmcloudant/__init__.py | 4 ++- ibmcloudant/cloudant_base_service.py | 3 --- ...couchdb_session_get_authenticator_patch.py | 4 +-- test/unit/test_couchdb_session_auth.py | 27 ------------------- 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/ibmcloudant/__init__.py b/ibmcloudant/__init__.py index 1ce2afa9..3b83fbad 100644 --- a/ibmcloudant/__init__.py +++ b/ibmcloudant/__init__.py @@ -19,7 +19,7 @@ from ibm_cloud_sdk_core import IAMTokenManager, DetailedResponse, BaseService, ApiException, get_authenticator from .couchdb_session_authenticator import CouchDbSessionAuthenticator from .couchdb_session_get_authenticator_patch import new_construct_authenticator -from .cloudant_base_service import new_init, new_prepare_request, new_set_default_headers, new_set_http_client, new_set_service_url +from .cloudant_base_service import new_init, new_prepare_request, new_set_default_headers, new_set_http_client, new_set_service_url, new_set_disable_ssl_verification from .couchdb_session_token_manager import CouchDbSessionTokenManager from .cloudant_v1 import CloudantV1 from .features.changes_follower import ChangesFollower @@ -37,3 +37,5 @@ CloudantV1.prepare_request = new_prepare_request CloudantV1.set_http_client = new_set_http_client + +CloudantV1.set_disable_ssl_verification = new_set_disable_ssl_verification diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index f9922bc4..172e791f 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -114,9 +114,6 @@ def new_set_default_headers(self, headers: Dict[str, str]): _old_set_disable_ssl_verification = CloudantV1.set_disable_ssl_verification -# Note this is currently unused, but probably should be enabled. -# To enable it we need to resolve whether CouchDbSessionAuthenticator -# should ever be allowed to have a different value from the service client. def new_set_disable_ssl_verification(self, status: bool = False) -> None: _old_set_disable_ssl_verification(self, status) if isinstance(self.authenticator, CouchDbSessionAuthenticator): diff --git a/ibmcloudant/couchdb_session_get_authenticator_patch.py b/ibmcloudant/couchdb_session_get_authenticator_patch.py index f917fe1e..cd31ef97 100644 --- a/ibmcloudant/couchdb_session_get_authenticator_patch.py +++ b/ibmcloudant/couchdb_session_get_authenticator_patch.py @@ -34,8 +34,6 @@ def new_construct_authenticator(config): # pylint: disable=missing-docstring return CouchDbSessionAuthenticator( username=config.get('USERNAME'), password=config.get('PASSWORD'), - disable_ssl_verification=config.get( - 'AUTH_DISABLE_SSL', - config.get('DISABLE_SSL', 'false')).lower() == 'true' + disable_ssl_verification=config.get('DISABLE_SSL', 'false').lower() == 'true' ) return old_construct_authenticator(config) diff --git a/test/unit/test_couchdb_session_auth.py b/test/unit/test_couchdb_session_auth.py index 6738943b..9285d9d2 100644 --- a/test/unit/test_couchdb_session_auth.py +++ b/test/unit/test_couchdb_session_auth.py @@ -231,30 +231,3 @@ def test_disable_ssl(self): self.assertTrue(service.disable_ssl_verification) self.assertTrue( service.authenticator.token_manager.disable_ssl_verification) - - def test_auth_disable_ssl(self): - os.environ['TEST_SERVICE_AUTHTYPE'] = 'couchdb_session' - os.environ['TEST_SERVICE_USERNAME'] = 'adm' - os.environ['TEST_SERVICE_PASSWORD'] = 'pass' - os.environ['TEST_SERVICE_AUTH_DISABLE_SSL'] = 'true' - service = CloudantV1.new_instance(service_name='TEST_SERVICE') - self.assertIsNotNone(service) - self.assertIsInstance(service, CloudantV1) - self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) - self.assertFalse(service.disable_ssl_verification) - self.assertTrue( - service.authenticator.token_manager.disable_ssl_verification) - - def test_auth_disable_ssl_only(self): - os.environ['TEST_SERVICE_AUTHTYPE'] = 'couchdb_session' - os.environ['TEST_SERVICE_USERNAME'] = 'adm' - os.environ['TEST_SERVICE_PASSWORD'] = 'pass' - os.environ['TEST_SERVICE_DISABLE_SSL'] = 'false' - os.environ['TEST_SERVICE_AUTH_DISABLE_SSL'] = 'true' - service = CloudantV1.new_instance(service_name='TEST_SERVICE') - self.assertIsNotNone(service) - self.assertIsInstance(service, CloudantV1) - self.assertEqual('COUCHDB_SESSION', service.authenticator.authentication_type()) - self.assertFalse(service.disable_ssl_verification) - self.assertTrue( - service.authenticator.token_manager.disable_ssl_verification) From d1a49ffb8dee710d530b5809c5262cd5c211d8f9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:48:23 +0000 Subject: [PATCH 539/669] fix(generated): typo in a file name of embedded pagination examples Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 937a583 --- docs/Pagination.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Pagination.md b/docs/Pagination.md index 7e9fe26b..8de1392f 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,7 +71,7 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/AllDocsPagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/all_docs_pagination.py) * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/design_docs_pagination.py) From 3ab2a32f94d8f87f6df6b2a09831146d728711a9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:53:11 +0000 Subject: [PATCH 540/669] Update version 0.10.7 -> 0.11.0 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index e20eec9b..099ff6a5 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.10.7" +current_version = "0.11.0" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 1ddff212..d69f9e02 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.10.7 +# IBM Cloudant Python SDK Version 0.11.0 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Pagination.md) (beta) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.10.7" +pip install --upgrade "ibmcloudant>=0.11.0" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.10.7" +easy_install --upgrade "ibmcloudant>=0.11.0" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index cdfaea39..fcfa0e51 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index ba47d93a..569f3170 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -324,4 +324,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 8de1392f..d06581f9 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.10.7/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index d74c309a..e34c8468 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.10.7 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.0 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 860f3d42..3d8ac7d2 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.10.7' +__version__ = '0.11.0' diff --git a/pyproject.toml b/pyproject.toml index 95da9ab5..b33b9bdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.10.7" +version = "0.11.0" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 22d1b05b8fcfd0bbd167c69d66d0e9c3606b6e66 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Tue, 14 Oct 2025 12:19:08 -0300 Subject: [PATCH 541/669] docs: add missing comments to pagination examples --- .../src/features/pagination/partition_search_pagination.py | 5 +++++ test/examples/src/features/pagination/search_pagination.py | 5 +++++ test/examples/src/features/pagination/view_pagination.py | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/test/examples/src/features/pagination/partition_search_pagination.py b/test/examples/src/features/pagination/partition_search_pagination.py index fdcd448e..9347be48 100644 --- a/test/examples/src/features/pagination/partition_search_pagination.py +++ b/test/examples/src/features/pagination/partition_search_pagination.py @@ -45,12 +45,17 @@ # Do something with row pass +# Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() if pager.has_next(): page = pager.get_next() # Do something with page +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. all_pager: Pager = pagination.pager() all_rows = all_pager.get_all() for page in all_rows: diff --git a/test/examples/src/features/pagination/search_pagination.py b/test/examples/src/features/pagination/search_pagination.py index 5b352973..7dcd4550 100644 --- a/test/examples/src/features/pagination/search_pagination.py +++ b/test/examples/src/features/pagination/search_pagination.py @@ -44,12 +44,17 @@ # Do something with row pass +# Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() if pager.has_next(): page = pager.get_next() # Do something with page +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. all_pager: Pager = pagination.pager() all_rows = all_pager.get_all() for page in all_rows: diff --git a/test/examples/src/features/pagination/view_pagination.py b/test/examples/src/features/pagination/view_pagination.py index dbd265da..53bff03d 100644 --- a/test/examples/src/features/pagination/view_pagination.py +++ b/test/examples/src/features/pagination/view_pagination.py @@ -43,12 +43,17 @@ # Do something with row pass +# Option: use pager next page # For retrieving one page at a time with a method call. pager: Pager = pagination.pager() if pager.has_next(): page = pager.get_next() # Do something with page +# Option: use pager all results +# For retrieving all result rows in a single list +# Note: all result rows may be very large! +# Preferably use iterables instead of get_all for memory efficiency with large result sets. all_pager: Pager = pagination.pager() all_rows = all_pager.get_all() for page in all_rows: From f7eea18ce686332cac9e4bea79181d7a4eba1e60 Mon Sep 17 00:00:00 2001 From: Kornel-Toth Date: Thu, 16 Oct 2025 13:10:29 +0200 Subject: [PATCH 542/669] chore: add python 3.14 and remove 3.9 support --- .github/workflows/docs.yml | 4 ++-- .github/workflows/test.yml | 2 +- pyproject.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 04561f10..90d80652 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,10 +11,10 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - - name: Setup python 3.13 + - name: Setup python 3.14 uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: - python-version: '3.13' + python-version: '3.14' cache: 'pip' - name: Install deps run: pip install -r requirements-docs.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9eec8ea..2c925536 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: test: strategy: matrix: - python: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python: ['3.10', '3.11', '3.12', '3.13', '3.14'] runs-on: ubuntu-latest services: couchdb: diff --git a/pyproject.toml b/pyproject.toml index b33b9bdd..48392396 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,16 +16,16 @@ authors = [ { name="IBM", email="cldtsdks@us.ibm.com" }, ] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" license = {file = "LICENSE"} classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", From 5d781a2d4add8d55975edc9d66390e6c6a1ab2d4 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:01:34 +0000 Subject: [PATCH 543/669] chore(generated): bump 3.9 to 3.10, and list all 5 supported versions Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version dd1eda5 --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c1c51489..ad356ebe 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ assignees: '' **Must gather (please complete the following information):** - SDK Version [e.g. 1.2.1] - - Python Version [e.g. Python 3.9] + - Python Version [e.g. Python 3.10] - Name of service that you're trying to use (if applicable) - Name of operation that you're trying to invoke (if applicable) diff --git a/README.md b/README.md index d69f9e02..698c11ad 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ project: service instance or a [CouchDB](https://docs.couchdb.org/en/latest/install/index.html) server. -- Python 3.9 or above. +- Python 3.10, 3.11, 3.12, 3.13 or 3.14 ## Installation From 966fece42df3dbe916d737f10cb6ffaf3c43e46a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:01:24 +0000 Subject: [PATCH 544/669] build(deps-dev): Bump coverage from 7.10.7 to 7.11.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.10.7 to 7.11.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.10.7...7.11.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.11.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index da9bedd5..4e78d1d7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.1.1 pylint==3.3.9 # code coverage -coverage==7.10.7 +coverage==7.11.0 pytest-cov==7.0.0 From 9d67789dfb2fa930a68ea65a8da38f1b4db4a982 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:48:36 +0000 Subject: [PATCH 545/669] build(deps-dev): Bump pylint from 3.3.9 to 4.0.1 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.9 to 4.0.1. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.9...v4.0.1) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4e78d1d7..4cb49430 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==8.4.2 responses==0.25.8 python_dotenv==1.1.1 -pylint==3.3.9 +pylint==4.0.1 # code coverage coverage==7.11.0 pytest-cov==7.0.0 From 365d72495245e3740343a5eee9036523d4f50651 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Thu, 16 Oct 2025 23:45:32 -0300 Subject: [PATCH 546/669] refactor: use CloudantBaseService as a super of CloudantV1 --- ibmcloudant/__init__.py | 15 +-- ibmcloudant/cloudant_base_service.py | 186 ++++++++++++++------------- ibmcloudant/cloudant_v1.py | 7 +- 3 files changed, 99 insertions(+), 109 deletions(-) diff --git a/ibmcloudant/__init__.py b/ibmcloudant/__init__.py index 3b83fbad..c385b4f3 100644 --- a/ibmcloudant/__init__.py +++ b/ibmcloudant/__init__.py @@ -1,5 +1,5 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2024. +# © Copyright IBM Corporation 2020, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ from ibm_cloud_sdk_core import IAMTokenManager, DetailedResponse, BaseService, ApiException, get_authenticator from .couchdb_session_authenticator import CouchDbSessionAuthenticator from .couchdb_session_get_authenticator_patch import new_construct_authenticator -from .cloudant_base_service import new_init, new_prepare_request, new_set_default_headers, new_set_http_client, new_set_service_url, new_set_disable_ssl_verification from .couchdb_session_token_manager import CouchDbSessionTokenManager from .cloudant_v1 import CloudantV1 from .features.changes_follower import ChangesFollower @@ -27,15 +26,3 @@ # sdk-core's __construct_authenticator works with a long switch-case so monkey-patching is required get_authenticator.__construct_authenticator = new_construct_authenticator - -CloudantV1.__init__ = new_init - -CloudantV1.set_service_url = new_set_service_url - -CloudantV1.set_default_headers = new_set_default_headers - -CloudantV1.prepare_request = new_prepare_request - -CloudantV1.set_http_client = new_set_http_client - -CloudantV1.set_disable_ssl_verification = new_set_disable_ssl_verification diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index 172e791f..e76275a2 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2024. +# © Copyright IBM Corporation 2020, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ from json.decoder import JSONDecodeError from io import BytesIO +from ibm_cloud_sdk_core import BaseService from ibm_cloud_sdk_core.authenticators import Authenticator from requests import Response, Session from requests.cookies import RequestsCookieJar from .common import get_sdk_headers -from .cloudant_v1 import CloudantV1 from .couchdb_session_authenticator import CouchDbSessionAuthenticator # pylint: disable=missing-docstring @@ -72,52 +72,99 @@ def __hash__(self): # Since Py3.6 dict is ordered so use a key only dict for our set rules_by_operation.setdefault(operation_id, dict()).setdefault(rule) -_old_init = CloudantV1.__init__ - -def new_init(self, authenticator: Authenticator = None): - _old_init(self, authenticator) - # Overwrite default read timeout to 2.5 minutes - if not ('timeout' in self.http_config): - new_http_config = self.http_config.copy() - new_http_config['timeout'] = (CONNECT_TIMEOUT, READ_TIMEOUT) - self.set_http_config(new_http_config) - # Custom actions for CouchDbSessionAuthenticator - if isinstance(authenticator, CouchDbSessionAuthenticator): - # Replacing BaseService's http.cookiejar.CookieJar as RequestsCookieJar supports update(CookieJar) - self.jar = RequestsCookieJar(self.jar) - self.authenticator.set_jar(self.jar) # Authenticators don't have access to cookie jars by default - add_hooks(self) - -_old_set_service_url = CloudantV1.set_service_url - -def new_set_service_url(self, service_url: str): - _old_set_service_url(self, service_url) - try: +class CloudantBaseService(BaseService): + """ + The base class for service classes. + """ + def __init__( + self, + service_url: str = None, + authenticator: Authenticator = None, + ) -> None: + """ + Construct a new client for the Cloudant service. + + :param Authenticator authenticator: The authenticator specifies the authentication mechanism. + Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md + about initializing the authenticator of your choice. + """ + BaseService.__init__(self, service_url=service_url, authenticator=authenticator) + # Overwrite default read timeout to 2.5 minutes + if not ('timeout' in self.http_config): + new_http_config = self.http_config.copy() + new_http_config['timeout'] = (CONNECT_TIMEOUT, READ_TIMEOUT) + self.set_http_config(new_http_config) + # Custom actions for CouchDbSessionAuthenticator + if isinstance(authenticator, CouchDbSessionAuthenticator): + # Replacing BaseService's http.cookiejar.CookieJar as RequestsCookieJar supports update(CookieJar) + self.jar = RequestsCookieJar(self.jar) + self.authenticator.set_jar(self.jar) # Authenticators don't have access to cookie jars by default + add_hooks(self) + + def set_service_url(self, service_url: str): + super().set_service_url(service_url) + try: + if isinstance(self.authenticator, CouchDbSessionAuthenticator): + self.authenticator.token_manager.set_service_url(service_url) + except AttributeError: + pass # in case no authenticator is configured yet, pass + + def set_default_headers(self, headers: Dict[str, str]): + super().set_default_headers(headers) if isinstance(self.authenticator, CouchDbSessionAuthenticator): - self.authenticator.token_manager.set_service_url(service_url) - except AttributeError: - pass # in case no authenticator is configured yet, pass - -_old_set_default_headers = CloudantV1.set_default_headers - -def new_set_default_headers(self, headers: Dict[str, str]): - _old_set_default_headers(self, headers) - if isinstance(self.authenticator, CouchDbSessionAuthenticator): - combined_headers = {} - combined_headers.update(headers) - combined_headers.update(get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='authenticator_post_session') - ) - self.authenticator.token_manager.set_default_headers(combined_headers) - -_old_set_disable_ssl_verification = CloudantV1.set_disable_ssl_verification - -def new_set_disable_ssl_verification(self, status: bool = False) -> None: - _old_set_disable_ssl_verification(self, status) - if isinstance(self.authenticator, CouchDbSessionAuthenticator): - self.authenticator.token_manager.set_disable_ssl_verification(status) + combined_headers = {} + combined_headers.update(headers) + combined_headers.update(get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='authenticator_post_session') + ) + self.authenticator.token_manager.set_default_headers(combined_headers) + + def set_disable_ssl_verification(self, status: bool = False) -> None: + super().set_disable_ssl_verification(status) + if isinstance(self.authenticator, CouchDbSessionAuthenticator): + self.authenticator.token_manager.set_disable_ssl_verification(status) + + def set_http_client(self, http_client: Session) -> None: + super().set_http_client(http_client) + add_hooks(self) + + def prepare_request(self, + method: str, + url: str, + *args, + headers: Optional[dict] = None, + params: Optional[dict] = None, + data: Optional[Union[str, dict]] = None, + files: Optional[Union[Dict[str, Tuple[str]], + List[Tuple[str, + Tuple[str, + ...]]]]] = None, + **kwargs) -> dict: + # Extract the operation ID from the request headers. + operation_id = None + header = headers.get('X-IBMCloud-SDK-Analytics') + if header is not None: + for element in header.split(';'): + if element.startswith('operation_id'): + operation_id = element.split('=')[1] + break + if operation_id is not None: + # Check each validation rule that applies to the operation. + # Until the request URL is passed to old_prepare_request it does not include the + # service URL and is relative to it + request_url_path_segments = urlsplit(url).path.strip('/').split('/') + if len(request_url_path_segments) == 1 and request_url_path_segments[0] == '': + request_url_path_segments = [] + # Note the get returns a value-less dict, we are iterating only the keys + for rule in rules_by_operation.get(operation_id, {}): + if len(request_url_path_segments) > rule.path_segment_index: + segment_to_validate = request_url_path_segments[rule.path_segment_index] + if segment_to_validate.startswith('_'): + raise ValueError('{0} {1} starts with the invalid _ character.'.format(rule.error_parameter_name, + unquote(segment_to_validate))) + return super().prepare_request(method, url, *args, headers=headers, params=params, data=data, files=files, **kwargs) def _error_response_hook(response:Response, *args, **kwargs) -> Optional[Response]: # pylint: disable=W0613 @@ -186,52 +233,7 @@ def _error_response_hook(response:Response, *args, **kwargs) -> Optional[Respons # so the exception can surface elsewhere. pass return response - -_old_prepare_request = CloudantV1.prepare_request - -def new_prepare_request(self, - method: str, - url: str, - *args, - headers: Optional[dict] = None, - params: Optional[dict] = None, - data: Optional[Union[str, dict]] = None, - files: Optional[Union[Dict[str, Tuple[str]], - List[Tuple[str, - Tuple[str, - ...]]]]] = None, - **kwargs) -> dict: - # Extract the operation ID from the request headers. - operation_id = None - header = headers.get('X-IBMCloud-SDK-Analytics') - if header is not None: - for element in header.split(';'): - if element.startswith('operation_id'): - operation_id = element.split('=')[1] - break - if operation_id is not None: - # Check each validation rule that applies to the operation. - # Until the request URL is passed to old_prepare_request it does not include the - # service URL and is relative to it - request_url_path_segments = urlsplit(url).path.strip('/').split('/') - if len(request_url_path_segments) == 1 and request_url_path_segments[0] == '': - request_url_path_segments = [] - # Note the get returns a value-less dict, we are iterating only the keys - for rule in rules_by_operation.get(operation_id, {}): - if len(request_url_path_segments) > rule.path_segment_index: - segment_to_validate = request_url_path_segments[rule.path_segment_index] - if segment_to_validate.startswith('_'): - raise ValueError('{0} {1} starts with the invalid _ character.'.format(rule.error_parameter_name, - unquote(segment_to_validate))) - return _old_prepare_request(self, method, url, *args, headers=headers, params=params, data=data, files=files, **kwargs) - def add_hooks(self): response_hooks = self.get_http_client().hooks['response'] if _error_response_hook not in response_hooks: response_hooks.append(_error_response_hook) - -_old_set_http_client = CloudantV1.set_http_client - -def new_set_http_client(self, http_client: Session) -> None: - _old_set_http_client(self, http_client) - add_hooks(self) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index af92973a..843868ef 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -27,11 +27,12 @@ import json import logging -from ibm_cloud_sdk_core import BaseService, DetailedResponse +from ibm_cloud_sdk_core import DetailedResponse from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment from ibm_cloud_sdk_core.utils import convert_list, convert_model, datetime_to_string, string_to_datetime +from .cloudant_base_service import CloudantBaseService from .common import get_sdk_headers ############################################################################## @@ -39,7 +40,7 @@ ############################################################################## -class CloudantV1(BaseService): +class CloudantV1(CloudantBaseService): """The Cloudant V1 service.""" DEFAULT_SERVICE_URL = 'https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud' @@ -72,7 +73,7 @@ def __init__( Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ - BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) + CloudantBaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) # enable gzip compression of request bodies self.set_enable_gzip_compression(True) From 59c2b573ad232e8d0658b3aa03c8fec6c31942d1 Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Fri, 17 Oct 2025 12:03:07 -0300 Subject: [PATCH 547/669] refactor: make session auth to use base service's http client --- ibmcloudant/cloudant_base_service.py | 8 +-- ibmcloudant/couchdb_session_authenticator.py | 24 ++++----- ibmcloudant/couchdb_session_token_manager.py | 15 ++++-- test/integration/test_timeout.py | 54 ++++++++++++-------- 4 files changed, 61 insertions(+), 40 deletions(-) diff --git a/ibmcloudant/cloudant_base_service.py b/ibmcloudant/cloudant_base_service.py index e76275a2..3884671b 100644 --- a/ibmcloudant/cloudant_base_service.py +++ b/ibmcloudant/cloudant_base_service.py @@ -27,7 +27,6 @@ from ibm_cloud_sdk_core import BaseService from ibm_cloud_sdk_core.authenticators import Authenticator from requests import Response, Session -from requests.cookies import RequestsCookieJar from .common import get_sdk_headers from .couchdb_session_authenticator import CouchDbSessionAuthenticator @@ -96,9 +95,8 @@ def __init__( self.set_http_config(new_http_config) # Custom actions for CouchDbSessionAuthenticator if isinstance(authenticator, CouchDbSessionAuthenticator): - # Replacing BaseService's http.cookiejar.CookieJar as RequestsCookieJar supports update(CookieJar) - self.jar = RequestsCookieJar(self.jar) - self.authenticator.set_jar(self.jar) # Authenticators don't have access to cookie jars by default + # Make token manager of CouchDbSessionAuthenticator to use the same http client as main service + self.authenticator._set_http_client(self.get_http_client(), self.jar) add_hooks(self) def set_service_url(self, service_url: str): @@ -128,6 +126,8 @@ def set_disable_ssl_verification(self, status: bool = False) -> None: def set_http_client(self, http_client: Session) -> None: super().set_http_client(http_client) + if isinstance(self.authenticator, CouchDbSessionAuthenticator): + self.authenticator._set_http_client(self.get_http_client(), self.jar) add_hooks(self) def prepare_request(self, diff --git a/ibmcloudant/couchdb_session_authenticator.py b/ibmcloudant/couchdb_session_authenticator.py index 815a5f8e..90de04d5 100644 --- a/ibmcloudant/couchdb_session_authenticator.py +++ b/ibmcloudant/couchdb_session_authenticator.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2022. +# © Copyright IBM Corporation 2020, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,9 @@ """ Module for handling session authentication """ -from requests import Request +from requests import Request, Session +from requests.cookies import RequestsCookieJar + from ibm_cloud_sdk_core.authenticators import Authenticator from .couchdb_session_token_manager import CouchDbSessionTokenManager @@ -46,8 +48,6 @@ def __init__(self, if not isinstance(disable_ssl_verification, bool): raise TypeError('disable_ssl_verification must be a bool') - self.jar = None - self.token_manager = CouchDbSessionTokenManager( username, password, @@ -55,11 +55,15 @@ def __init__(self, ) self.validate() - def set_jar(self, jar): - """Sets the cookie jar for the authenticator. + def _set_http_client(self, http_client: Session, jar: RequestsCookieJar) -> None: + """Sets base serivice's http client for the authenticator. This is an internal method called by BaseService. Not to be called directly. """ - self.jar = jar + if isinstance(http_client, Session): + self.token_manager.http_client = http_client + self.token_manager.jar = jar + else: + raise TypeError("http_client parameter must be a requests.sessions.Session") def validate(self): """Validates the username, and password for session token requests. @@ -82,11 +86,7 @@ def authenticate(self, req: Request): Args: req: Ignored. BaseService uses the cookie jar for every request """ - jar = self.token_manager.get_token() - # Requests seem to save cookies only for Sessions. BaseService is - # hard-coded to work with "regular" requests requests so updating - # the jar manually is necessary - self.jar.update(jar) + self.token_manager.get_token() def authentication_type(self) -> str: """Returns this authenticator's type ('COUCHDB_SESSION').""" diff --git a/ibmcloudant/couchdb_session_token_manager.py b/ibmcloudant/couchdb_session_token_manager.py index d39005f7..32512abf 100644 --- a/ibmcloudant/couchdb_session_token_manager.py +++ b/ibmcloudant/couchdb_session_token_manager.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2020, 2022. +# © Copyright IBM Corporation 2020, 2025. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ """ Module for managing session authentication token """ +from requests import Session + from ibm_cloud_sdk_core.token_managers.token_manager import TokenManager @@ -52,7 +54,9 @@ def __init__(self, username: str, password: str, self.token = None + self.http_client = None self.http_config = {} + self.jar = None self.headers = None def request_token(self): @@ -63,14 +67,19 @@ def request_token(self): A CookieJar of Cookies the server sent back. """ - response = self._request( + if not isinstance(self.http_client, Session): + raise TypeError("http_client parameter must be a requests.sessions.Session") + + response = self.http_client.request( method='POST', url=self.url + "/_session", headers=self.headers, json={ 'username': self.username, 'password': self.password, - } + }, + cookies=self.jar, + **self.http_config ) return response diff --git a/test/integration/test_timeout.py b/test/integration/test_timeout.py index 3a6a475a..ece750b9 100644 --- a/test/integration/test_timeout.py +++ b/test/integration/test_timeout.py @@ -1,6 +1,6 @@ # coding: utf-8 -# © Copyright IBM Corporation 2021. +# © Copyright IBM Corporation 2021, 2025. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -86,8 +86,24 @@ def get_authenticate_arguments(req): return req.mock_calls[0] @staticmethod - def get_request_arguments(tci, srv, idx): - tci.assertEqual(srv.http_client.request.call_count, idx + 1) + def get_request_arguments(tci, srv, idx, call_count=None): + """ + Retrieve the arguments passed to a mocked HTTP request. + + Parameters: + tci (unittest.mock.Mock): A Mock object used for assertions. + srv (Service): The instance of CloudantV1 service. + idx (int): The index of the request in srv.http_client.request.mock_calls. + call_count (int, optional): The total call count for the request. Defaults to None. + + Returns: + list: The arguments passed to the HTTP request at the specified index. + + Raises: + AssertionError: If the actual call count of the request does not match the provided or calculated call_count. + """ + call_count = idx + 1 if call_count is None else call_count + tci.assertEqual(srv.http_client.request.call_count, call_count) return srv.http_client.request.mock_calls[idx] # Every method tests an authenticator. @@ -142,31 +158,27 @@ def test_timeout_cloudantv1_sessionauth(self): ) my_service.set_service_url("http://cloudant.example") - # Mock out authentication - orig_request = requests.request - requests.request = Mock(return_value=Helpers.get_mocked_response()) - # Mock out request response Helpers.mock_out_cloudant_request(my_service) - testcases = Helpers.defineTestCases(my_service) + # Call the server + my_service.get_server_information() - for tc_num, tc in enumerate(testcases): - tc['set_timeout'](CUSTOM_TIMEOUT_CONFIG) - - # Call the server - my_service.get_server_information() + # Assert timeout is set to the authenticator + auth_args = Helpers.get_request_arguments(self, my_service.authenticator.token_manager, 0, call_count=2) + self.assertEqual(auth_args.kwargs['timeout'], DEFAULT_TIMEOUT) - # Assert timeout is set to the authenticator - auth_args = Helpers.get_authenticate_arguments(requests.request) - Helpers.assert_default_timeout_setting(self, auth_args) + # Assert timeout is set to the server request + req_args = Helpers.get_request_arguments(self, my_service, 1, call_count=2) + self.assertEqual(req_args.kwargs['timeout'], DEFAULT_TIMEOUT) - # Assert timeout is set in the server request - req_args = Helpers.get_request_arguments(self, my_service, tc_num) - tc['assert_func'](self, req_args) + # Set a custom timeout and repeat the request. Client should be already authenticated. + my_service.set_http_config(CUSTOM_TIMEOUT_CONFIG) + my_service.get_server_information() - # Set back requests.request - requests.request = orig_request + # Assert the custom timeout is set to the server request + req_args = Helpers.get_request_arguments(self, my_service, 2, call_count=3) + self.assertEqual(req_args.kwargs['timeout'], CUSTOM_TIMEOUT) def test_timeout_cloudantv1_iamauth(self): authenticator = IAMAuthenticator('apikey') From c2e376d5fb514f6a322dd828160c51bc3835ecec Mon Sep 17 00:00:00 2001 From: Eric Avdey Date: Fri, 17 Oct 2025 12:03:47 -0300 Subject: [PATCH 548/669] fix: rename pagination test class name to avoid warning --- test/unit/features/test_pagination_base.py | 92 +++++++++++----------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/test/unit/features/test_pagination_base.py b/test/unit/features/test_pagination_base.py index 77d2a16f..85006d51 100644 --- a/test/unit/features/test_pagination_base.py +++ b/test/unit/features/test_pagination_base.py @@ -32,7 +32,7 @@ def __init__(self, total_items: int, page_size: int): # Override plus_one_paging to accommodate this weird hybrid self.plus_one_paging = False -class TestPageIterator(_BasePageIterator): +class BaseTestPageIterator(_BasePageIterator): """ A test subclass of the _BasePager under test. """ @@ -40,7 +40,7 @@ class TestPageIterator(_BasePageIterator): page_keys: list[str] = [] def __init__(self, client, opts): - super().__init__(client, TestPageIterator.operation or client.post_view, TestPageIterator.page_keys, opts) + super().__init__(client, BaseTestPageIterator.operation or client.post_view, BaseTestPageIterator.page_keys, opts) def _result_converter(self) -> Callable[[dict], ViewResult]: return lambda d: ViewResult.from_dict(d) @@ -58,7 +58,7 @@ class TestBasePageIterator(MockClientBaseCase): def test_init(self): operation = self.client.post_view opts = {'db': 'test', 'limit': 20} - page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator(self.client, opts) # Assert client is set self.assertEqual(page_iterator._client, self.client, 'The supplied client should be set.') # Assert operation is set @@ -72,8 +72,8 @@ def test_partial_options(self): page_opts = {'foo': 'boo', 'bar': 'far'} opts = {**static_opts, **page_opts} # Use page_opts.keys() to pass the list of names for page options - with patch('test_pagination_base.TestPageIterator.page_keys', page_opts.keys()): - page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + with patch('test_pagination_base.BaseTestPageIterator.page_keys', page_opts.keys()): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator(self.client, opts) # Assert partial function has only static opts self.assertEqual(page_iterator._next_request_function.keywords, static_opts, 'The partial function kwargs should be only the static options.') # Assert next page options @@ -81,7 +81,7 @@ def test_partial_options(self): def test_default_page_size(self): opts = {'db': 'test'} - page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator(self.client, opts) # Assert the default page size expected_page_size = 200 self.assertEqual(page_iterator._page_size, expected_page_size, 'The default page size should be set.') @@ -89,7 +89,7 @@ def test_default_page_size(self): def test_limit_page_size(self): opts = {'db': 'test', 'limit': 42} - page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator(self.client, opts) # Assert the provided page size expected_page_size = 42 self.assertEqual(page_iterator._page_size, expected_page_size, 'The default page size should be set.') @@ -97,15 +97,15 @@ def test_limit_page_size(self): def test_has_next_initially_true(self): opts = {'limit': 1} - page_iterator: Iterable[ViewResultRow] = TestPageIterator(self.client, opts) + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator(self.client, opts) # Assert _has_next self.assertTrue(page_iterator._has_next, '_has_next should initially return True.') def test_has_next_true_for_result_equal_to_limit(self): page_size = 1 # Init with mock that returns only a single row - with patch('test_pagination_base.TestPageIterator.operation', BasePageMockResponses(1, page_size).get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', BasePageMockResponses(1, page_size).get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) # Get first page with 1 result @@ -116,8 +116,8 @@ def test_has_next_true_for_result_equal_to_limit(self): def test_has_next_false_for_result_less_than_limit(self): page_size = 1 # Init with mock that returns zero rows - with patch('test_pagination_base.TestPageIterator.operation', BasePageMockResponses(0, page_size).get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', BasePageMockResponses(0, page_size).get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) # Get first page with 0 result @@ -129,8 +129,8 @@ def test_next_first_page(self): page_size = 25 # Mock that returns one page of 25 items mock = BasePageMockResponses(page_size, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) # Get first page @@ -142,8 +142,8 @@ def test_next_two_pages(self): page_size = 3 # Mock that returns two pages of 3 items mock = BasePageMockResponses(2*page_size, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) # Get first page @@ -163,8 +163,8 @@ def test_next_until_empty(self): page_size = 3 # Mock that returns 3 pages of 3 items mock = BasePageMockResponses(3*page_size, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) page_count = 0 @@ -182,8 +182,8 @@ def test_next_until_smaller(self): page_size = 3 # Mock that returns 3 pages of 3 items, then 1 more page with 1 item mock = BasePageMockResponses(3*page_size + 1, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) page_count = 0 @@ -201,8 +201,8 @@ def test_next_exception(self): page_size = 2 # Mock that returns one page of one item mock = BasePageMockResponses(page_size - 1, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) # Get first and only page @@ -218,8 +218,8 @@ def test_next_exception(self): def test_pages_immutable(self): page_size = 1 mock = BasePageMockResponses(page_size, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) # Get page @@ -230,8 +230,8 @@ def test_pages_immutable(self): def test_set_next_page_options(self): page_size = 1 mock = BasePageMockResponses(5*page_size, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) self.assertIsNone(page_iterator._next_page_opts.get('start_key'), "The start key should intially be None.") @@ -248,8 +248,8 @@ def test_set_next_page_options(self): def test_next_resumes_after_error(self): page_size = 1 mock = BasePageMockResponses(3*page_size, page_size) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): - page_iterator: Iterable[ViewResultRow] = TestPageIterator( + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): + page_iterator: Iterable[ViewResultRow] = BaseTestPageIterator( self.client, {'limit': page_size}) self.assertIsNone(page_iterator._next_page_opts.get('start_key'), "The start key should intially be None.") @@ -269,8 +269,8 @@ def test_next_resumes_after_error(self): def test_pages_iterable(self): page_size = 23 mock = BasePageMockResponses(3*page_size-1, page_size) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): # Check pages are iterable page_number = 0 for page in pagination.pages(): @@ -282,8 +282,8 @@ def test_pages_iterable(self): def test_rows_iterable(self): page_size = 23 mock = BasePageMockResponses(3*page_size-1, page_size) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): actual_items = [] # Check rows are iterable for row in pagination.rows(): @@ -294,8 +294,8 @@ def test_as_pager_get_next_first_page(self): page_size = 7 # Mock that returns two pages of 7 items mock = BasePageMockResponses(2*page_size, page_size) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): pager = pagination.pager() # Get first page actual_page: list[ViewResultRow] = pager.get_next() @@ -305,8 +305,8 @@ def test_as_pager_get_all(self): page_size = 11 # Mock that returns 6 pages of 11 items, then 1 more page with 5 items mock = BasePageMockResponses(71, page_size) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): pager: Pager[ViewResultRow] = pagination.pager() actual_items = pager.get_all() self.assertSequenceEqual(actual_items, mock.all_expected_items(), "The results should match all the pages.") @@ -326,8 +326,8 @@ def test_as_pager_get_all_restarts_after_error(self): first_page, mock.get_next_page() ]) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mockmock): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mockmock): pager = pagination.pager() with self.assertRaises(Exception): pager.get_all() @@ -337,8 +337,8 @@ def test_as_pager_get_next_get_all_raises(self): page_size = 11 # Mock that returns 6 pages of 11 items, then 1 more page with 5 items mock = BasePageMockResponses(71, page_size) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): pager: Pager[ViewResultRow] = pagination.pager() first_page = pager.get_next() self.assertSequenceEqual(first_page, mock.get_expected_page(1), "The actual page should match the expected page") @@ -358,8 +358,8 @@ def test_as_pager_get_all_get_next_raises(self): first_page, Exception('test exception') ]) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mockmock): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mockmock): pager = pagination.pager() # Stop get all part way through so it isn't consumed when we call get Next with self.assertRaises(Exception): @@ -378,8 +378,8 @@ def test_as_pager_get_next_resumes_after_error(self): Exception('test exception'), mock.get_next_page() ]) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mockmock): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mockmock): pager = pagination.pager() # Assert first page self.assertSequenceEqual(pager.get_next(), mock.get_expected_page(1), "The actual page should match the expected page") @@ -392,8 +392,8 @@ def test_as_pager_get_next_until_consumed(self): page_size = 7 # Mock that returns two pages of 7 items mock = BasePageMockResponses(2*page_size, page_size) - pagination = Pagination(self.client, TestPageIterator, {'limit': page_size}) - with patch('test_pagination_base.TestPageIterator.operation', mock.get_next_page): + pagination = Pagination(self.client, BaseTestPageIterator, {'limit': page_size}) + with patch('test_pagination_base.BaseTestPageIterator.operation', mock.get_next_page): pager = pagination.pager() page_count = 0 while pager.has_next(): From 63050486a4af518c6f0295d36cc27c6117a2fc18 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:30:30 +0000 Subject: [PATCH 549/669] build(generated): simplify stub merging Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 8b68462 --- stubs/mappings.json | 1052 ++++++++++++++++++++++--------------------- 1 file changed, 536 insertions(+), 516 deletions(-) diff --git a/stubs/mappings.json b/stubs/mappings.json index 2f927bd7..362fb53e 100644 --- a/stubs/mappings.json +++ b/stubs/mappings.json @@ -1,533 +1,553 @@ -{"mappings":[{ - "id": "4e7ecd46-9129-42a1-8899-985567444ad6", - "name": "orders_example", - "request": { - "url": "/orders/example?rev=4-bf3f53fe029a70e6451e375ccd36599c", - "method": "DELETE" - }, - "response": { - "status": 404, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "750c2d635a", - "X-CouchDB-Body-Time": "0" - }, - "jsonBody": { - "error": "not_found", - "reason": "deleted" - } - }, - "uuid": "4e7ecd46-9129-42a1-8899-985567444ad6", - "persistent": true, - "insertionIndex": 18 -},{ - "id": "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", - "name": "orders_example", - "request": { - "url": "/orders/example?rev=2-4e2178e85cffb32d38ba4e451f6ca376", - "method": "DELETE" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"3-4f1787d7a0520f825bd36822d7be627a\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "1b41b9bfa1", - "X-CouchDB-Body-Time": "0" +{ + "mappings": [ + { + "id": "4e7ecd46-9129-42a1-8899-985567444ad6", + "name": "orders_example", + "request": { + "url": "/orders/example?rev=4-bf3f53fe029a70e6451e375ccd36599c", + "method": "DELETE" + }, + "response": { + "status": 404, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "750c2d635a", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "error": "not_found", + "reason": "deleted" + } + }, + "uuid": "4e7ecd46-9129-42a1-8899-985567444ad6", + "persistent": true, + "insertionIndex": 18 }, - "jsonBody": { - "ok": true, - "id": "example", - "rev": "3-4f1787d7a0520f825bd36822d7be627a" - } - }, - "uuid": "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", - "persistent": true, - "insertionIndex": 17 -},{ - "id": "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", - "name": "orders_example", - "request": { - "url": "/orders/example", - "method": "GET" - }, - "response": { - "status": 404, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "403d112b46", - "X-CouchDB-Body-Time": "0" + { + "id": "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", + "name": "orders_example", + "request": { + "url": "/orders/example?rev=2-4e2178e85cffb32d38ba4e451f6ca376", + "method": "DELETE" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"3-4f1787d7a0520f825bd36822d7be627a\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "1b41b9bfa1", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "3-4f1787d7a0520f825bd36822d7be627a" + } + }, + "uuid": "9fa984ad-62e6-4e74-a0ee-a531711f5dbc", + "persistent": true, + "insertionIndex": 17 }, - "jsonBody": { - "error": "not_found", - "reason": "deleted" - } - }, - "uuid": "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", - "persistent": true, - "scenarioName": "scenario-2-orders-example", - "requiredScenarioState": "scenario-2-orders-example-6", - "insertionIndex": 16 -},{ - "id": "9fa984ad-62e6-4e74-a0ee-a531711f5dba", - "name": "orders_example", - "request": { - "url": "/orders/example?rev=3-4f1787d7a0520f825bd36822d7be627a", - "method": "DELETE" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"4-bf3f53fe029a70e6451e375ccd36599c\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "1b41b9bfa1", - "X-CouchDB-Body-Time": "0" + { + "id": "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 404, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "403d112b46", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "error": "not_found", + "reason": "deleted" + } + }, + "uuid": "75821ec1-cfed-41f0-bdef-cf3524a0ec4a", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-6", + "insertionIndex": 16 }, - "jsonBody": { - "ok": true, - "id": "example", - "rev": "4-bf3f53fe029a70e6451e375ccd36599c" - } - }, - "uuid": "9fa984ad-62e6-4e74-a0ee-a531711f5dba", - "persistent": true, - "insertionIndex": 15 -},{ - "id": "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", - "name": "orders_example", - "request": { - "url": "/orders/example", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"4-bf3f53fe029a70e6451e375ccd36599c\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "175d24412f", - "X-CouchDB-Body-Time": "0" + { + "id": "9fa984ad-62e6-4e74-a0ee-a531711f5dba", + "name": "orders_example", + "request": { + "url": "/orders/example?rev=3-4f1787d7a0520f825bd36822d7be627a", + "method": "DELETE" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"4-bf3f53fe029a70e6451e375ccd36599c\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "1b41b9bfa1", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "4-bf3f53fe029a70e6451e375ccd36599c" + } + }, + "uuid": "9fa984ad-62e6-4e74-a0ee-a531711f5dba", + "persistent": true, + "insertionIndex": 15 }, - "jsonBody": { - "_id": "example", - "_rev": "4-bf3f53fe029a70e6451e375ccd36599c", - "name": "Bob Smith", - "address": "19 Front Street, Darlington, DL5 1TY" - } - }, - "uuid": "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", - "persistent": true, - "scenarioName": "scenario-2-orders-example", - "requiredScenarioState": "scenario-2-orders-example-5", - "newScenarioState": "scenario-2-orders-example-6", - "insertionIndex": 14 -},{ - "id": "9d0f096d-1d43-414f-8831-5e6e6abe7659", - "name": "orders", - "request": { - "url": "/orders", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"_id\":\"example\",\"_rev\":\"3-4f1787d7a0520f825bd36822d7be627a\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Location": "http://localhost:5984/orders/example", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "32c3176598", - "X-CouchDB-Body-Time": "0" + { + "id": "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"4-bf3f53fe029a70e6451e375ccd36599c\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "175d24412f", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "4-bf3f53fe029a70e6451e375ccd36599c", + "name": "Bob Smith", + "address": "19 Front Street, Darlington, DL5 1TY" + } + }, + "uuid": "777d45f4-fdb3-43c4-835f-1fcafcbfd26b", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-5", + "newScenarioState": "scenario-2-orders-example-6", + "insertionIndex": 14 }, - "jsonBody": { - "ok": true, - "id": "example", - "rev": "4-bf3f53fe029a70e6451e375ccd36599c" - } - }, - "uuid": "9d0f096d-1d43-414f-8831-5e6e6abe7659", - "persistent": true, - "insertionIndex": 13 -},{ - "id": "232b9d9d-1506-44a9-a11a-66639eb9250e", - "name": "orders_example", - "request": { - "url": "/orders/example", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"3-4f1787d7a0520f825bd36822d7be627a\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "4b23a37b39", - "X-CouchDB-Body-Time": "0" + { + "id": "9d0f096d-1d43-414f-8831-5e6e6abe7659", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\":\"example\",\"_rev\":\"3-4f1787d7a0520f825bd36822d7be627a\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "32c3176598", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "4-bf3f53fe029a70e6451e375ccd36599c" + } + }, + "uuid": "9d0f096d-1d43-414f-8831-5e6e6abe7659", + "persistent": true, + "insertionIndex": 13 }, - "jsonBody": { - "_id": "example", - "_rev": "3-4f1787d7a0520f825bd36822d7be627a", - "name": "Bob Smith", - "address": "19 Front Street, Darlington, DL5 1TY" - } - }, - "uuid": "232b9d9d-1506-44a9-a11a-66639eb9250e", - "persistent": true, - "scenarioName": "scenario-2-orders-example", - "requiredScenarioState": "scenario-2-orders-example-4", - "newScenarioState": "scenario-2-orders-example-5", - "insertionIndex": 12 -},{ - "id": "d2d672a9-90d5-4959-b7c6-cef7538fd233", - "name": "orders", - "request": { - "url": "/orders", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"_id\":\"example\",\"_rev\":\"2-4e2178e85cffb32d38ba4e451f6ca376\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Location": "http://localhost:5984/orders/example", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "260d229417", - "X-CouchDB-Body-Time": "0" + { + "id": "232b9d9d-1506-44a9-a11a-66639eb9250e", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"3-4f1787d7a0520f825bd36822d7be627a\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "4b23a37b39", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "3-4f1787d7a0520f825bd36822d7be627a", + "name": "Bob Smith", + "address": "19 Front Street, Darlington, DL5 1TY" + } + }, + "uuid": "232b9d9d-1506-44a9-a11a-66639eb9250e", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-4", + "newScenarioState": "scenario-2-orders-example-5", + "insertionIndex": 12 }, - "jsonBody": { - "ok": true, - "id": "example", - "rev": "3-4f1787d7a0520f825bd36822d7be627a" - } - }, - "uuid": "d2d672a9-90d5-4959-b7c6-cef7538fd233", - "persistent": true, - "insertionIndex": 11 -},{ - "id": "b19304eb-3f50-4af2-b692-23847652a661", - "name": "orders_example", - "request": { - "url": "/orders/example", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"2-4e2178e85cffb32d38ba4e451f6ca376\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "fd177b95bf", - "X-CouchDB-Body-Time": "0" + { + "id": "d2d672a9-90d5-4959-b7c6-cef7538fd233", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\":\"example\",\"_rev\":\"2-4e2178e85cffb32d38ba4e451f6ca376\",\"name\":\"Bob Smith\",\"address\":\"19 Front Street, Darlington, DL5 1TY\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "260d229417", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "3-4f1787d7a0520f825bd36822d7be627a" + } + }, + "uuid": "d2d672a9-90d5-4959-b7c6-cef7538fd233", + "persistent": true, + "insertionIndex": 11 }, - "jsonBody": { - "_id": "example", - "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:59.000Z" - } - }, - "uuid": "b19304eb-3f50-4af2-b692-23847652a661", - "persistent": true, - "scenarioName": "scenario-2-orders-example", - "requiredScenarioState": "scenario-2-orders-example-3", - "newScenarioState": "scenario-2-orders-example-4", - "insertionIndex": 10 -},{ - "id": "61d277cc-c7e5-4390-8845-4276000c224e", - "name": "orders", - "request": { - "url": "/orders", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"_id\": \"example\", \"_rev\": \"1-1b403633540686aa32d013fda9041a5d\", \"name\": \"Bob Smith\", \"address\": \"19 Front Street, Darlington, DL5 1TY\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Location": "http://localhost:5984/orders/example", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "ef31b7a04b", - "X-CouchDB-Body-Time": "0" + { + "id": "b19304eb-3f50-4af2-b692-23847652a661", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"2-4e2178e85cffb32d38ba4e451f6ca376\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "fd177b95bf", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:59.000Z" + } + }, + "uuid": "b19304eb-3f50-4af2-b692-23847652a661", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-3", + "newScenarioState": "scenario-2-orders-example-4", + "insertionIndex": 10 }, - "jsonBody": { - "ok": true, - "id": "example", - "rev": "2-4e2178e85cffb32d38ba4e451f6ca376" - } - }, - "uuid": "61d277cc-c7e5-4390-8845-4276000c224e", - "persistent": true, - "insertionIndex": 9 -},{ - "id": "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", - "name": "orders_example", - "request": { - "url": "/orders/example", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"1-1b403633540686aa32d013fda9041a5d\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "f9bef554c3", - "X-CouchDB-Body-Time": "0" + { + "id": "61d277cc-c7e5-4390-8845-4276000c224e", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\": \"example\", \"_rev\": \"1-1b403633540686aa32d013fda9041a5d\", \"name\": \"Bob Smith\", \"address\": \"19 Front Street, Darlington, DL5 1TY\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "ef31b7a04b", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "2-4e2178e85cffb32d38ba4e451f6ca376" + } + }, + "uuid": "61d277cc-c7e5-4390-8845-4276000c224e", + "persistent": true, + "insertionIndex": 9 }, - "jsonBody": { - "_id": "example", - "_rev": "1-1b403633540686aa32d013fda9041a5d", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:59.000Z" - } - }, - "uuid": "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", - "persistent": true, - "scenarioName": "scenario-2-orders-example", - "requiredScenarioState": "scenario-2-orders-example-2", - "newScenarioState": "scenario-2-orders-example-3", - "insertionIndex": 8 -},{ - "id": "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", - "name": "orders", - "request": { - "url": "/orders", - "method": "PUT" - }, - "response": { - "status": 412, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "474375177b", - "X-CouchDB-Body-Time": "0" + { + "id": "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"1-1b403633540686aa32d013fda9041a5d\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "f9bef554c3", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:59.000Z" + } + }, + "uuid": "c8ad5e93-3d1c-4fd4-a6ed-92f28a683a23", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "scenario-2-orders-example-2", + "newScenarioState": "scenario-2-orders-example-3", + "insertionIndex": 8 }, - "jsonBody": { - "error": "file_exists", - "reason": "The database could not be created, the file already exists." - } - }, - "uuid": "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", - "persistent": true, - "scenarioName": "scenario-1-orders", - "requiredScenarioState": "scenario-1-orders-2", - "insertionIndex": 7 -},{ - "id": "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", - "name": "orders", - "request": { - "url": "/orders", - "method": "POST", - "bodyPatterns": [ - { - "equalToJson": "{\"_id\":\"example\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}", - "ignoreArrayOrder": true, - "ignoreExtraElements": true - } - ] - }, - "response": { - "status": 201, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Location": "http://localhost:5984/orders/example", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "1528aeb812", - "X-CouchDB-Body-Time": "0" + { + "id": "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", + "name": "orders", + "request": { + "url": "/orders", + "method": "PUT" + }, + "response": { + "status": 412, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "474375177b", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "error": "file_exists", + "reason": "The database could not be created, the file already exists." + } + }, + "uuid": "b6d3f5e3-8689-4740-8a5a-273c9ed9f5a7", + "persistent": true, + "scenarioName": "scenario-1-orders", + "requiredScenarioState": "scenario-1-orders-2", + "insertionIndex": 7 }, - "jsonBody": { - "ok": true, - "id": "example", - "rev": "1-1b403633540686aa32d013fda9041a5d" - } - }, - "uuid": "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", - "persistent": true, - "insertionIndex": 6 -},{ - "id": "05def288-5864-48e7-87ff-f7552a9dd1c2", - "name": "orders", - "request": { - "url": "/orders", - "method": "PUT" - }, - "response": { - "status": 201, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Location": "http://localhost:5984/orders", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "141b3ba868", - "X-CouchDB-Body-Time": "0" + { + "id": "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", + "name": "orders", + "request": { + "url": "/orders", + "method": "POST", + "bodyPatterns": [ + { + "equalToJson": "{\"_id\":\"example\",\"name\":\"Bob Smith\",\"joined\":\"2019-01-24T10:42:59.000Z\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders/example", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "1528aeb812", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true, + "id": "example", + "rev": "1-1b403633540686aa32d013fda9041a5d" + } + }, + "uuid": "666242fb-0be6-4e5d-8e68-fbfa863f3f3a", + "persistent": true, + "insertionIndex": 6 }, - "jsonBody": { - "ok": true - } - }, - "uuid": "05def288-5864-48e7-87ff-f7552a9dd1c2", - "persistent": true, - "scenarioName": "scenario-1-orders", - "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-orders-2", - "insertionIndex": 4 -},{ - "id": "af927fc5-341a-4f9d-9c48-83a57aa7b505", - "name": "orders_example", - "request": { - "url": "/orders/example", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "ETag": "\"1-1b403633540686aa32d013fda9041a5d\"", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "f9bef554c3", - "X-CouchDB-Body-Time": "0" + { + "id": "05def288-5864-48e7-87ff-f7552a9dd1c2", + "name": "orders", + "request": { + "url": "/orders", + "method": "PUT" + }, + "response": { + "status": 201, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Location": "http://localhost:5984/orders", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "141b3ba868", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "ok": true + } + }, + "uuid": "05def288-5864-48e7-87ff-f7552a9dd1c2", + "persistent": true, + "scenarioName": "scenario-1-orders", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-orders-2", + "insertionIndex": 4 }, - "jsonBody": { - "_id": "example", - "_rev": "1-1b403633540686aa32d013fda9041a5d", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:59.000Z" - } - }, - "uuid": "af927fc5-341a-4f9d-9c48-83a57aa7b505", - "persistent": true, - "scenarioName": "scenario-2-orders-example", - "requiredScenarioState": "Started", - "newScenarioState": "scenario-2-orders-example-2", - "insertionIndex": 3 -},{ - "id": "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", - "name": "orders", - "request": { - "url": "/orders", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "832fcf2ea2", - "X-CouchDB-Body-Time": "0" + { + "id": "af927fc5-341a-4f9d-9c48-83a57aa7b505", + "name": "orders_example", + "request": { + "url": "/orders/example", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "ETag": "\"1-1b403633540686aa32d013fda9041a5d\"", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "f9bef554c3", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "_id": "example", + "_rev": "1-1b403633540686aa32d013fda9041a5d", + "name": "Bob Smith", + "joined": "2019-01-24T10:42:59.000Z" + } + }, + "uuid": "af927fc5-341a-4f9d-9c48-83a57aa7b505", + "persistent": true, + "scenarioName": "scenario-2-orders-example", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-orders-example-2", + "insertionIndex": 3 }, - "jsonBody": { - "db_name": "orders", - "purge_seq": "0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4", - "update_seq": "1-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEjlxqEtkSKoHK2DLAgCGPRlt", - "sizes": { - "file": 57751, - "external": 3450, - "active": 7355 - }, - "props": {}, - "doc_del_count": 0, - "doc_count": 1, - "disk_format_version": 8, - "compact_running": false, - "cluster": { - "q": 2, - "n": 1, - "w": 1, - "r": 1 - }, - "instance_start_time": "0" - } - }, - "uuid": "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", - "persistent": true, - "insertionIndex": 2 -},{ - "id": "50eb71a6-e709-4d04-aba8-861a4135cdb8", - "name": "", - "request": { - "url": "/", - "method": "GET" - }, - "response": { - "status": 200, - "headers": { - "Cache-Control": "must-revalidate", - "Content-Type": "application/json", - "Date": "Tue, 21 Jul 2020 07:58:57 GMT", - "Server": "CouchDB/3.0.0 (Erlang OTP/20)", - "X-Couch-Request-ID": "b6cf47349d", - "X-CouchDB-Body-Time": "0" + { + "id": "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", + "name": "orders", + "request": { + "url": "/orders", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "832fcf2ea2", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "db_name": "orders", + "purge_seq": "0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4", + "update_seq": "1-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEjlxqEtkSKoHK2DLAgCGPRlt", + "sizes": { + "file": 57751, + "external": 3450, + "active": 7355 + }, + "props": {}, + "doc_del_count": 0, + "doc_count": 1, + "disk_format_version": 8, + "compact_running": false, + "cluster": { + "q": 2, + "n": 1, + "w": 1, + "r": 1 + }, + "instance_start_time": "0" + } + }, + "uuid": "e8a4edcf-8d9d-431b-8a99-76f5d9ad8a7b", + "persistent": true, + "insertionIndex": 2 }, - "jsonBody": { - "couchdb": "Welcome", - "version": "2.1.1", - "git_sha": "03a77db6c", - "uuid": "cffa3c2cc703d6caed7ec9a9f6d110e9", - "features": [ - "access-ready", - "partitioned", - "pluggable-storage-engines", - "reshard", - "scheduler" - ], - "vendor": { - "name": "The Apache Software Foundation" - } + { + "id": "50eb71a6-e709-4d04-aba8-861a4135cdb8", + "name": "", + "request": { + "url": "/", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Cache-Control": "must-revalidate", + "Content-Type": "application/json", + "Date": "Tue, 21 Jul 2020 07:58:57 GMT", + "Server": "CouchDB/3.0.0 (Erlang OTP/20)", + "X-Couch-Request-ID": "b6cf47349d", + "X-CouchDB-Body-Time": "0" + }, + "jsonBody": { + "couchdb": "Welcome", + "version": "2.1.1", + "git_sha": "03a77db6c", + "uuid": "cffa3c2cc703d6caed7ec9a9f6d110e9", + "features": [ + "access-ready", + "partitioned", + "pluggable-storage-engines", + "reshard", + "scheduler" + ], + "vendor": { + "name": "The Apache Software Foundation" + } + } + }, + "uuid": "50eb71a6-e709-4d04-aba8-861a4135cdb8", + "persistent": true, + "insertionIndex": 1 } - }, - "uuid": "50eb71a6-e709-4d04-aba8-861a4135cdb8", - "persistent": true, - "insertionIndex": 1 -}]} + ] +} From 1de3806240134018721962349d5d3c4f4cf08cee Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 22 Oct 2025 09:09:19 +0000 Subject: [PATCH 550/669] PR feedback(generated): use enum values instead of plain strings Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 52aab7c --- examples/README.md | 7 +++++-- .../snippets/postActivityTrackerEvents/example_request.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/README.md b/examples/README.md index dd2db2cf..5f80b163 100644 --- a/examples/README.md +++ b/examples/README.md @@ -125,12 +125,15 @@ _POST `/_api/v2/user/activity_tracker/events`_ [embedmd]:# (snippets/postActivityTrackerEvents/example_request.py) ```py # section: code -from ibmcloudant.cloudant_v1 import CloudantV1 +from ibmcloudant.cloudant_v1 import CloudantV1, ActivityTrackerEvents service = CloudantV1.new_instance() response = service.post_activity_tracker_events( - types=['management'] + types=[ + ActivityTrackerEvents.TypesEnum.MANAGEMENT, + ActivityTrackerEvents.TypesEnum.DATA + ] ).get_result() print(response) diff --git a/examples/snippets/postActivityTrackerEvents/example_request.py b/examples/snippets/postActivityTrackerEvents/example_request.py index a4af6f0a..8460282f 100644 --- a/examples/snippets/postActivityTrackerEvents/example_request.py +++ b/examples/snippets/postActivityTrackerEvents/example_request.py @@ -1,10 +1,13 @@ # section: code -from ibmcloudant.cloudant_v1 import CloudantV1 +from ibmcloudant.cloudant_v1 import CloudantV1, ActivityTrackerEvents service = CloudantV1.new_instance() response = service.post_activity_tracker_events( - types=['management'] + types=[ + ActivityTrackerEvents.TypesEnum.MANAGEMENT, + ActivityTrackerEvents.TypesEnum.DATA + ] ).get_result() print(response) From 2dd1408ad43d29a9615aad62eb52839795fe75ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 22:44:19 +0000 Subject: [PATCH 551/669] build(deps-dev): Bump pylint from 4.0.1 to 4.0.2 Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v4.0.1...v4.0.2) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4cb49430..1c3007dc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==8.4.2 responses==0.25.8 python_dotenv==1.1.1 -pylint==4.0.1 +pylint==4.0.2 # code coverage coverage==7.11.0 pytest-cov==7.0.0 From 72f721611699f35c77e833350cefb3f6cc9aa84f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 01:20:30 +0000 Subject: [PATCH 552/669] build(deps): Bump github/codeql-action from 3.30.6 to 4.30.9 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.6 to 4.30.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/64d10c13136e1c5bce3e5fbde8d4906eeaafc885...16140ae1a102900babc80a33c44059580f687047) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.30.9 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 812b747a..8f60e8f3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 + uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 + uses: github/codeql-action/autobuild@16140ae1a102900babc80a33c44059580f687047 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 + uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v3.29.5 with: category: "/language:${{matrix.language}}" From e56594541909c6393c13d11f5c2be52a253b793b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:38:57 +0000 Subject: [PATCH 553/669] build(deps-dev): Bump python-dotenv from 1.1.1 to 1.2.1 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.1.1 to 1.2.1. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.1.1...v1.2.1) --- updated-dependencies: - dependency-name: python-dotenv dependency-version: 1.2.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1c3007dc..3ca63180 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ flit==3.12.0 # test dependencies pytest==8.4.2 responses==0.25.8 -python_dotenv==1.1.1 +python_dotenv==1.2.1 pylint==4.0.2 # code coverage coverage==7.11.0 From c557a3104d01ba31a472e2ecc7111fc3947aeb98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Oct 2025 08:25:45 +0000 Subject: [PATCH 554/669] build(deps): Bump github/codeql-action from 4.30.9 to 4.31.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.30.9 to 4.31.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/16140ae1a102900babc80a33c44059580f687047...4e94bd11f71e507f7f87df81788dff88d1dacbfb) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8f60e8f3..5fb2ec01 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # v3.29.5 + uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@16140ae1a102900babc80a33c44059580f687047 # v3.29.5 + uses: github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v3.29.5 + uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 with: category: "/language:${{matrix.language}}" From 95df21f3ac6d3c3327a41039544e142c39839ce2 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 28 Oct 2025 16:24:53 +0000 Subject: [PATCH 555/669] docs(generated): improve snippet examples Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 0a2725e --- examples/README.md | 10 ++++------ examples/snippets/getDbUpdates/example_request.py | 1 - examples/snippets/getDesignDocument/example_request.py | 3 +-- examples/snippets/postDesignDocs/example_request.py | 2 +- .../snippets/postDesignDocsQueries/example_request.py | 2 +- .../postFind/example_request_for_text_index_type.py | 2 +- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/README.md b/examples/README.md index 5f80b163..6bb22b35 100644 --- a/examples/README.md +++ b/examples/README.md @@ -249,7 +249,6 @@ service = CloudantV1.new_instance() response = service.get_db_updates( feed='normal', - heartbeat=10000, since='now' ).get_result() @@ -1001,8 +1000,7 @@ service = CloudantV1.new_instance() response = service.get_design_document( db='products', - ddoc='appliances', - latest=True + ddoc='appliances' ).get_result() print(response) @@ -1237,7 +1235,7 @@ from ibmcloudant.cloudant_v1 import CloudantV1 service = CloudantV1.new_instance() response = service.post_design_docs( - attachments=True, + descending=True, db='users' ).get_result() @@ -1264,7 +1262,7 @@ doc1 = AllDocsQuery( ) doc2 = AllDocsQuery( inclusive_end=True, - key='_design/allusers', + start_key='_design/allusers', skip=1 ) @@ -1335,7 +1333,7 @@ service = CloudantV1.new_instance() response = service.post_find( db='users', - selector={'address': {'$regex': 'Street'}}, + selector={'address': {'$exists': True}}, fields=["_id", "type", "name", "email", "address"], limit=3 ).get_result() diff --git a/examples/snippets/getDbUpdates/example_request.py b/examples/snippets/getDbUpdates/example_request.py index 8c99878f..ea8ce344 100644 --- a/examples/snippets/getDbUpdates/example_request.py +++ b/examples/snippets/getDbUpdates/example_request.py @@ -5,7 +5,6 @@ response = service.get_db_updates( feed='normal', - heartbeat=10000, since='now' ).get_result() diff --git a/examples/snippets/getDesignDocument/example_request.py b/examples/snippets/getDesignDocument/example_request.py index 7330e77c..97fd1080 100644 --- a/examples/snippets/getDesignDocument/example_request.py +++ b/examples/snippets/getDesignDocument/example_request.py @@ -5,8 +5,7 @@ response = service.get_design_document( db='products', - ddoc='appliances', - latest=True + ddoc='appliances' ).get_result() print(response) diff --git a/examples/snippets/postDesignDocs/example_request.py b/examples/snippets/postDesignDocs/example_request.py index 92373308..6fe6331c 100644 --- a/examples/snippets/postDesignDocs/example_request.py +++ b/examples/snippets/postDesignDocs/example_request.py @@ -4,7 +4,7 @@ service = CloudantV1.new_instance() response = service.post_design_docs( - attachments=True, + descending=True, db='users' ).get_result() diff --git a/examples/snippets/postDesignDocsQueries/example_request.py b/examples/snippets/postDesignDocsQueries/example_request.py index ce1a089f..c562af36 100644 --- a/examples/snippets/postDesignDocsQueries/example_request.py +++ b/examples/snippets/postDesignDocsQueries/example_request.py @@ -10,7 +10,7 @@ ) doc2 = AllDocsQuery( inclusive_end=True, - key='_design/allusers', + start_key='_design/allusers', skip=1 ) diff --git a/examples/snippets/postFind/example_request_for_text_index_type.py b/examples/snippets/postFind/example_request_for_text_index_type.py index ae8f3583..c704b7de 100644 --- a/examples/snippets/postFind/example_request_for_text_index_type.py +++ b/examples/snippets/postFind/example_request_for_text_index_type.py @@ -5,7 +5,7 @@ response = service.post_find( db='users', - selector={'address': {'$regex': 'Street'}}, + selector={'address': {'$exists': True}}, fields=["_id", "type", "name", "email", "address"], limit=3 ).get_result() From 61a6e71baf07594bffbbe6e8efbfaa6f1f5c10c8 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:07:55 +0000 Subject: [PATCH 556/669] fix(generated): correct name to new snippets in examples README Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.29 - Automation (cloudant-sdks) version 5284919 --- examples/README.md | 19 +++++++++++++++++++ .../example_request_as_a_stream.py | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 examples/snippets/postDocument/example_request_as_a_stream.py diff --git a/examples/README.md b/examples/README.md index 6bb22b35..3331e4b2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -656,6 +656,25 @@ response = service.post_document(db='products', document=products_doc).get_resul print(response) ``` +### [Example request as a stream](snippets/postDocument/example_request_as_a_stream.py) + +[embedmd]:# (snippets/postDocument/example_request_as_a_stream.py) +```py +# section: code +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +with open("products_doc.json", "rb") as products_doc: + response = service.post_document( + db='products', + document=products_doc_binary, + content_type="application/json" + ).get_result() + +print(response) +``` + ## putDatabase _PUT `/{db}`_ diff --git a/examples/snippets/postDocument/example_request_as_a_stream.py b/examples/snippets/postDocument/example_request_as_a_stream.py new file mode 100644 index 00000000..879ddbee --- /dev/null +++ b/examples/snippets/postDocument/example_request_as_a_stream.py @@ -0,0 +1,13 @@ +# section: code +from ibmcloudant.cloudant_v1 import Document, CloudantV1 + +service = CloudantV1.new_instance() + +with open("products_doc.json", "rb") as products_doc: + response = service.post_document( + db='products', + document=products_doc_binary, + content_type="application/json" + ).get_result() + +print(response) From b9f35323407a894bad5a77aca0fc7a1b711f4866 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:56:35 +0000 Subject: [PATCH 557/669] build(deps): Bump github/codeql-action from 4.31.0 to 4.31.2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.0 to 4.31.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/4e94bd11f71e507f7f87df81788dff88d1dacbfb...0499de31b99561a6d14a36a5f662c2a54f91beee) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5fb2ec01..0cbcaf70 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 + uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 + uses: github/codeql-action/autobuild@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 + uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5 with: category: "/language:${{matrix.language}}" From 4890d0f8afc49a3dd956cff59362cf05bbdd7104 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:44:03 +0000 Subject: [PATCH 558/669] feat(generated): update API definition to 1.0.0-dev0.1.30 Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.30 - Automation (cloudant-sdks) version ae20582 --- ibmcloudant/cloudant_v1.py | 477 +++++++++++++++------------ stubs/gen-its-mappings.json | 4 +- test/integration/test_cloudant_v1.py | 14 +- test/unit/test_cloudant_v1.py | 45 +-- 4 files changed, 301 insertions(+), 239 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 843868ef..6a4336fd 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -292,18 +292,17 @@ def get_db_updates( type. :param int heartbeat: (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by - default and only applicable for - `continuous` and `eventsource` feeds. Overrides any timeout to keep the - feed alive indefinitely. May also be `true` to use a value of `60000`. + default and only applicable for `continuous` and `eventsource` feeds. + Overrides any timeout to keep the feed alive indefinitely. May also be + `true` to use a value of `60000`. **Note:** Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break, `heartbeat` is not suitable as a keepalive mechanism. Instead, consider one of the following options: - * Use the `timeout` parameter with a value that is compatible with your - network environment. + * Use the `timeout` parameter with a value that is compatible with + your network environment. * Switch to scheduled usage of one of the non-continuous changes feed - types - (`normal` or `longpoll`). + types (`normal` or `longpoll`). * Use TCP keepalive. :param int limit: (optional) Query parameter to specify the number of returned documents to limit the result to. @@ -314,8 +313,12 @@ def get_db_updates( configuration option. Note that `60000` value is also the default maximum timeout to prevent undetected dead connections. :param str since: (optional) Query parameter to specify to start the - results from the change immediately after the given update sequence. Can be - a valid update sequence or `now` value. Default is `0` i.e. all changes. + results from the change immediately after the given update sequence. + Possible values are: + * `0` for all available changes (default). + * `now` for future changes. + * A valid update sequence, for example, from the `seq` value of a + change received before. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `DbUpdates` object @@ -426,9 +429,9 @@ def post_changes( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -458,11 +461,10 @@ def post_changes( The built-in filter types are: * `_design` - Returns only changes to design documents. * `_doc_ids` - Returns changes for documents with an ID matching one - specified in - `doc_ids` request body parameter. (`POST` only) - * `_selector` - Returns changes for documents that match the `selector` - request body parameter. The selector syntax is the same as used for - `_find`. (`POST` only) + specified in `doc_ids` request body parameter. (`POST` only) + * `_selector` - Returns changes for documents that match the + `selector` request body parameter. The selector syntax is the same + as used for `_find`. (`POST` only) * `_view` - Returns changes for documents that match an existing map function in the view specified by the query parameter `view`. Additionally, the value can be the name of a JS filter function from a @@ -473,18 +475,17 @@ def post_changes( `_selector` filter type. :param int heartbeat: (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by - default and only applicable for - `continuous` and `eventsource` feeds. Overrides any timeout to keep the - feed alive indefinitely. May also be `true` to use a value of `60000`. + default and only applicable for `continuous` and `eventsource` feeds. + Overrides any timeout to keep the feed alive indefinitely. May also be + `true` to use a value of `60000`. **Note:** Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break, `heartbeat` is not suitable as a keepalive mechanism. Instead, consider one of the following options: - * Use the `timeout` parameter with a value that is compatible with your - network environment. + * Use the `timeout` parameter with a value that is compatible with + your network environment. * Switch to scheduled usage of one of the non-continuous changes feed - types - (`normal` or `longpoll`). + types (`normal` or `longpoll`). * Use TCP keepalive. :param bool include_docs: (optional) Query parameter to specify whether to include the full content of the documents in the response. @@ -498,8 +499,12 @@ def post_changes( computing the seq value across many shards (especially in highly-sharded databases) is expensive. :param str since: (optional) Query parameter to specify to start the - results from the change immediately after the given update sequence. Can be - a valid update sequence or `now` value. Default is `0` i.e. all changes. + results from the change immediately after the given update sequence. + Possible values are: + * `0` for all available changes (default). + * `now` for future changes. + * A valid update sequence, for example, from the `seq` value of a + change received before. :param str style: (optional) Query parameter to specify how many revisions are returned in the changes array. The default, `main_only`, will only return the current "winning" revision; all_docs will return all leaf @@ -644,9 +649,9 @@ def post_changes_as_stream( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -676,11 +681,10 @@ def post_changes_as_stream( The built-in filter types are: * `_design` - Returns only changes to design documents. * `_doc_ids` - Returns changes for documents with an ID matching one - specified in - `doc_ids` request body parameter. (`POST` only) - * `_selector` - Returns changes for documents that match the `selector` - request body parameter. The selector syntax is the same as used for - `_find`. (`POST` only) + specified in `doc_ids` request body parameter. (`POST` only) + * `_selector` - Returns changes for documents that match the + `selector` request body parameter. The selector syntax is the same + as used for `_find`. (`POST` only) * `_view` - Returns changes for documents that match an existing map function in the view specified by the query parameter `view`. Additionally, the value can be the name of a JS filter function from a @@ -691,18 +695,17 @@ def post_changes_as_stream( `_selector` filter type. :param int heartbeat: (optional) Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Off by - default and only applicable for - `continuous` and `eventsource` feeds. Overrides any timeout to keep the - feed alive indefinitely. May also be `true` to use a value of `60000`. + default and only applicable for `continuous` and `eventsource` feeds. + Overrides any timeout to keep the feed alive indefinitely. May also be + `true` to use a value of `60000`. **Note:** Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an environment where idle network connections may break, `heartbeat` is not suitable as a keepalive mechanism. Instead, consider one of the following options: - * Use the `timeout` parameter with a value that is compatible with your - network environment. + * Use the `timeout` parameter with a value that is compatible with + your network environment. * Switch to scheduled usage of one of the non-continuous changes feed - types - (`normal` or `longpoll`). + types (`normal` or `longpoll`). * Use TCP keepalive. :param bool include_docs: (optional) Query parameter to specify whether to include the full content of the documents in the response. @@ -716,8 +719,12 @@ def post_changes_as_stream( computing the seq value across many shards (especially in highly-sharded databases) is expensive. :param str since: (optional) Query parameter to specify to start the - results from the change immediately after the given update sequence. Can be - a valid update sequence or `now` value. Default is `0` i.e. all changes. + results from the change immediately after the given update sequence. + Possible values are: + * `0` for all available changes (default). + * `now` for future changes. + * A valid update sequence, for example, from the `seq` value of a + change received before. :param str style: (optional) Query parameter to specify how many revisions are returned in the changes array. The default, `main_only`, will only return the current "winning" revision; all_docs will return all leaf @@ -2497,7 +2504,7 @@ def put_document( Creates or modifies a document in the specified database. For creation, you must specify the document ID but you should not specify the revision. - For modification, you must specify the document ID and a revision identifier. + For modification, you must specify the document ID and a revision identifier. :param str db: Path parameter to specify the database name. :param str doc_id: Path parameter to specify the document ID. @@ -3204,7 +3211,8 @@ def post_view( in the response an update_seq value indicating the sequence id of the database the view reflects. :param object end_key: (optional) Schema for any JSON type. - :param str end_key_doc_id: (optional) Schema for a document ID. + :param str end_key_doc_id: (optional) Stop returning rows at the specified + document ID. No effect if using `group` or not providing end key. :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups @@ -3215,27 +3223,32 @@ def post_view( group is `true`. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key. - :param object key: (optional) Schema for any JSON type. + :param object key: (optional) Parameter to specify to return only rows that + match the specified key. String representation of any JSON type that + matches the key type emitted by the view function. :param List[object] keys: (optional) Parameter to specify returning only - documents that match any of the specified keys. A JSON array of keys that - match the key type emitted by the view function. + rows that match any of the specified keys. A JSON array of keys that match + the key type emitted by the view function. :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - A default `reduce` view type can be disabled to behave like a `map` by - setting `reduce=false` explicitly. - Be aware that `include_docs=true` can only be used with `map` views. + A default `reduce` view type can be disabled to behave like a + `map` by setting `reduce=false` explicitly. + Be aware that `include_docs=true` is only for `map` views. Reduced views do + not include document IDs in view rows. :param bool stable: (optional) Query parameter to specify whether use the - same replica of the index on each request. The default value `false` - contacts all replicas and returns the result from the first, fastest, + same replica of the index on each request. The default value `false` + contacts all replicas and returns the result from the first, fastest, responder. Setting it to `true` when used in conjunction with - `update=false` may improve consistency at the expense of increased latency + `update=false` may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the - available replicas. + available replicas. **Note:** In general setting `true` is discouraged and is strictly not recommended when using `update=true`. :param object start_key: (optional) Schema for any JSON type. - :param str start_key_doc_id: (optional) Schema for a document ID. + :param str start_key_doc_id: (optional) Start returning rows at the + specified document ID. No effect if using `group` or not providing start + key. :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. @@ -3372,7 +3385,8 @@ def post_view_as_stream( in the response an update_seq value indicating the sequence id of the database the view reflects. :param object end_key: (optional) Schema for any JSON type. - :param str end_key_doc_id: (optional) Schema for a document ID. + :param str end_key_doc_id: (optional) Stop returning rows at the specified + document ID. No effect if using `group` or not providing end key. :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups @@ -3383,27 +3397,32 @@ def post_view_as_stream( group is `true`. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key. - :param object key: (optional) Schema for any JSON type. + :param object key: (optional) Parameter to specify to return only rows that + match the specified key. String representation of any JSON type that + matches the key type emitted by the view function. :param List[object] keys: (optional) Parameter to specify returning only - documents that match any of the specified keys. A JSON array of keys that - match the key type emitted by the view function. + rows that match any of the specified keys. A JSON array of keys that match + the key type emitted by the view function. :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - A default `reduce` view type can be disabled to behave like a `map` by - setting `reduce=false` explicitly. - Be aware that `include_docs=true` can only be used with `map` views. + A default `reduce` view type can be disabled to behave like a + `map` by setting `reduce=false` explicitly. + Be aware that `include_docs=true` is only for `map` views. Reduced views do + not include document IDs in view rows. :param bool stable: (optional) Query parameter to specify whether use the - same replica of the index on each request. The default value `false` - contacts all replicas and returns the result from the first, fastest, + same replica of the index on each request. The default value `false` + contacts all replicas and returns the result from the first, fastest, responder. Setting it to `true` when used in conjunction with - `update=false` may improve consistency at the expense of increased latency + `update=false` may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the - available replicas. + available replicas. **Note:** In general setting `true` is discouraged and is strictly not recommended when using `update=true`. :param object start_key: (optional) Schema for any JSON type. - :param str start_key_doc_id: (optional) Schema for a document ID. + :param str start_key_doc_id: (optional) Start returning rows at the + specified document ID. No effect if using `group` or not providing start + key. :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. @@ -3961,7 +3980,7 @@ def post_partition_search( the specified number. :param List[str] sort: (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies - the sort order within a group. The default sort order is relevance. A JSON + the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type @@ -4095,7 +4114,7 @@ def post_partition_search_as_stream( the specified number. :param List[str] sort: (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies - the sort order within a group. The default sort order is relevance. A JSON + the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type @@ -4236,7 +4255,8 @@ def post_partition_view( in the response an update_seq value indicating the sequence id of the database the view reflects. :param object end_key: (optional) Schema for any JSON type. - :param str end_key_doc_id: (optional) Schema for a document ID. + :param str end_key_doc_id: (optional) Stop returning rows at the specified + document ID. No effect if using `group` or not providing end key. :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups @@ -4247,18 +4267,23 @@ def post_partition_view( group is `true`. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key. - :param object key: (optional) Schema for any JSON type. + :param object key: (optional) Parameter to specify to return only rows that + match the specified key. String representation of any JSON type that + matches the key type emitted by the view function. :param List[object] keys: (optional) Parameter to specify returning only - documents that match any of the specified keys. A JSON array of keys that - match the key type emitted by the view function. + rows that match any of the specified keys. A JSON array of keys that match + the key type emitted by the view function. :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - A default `reduce` view type can be disabled to behave like a `map` by - setting `reduce=false` explicitly. - Be aware that `include_docs=true` can only be used with `map` views. + A default `reduce` view type can be disabled to behave like a + `map` by setting `reduce=false` explicitly. + Be aware that `include_docs=true` is only for `map` views. Reduced views do + not include document IDs in view rows. :param object start_key: (optional) Schema for any JSON type. - :param str start_key_doc_id: (optional) Schema for a document ID. + :param str start_key_doc_id: (optional) Start returning rows at the + specified document ID. No effect if using `group` or not providing start + key. :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. @@ -4400,7 +4425,8 @@ def post_partition_view_as_stream( in the response an update_seq value indicating the sequence id of the database the view reflects. :param object end_key: (optional) Schema for any JSON type. - :param str end_key_doc_id: (optional) Schema for a document ID. + :param str end_key_doc_id: (optional) Stop returning rows at the specified + document ID. No effect if using `group` or not providing end key. :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups @@ -4411,18 +4437,23 @@ def post_partition_view_as_stream( group is `true`. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key. - :param object key: (optional) Schema for any JSON type. + :param object key: (optional) Parameter to specify to return only rows that + match the specified key. String representation of any JSON type that + matches the key type emitted by the view function. :param List[object] keys: (optional) Parameter to specify returning only - documents that match any of the specified keys. A JSON array of keys that - match the key type emitted by the view function. + rows that match any of the specified keys. A JSON array of keys that match + the key type emitted by the view function. :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - A default `reduce` view type can be disabled to behave like a `map` by - setting `reduce=false` explicitly. - Be aware that `include_docs=true` can only be used with `map` views. + A default `reduce` view type can be disabled to behave like a + `map` by setting `reduce=false` explicitly. + Be aware that `include_docs=true` is only for `map` views. Reduced views do + not include document IDs in view rows. :param object start_key: (optional) Schema for any JSON type. - :param str start_key_doc_id: (optional) Schema for a document ID. + :param str start_key_doc_id: (optional) Start returning rows at the + specified document ID. No effect if using `group` or not providing start + key. :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. @@ -4546,9 +4577,9 @@ def post_partition_explain( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -4559,7 +4590,7 @@ def post_partition_explain( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param bool allow_fallback: (optional) Whether to allow fallback to other - indexes. Default is true. + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4580,8 +4611,8 @@ def post_partition_explain( field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. - For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": - "desc"}]` + For example in JSON: + `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]` When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included @@ -4724,9 +4755,9 @@ def post_partition_find( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -4737,7 +4768,7 @@ def post_partition_find( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param bool allow_fallback: (optional) Whether to allow fallback to other - indexes. Default is true. + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4758,8 +4789,8 @@ def post_partition_find( field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. - For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": - "desc"}]` + For example in JSON: + `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]` When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included @@ -4902,9 +4933,9 @@ def post_partition_find_as_stream( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -4915,7 +4946,7 @@ def post_partition_find_as_stream( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param bool allow_fallback: (optional) Whether to allow fallback to other - indexes. Default is true. + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -4936,8 +4967,8 @@ def post_partition_find_as_stream( field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. - For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": - "desc"}]` + For example in JSON: + `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]` When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included @@ -5069,9 +5100,9 @@ def post_explain( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -5082,7 +5113,7 @@ def post_explain( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param bool allow_fallback: (optional) Whether to allow fallback to other - indexes. Default is true. + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5103,8 +5134,8 @@ def post_explain( field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. - For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": - "desc"}]` + For example in JSON: + `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]` When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included @@ -5247,9 +5278,9 @@ def post_find( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -5260,7 +5291,7 @@ def post_find( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param bool allow_fallback: (optional) Whether to allow fallback to other - indexes. Default is true. + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5281,8 +5312,8 @@ def post_find( field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. - For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": - "desc"}]` + For example in JSON: + `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]` When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included @@ -5425,9 +5456,9 @@ def post_find_as_stream( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -5438,7 +5469,7 @@ def post_find_as_stream( For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param bool allow_fallback: (optional) Whether to allow fallback to other - indexes. Default is true. + indexes. Default is true. :param str bookmark: (optional) Opaque bookmark token used when paginating results. :param bool conflicts: (optional) A boolean value that indicates whether or @@ -5459,8 +5490,8 @@ def post_find_as_stream( field name and direction pair is the topmost level of sort. The second pair, if provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document fields. - For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": - "desc"}]` + For example in JSON: + `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]` When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the same order and each object in the sort array has a single key or at least one of the sort fields is included @@ -5854,7 +5885,7 @@ def post_search( the specified number. :param List[str] sort: (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies - the sort order within a group. The default sort order is relevance. A JSON + the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type @@ -6023,7 +6054,7 @@ def post_search_as_stream( the specified number. :param List[str] sort: (optional) Specifies the sort order of the results. In a grouped search (when group_field is used), this parameter specifies - the sort order within a group. The default sort order is relevance. A JSON + the sort order within a group. The default sort order is relevance. A JSON string of the form "fieldname<type>" or "-fieldname<type>" for descending order, where fieldname is the name of a string or number field, and type is either a number, a string, or a JSON array of strings. The type @@ -8355,8 +8386,8 @@ def get_up_information( """ Retrieve information about whether the server is up. - Confirms that the server is up, running, and ready to respond to requests. If - `maintenance_mode` is `true` or `nolb`, the endpoint returns a 404 response. + Confirms that the server is up, running, and ready to respond to requests. If the + cluster is unavailable the endpoint returns a `503` response code. **Tip:** The authentication for this endpoint is only enforced when using IAM. :param dict headers: A `dict` containing the request headers @@ -11419,7 +11450,7 @@ class DatabaseInformation: :param str engine: (optional) The engine used for the database. :param str instance_start_time: An opaque string to detect whether a database has been recreated. The field name is for compatibility with old replicator - versions. Do not use the value to infer timing infromation. Typically only used + versions. Do not use the value to infer timing information. Typically only used by replicators. :param PartitionedIndexesInformation partitioned_indexes: (optional) Information about database's partitioned indexes. @@ -11463,7 +11494,7 @@ def __init__( :param int doc_del_count: Number of deleted documents. :param str instance_start_time: An opaque string to detect whether a database has been recreated. The field name is for compatibility with old - replicator versions. Do not use the value to infer timing infromation. + replicator versions. Do not use the value to infer timing information. Typically only used by replicators. :param DatabaseInformationProps props: Schema for database properties. :param ContentInformationSizes sizes: Schema for size information of @@ -12167,11 +12198,13 @@ class DesignDocument: The function takes 4 parameters: * `newDoc` - New version of document that will be stored from the update request. - * `oldDoc` - Previous version of document that is already stored. - * `userCtx` - User Context Object, containing information about the - user writing the document (if present), see the `UserContext`. - * `secObj` - Security Object, with lists of database security roles, - see the `SecurityObject`. + * `oldDoc` - Previous version of document that is already + stored. + * `userCtx` - User Context Object, containing information + about the user writing the document (if present), see the + `UserContext`. + * `secObj` - Security Object, with lists of database security + roles, see the `SecurityObject`. :param dict views: (optional) Schema for design document views. This type supports additional properties of type object. @@ -12286,11 +12319,13 @@ def __init__( The function takes 4 parameters: * `newDoc` - New version of document that will be stored from the update request. - * `oldDoc` - Previous version of document that is already stored. - * `userCtx` - User Context Object, containing information about the - user writing the document (if present), see the `UserContext`. - * `secObj` - Security Object, with lists of database security roles, - see the `SecurityObject`. + * `oldDoc` - Previous version of document that is already + stored. + * `userCtx` - User Context Object, containing information + about the user writing the document (if present), see the + `UserContext`. + * `secObj` - Security Object, with lists of database security + roles, see the `SecurityObject`. :param dict views: (optional) Schema for design document views. :param object **kwargs: (optional) Additional properties of type object """ @@ -13620,9 +13655,9 @@ class ExplainResult: value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but - not `$ne`) can be used as the basis of a query. You should include at least one - of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should include + at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of @@ -13691,9 +13726,9 @@ def __init__( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -14413,7 +14448,8 @@ class IndexAnalysisExclusionReason: :param str name: A reason code for index's exclusion. The full list of possible reason codes is following: * alphabetically_comes_after: json - There is another suitable index whose name comes before that of this index. + There is another suitable index whose name comes before that of + this index. * empty_selector: text "text" indexes do not support queries with empty selectors. * excluded_by_user: any use_index was used to manually specify the index. @@ -14440,8 +14476,8 @@ def __init__( :param str name: A reason code for index's exclusion. The full list of possible reason codes is following: * alphabetically_comes_after: json - There is another suitable index whose name comes before that of this - index. + There is another suitable index whose name comes before that of + this index. * empty_selector: text "text" indexes do not support queries with empty selectors. * excluded_by_user: any use_index was used to manually specify the index. @@ -14506,7 +14542,8 @@ class NameEnum(str, Enum): A reason code for index's exclusion. The full list of possible reason codes is following: * alphabetically_comes_after: json - There is another suitable index whose name comes before that of this index. + There is another suitable index whose name comes before that of + this index. * empty_selector: text "text" indexes do not support queries with empty selectors. * excluded_by_user: any use_index was used to manually specify the index. @@ -14662,9 +14699,9 @@ class IndexDefinition: value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but - not `$ne`) can be used as the basis of a query. You should include at least one - of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should include + at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of @@ -14733,9 +14770,9 @@ def __init__( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -16346,9 +16383,9 @@ class ReplicationDocument: value stored in that field. For instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but - not `$ne`) can be used as the basis of a query. You should include at least one - of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should include + at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to reduce the number of @@ -16516,9 +16553,9 @@ def __init__( matches when the specified field contains a value that is equal to the supplied argument. It is important for query performance to use appropriate selectors: - * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` - (but not `$ne`) can be used as the basis of a query. You should include at - least one of these in a selector. + * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and + `$lte` (but not `$ne`) can be used as the basis of a query. You should + include at least one of these in a selector. * Some operators such as `$not`, `$or`, `$in`, and `$regex` cannot be answered from an index. For query selectors use these operators in conjunction with equality operators or create and use a partial index to @@ -17878,20 +17915,22 @@ class SearchIndexDefinition: 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 data. The index function takes 2, or optionally 3, parameters. - * The first parameter is the name of the field you intend to use when - querying the index. If the special value `"default"` is used when you - define the name, you do not have to specify a field name at query time. - * The second parameter is the data to be indexed. This data must be only a - string, number, or boolean. Other types will cause an error to be thrown - by the index function call. + * The first parameter is the name of the field you intend to use + when querying the index. If the special value `"default"` is used + when you define the name, you do not have to specify a field name + at query time. + * The second parameter is the data to be indexed. This data must be + only a string, number, or boolean. Other types will cause an error + to be thrown by the index function call. * The optional third parameter is a JavaScript object with these properties: * `facet` - boolean, default `false` - Creates a faceted index. - * `index` - boolean, default `true` - If set to `false`, the data - cannot be used for searches, but can still be retrieved from the - index if `store` is set to `true`. - * `store` - boolean, default `true` - If true, the value is returned - in the search result; otherwise, the value is not returned. + * `index` - boolean, default `true` - If set to `false`, the + data cannot be used for searches, but can still be retrieved + from the index if `store` is set to `true`. + * `store` - boolean, default `true` - If true, the value is + returned in the search result; otherwise, the value is not + returned. """ def __init__( @@ -17908,20 +17947,22 @@ def __init__( parameter, extracts some data from it, and then calls the `index` function to index that data. The index function takes 2, or optionally 3, parameters. - * The first parameter is the name of the field you intend to use when - querying the index. If the special value `"default"` is used when you - define the name, you do not have to specify a field name at query time. - * The second parameter is the data to be indexed. This data must be only a - string, number, or boolean. Other types will cause an error to be thrown - by the index function call. + * The first parameter is the name of the field you intend to use + when querying the index. If the special value `"default"` is used + when you define the name, you do not have to specify a field name + at query time. + * The second parameter is the data to be indexed. This data must be + only a string, number, or boolean. Other types will cause an error + to be thrown by the index function call. * The optional third parameter is a JavaScript object with these properties: * `facet` - boolean, default `false` - Creates a faceted index. - * `index` - boolean, default `true` - If set to `false`, the data - cannot be used for searches, but can still be retrieved from the - index if `store` is set to `true`. - * `store` - boolean, default `true` - If true, the value is returned - in the search result; otherwise, the value is not returned. + * `index` - boolean, default `true` - If set to `false`, the + data cannot be used for searches, but can still be retrieved + from the index if `store` is set to `true`. + * `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. """ @@ -18567,7 +18608,7 @@ def __ne__(self, other: 'SearchResultRow') -> bool: class Security: """ - Schema for a security document. + Schema for a Cloudant security document. :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. @@ -19384,6 +19425,7 @@ class UpInformation: """ Schema for information about the up state of the server. + :param str cluster: (optional) cluster. :param dict seeds: (optional) seeds. :param str status: status. """ @@ -19392,14 +19434,17 @@ def __init__( self, status: str, *, + cluster: Optional[str] = None, seeds: Optional[dict] = None, ) -> None: """ Initialize a UpInformation object. :param str status: status. + :param str cluster: (optional) cluster. :param dict seeds: (optional) seeds. """ + self.cluster = cluster self.seeds = seeds self.status = status @@ -19407,6 +19452,8 @@ def __init__( def from_dict(cls, _dict: Dict) -> 'UpInformation': """Initialize a UpInformation object from a json dictionary.""" args = {} + if (cluster := _dict.get('cluster')) is not None: + args['cluster'] = cluster if (seeds := _dict.get('seeds')) is not None: args['seeds'] = seeds if (status := _dict.get('status')) is not None: @@ -19423,6 +19470,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'cluster') and self.cluster is not None: + _dict['cluster'] = self.cluster if hasattr(self, 'seeds') and self.seeds is not None: _dict['seeds'] = self.seeds if hasattr(self, 'status') and self.status is not None: @@ -19791,7 +19840,8 @@ class ViewQuery: the response an update_seq value indicating the sequence id of the database the view reflects. :param object end_key: (optional) Schema for any JSON type. - :param str end_key_doc_id: (optional) Schema for a document ID. + :param str end_key_doc_id: (optional) Stop returning rows at the specified + document ID. No effect if using `group` or not providing end key. :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups further @@ -19801,26 +19851,31 @@ class ViewQuery: is `true`. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key. - :param object key: (optional) Schema for any JSON type. - :param List[object] keys: (optional) Parameter to specify returning only - documents that match any of the specified keys. A JSON array of keys that match - the key type emitted by the view function. + :param object key: (optional) Parameter to specify to return only rows that + match the specified key. String representation of any JSON type that matches the + key type emitted by the view function. + :param List[object] keys: (optional) Parameter to specify returning only rows + that match any of the specified keys. A JSON array of keys that match the key + type emitted by the view function. :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - A default `reduce` view type can be disabled to behave like a `map` by setting - `reduce=false` explicitly. - Be aware that `include_docs=true` can only be used with `map` views. + A default `reduce` view type can be disabled to behave like a + `map` by setting `reduce=false` explicitly. + Be aware that `include_docs=true` is only for `map` views. Reduced views do not + include document IDs in view rows. :param bool stable: (optional) Query parameter to specify whether use the same - replica of the index on each request. The default value `false` contacts all + replica of the index on each request. The default value `false` contacts all replicas and returns the result from the first, fastest, responder. Setting it - to `true` when used in conjunction with `update=false` may improve consistency - at the expense of increased latency and decreased throughput if the selected - replica is not the fastest of the available replicas. + to `true` when used in conjunction with + `update=false` may improve consistency at the expense of increased latency and + decreased throughput if the selected replica is not the fastest of the available + replicas. **Note:** In general setting `true` is discouraged and is strictly not recommended when using `update=true`. :param object start_key: (optional) Schema for any JSON type. - :param str start_key_doc_id: (optional) Schema for a document ID. + :param str start_key_doc_id: (optional) Start returning rows at the specified + document ID. No effect if using `group` or not providing start key. :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. @@ -19878,7 +19933,8 @@ def __init__( in the response an update_seq value indicating the sequence id of the database the view reflects. :param object end_key: (optional) Schema for any JSON type. - :param str end_key_doc_id: (optional) Schema for a document ID. + :param str end_key_doc_id: (optional) Stop returning rows at the specified + document ID. No effect if using `group` or not providing end key. :param bool group: (optional) Parameter to specify whether to group reduced results by key. Valid only if a reduce function defined in the view. If the view emits key in JSON array format, then it is possible to reduce groups @@ -19889,27 +19945,32 @@ def __init__( group is `true`. Group level groups the reduced results by the specified number of array elements. If unset, results are grouped by the entire array key, returning a reduced value for each complete key. - :param object key: (optional) Schema for any JSON type. + :param object key: (optional) Parameter to specify to return only rows that + match the specified key. String representation of any JSON type that + matches the key type emitted by the view function. :param List[object] keys: (optional) Parameter to specify returning only - documents that match any of the specified keys. A JSON array of keys that - match the key type emitted by the view function. + rows that match any of the specified keys. A JSON array of keys that match + the key type emitted by the view function. :param bool reduce: (optional) Parameter to specify whether to use the reduce function in a map-reduce view. Default is true when a reduce function is defined. - A default `reduce` view type can be disabled to behave like a `map` by - setting `reduce=false` explicitly. - Be aware that `include_docs=true` can only be used with `map` views. + A default `reduce` view type can be disabled to behave like a + `map` by setting `reduce=false` explicitly. + Be aware that `include_docs=true` is only for `map` views. Reduced views do + not include document IDs in view rows. :param bool stable: (optional) Query parameter to specify whether use the - same replica of the index on each request. The default value `false` - contacts all replicas and returns the result from the first, fastest, + same replica of the index on each request. The default value `false` + contacts all replicas and returns the result from the first, fastest, responder. Setting it to `true` when used in conjunction with - `update=false` may improve consistency at the expense of increased latency + `update=false` may improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the - available replicas. + available replicas. **Note:** In general setting `true` is discouraged and is strictly not recommended when using `update=true`. :param object start_key: (optional) Schema for any JSON type. - :param str start_key_doc_id: (optional) Schema for a document ID. + :param str start_key_doc_id: (optional) Start returning rows at the + specified document ID. No effect if using `group` or not providing start + key. :param str update: (optional) Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index dc148f99..5c5bce1b 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -2829,7 +2829,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "equalToJson": "{\"bookmark\": \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productId\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", "ignoreArrayOrder": false, "ignoreExtraElements": true } @@ -2918,7 +2918,7 @@ "method": "POST", "bodyPatterns": [ { - "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productid\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", + "equalToJson": "{\"bookmark\" : \"testString\",\"conflicts\" : true, \"execution_stats\" : true, \"fields\" : [ \"productId\", \"name\", \"description\" ], \"limit\" : 25, \"selector\" : { }, \"skip\" : 0, \"sort\" : [ { \"key1\": \"asc\" } ], \"stable\" : true, \"update\" : \"true\", \"use_index\" : [ \"testString\" ]}", "ignoreArrayOrder": false, "ignoreExtraElements": true } diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index be039006..9c9f99b7 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -267,7 +267,7 @@ def test_post_document(self): 'keywords': '["Foo","Scales","Weight","Digital","Kitchen"]', 'name': 'Digital Kitchen Scales', 'price': '14.99', - 'productid': '1000042', + 'productId': '1000042', 'taxonomy': '["Home","Kitchen","Small Appliances"]', 'type': 'product', } @@ -659,7 +659,7 @@ def test_put_document(self): 'keywords': '["Foo","Scales","Weight","Digital","Kitchen"]', 'name': 'Digital Kitchen Scales', 'price': '14.99', - 'productid': '1000042', + 'productId': '1000042', 'taxonomy': '["Home","Kitchen","Small Appliances"]', 'type': 'product', } @@ -757,7 +757,7 @@ def test_put_design_document(self): } # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = { - 'map': 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}', + 'map': 'function(doc) {\n emit(doc.productId, [doc.brand, doc.name, doc.description])\n}', 'reduce': 'testString', } # Construct a dict representation of a DesignDocument model @@ -1179,7 +1179,7 @@ def test_post_partition_explain(self): bookmark='testString', conflicts=True, execution_stats=True, - fields=['productid', 'name', 'description'], + fields=['productId', 'name', 'description'], limit=25, skip=0, sort=[{'key1': 'asc'}], @@ -1202,7 +1202,7 @@ def test_post_partition_find(self): bookmark='testString', conflicts=True, execution_stats=True, - fields=['productid', 'name', 'description'], + fields=['productId', 'name', 'description'], limit=25, skip=0, sort=[{'key1': 'asc'}], @@ -1225,7 +1225,7 @@ def test_post_partition_find_as_stream(self): bookmark='testString', conflicts=True, execution_stats=True, - fields=['productid', 'name', 'description'], + fields=['productId', 'name', 'description'], limit=25, skip=0, sort=[{'key1': 'asc'}], @@ -1952,7 +1952,7 @@ def test_put_local_document(self): 'keywords': '["Foo","Scales","Weight","Digital","Kitchen"]', 'name': 'Digital Kitchen Scales', 'price': '14.99', - 'productid': '1000042', + 'productId': '1000042', 'taxonomy': '["Home","Kitchen","Small Appliances"]', 'type': 'product', } diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 3b369a6c..afe58425 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1695,7 +1695,7 @@ def test_post_document_all_params(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -1792,7 +1792,7 @@ def test_post_document_required_params(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -1881,7 +1881,7 @@ def test_post_document_value_error(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -4176,7 +4176,7 @@ def test_put_document_all_params(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -4283,7 +4283,7 @@ def test_put_document_required_params(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -4374,7 +4374,7 @@ def test_put_document_value_error(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -4922,7 +4922,7 @@ def test_put_design_document_all_params(self): # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} - design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' + design_document_views_map_reduce_model['map'] = 'function(doc) {\n emit(doc.productId, [doc.brand, doc.name, doc.description])\n}' design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5052,7 +5052,7 @@ def test_put_design_document_required_params(self): # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} - design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' + design_document_views_map_reduce_model['map'] = 'function(doc) {\n emit(doc.productId, [doc.brand, doc.name, doc.description])\n}' design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -5168,7 +5168,7 @@ def test_put_design_document_value_error(self): # Construct a dict representation of a DesignDocumentViewsMapReduce model design_document_views_map_reduce_model = {} - design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}' + design_document_views_map_reduce_model['map'] = 'function(doc) {\n emit(doc.productId, [doc.brand, doc.name, doc.description])\n}' design_document_views_map_reduce_model['reduce'] = 'testString' # Construct a dict representation of a DesignDocument model @@ -7426,7 +7426,7 @@ def test_post_partition_explain_all_params(self): bookmark = 'testString' conflicts = True execution_stats = True - fields = ['productid', 'name', 'description'] + fields = ['productId', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7467,7 +7467,7 @@ def test_post_partition_explain_all_params(self): assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['productid', 'name', 'description'] + assert req_body['fields'] == ['productId', 'name', 'description'] assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] @@ -7508,7 +7508,7 @@ def test_post_partition_explain_value_error(self): bookmark = 'testString' conflicts = True execution_stats = True - fields = ['productid', 'name', 'description'] + fields = ['productId', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7566,7 +7566,7 @@ def test_post_partition_find_all_params(self): bookmark = 'testString' conflicts = True execution_stats = True - fields = ['productid', 'name', 'description'] + fields = ['productId', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7607,7 +7607,7 @@ def test_post_partition_find_all_params(self): assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['productid', 'name', 'description'] + assert req_body['fields'] == ['productId', 'name', 'description'] assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] @@ -7648,7 +7648,7 @@ def test_post_partition_find_value_error(self): bookmark = 'testString' conflicts = True execution_stats = True - fields = ['productid', 'name', 'description'] + fields = ['productId', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7706,7 +7706,7 @@ def test_post_partition_find_as_stream_all_params(self): bookmark = 'testString' conflicts = True execution_stats = True - fields = ['productid', 'name', 'description'] + fields = ['productId', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -7747,7 +7747,7 @@ def test_post_partition_find_as_stream_all_params(self): assert req_body['bookmark'] == 'testString' assert req_body['conflicts'] == True assert req_body['execution_stats'] == True - assert req_body['fields'] == ['productid', 'name', 'description'] + assert req_body['fields'] == ['productId', 'name', 'description'] assert req_body['limit'] == 25 assert req_body['skip'] == 0 assert req_body['sort'] == [{'key1': 'asc'}] @@ -7794,7 +7794,7 @@ def test_post_partition_find_as_stream_value_error(self): bookmark = 'testString' conflicts = True execution_stats = True - fields = ['productid', 'name', 'description'] + fields = ['productId', 'name', 'description'] limit = 25 skip = 0 sort = [{'key1': 'asc'}] @@ -12772,7 +12772,7 @@ def test_put_local_document_all_params(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -12871,7 +12871,7 @@ def test_put_local_document_required_params(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -12962,7 +12962,7 @@ def test_put_local_document_value_error(self): document_model['keywords'] = '["Foo","Scales","Weight","Digital","Kitchen"]' document_model['name'] = 'Digital Kitchen Scales' document_model['price'] = '14.99' - document_model['productid'] = '1000042' + document_model['productId'] = '1000042' document_model['taxonomy'] = '["Home","Kitchen","Small Appliances"]' document_model['type'] = 'product' @@ -13691,7 +13691,7 @@ def test_get_up_information_all_params(self): """ # Set up mock url = preprocess_url('/_up') - mock_response = '{"seeds": {"anyKey": "anyValue"}, "status": "maintenance_mode"}' + mock_response = '{"cluster": "cluster", "seeds": {"anyKey": "anyValue"}, "status": "maintenance_mode"}' responses.add( responses.GET, url, @@ -18309,6 +18309,7 @@ def test_up_information_serialization(self): # Construct a json representation of a UpInformation model up_information_model_json = {} + up_information_model_json['cluster'] = 'testString' up_information_model_json['seeds'] = {'anyKey': 'anyValue'} up_information_model_json['status'] = 'maintenance_mode' From 66ff5d762e49cb7e3b9f1b149e69442f23c9eb74 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:01:38 +0000 Subject: [PATCH 559/669] Update version 0.11.0 -> 0.11.1 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 099ff6a5..d54f3814 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.0" +current_version = "0.11.1" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 698c11ad..4172ffef 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.0 +# IBM Cloudant Python SDK Version 0.11.1 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Pagination.md) (beta) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.0" +pip install --upgrade "ibmcloudant>=0.11.1" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.0" +easy_install --upgrade "ibmcloudant>=0.11.1" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index fcfa0e51..cd04c814 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index 569f3170..0a3b6a2f 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -324,4 +324,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index d06581f9..3c6bf0c8 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.0/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index e34c8468..e862993b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.0 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.1 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 3d8ac7d2..46e0d4d9 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.0' +__version__ = '0.11.1' diff --git a/pyproject.toml b/pyproject.toml index 48392396..574bcb02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.0" +version = "0.11.1" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 6f4834f7498126bb3cb177fb8b1d26a59fa66a03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:01:20 +0000 Subject: [PATCH 560/669] build(deps-dev): Bump coverage from 7.11.0 to 7.11.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.11.0 to 7.11.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.11.0...7.11.1) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.11.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3ca63180..8446fa13 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.2 # code coverage -coverage==7.11.0 +coverage==7.11.1 pytest-cov==7.0.0 From 197af8adfa592650049130e539ac7558abd0d79c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:11:05 +0000 Subject: [PATCH 561/669] build(deps-dev): Bump coverage from 7.11.1 to 7.11.3 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.11.1 to 7.11.3. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.11.1...7.11.3) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.11.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8446fa13..9586a977 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.2 # code coverage -coverage==7.11.1 +coverage==7.11.3 pytest-cov==7.0.0 From 05f70d60a13525941487b26a31420db62d975b01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:54:03 +0000 Subject: [PATCH 562/669] build(deps-dev): Bump pytest from 8.4.2 to 9.0.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.2 to 9.0.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.4.2...9.0.0) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9586a977..e4474b20 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==8.4.2 +pytest==9.0.0 responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.2 From c770153b8cf81efbae18c47d37395004423679d9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 14 Nov 2025 10:06:13 +0000 Subject: [PATCH 563/669] fix(generated): improve _up examples Generated SDK source code using: - Generator version 3.107.1 - Specification version 1.0.0-dev0.1.30 - Automation (cloudant-sdks) version e8e7dee --- examples/README.md | 13 ++++++++++--- .../snippets/getUpInformation/example_request.py | 13 ++++++++++--- .../snippets/headUpInformation/example_request.py | 14 ++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 examples/snippets/headUpInformation/example_request.py diff --git a/examples/README.md b/examples/README.md index 3331e4b2..6012bf94 100644 --- a/examples/README.md +++ b/examples/README.md @@ -549,12 +549,19 @@ _GET `/_up`_ ```py # section: code from ibmcloudant.cloudant_v1 import CloudantV1 +from ibm_cloud_sdk_core.api_exception import ApiException service = CloudantV1.new_instance() +try: + response = service.get_up_information() -response = service.get_up_information().get_result() - -print(response) + print("Service is up and healthy") + print(response.get_result()) +except ApiException as ae: + if ae.code == 503: + print(f"Service is unavailable, status code: {ae.code}") + else: + print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}") ``` ## getUuids diff --git a/examples/snippets/getUpInformation/example_request.py b/examples/snippets/getUpInformation/example_request.py index 4e6be59e..215a2208 100644 --- a/examples/snippets/getUpInformation/example_request.py +++ b/examples/snippets/getUpInformation/example_request.py @@ -1,8 +1,15 @@ # section: code from ibmcloudant.cloudant_v1 import CloudantV1 +from ibm_cloud_sdk_core.api_exception import ApiException service = CloudantV1.new_instance() +try: + response = service.get_up_information() -response = service.get_up_information().get_result() - -print(response) + print("Service is up and healthy") + print(response.get_result()) +except ApiException as ae: + if ae.code == 503: + print(f"Service is unavailable, status code: {ae.code}") + else: + print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}") diff --git a/examples/snippets/headUpInformation/example_request.py b/examples/snippets/headUpInformation/example_request.py new file mode 100644 index 00000000..9942e6d6 --- /dev/null +++ b/examples/snippets/headUpInformation/example_request.py @@ -0,0 +1,14 @@ +# section: code +from ibmcloudant.cloudant_v1 import CloudantV1 +from ibm_cloud_sdk_core.api_exception import ApiException + +service = CloudantV1.new_instance() +try: + response = service.head_up_information() + + print("Service is up and healthy") +except ApiException as ae: + if ae.code == 503: + print(f"Service is unavailable, status code: {ae.code}") + else: + print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}") From 1b22058726e5c6cff0ccc3a57e33c288ea0fa5e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 17:01:30 +0000 Subject: [PATCH 564/669] build(deps-dev): Bump pylint from 4.0.2 to 4.0.3 Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v4.0.2...v4.0.3) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e4474b20..3b6e2036 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==9.0.0 responses==0.25.8 python_dotenv==1.2.1 -pylint==4.0.2 +pylint==4.0.3 # code coverage coverage==7.11.3 pytest-cov==7.0.0 From 3363f876de46cc41eb55827ad6bde7b8c2b2d8d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 17:01:23 +0000 Subject: [PATCH 565/669] build(deps-dev): Bump pytest from 9.0.0 to 9.0.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 9.0.0 to 9.0.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/9.0.0...9.0.1) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.0.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3b6e2036..727a1157 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==9.0.0 +pytest==9.0.1 responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.3 From a09f70d8252a6a075d66693e05a870e218d4a54d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:21:12 +0000 Subject: [PATCH 566/669] build(deps): Bump github/codeql-action from 4.31.2 to 4.31.3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.2 to 4.31.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/0499de31b99561a6d14a36a5f662c2a54f91beee...014f16e7ab1402f30e7c3329d33797e7948572db) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0cbcaf70..0bbf6dd6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5 + uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5 + uses: github/codeql-action/autobuild@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v3.29.5 + uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 with: category: "/language:${{matrix.language}}" From 2322df95fa6627b399937564e6d5428e9829d1db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:51:17 +0000 Subject: [PATCH 567/669] build(deps): Bump actions/checkout from 5.0.0 to 5.0.1 Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/08c6903cd8c0fde910a37f88322edcfb5dd907a8...93cb6efe18208431cddfb8368fd83d5badbf9bfd) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 5.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0bbf6dd6..c36be85f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 - name: Initialize CodeQL uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 90d80652..bc458925 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c925536..d88e5fa4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From a94c88c09fe6a886756addd65f061b254cdf3eef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 17:01:46 +0000 Subject: [PATCH 568/669] build(deps-dev): Bump coverage from 7.11.3 to 7.12.0 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.11.3 to 7.12.0. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.11.3...7.12.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.12.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 727a1157..bb6391e5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.3 # code coverage -coverage==7.11.3 +coverage==7.12.0 pytest-cov==7.0.0 From 986b1895d446516371737091e296bff43d076cb3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 24 Nov 2025 16:45:28 +0000 Subject: [PATCH 569/669] feat(generated): update API definition to 1.0.0-dev0.1.31 Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.31 - Automation (cloudant-sdks) version 48efa51 --- ibmcloudant/cloudant_v1.py | 458 ++++++++++++++++++++++--------------- 1 file changed, 272 insertions(+), 186 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 6a4336fd..b90a79e6 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -287,7 +287,7 @@ def get_db_updates( feed. :param bool descending: (optional) Query parameter to specify whether to - return the documents in descending by key order. + return rows in descending by key order. :param str feed: (optional) Query parameter to specify the changes feed type. :param int heartbeat: (optional) Query parameter to specify the period in @@ -445,15 +445,20 @@ def post_changes( the last events received by the server on a previous connection. Overrides `since` query parameter. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool descending: (optional) Query parameter to specify whether to - return the documents in descending by key order. + return changes in the descending order with most recent change first. The + `since` parameter has no effect when using descending order. :param str feed: (optional) Query parameter to specify the changes feed type. :param str filter: (optional) Query parameter to specify a filter to emit @@ -665,15 +670,20 @@ def post_changes_as_stream( the last events received by the server on a previous connection. Overrides `since` query parameter. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool descending: (optional) Query parameter to specify whether to - return the documents in descending by key order. + return changes in the descending order with most recent change first. The + `since` parameter has no effect when using descending order. :param str feed: (optional) Query parameter to specify the changes feed type. :param str filter: (optional) Query parameter to specify a filter to emit @@ -866,7 +876,7 @@ def get_all_dbs( Query to retrieve a list of database names from the instance. :param bool descending: (optional) Query parameter to specify whether to - return the documents in descending by key order. + return rows in descending by key order. :param str end_key: (optional) Query parameter to specify to stop returning records when the specified key is reached. String representation of any JSON type that matches the key type emitted by the view function. @@ -1306,19 +1316,20 @@ def post_all_docs( :param str db: Path parameter to specify the database name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -1414,19 +1425,20 @@ def post_all_docs_as_stream( :param str db: Path parameter to specify the database name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -1700,10 +1712,13 @@ def post_bulk_get( :param List[BulkGetQueryDocument] docs: List of document items to get in bulk. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool latest: (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested. :param bool revs: (optional) Query parameter to specify whether to include @@ -1781,10 +1796,13 @@ def post_bulk_get_as_mixed( :param List[BulkGetQueryDocument] docs: List of document items to get in bulk. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool latest: (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested. :param bool revs: (optional) Query parameter to specify whether to include @@ -1862,10 +1880,13 @@ def post_bulk_get_as_related( :param List[BulkGetQueryDocument] docs: List of document items to get in bulk. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool latest: (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested. :param bool revs: (optional) Query parameter to specify whether to include @@ -1943,10 +1964,13 @@ def post_bulk_get_as_stream( :param List[BulkGetQueryDocument] docs: List of document items to get in bulk. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool latest: (optional) Query parameter to specify whether to force retrieving latest leaf revision, no matter what rev was requested. :param bool revs: (optional) Query parameter to specify whether to include @@ -2103,13 +2127,17 @@ def get_document( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool deleted_conflicts: (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the `_deleted_conflicts` property of the returned document. @@ -2206,13 +2234,17 @@ def get_document_as_mixed( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool deleted_conflicts: (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the `_deleted_conflicts` property of the returned document. @@ -2309,13 +2341,17 @@ def get_document_as_related( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool deleted_conflicts: (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the `_deleted_conflicts` property of the returned document. @@ -2412,13 +2448,17 @@ def get_document_as_stream( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool deleted_conflicts: (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the `_deleted_conflicts` property of the returned document. @@ -2751,13 +2791,17 @@ def get_design_document( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool deleted_conflicts: (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the `_deleted_conflicts` property of the returned document. @@ -2997,19 +3041,20 @@ def post_design_docs( :param str db: Path parameter to specify the database name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -3190,19 +3235,20 @@ def post_view( :param str view: Path parameter to specify the map reduce view function name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -3364,19 +3410,20 @@ def post_view_as_stream( :param str view: Path parameter to specify the map reduce view function name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -3725,19 +3772,20 @@ def post_partition_all_docs( :param str partition_key: Path parameter to specify the database partition key. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -3838,19 +3886,20 @@ def post_partition_all_docs_as_stream( :param str partition_key: Path parameter to specify the database partition key. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -4234,19 +4283,20 @@ def post_partition_view( :param str view: Path parameter to specify the map reduce view function name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -4404,19 +4454,20 @@ def post_partition_view_as_stream( :param str view: Path parameter to specify the map reduce view function name. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -6564,13 +6615,17 @@ def get_replication_document( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool conflicts: (optional) Query parameter to specify whether to - include a list of conflicted revisions in each returned document. Active - only when `include_docs` is `true`. + include a list of conflicted revisions in each returned document. Note that + when used with a view-style query or changes feed this only applies when + requesting documents in the response. :param bool deleted_conflicts: (optional) Query parameter to specify whether to include a list of deleted conflicted revisions in the `_deleted_conflicts` property of the returned document. @@ -7775,10 +7830,13 @@ def get_local_document( :param str if_none_match: (optional) Header parameter for a conditional HTTP request not matching an ETag. :param bool attachments: (optional) Query parameter to specify whether to - include attachments bodies in a response. + include attachment content in the response. Note that when used with a + view-style query or changes feed this only applies when requesting + documents in the response. :param bool att_encoding_info: (optional) Query parameter to specify - whether to include the encoding information in attachment stubs if the - particular attachment is compressed. + whether to include the encoding information for compressed attachments. + Note that when used with a view-style query or changes feed this only + applies when requesting documents in the response. :param bool local_seq: (optional) Query parameter to specify whether to include the last update sequence for the document. :param dict headers: A `dict` containing the request headers @@ -9322,19 +9380,20 @@ class AllDocsQuery: Schema for an all documents query operation. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only applies + when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment metadata. + This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a list - of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + of conflicted revisions in each returned document. This only applies when + requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the specified - end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to include + the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records before @@ -9369,19 +9428,20 @@ def __init__( Initialize a AllDocsQuery object. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records @@ -9943,27 +10003,30 @@ class Attachment: Schema for an attachment. :param str content_type: (optional) Attachment MIME type. - :param bytes data: (optional) Base64-encoded content. Available if attachment - content is requested by using the query parameters `attachments=true` or - `atts_since`. Note that when used with a view or changes feed `include_docs` - must also be `true`. - :param str digest: (optional) Content hash digest. It starts with prefix which - announce hash type (e.g. `md5-`) and continues with Base64-encoded hash digest. + :param bytes data: (optional) Base64-encoded content. Available when requested + with `attachments=true` or `atts_since`. When retrieving attachments for a + single document this field is only avialable when accepting an application/json + response. For multipart responses each attachment is instead included in a + separate part of the response (see `follows`). + Note that SDK deserialization of documents with included attachments + automatically decodes the Base64 encoded attachment content string to bytes. + :param str digest: (optional) Content hash digest. It starts with prefix + declaring the hash type, `md5-` for example, and continues with the + Base64-encoded hash digest. :param int encoded_length: (optional) Compressed attachment size in bytes. - Available if content_type was in list of compressible types when the attachment - was added and the query parameter `att_encoding_info` is `true`. Note that when - used with a view or changes feed `include_docs` must also be `true`. - :param str encoding: (optional) Compression codec. Available if content_type was - in list of compressible types when the attachment was added and the and the - query parameter `att_encoding_info` is `true`. Note that when used with a view - or changes feed `include_docs` must also be `true`. + Available for compressed attachments when requested with `att_encoding_info`. + The database compresses attachments if the content_type is in the list of + compressible types when added. + :param str encoding: (optional) Compression codec. Available for compressed + attachments when requested with `att_encoding_info`. The database compresses + attachments if the content_type is in the list of compressible types when added. :param bool follows: (optional) True if the attachment follows in a multipart request or response. :param int length: (optional) Real attachment size in bytes. Not available if inline attachment content requested. - :param int revpos: (optional) Revision number when attachment was added. - :param bool stub: (optional) Has `true` value if object contains stub info and - no content. Otherwise omitted in response. + :param int revpos: (optional) Revision number at attachment addition. + :param bool stub: (optional) Has `true` value if object has stub attachment + metadata, but not attachment content. Otherwise omitted in response. """ def __init__( @@ -9983,30 +10046,33 @@ def __init__( Initialize a Attachment object. :param str content_type: (optional) Attachment MIME type. - :param bytes data: (optional) Base64-encoded content. Available if - attachment content is requested by using the query parameters - `attachments=true` or `atts_since`. Note that when used with a view or - changes feed `include_docs` must also be `true`. + :param bytes data: (optional) Base64-encoded content. Available when + requested with `attachments=true` or `atts_since`. When retrieving + attachments for a single document this field is only avialable when + accepting an application/json response. For multipart responses each + attachment is instead included in a separate part of the response (see + `follows`). + Note that SDK deserialization of documents with included attachments + automatically decodes the Base64 encoded attachment content string to + bytes. :param str digest: (optional) Content hash digest. It starts with prefix - which announce hash type (e.g. `md5-`) and continues with Base64-encoded - hash digest. + declaring the hash type, `md5-` for example, and continues with the + Base64-encoded hash digest. :param int encoded_length: (optional) Compressed attachment size in bytes. - Available if content_type was in list of compressible types when the - attachment was added and the query parameter `att_encoding_info` is `true`. - Note that when used with a view or changes feed `include_docs` must also be - `true`. - :param str encoding: (optional) Compression codec. Available if - content_type was in list of compressible types when the attachment was - added and the and the query parameter `att_encoding_info` is `true`. Note - that when used with a view or changes feed `include_docs` must also be - `true`. + Available for compressed attachments when requested with + `att_encoding_info`. The database compresses attachments if the + content_type is in the list of compressible types when added. + :param str encoding: (optional) Compression codec. Available for compressed + attachments when requested with `att_encoding_info`. The database + compresses attachments if the content_type is in the list of compressible + types when added. :param bool follows: (optional) True if the attachment follows in a multipart request or response. :param int length: (optional) Real attachment size in bytes. Not available if inline attachment content requested. - :param int revpos: (optional) Revision number when attachment was added. - :param bool stub: (optional) Has `true` value if object contains stub info - and no content. Otherwise omitted in response. + :param int revpos: (optional) Revision number at attachment addition. + :param bool stub: (optional) Has `true` value if object has stub attachment + metadata, but not attachment content. Otherwise omitted in response. """ self.content_type = content_type self.data = data @@ -11056,6 +11122,7 @@ class ContentInformationSizes: :param int active: The active size of the content, in bytes. :param int external: The total uncompressed size of the content, in bytes. + This is the value used for IBM Cloudant storage billing. :param int file: The total size of the content as stored on disk, in bytes. """ @@ -11070,6 +11137,7 @@ def __init__( :param int active: The active size of the content, in bytes. :param int external: The total uncompressed size of the content, in bytes. + This is the value used for IBM Cloudant storage billing. :param int file: The total size of the content as stored on disk, in bytes. """ self.active = active @@ -12585,7 +12653,15 @@ class DesignDocumentOptions: Schema for design document options. :param bool partitioned: (optional) Whether this design document describes - partitioned or global indexes. + partitioned or global indexes. Set this option to `false` for a design document + that describes global indexes in a partitioned database. A design document + describes either global or partitioned indexes, but not both. By default, for a + partitioned database this option is `true` and the design document describes + partitioned indexes for queries on a single partition at a time. When set to + `false` this option allows creating global indexes in this design document for + queries spanning many partitions. For non-partitioned databases, the default is + `false` and design documents default to global. Only partitioned databases can + have partitioned indexes. """ def __init__( @@ -12597,7 +12673,15 @@ def __init__( Initialize a DesignDocumentOptions object. :param bool partitioned: (optional) Whether this design document describes - partitioned or global indexes. + partitioned or global indexes. Set this option to `false` for a design + document that describes global indexes in a partitioned database. A design + document describes either global or partitioned indexes, but not both. By + default, for a partitioned database this option is `true` and the design + document describes partitioned indexes for queries on a single partition at + a time. When set to `false` this option allows creating global indexes in + this design document for queries spanning many partitions. For + non-partitioned databases, the default is `false` and design documents + default to global. Only partitioned databases can have partitioned indexes. """ self.partitioned = partitioned @@ -19819,19 +19903,20 @@ class ViewQuery: Schema for a query view operation. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only applies + when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment metadata. + This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a list - of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + of conflicted revisions in each returned document. This only applies when + requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the specified - end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to include + the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records before @@ -19912,19 +19997,20 @@ def __init__( Initialize a ViewQuery object. :param bool att_encoding_info: (optional) Parameter to specify whether to - include the encoding information in attachment stubs if the particular - attachment is compressed. + include the encoding information for compressed attachments. This only + applies when requesting documents in the response. :param bool attachments: (optional) Parameter to specify whether to include - attachments bodies in a response. + attachment content in included document content or only the attachment + metadata. This only applies when requesting documents in the response. :param bool conflicts: (optional) Parameter to specify whether to include a - list of conflicted revisions in each returned document. Active only when - `include_docs` is `true`. + list of conflicted revisions in each returned document. This only applies + when requesting documents in the response. :param bool descending: (optional) Parameter to specify whether to return the documents in descending by key order. :param bool include_docs: (optional) Parameter to specify whether to include the full content of the documents in the response. - :param bool inclusive_end: (optional) Parameter to specify whether the - specified end key should be included in the result. + :param bool inclusive_end: (optional) Parameter to specify whether to + include the specified end key in the result. :param int limit: (optional) Parameter to specify the number of returned documents to limit the result to. :param int skip: (optional) Parameter to specify the number of records From 732c331f35c51de4051d8f99ff44ce0a6e6cbaa9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 25 Nov 2025 11:35:43 +0000 Subject: [PATCH 570/669] chore(generated): cleanup extra whitespace Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.31 - Automation (cloudant-sdks) version af64011 --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e79bd67e..4c1b0e0d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -364,4 +364,3 @@ void publishDocs() { ./scripts/pydoc/publish-doc.sh ''' } - From a1d1685f7d86a776e0a00da8e37f6c5118881495 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:27:23 +0000 Subject: [PATCH 571/669] build(deps): Bump actions/checkout from 5.0.1 to 6.0.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.1 to 6.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/93cb6efe18208431cddfb8368fd83d5badbf9bfd...1af3b93b6815bc44a9784bd300feb67ff0d1eeb3) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c36be85f..192d8983 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - name: Initialize CodeQL uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bc458925..71e76a39 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d88e5fa4..c8ea3624 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From 02627b77760e4b7d43958222a14254d53b7469b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:49:24 +0000 Subject: [PATCH 572/669] build(deps): Bump github/codeql-action from 4.31.3 to 4.31.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.3 to 4.31.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/014f16e7ab1402f30e7c3329d33797e7948572db...fdbfb4d2750291e159f0156def62b853c2798ca2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 192d8983..a891878f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 + uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 + uses: github/codeql-action/autobuild@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v3.29.5 + uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5 with: category: "/language:${{matrix.language}}" From b02520872cfb6176fd53e0da21b9e0ad6eef2fc8 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 27 Nov 2025 17:49:22 +0000 Subject: [PATCH 573/669] fix(generated): progress deleted doc into deleted state Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.31 - Automation (cloudant-sdks) version 66d1dad --- stubs/mappings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/mappings.json b/stubs/mappings.json index 362fb53e..b860410d 100644 --- a/stubs/mappings.json +++ b/stubs/mappings.json @@ -206,7 +206,7 @@ "persistent": true, "scenarioName": "scenario-2-orders-example", "requiredScenarioState": "scenario-2-orders-example-4", - "newScenarioState": "scenario-2-orders-example-5", + "newScenarioState": "scenario-2-orders-example-6", "insertionIndex": 12 }, { From 443e6d533c7bbbf9963e5420992a228392e6fa7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:18:50 +0000 Subject: [PATCH 574/669] build(deps): Bump actions/setup-python from 6.0.0 to 6.1.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.0.0 to 6.1.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/e797f83bcb11b83ae66e0230d6156d7c80228e7c...83679a892e2d95755f2dac6acb0bfd1e9ac5d548) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 71e76a39..35df0436 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.14 - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: '3.14' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8ea3624..4b003263 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 2f0f5d5d9c56d7a9ab837e946a380d57685be095 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 08:09:20 +0000 Subject: [PATCH 575/669] build(deps): Bump github/codeql-action from 4.31.5 to 4.31.6 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.5 to 4.31.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/fdbfb4d2750291e159f0156def62b853c2798ca2...fe4161a26a8629af62121b670040955b330f9af2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a891878f..d3d1346e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5 + uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5 + uses: github/codeql-action/autobuild@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # v3.29.5 + uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 with: category: "/language:${{matrix.language}}" From f1ce13fe7759d25f1d98c41b38600832cd14f802 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:14:46 +0000 Subject: [PATCH 576/669] build(deps-dev): Bump pylint from 4.0.3 to 4.0.4 Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v4.0.3...v4.0.4) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.4 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bb6391e5..de1a51b6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==9.0.1 responses==0.25.8 python_dotenv==1.2.1 -pylint==4.0.3 +pylint==4.0.4 # code coverage coverage==7.12.0 pytest-cov==7.0.0 From 405de8d8a5748528cdcce8e97641e5960c4b297c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:03:29 +0000 Subject: [PATCH 577/669] Update version 0.11.1 -> 0.11.2 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index d54f3814..784f5386 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.1" +current_version = "0.11.2" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 4172ffef..8db77adf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.1 +# IBM Cloudant Python SDK Version 0.11.2 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Pagination.md) (beta) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.1" +pip install --upgrade "ibmcloudant>=0.11.2" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.1" +easy_install --upgrade "ibmcloudant>=0.11.2" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index cd04c814..ae24424d 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index 0a3b6a2f..b1e0c953 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -324,4 +324,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 3c6bf0c8..81c7c494 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.1/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index e862993b..4b054bf3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.1 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.2 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 46e0d4d9..28ed86ad 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.1' +__version__ = '0.11.2' diff --git a/pyproject.toml b/pyproject.toml index 574bcb02..e889317a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.1" +version = "0.11.2" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 615a0fc6f2b1f72290c4e615f041ea62cd248055 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 10:24:43 +0000 Subject: [PATCH 578/669] build(deps-dev): Bump pytest from 9.0.1 to 9.0.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 9.0.1 to 9.0.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/9.0.1...9.0.2) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.0.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index de1a51b6..6b84bd01 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==9.0.1 +pytest==9.0.2 responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.4 From 9de1a6c27aee19db528349e922f0a7af94d009f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 13:29:11 +0000 Subject: [PATCH 579/669] build(deps): Bump actions/checkout from 6.0.0 to 6.0.1 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/1af3b93b6815bc44a9784bd300feb67ff0d1eeb3...8e8c483db84b4bee98b60c0593521ed34d9990e8) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d3d1346e..f16e2213 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Initialize CodeQL uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 35df0436..266d1118 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b003263..d3021c1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From 6b8c57798698288aaf4c812c21b6d1ebcf514753 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 13:46:33 +0000 Subject: [PATCH 580/669] build(deps): Bump github/codeql-action from 4.31.6 to 4.31.7 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.6 to 4.31.7. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/fe4161a26a8629af62121b670040955b330f9af2...cf1bb45a277cb3c205638b2cd5c984db1c46a412) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f16e2213..c0627447 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 + uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 + uses: github/codeql-action/autobuild@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5 + uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5 with: category: "/language:${{matrix.language}}" From aba2e67a3ad17f89746534d7bdf158d23e96639b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:01:26 +0000 Subject: [PATCH 581/669] build(deps-dev): Bump coverage from 7.12.0 to 7.13.0 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.12.0 to 7.13.0. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.12.0...7.13.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.13.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 6b84bd01..e5e37642 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.4 # code coverage -coverage==7.12.0 +coverage==7.13.0 pytest-cov==7.0.0 From 8a9b38578bde3bf50763537667427512c525b8ee Mon Sep 17 00:00:00 2001 From: Kornel-Toth Date: Thu, 11 Dec 2025 13:54:23 +0100 Subject: [PATCH 582/669] test: add testsuite for README code, fix messages, align example outputs --- test/examples/output/create_db_and_doc.txt | 9 +- test/examples/output/delete_doc2.txt | 1 + .../get_info_from_existing_database.txt | 4 +- test/examples/output/update_doc.txt | 1 + test/examples/output/update_doc2.txt | 7 ++ test/examples/src/create_db_and_doc.py | 8 +- test/examples/src/delete_doc.py | 2 +- test/examples/src/test_readme.py | 110 ++++++++++++++++++ test/examples/src/update_doc.py | 2 +- 9 files changed, 131 insertions(+), 13 deletions(-) create mode 100644 test/examples/output/delete_doc2.txt create mode 100644 test/examples/output/update_doc2.txt create mode 100644 test/examples/src/test_readme.py diff --git a/test/examples/output/create_db_and_doc.txt b/test/examples/output/create_db_and_doc.txt index 52cd7a00..8dfe98cf 100644 --- a/test/examples/output/create_db_and_doc.txt +++ b/test/examples/output/create_db_and_doc.txt @@ -1,8 +1,7 @@ "orders" database created. -You have created the document: +You have created the document. Response body: { - "_id": "example", - "_rev": "1-1b403633540686aa32d013fda9041a5d", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:99.000Z" + "ok": true, + "id": "example", + "rev": "1-1b403633540686aa32d013fda9041a5d" } \ No newline at end of file diff --git a/test/examples/output/delete_doc2.txt b/test/examples/output/delete_doc2.txt new file mode 100644 index 00000000..35ea06bd --- /dev/null +++ b/test/examples/output/delete_doc2.txt @@ -0,0 +1 @@ +Cannot delete document because either "orders" database or "example" document was not found. \ No newline at end of file diff --git a/test/examples/output/get_info_from_existing_database.txt b/test/examples/output/get_info_from_existing_database.txt index f9074276..ba544c46 100644 --- a/test/examples/output/get_info_from_existing_database.txt +++ b/test/examples/output/get_info_from_existing_database.txt @@ -1,9 +1,9 @@ -Server Version: 2.1.1 +Server Version: 3.2.1 Document count in "orders" database is 1. Document retrieved from database: { "_id": "example", "_rev": "1-1b403633540686aa32d013fda9041a5d", "name": "Bob Smith", - "joined": "2019-01-24T10:42:99.000Z" + "joined": "2019-01-24T10:42:59.000Z" } \ No newline at end of file diff --git a/test/examples/output/update_doc.txt b/test/examples/output/update_doc.txt index 4ec63a73..5ed0026e 100644 --- a/test/examples/output/update_doc.txt +++ b/test/examples/output/update_doc.txt @@ -1,3 +1,4 @@ +You have updated the document: { "_id": "example", "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", diff --git a/test/examples/output/update_doc2.txt b/test/examples/output/update_doc2.txt new file mode 100644 index 00000000..3bf62984 --- /dev/null +++ b/test/examples/output/update_doc2.txt @@ -0,0 +1,7 @@ +You have updated the document: +{ + "_id": "example", + "_rev": "3-4f1787d7a0520f825bd36822d7be627a", + "name": "Bob Smith", + "address": "19 Front Street, Darlington, DL5 1TY" +} \ No newline at end of file diff --git a/test/examples/src/create_db_and_doc.py b/test/examples/src/create_db_and_doc.py index aceebf8e..b3c3e607 100644 --- a/test/examples/src/create_db_and_doc.py +++ b/test/examples/src/create_db_and_doc.py @@ -14,6 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import json + from ibm_cloud_sdk_core import ApiException from ibmcloudant.cloudant_v1 import CloudantV1, Document @@ -65,7 +67,5 @@ """ # ===================================================================== -# Keeping track of the revision number of the document object -# is necessary for further UPDATE/DELETE operations: -example_document.rev = create_document_response["rev"] -print(f'You have created the document:\n{example_document}') +response_body = json.dumps(create_document_response, indent=2) +print(f'You have created the document. Response body:\n{response_body}') diff --git a/test/examples/src/delete_doc.py b/test/examples/src/delete_doc.py index 993233a3..5cc9461c 100644 --- a/test/examples/src/delete_doc.py +++ b/test/examples/src/delete_doc.py @@ -43,5 +43,5 @@ except ApiException as ae: if ae.status_code == 404: print('Cannot delete document because either ' + - f'"{example_db_name}" database or "{example_doc_id}"' + + f'"{example_db_name}" database or "{example_doc_id}" ' + 'document was not found.') diff --git a/test/examples/src/test_readme.py b/test/examples/src/test_readme.py new file mode 100644 index 00000000..b8f5da38 --- /dev/null +++ b/test/examples/src/test_readme.py @@ -0,0 +1,110 @@ +# © Copyright IBM Corporation 2025. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# Testsuite for the examples in the README file. + +import unittest +import subprocess +import sys +import os +import requests +from pathlib import Path + +parent_dir = Path(__file__).resolve().parent.parent + + +class TestReadmeExamples(unittest.TestCase): + + @classmethod + def setUpClass(cls): + """Set up test environment before all tests""" + # Get WireMock URL from environment + wiremock_url = os.environ.get('WIREMOCK_URL') + + # Reset WireMock scenarios + requests.post(f"{wiremock_url}/__admin/scenarios/reset") + + # Set authentication environment variables + os.environ['CLOUDANT_URL'] = wiremock_url + os.environ['CLOUDANT_AUTH_TYPE'] = 'noauth' + + def run_example_and_check_output(self, script_path, expected_output_path): + env = os.environ.copy() + + # Ensure the subprocess uses the same site-packages + python_path = sys.path.copy() + if 'PYTHONPATH' in env: + python_path.append(env['PYTHONPATH']) + env['PYTHONPATH'] = os.pathsep.join(python_path) + + result = subprocess.run( + [sys.executable, str(script_path)], + capture_output=True, + text=True, + timeout=5, + env=env, + ) + if result.returncode != 0: + self.fail(f"Script failed with return code {result.returncode}\n" + f"STDOUT:\n{result.stdout}\n" + f"STDERR:\n{result.stderr}") + + with open(expected_output_path, 'r') as f: + expected_output = f.read().strip() + + actual_output = result.stdout.strip() + + self.assertEqual(actual_output, expected_output, + f"Output mismatch.\nExpected:\n{expected_output}\n\nGot:\n{actual_output}") + + def test_1_create_db_and_doc_example(self): + """Creates db and doc for the first time""" + script = parent_dir / "src" / "create_db_and_doc.py" + output = parent_dir / "output" / "create_db_and_doc.txt" + self.run_example_and_check_output(script, output) + + def test_2_get_info_from_existing_database_example(self): + """Gets document from orders database""" + script = parent_dir / "src" / "get_info_from_existing_database.py" + output = parent_dir / "output" / "get_info_from_existing_database.txt" + self.run_example_and_check_output(script, output) + + def test_3_update_doc_example_first_time(self): + """Updates doc for the first time""" + script = parent_dir / "src" / "update_doc.py" + output = parent_dir / "output" / "update_doc.txt" + self.run_example_and_check_output(script, output) + + def test_4_update_doc_example_second_time(self): + """Updates doc for the second time""" + script = parent_dir / "src" / "update_doc.py" + output = parent_dir / "output" / "update_doc2.txt" + self.run_example_and_check_output(script, output) + + def test_5_delete_doc_example_existing(self): + """Deletes existing doc""" + script = parent_dir / "src" / "delete_doc.py" + output = parent_dir / "output" / "delete_doc.txt" + self.run_example_and_check_output(script, output) + + def test_6_delete_doc_example_non_existing(self): + """Deletes non-existing doc""" + script = parent_dir / "src" / "delete_doc.py" + output = parent_dir / "output" / "delete_doc2.txt" + self.run_example_and_check_output(script, output) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/examples/src/update_doc.py b/test/examples/src/update_doc.py index e66ae530..82170758 100644 --- a/test/examples/src/update_doc.py +++ b/test/examples/src/update_doc.py @@ -89,6 +89,6 @@ except ApiException as ae: if ae.status_code == 404: - print('Cannot delete document because either ' + + print('Cannot update document because either ' + f'"{example_db_name}" database or "{example_doc_id}" ' + 'document was not found.') From 9e488d49ba4070d6b7fc68ce487889e872dea717 Mon Sep 17 00:00:00 2001 From: Kornel-Toth Date: Thu, 11 Dec 2025 13:54:54 +0100 Subject: [PATCH 583/669] fix: use '_id' instead of 'id' in readme example --- test/examples/src/create_db_and_doc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/examples/src/create_db_and_doc.py b/test/examples/src/create_db_and_doc.py index b3c3e607..92472605 100644 --- a/test/examples/src/create_db_and_doc.py +++ b/test/examples/src/create_db_and_doc.py @@ -40,10 +40,10 @@ # 3. Create a document ================================================ # Create a document object with "example" id example_doc_id = "example" -# Setting `id` for the document is optional when "post_document" -# function is used for CREATE. When `id` is not provided the server +# Setting `_id` for the document is optional when "post_document" +# function is used for CREATE. When `_id` is not provided the server # will generate one for your document. -example_document: Document = Document(id=example_doc_id) +example_document: Document = Document(_id=example_doc_id) # Add "name" and "joined" fields to the document example_document.name = "Bob Smith" From 0aad7a3d6ed34337a5c3d5743832530a49f6a422 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:17:08 +0000 Subject: [PATCH 584/669] build(deps): Bump github/codeql-action from 4.31.7 to 4.31.8 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.7 to 4.31.8. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cf1bb45a277cb3c205638b2cd5c984db1c46a412...1b168cd39490f61582a9beae412bb7057a6b2c4e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c0627447..f1a3efae 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5 + uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5 + uses: github/codeql-action/autobuild@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5 + uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5 with: category: "/language:${{matrix.language}}" From c805077794a4274d79d8db49545f8505529c2266 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 16 Dec 2025 17:16:23 +0000 Subject: [PATCH 585/669] docs(generated): update examples (#923) Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.31 - Automation (cloudant-sdks) version 66d1dad --- docs/Examples.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/Examples.md b/docs/Examples.md index b1e0c953..fb2235e5 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -57,10 +57,10 @@ except ApiException as ae: # 3. Create a document ================================================ # Create a document object with "example" id example_doc_id = "example" -# Setting `id` for the document is optional when "post_document" -# function is used for CREATE. When `id` is not provided the server +# Setting `_id` for the document is optional when "post_document" +# function is used for CREATE. When `_id` is not provided the server # will generate one for your document. -example_document: Document = Document(id=example_doc_id) +example_document: Document = Document(_id=example_doc_id) # Add "name" and "joined" fields to the document example_document.name = "Bob Smith" @@ -84,22 +84,19 @@ create_document_response = client.put_document( """ # ===================================================================== -# Keeping track of the revision number of the document object -# is necessary for further UPDATE/DELETE operations: -example_document.rev = create_document_response["rev"] -print(f'You have created the document:\n{example_document}') +response_body = json.dumps(create_document_response, indent=2) +print(f'You have created the document. Response body:\n{response_body}') ``` When you run the code, you see a result similar to the following output. ```text "orders" database created. -You have created the document: +You have created the document. Response body: { - "_id": "example", - "_rev": "1-1b403633540686aa32d013fda9041a5d", - "name": "Bob Smith", - "joined": "2019-01-24T10:42:99.000Z" + "ok": true, + "id": "example", + "rev": "1-1b403633540686aa32d013fda9041a5d" } ``` @@ -155,14 +152,14 @@ print(f'Document retrieved from database:\n' When you run the code, you see a result similar to the following output. ```text -Server Version: 2.1.1 +Server Version: 3.2.1 Document count in "orders" database is 1. Document retrieved from database: { "_id": "example", "_rev": "1-1b403633540686aa32d013fda9041a5d", "name": "Bob Smith", - "joined": "2019-01-24T10:42:99.000Z" + "joined": "2019-01-24T10:42:59.000Z" } ``` @@ -253,7 +250,7 @@ try: except ApiException as ae: if ae.status_code == 404: - print('Cannot delete document because either ' + + print('Cannot update document because either ' + f'"{example_db_name}" database or "{example_doc_id}" ' + 'document was not found.') ``` @@ -262,6 +259,7 @@ except ApiException as ae: When you run the code, you see a result similar to the following output. ```text +You have updated the document: { "_id": "example", "_rev": "2-4e2178e85cffb32d38ba4e451f6ca376", @@ -311,7 +309,7 @@ try: except ApiException as ae: if ae.status_code == 404: print('Cannot delete document because either ' + - f'"{example_db_name}" database or "{example_doc_id}"' + + f'"{example_db_name}" database or "{example_doc_id}" ' + 'document was not found.') ``` From 3df4513cf8d5052526a14947ea66258e21fa9aea Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Thu, 18 Dec 2025 11:30:44 +0000 Subject: [PATCH 586/669] test: remove obsolete sniff tests --- test/integration/test_integration.py | 45 ---------------------------- 1 file changed, 45 deletions(-) delete mode 100644 test/integration/test_integration.py diff --git a/test/integration/test_integration.py b/test/integration/test_integration.py deleted file mode 100644 index 2e6eb891..00000000 --- a/test/integration/test_integration.py +++ /dev/null @@ -1,45 +0,0 @@ -from ibmcloudant.cloudant_v1 import CloudantV1 -import os -import unittest - -# Read config file -configFile = 'cloudant_v1.env' -configLoaded = None - -if os.path.exists(configFile): - os.environ['IBM_CREDENTIALS_FILE'] = configFile - configLoaded = True -else: - print('External configuration was not found, skipping tests...') - -class TestIntegration(unittest.TestCase): - def setUp(self): - if not configLoaded: - self.skipTest("External configuration not available, skipping...") - - self.cloudant = CloudantV1.new_instance(service_name='SERVER') - self.db_name = os.environ.get('DATABASE_NAME', 'stores') - self.assertIsNotNone(self.cloudant) - self.assertIsNotNone(self.db_name) - - def test_server_information(self): - response = self.cloudant.get_server_information() - self.assertIsNotNone(response) - result = response.get_result() - self.assertIsNotNone(result) - self.assertIsNotNone(result['couchdb']) - self.assertIsNotNone(result['version']) - - def test_head_database(self): - response = self.cloudant.head_database(self.db_name) - self.assertIsNotNone(response) - self.assertIsNotNone(response.get_headers()) - self.assertTrue(len(response.get_headers()) > 0) - - def test_all_docs(self): - response = self.cloudant.post_all_docs(self.db_name) - self.assertIsNotNone(response) - result = response.get_result() - self.assertIsNotNone(result) - self.assertIsNotNone(result['rows']) - self.assertTrue(len(result['rows']) > 0) From 1104ada6ed2ccefa218771dbb00befb481a61e5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 17:01:19 +0000 Subject: [PATCH 587/669] build(deps-dev): Bump coverage from 7.13.0 to 7.13.1 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.13.0 to 7.13.1. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.0...7.13.1) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.13.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e5e37642..8530f56d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.4 # code coverage -coverage==7.13.0 +coverage==7.13.1 pytest-cov==7.0.0 From 664cea4d8c790f761d3764443fbb5355b5e5cb9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 09:07:47 +0000 Subject: [PATCH 588/669] build(deps): Bump github/codeql-action from 4.31.8 to 4.31.9 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/1b168cd39490f61582a9beae412bb7057a6b2c4e...5d4e8d1aca955e8d8589aabd499c5cae939e33c7) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f1a3efae..79c9a138 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5 + uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5 + uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v3.29.5 + uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5 with: category: "/language:${{matrix.language}}" From 9e39282969fde0276f136575df6ec29a511441c3 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 5 Jan 2026 11:41:45 +0000 Subject: [PATCH 589/669] build(generated): Update release issue template for 2026 Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.31 - Automation (cloudant-sdks) version 7f7869e --- ibmcloudant/cloudant_v1.py | 2 +- test/integration/test_cloudant_v1.py | 2 +- test/unit/test_cloudant_v1.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index b90a79e6..c53f68d1 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 9c9f99b7..841232ce 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index afe58425..88189dfe 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 50e94d6b4fd6b9c0de61f166f0bb7ab4017c71ef Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 5 Jan 2026 13:28:55 +0000 Subject: [PATCH 590/669] docs(generated): update container auth profile ID example Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.31 - Automation (cloudant-sdks) version fe476c6 --- docs/Authentication.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Authentication.md b/docs/Authentication.md index 9709a6ce..d40a7142 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -32,7 +32,7 @@ This library requires credentials to authenticate with IBM Cloudant. These crede | Authentication type | Recommended for | `AUTH_TYPE` | Description | | --- | --- | --- | --- | -| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | +| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant
(SDK running in IBM Cloud Containers, including Serverless) | `CONTAINER` | Obtains a compute resource (CR) token from the container.
Exchanges the CR token for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | | IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant
(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.
Exchanges the identity token for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | | IAM Trusted Profiles ([assume identity](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-assume)) | Cloudant | `IAMASSUME` | Exchanges an IAM API key for an IAM `access_token` (same as `IAM` auth type).
Uses that initial token to obtain a second `access_token` from IAM with the assumed identity information.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | | [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-apikey) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.
Adds an `Authorization` header to each HTTP request with the `access_token` bearer.
Automatically renews the access token when needed. | @@ -70,7 +70,7 @@ amending with your own correct values. There is no need to set ```sh CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL -CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID +CLOUDANT_IAM_PROFILE_ID=Profile-00000000-0000-0000-0000-000000000000 # use your own IAM Profile ID ``` Alternatives to `CLOUDANT_IAM_PROFILE_ID`: @@ -84,7 +84,7 @@ amending with your own correct values. ```sh CLOUDANT_AUTH_TYPE=VPC CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL -CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID +CLOUDANT_IAM_PROFILE_ID=Profile-00000000-0000-0000-0000-000000000000 # use your own IAM Profile ID ``` Alternatives to `CLOUDANT_IAM_PROFILE_ID`: @@ -99,7 +99,7 @@ amending with your own correct values. ```sh CLOUDANT_AUTH_TYPE=IAMASSUME CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL -CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID +CLOUDANT_IAM_PROFILE_ID=Profile-00000000-0000-0000-0000-000000000000 # use your own IAM Profile ID ``` Alternatives to `CLOUDANT_IAM_PROFILE_ID`: From 7318a4d33b78fcf12ee313be17a924a29515a6f7 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 591/669] 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 From 9c603ab3b070f25653720a6e2d82c05aedef0fa2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 21:42:50 +0000 Subject: [PATCH 592/669] build(deps): Bump sphinx-rtd-theme from 3.0.2 to 3.1.0 Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.2 to 3.1.0. - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.2...3.1.0) --- updated-dependencies: - dependency-name: sphinx-rtd-theme dependency-version: 3.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index c06ef99e..d2b67beb 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,4 +3,4 @@ recommonmark==0.7.1 Sphinx==8.2.3 sphinx-autodoc2==0.5.0 myst-parser==4.0.1 -sphinx-rtd-theme==3.0.2 +sphinx-rtd-theme==3.1.0 From b3328a90d6d1306f561dcd0e29cbd2a5a4813792 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 21:46:27 +0000 Subject: [PATCH 593/669] build(deps): Bump github/codeql-action from 4.31.9 to 4.31.10 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.9 to 4.31.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/5d4e8d1aca955e8d8589aabd499c5cae939e33c7...cdefb33c0f6224e58673d9004f47f7cb3e328b89) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.31.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 79c9a138..9b11a3fd 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5 + uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5 + uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5 + uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 with: category: "/language:${{matrix.language}}" From f5cccd11eb4c00b690ea39edbcaf8e5beca50f4a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 15 Jan 2026 10:08:12 +0000 Subject: [PATCH 594/669] Update version 0.11.2 -> 0.11.3 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 784f5386..f158040c 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.2" +current_version = "0.11.3" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 8db77adf..9bbc952c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.2 +# IBM Cloudant Python SDK Version 0.11.3 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Pagination.md) (beta) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Pagination.md) (beta) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.2" +pip install --upgrade "ibmcloudant>=0.11.3" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.2" +easy_install --upgrade "ibmcloudant>=0.11.3" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index ae24424d..f4795d1f 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index fb2235e5..ce6e8c15 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 81c7c494..2d62a3bb 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.2/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index 4b054bf3..bbe5c5ae 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.2 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.3 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 28ed86ad..a47f7894 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.2' +__version__ = '0.11.3' diff --git a/pyproject.toml b/pyproject.toml index e889317a..9f78d0ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.2" +version = "0.11.3" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.2", From 6c36714d2fefeb74514d71e13163fa9e9a75897d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 20:32:00 +0000 Subject: [PATCH 595/669] build(deps): Bump actions/checkout from 6.0.1 to 6.0.2 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9b11a3fd..8b4a6d62 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 266d1118..c9567788 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3021c1f..72fa9e3b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From 12389770c9c2052a04c6f309a64bf7be229ee57b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:07:13 +0000 Subject: [PATCH 596/669] build(deps): Bump actions/setup-python from 6.1.0 to 6.2.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.1.0 to 6.2.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/83679a892e2d95755f2dac6acb0bfd1e9ac5d548...a309ff8b426b58ec0e2a45f0f869d46889d02405) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c9567788..8290f563 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.14 - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.14' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72fa9e3b..203a4ff7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 49ef882f7089a8a00274b3bf03d33fb05ae28c49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:41:13 +0000 Subject: [PATCH 597/669] build(deps): Bump github/codeql-action from 4.31.10 to 4.32.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.10 to 4.32.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdefb33c0f6224e58673d9004f47f7cb3e328b89...b20883b0cd1f46c72ae0ba6d1090936928f9fa30) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8b4a6d62..8860fbe0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 + uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 + uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.29.5 + uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5 with: category: "/language:${{matrix.language}}" From c150b3fea3f1ac8c279f65da6b6443e085d695ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 19:49:03 +0000 Subject: [PATCH 598/669] build(deps-dev): Bump coverage from 7.13.1 to 7.13.2 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.13.1 to 7.13.2. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.1...7.13.2) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.13.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8530f56d..e661fba6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.4 # code coverage -coverage==7.13.1 +coverage==7.13.2 pytest-cov==7.0.0 From f07f5656c0d6bc7d1b3827137db1ec24b483cbbe Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 29 Jan 2026 14:16:38 +0000 Subject: [PATCH 599/669] docs(generated): fix fs imports in stream examples Generated SDK source code using: - Generator version 3.110.0 - Specification version 1.0.0-dev0.1.33 - Automation (cloudant-sdks) version 128d5e0 --- examples/README.md | 2 +- examples/snippets/postDocument/example_request_as_a_stream.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/README.md b/examples/README.md index 6012bf94..58ac8e33 100644 --- a/examples/README.md +++ b/examples/README.md @@ -675,7 +675,7 @@ service = CloudantV1.new_instance() with open("products_doc.json", "rb") as products_doc: response = service.post_document( db='products', - document=products_doc_binary, + document=products_doc, content_type="application/json" ).get_result() diff --git a/examples/snippets/postDocument/example_request_as_a_stream.py b/examples/snippets/postDocument/example_request_as_a_stream.py index 879ddbee..965177ba 100644 --- a/examples/snippets/postDocument/example_request_as_a_stream.py +++ b/examples/snippets/postDocument/example_request_as_a_stream.py @@ -6,7 +6,7 @@ with open("products_doc.json", "rb") as products_doc: response = service.post_document( db='products', - document=products_doc_binary, + document=products_doc, content_type="application/json" ).get_result() From a45d99dd8568880e0a89e7514914001825bb798e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:42:25 +0000 Subject: [PATCH 600/669] build(deps): Bump ibm-cloud-sdk-core from 3.24.2 to 3.24.3 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.24.2 to 3.24.3. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.24.2...v3.24.3) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 3.24.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9f78d0ec..9720dc6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.11.3" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.24.2", + "ibm_cloud_sdk_core==3.24.3", "requests>=2.32.4,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From a9bf920d345127b1dc0b7c068357d488c5f2074c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 00:07:55 +0000 Subject: [PATCH 601/669] build(deps): Bump github/codeql-action from 4.32.0 to 4.32.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.0 to 4.32.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/b20883b0cd1f46c72ae0ba6d1090936928f9fa30...6bc82e05fd0ea64601dd4b465378bbcf57de0314) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8860fbe0..367fbb59 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5 + uses: github/codeql-action/init@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v3.29.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5 + uses: github/codeql-action/autobuild@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v3.29.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5 + uses: github/codeql-action/analyze@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v3.29.5 with: category: "/language:${{matrix.language}}" From 7d3411afcc000a3410a9cf5b168112181651a42c Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 3 Feb 2026 09:34:45 +0000 Subject: [PATCH 602/669] chore: correct codeql version in yaml --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 367fbb59..d83a35f5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v3.29.5 + uses: github/codeql-action/init@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v3.29.5 + uses: github/codeql-action/autobuild@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v3.29.5 + uses: github/codeql-action/analyze@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1 with: category: "/language:${{matrix.language}}" From d456e7273fbac4f08021196052d077f3055a3b35 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 3 Feb 2026 15:40:52 +0000 Subject: [PATCH 603/669] chore(generated): add dependabot cooldown Generated SDK source code using: - Generator version 3.110.0 - Specification version 1.0.0-dev0.1.33 - Automation (cloudant-sdks) version 37521b4 --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fe6c93d1..69ce69e9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,8 @@ updates: directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 4 pull-request-branch-name: separator: "-" - package-ecosystem: "pip" @@ -11,6 +13,8 @@ updates: open-pull-requests-limit: 10 schedule: interval: "daily" + cooldown: + default-days: 4 pull-request-branch-name: separator: "-" # Custom settings @@ -18,6 +22,8 @@ updates: directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 4 target-branch: "gh-pages" pull-request-branch-name: separator: "-" From 9f4391a38de8da160dd662f65094cd4fc07343f6 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Feb 2026 13:46:13 +0000 Subject: [PATCH 604/669] docs(generated): remove beta tag from pagination Generated SDK source code using: - Generator version 3.110.0 - Specification version 1.0.0-dev0.1.33 - Automation (cloudant-sdks) version cd52ccf --- README.md | 2 +- docs/Pagination.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bbc952c..5514700a 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ project: - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. - Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Pagination.md) (beta) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites diff --git a/docs/Pagination.md b/docs/Pagination.md index 2d62a3bb..3ecfd017 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -22,7 +22,7 @@ ## Introduction -The pagination feature (currently beta) accepts options for a single operation and automatically +The pagination feature accepts options for a single operation and automatically creates the multiple requests to the server necessary to page through the results a fixed number at a time. Pagination is a best-practice to break apart large queries into multiple server requests. From 975d603229d5adec2e2fa0068e5554297e033671 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Feb 2026 15:36:43 +0000 Subject: [PATCH 605/669] docs(generated): known issue for application/json attachments Generated SDK source code using: - Generator version 3.110.0 - Specification version 1.0.0-dev0.1.33 - Automation (cloudant-sdks) version 095458f --- KNOWN_ISSUES.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index afec4185..0e1a21b9 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -143,3 +143,26 @@ client = CloudantV1.new_instance(service_name="YOUR_SERVICE_NAME") client.set_enable_gzip_compression(False) ... ``` + +### Attachments with `content-type: application/json` + +Calling [`get_attachment`](https://ibm.github.io/cloudant-python-sdk/docs/latest/apidocs/ibmcloudant/ibmcloudant.cloudant_v1.html#ibmcloudant.cloudant_v1.CloudantV1.get_attachment) +typically returns a `DetailedResponse` with `BinaryIO` result. +For attachments uploaded with a `content-type: application/json` +header or as a `.json` file in the dashboard then calls to `get_attachment` +return a `DetailedResponse` with, for example, a `dict` result for a JSON +object. +The JSON is automatically loaded by the underlying SDK core +and client to the default Python object types. + +To get a `BinaryIO` result with an `application/json` attachment +pass `stream=True` on the `get_attachment` request. + +```python +json_attachment: bytes = service.get_attachment( + db='products', + doc_id='1000042', + attachment_name='product_details.json', + stream=True +).get_result().content # content bytes that can be decoded +``` From 8a7d5e720efd353487a3d09223c5bd033ba66e3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 10:42:57 +0000 Subject: [PATCH 606/669] build(deps-dev): Bump coverage from 7.13.2 to 7.13.3 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.13.2 to 7.13.3. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.2...7.13.3) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.13.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e661fba6..d75822d0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.4 # code coverage -coverage==7.13.2 +coverage==7.13.3 pytest-cov==7.0.0 From 89d5eeeb4def3383cdea01bbc58009fa901d089d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 11:06:43 +0000 Subject: [PATCH 607/669] build(deps): Bump ibm-cloud-sdk-core from 3.24.3 to 3.24.4 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.24.3 to 3.24.4. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.24.3...v3.24.4) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 3.24.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9720dc6f..31cb63fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.11.3" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.24.3", + "ibm_cloud_sdk_core==3.24.4", "requests>=2.32.4,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 13be94bf75246d1791978d94171cef49a3b30974 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:01:25 +0000 Subject: [PATCH 608/669] Update version 0.11.3 -> 0.11.4 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index f158040c..f25ccd21 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.3" +current_version = "0.11.4" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 5514700a..cee6c594 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.3 +# IBM Cloudant Python SDK Version 0.11.4 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.3" +pip install --upgrade "ibmcloudant>=0.11.4" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.3" +easy_install --upgrade "ibmcloudant>=0.11.4" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index f4795d1f..1ced328d 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index ce6e8c15..2d552451 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 3ecfd017..4f4fa0b1 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.3/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index bbe5c5ae..8bda7a80 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.3 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.4 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index a47f7894..25d94e3a 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.3' +__version__ = '0.11.4' diff --git a/pyproject.toml b/pyproject.toml index 31cb63fd..f4d67554 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.3" +version = "0.11.4" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.4", From 7e05c43d08c26f490604d6648286997273875b93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:29:12 +0000 Subject: [PATCH 609/669] build(deps): Bump github/codeql-action from 4.32.1 to 4.32.2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.1 to 4.32.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/6bc82e05fd0ea64601dd4b465378bbcf57de0314...45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d83a35f5..4daf38a4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1 + uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1 + uses: github/codeql-action/autobuild@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1 + uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 with: category: "/language:${{matrix.language}}" From 8c84bd954ac4b37ca6ef497e97d61787f6134e32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:43:21 +0000 Subject: [PATCH 610/669] build(deps-dev): Bump coverage from 7.13.3 to 7.13.4 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.13.3 to 7.13.4. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.3...7.13.4) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.13.4 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d75822d0..f582beb5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.25.8 python_dotenv==1.2.1 pylint==4.0.4 # code coverage -coverage==7.13.3 +coverage==7.13.4 pytest-cov==7.0.0 From 6547b45e7fdbe23f8f5188c839891d322a835cf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 18:02:08 +0000 Subject: [PATCH 611/669] build(deps): Bump github/codeql-action from 4.32.2 to 4.32.3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.2 to 4.32.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2...9e907b5e64f6b83e7804b09294d44122997950d6) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4daf38a4..a6732a5c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/autobuild@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4.32.2 + uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 with: category: "/language:${{matrix.language}}" From 63f457aa5eef22ab896ed985b1b847bc16cbed0c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 19 Feb 2026 10:43:08 +0000 Subject: [PATCH 612/669] feat(generated): update API definition to 1.0.0-dev0.1.34 Generated SDK source code using: - Generator version 3.111.0 - Specification version 1.0.0-dev0.1.34 - Automation (cloudant-sdks) version 7b856f8 --- ibmcloudant/cloudant_v1.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index ec2496f2..7f4cc63c 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -9649,7 +9649,9 @@ class Analyzer: * 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. + analyzer where supported. Not used for `keyword`, `simple`, `whitespace`, + `simple_asciifolding` or `perfield` analyzers. Ensure stopwords match the folded + case for analyzers that perform folding. """ def __init__( @@ -9668,7 +9670,9 @@ def __init__( * 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. + named analyzer where supported. Not used for `keyword`, `simple`, + `whitespace`, `simple_asciifolding` or `perfield` analyzers. Ensure + stopwords match the folded case for analyzers that perform folding. """ self.name = name self.stopwords = stopwords @@ -9782,7 +9786,9 @@ class AnalyzerConfiguration: * 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. + analyzer where supported. Not used for `keyword`, `simple`, `whitespace`, + `simple_asciifolding` or `perfield` analyzers. Ensure stopwords match the folded + case for analyzers that perform folding. :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. @@ -9806,7 +9812,9 @@ def __init__( * 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. + named analyzer where supported. Not used for `keyword`, `simple`, + `whitespace`, `simple_asciifolding` or `perfield` analyzers. Ensure + stopwords match the folded case for analyzers that perform folding. :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. @@ -12271,8 +12279,8 @@ class DesignDocument: The validation function can abort the pending document write by throwing one of two error objects: ``` - // user is not authorized to make the change but may re-authenticate throw({ - unauthorized: 'Error message here.' }); + // user is not authorized to make the change but may + // re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' }); ``` The function takes 4 parameters: @@ -12392,8 +12400,8 @@ def __init__( The validation function can abort the pending document write by throwing one of two error objects: ``` - // user is not authorized to make the change but may re-authenticate - throw({ unauthorized: 'Error message here.' }); + // user is not authorized to make the change but may + // re-authenticate throw({ unauthorized: 'Error message here.' }); // change is not allowed throw({ forbidden: 'Error message here.' }); ``` The function takes 4 parameters: From 3de3ad9a3601710c8b2a1b0e124edc4fdaec8ad3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 19:32:47 +0000 Subject: [PATCH 613/669] build(deps-dev): Bump responses from 0.25.8 to 0.26.0 Bumps [responses](https://github.com/getsentry/responses) from 0.25.8 to 0.26.0. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.8...0.26.0) --- updated-dependencies: - dependency-name: responses dependency-version: 0.26.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f582beb5..1742e091 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.12.0 # test dependencies pytest==9.0.2 -responses==0.25.8 +responses==0.26.0 python_dotenv==1.2.1 pylint==4.0.4 # code coverage From f1cb6b8cced808687ca6cf75c99c125eaf7ef9d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:43:03 +0000 Subject: [PATCH 614/669] build(deps-dev): Bump pylint from 4.0.4 to 4.0.5 Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v4.0.4...v4.0.5) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1742e091..b72e9c12 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==9.0.2 responses==0.26.0 python_dotenv==1.2.1 -pylint==4.0.4 +pylint==4.0.5 # code coverage coverage==7.13.4 pytest-cov==7.0.0 From 02e68043c9abb206e7ec720aca685c130734102c Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Fri, 20 Feb 2026 14:27:56 +0000 Subject: [PATCH 615/669] build(dev-deps): myst-parser 5.0.0 Sphinx 9.1.0 --- requirements-docs.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index d2b67beb..7f1f1ef5 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,6 +1,6 @@ # documentation recommonmark==0.7.1 -Sphinx==8.2.3 +Sphinx==9.1.0 sphinx-autodoc2==0.5.0 -myst-parser==4.0.1 +myst-parser==5.0.0 sphinx-rtd-theme==3.1.0 From 17d19c3072e3c6b579ec380623ff118c865bdc45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 17:46:01 +0000 Subject: [PATCH 616/669] build(deps): Bump github/codeql-action from 4.32.3 to 4.32.4 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.3 to 4.32.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/9e907b5e64f6b83e7804b09294d44122997950d6...89a39a4e59826350b863aa6b6252a07ad50cf83e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a6732a5c..bd548261 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3 + uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 with: category: "/language:${{matrix.language}}" From 585ee4ca0445bea261f4d904f38cc0716edf9832 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 17:43:51 +0000 Subject: [PATCH 617/669] build(deps-dev): Bump python-dotenv from 1.2.1 to 1.2.2 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: python-dotenv dependency-version: 1.2.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b72e9c12..668fb436 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ flit==3.12.0 # test dependencies pytest==9.0.2 responses==0.26.0 -python_dotenv==1.2.1 +python_dotenv==1.2.2 pylint==4.0.5 # code coverage coverage==7.13.4 From ad0e78504288c94484e1f048cbaa264b4f66763a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:46:11 +0000 Subject: [PATCH 618/669] build(deps): Bump github/codeql-action from 4.32.4 to 4.32.6 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.4 to 4.32.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/89a39a4e59826350b863aa6b6252a07ad50cf83e...0d579ffd059c29b07949a3cce3983f0780820c98) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.32.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bd548261..d5efeb36 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4 + uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 with: category: "/language:${{matrix.language}}" From b7a8661313de2c493e50a007a978c8b8e7326ead Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 17 Mar 2026 15:09:41 +0000 Subject: [PATCH 619/669] Update version 0.11.4 -> 0.11.5 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index f25ccd21..9d11fac3 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.4" +current_version = "0.11.5" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index cee6c594..77303a55 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.4 +# IBM Cloudant Python SDK Version 0.11.5 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.4" +pip install --upgrade "ibmcloudant>=0.11.5" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.4" +easy_install --upgrade "ibmcloudant>=0.11.5" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index 1ced328d..eb1cbdaf 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index 2d552451..ad515801 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 4f4fa0b1..016fc75d 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.4/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index 8bda7a80..0f0f8aab 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.4 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.5 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 25d94e3a..69b6b570 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.4' +__version__ = '0.11.5' diff --git a/pyproject.toml b/pyproject.toml index f4d67554..536ab5ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.4" +version = "0.11.5" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.4", From ac674f778ea35b8dfc13ba7624051ad3142fb457 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:03:38 +0000 Subject: [PATCH 620/669] build(deps-dev): Bump coverage from 7.13.4 to 7.13.5 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.13.4 to 7.13.5. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.4...7.13.5) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.13.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 668fb436..ece2ff8d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.0 python_dotenv==1.2.2 pylint==4.0.5 # code coverage -coverage==7.13.4 +coverage==7.13.5 pytest-cov==7.0.0 From 051658f96a35ac30888fca5798a670e1b150fc6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 17:45:47 +0000 Subject: [PATCH 621/669] build(deps): Bump github/codeql-action from 4.32.6 to 4.34.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.6 to 4.34.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/0d579ffd059c29b07949a3cce3983f0780820c98...38697555549f1db7851b81482ff19f1fa5c4fedc) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.34.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d5efeb36..6244141c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/autobuild@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 with: category: "/language:${{matrix.language}}" From a04ce5f99d620e6b3801eca9dbf133613b92c312 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 18:03:10 +0000 Subject: [PATCH 622/669] build(deps-dev): Bump pytest-cov from 7.0.0 to 7.1.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 7.0.0 to 7.1.0. - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v7.0.0...v7.1.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-version: 7.1.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ece2ff8d..4b692779 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ python_dotenv==1.2.2 pylint==4.0.5 # code coverage coverage==7.13.5 -pytest-cov==7.0.0 +pytest-cov==7.1.0 From 1e029f3a68b1467521fa9286d8f35f8c50736502 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 22:32:53 +0000 Subject: [PATCH 623/669] build(deps): Bump github/codeql-action from 4.34.1 to 4.35.1 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.34.1 to 4.35.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/38697555549f1db7851b81482ff19f1fa5c4fedc...c10b8064de6f491fea524254123dbe5e09572f13) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6244141c..99eb1fe3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: category: "/language:${{matrix.language}}" From ead8d710a7015898bd6df59ce6c2f1796ed296d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 18:53:23 +0000 Subject: [PATCH 624/669] build(deps-dev): Bump pytest from 9.0.2 to 9.0.3 Bumps [pytest](https://github.com/pytest-dev/pytest) from 9.0.2 to 9.0.3. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/9.0.2...9.0.3) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.0.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4b692779..9223c587 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==9.0.2 +pytest==9.0.3 responses==0.26.0 python_dotenv==1.2.2 pylint==4.0.5 From ec93c4b44f53db3f1bcd3f58fe1451dd2726a649 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:45:40 +0000 Subject: [PATCH 625/669] build(deps): Bump github/codeql-action from 4.35.1 to 4.35.2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.1 to 4.35.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/c10b8064de6f491fea524254123dbe5e09572f13...95e58e9a2cdfd71adc6e0353d5c52f41a045d225) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 99eb1fe3..b86a5a5e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 + uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 + uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 + uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 with: category: "/language:${{matrix.language}}" From c4471fba0346fc42a16fad23bdaf5e9b0343470b Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 27 Apr 2026 10:14:01 +0000 Subject: [PATCH 626/669] Update version 0.11.5 -> 0.11.6 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 9d11fac3..91652e23 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.5" +current_version = "0.11.6" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 77303a55..1aabe891 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.5 +# IBM Cloudant Python SDK Version 0.11.6 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.5" +pip install --upgrade "ibmcloudant>=0.11.6" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.5" +easy_install --upgrade "ibmcloudant>=0.11.6" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index eb1cbdaf..72c86b09 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index ad515801..e64f33f5 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 016fc75d..63aea134 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.5/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index 0f0f8aab..dd6ca03a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.5 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.6 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 69b6b570..b9f92189 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.5' +__version__ = '0.11.6' diff --git a/pyproject.toml b/pyproject.toml index 536ab5ad..3d668423 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.5" +version = "0.11.6" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.4", From 1dbe8c96c4f4a2cd5547fe074de7d7eaf220667f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 17:46:10 +0000 Subject: [PATCH 627/669] build(deps): Bump github/codeql-action from 4.35.2 to 4.35.3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.2 to 4.35.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/95e58e9a2cdfd71adc6e0353d5c52f41a045d225...e46ed2cbd01164d986452f91f178727624ae40d7) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b86a5a5e..e90f75f1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/autobuild@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 with: category: "/language:${{matrix.language}}" From e130900a21124d19e54bd4e9e8b451dc04320b8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 18:16:13 +0000 Subject: [PATCH 628/669] build(deps): Bump github/codeql-action from 4.35.3 to 4.35.4 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.3 to 4.35.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e46ed2cbd01164d986452f91f178727624ae40d7...68bde559dea0fdcac2102bfdf6230c5f70eb485e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e90f75f1..305b9121 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 + uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 + uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 + uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 with: category: "/language:${{matrix.language}}" From b400dc4a42d5a2a53442567a753d876f1d2fae19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 17:42:33 +0000 Subject: [PATCH 629/669] build(deps-dev): Bump coverage from 7.13.5 to 7.14.0 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.13.5 to 7.14.0. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.5...7.14.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.14.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9223c587..2480caf1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.0 python_dotenv==1.2.2 pylint==4.0.5 # code coverage -coverage==7.13.5 +coverage==7.14.0 pytest-cov==7.1.0 From c159dcfb2b570da00b8c7c724218a23cdb5d7cc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 May 2026 21:57:22 +0000 Subject: [PATCH 630/669] build(deps): Bump github/codeql-action from 4.35.4 to 4.35.5 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.4 to 4.35.5. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/68bde559dea0fdcac2102bfdf6230c5f70eb485e...9e0d7b8d25671d64c341c19c0152d693099fb5ba) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.35.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 305b9121..538fdf08 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 + uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 + uses: github/codeql-action/autobuild@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 + uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 with: category: "/language:${{matrix.language}}" From f4777960d793a97d6cd6df5dac7cc1845bd78832 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 22 May 2026 10:55:03 +0000 Subject: [PATCH 631/669] feat(generated): update API definition to 1.0.0-dev0.1.38 Generated SDK source code using: - Generator version 3.114.0 - Specification version 1.0.0-dev0.1.38 - Automation (cloudant-sdks) version 892ac8e --- ibmcloudant/cloudant_v1.py | 54 ++++++++++++++-------------- test/integration/test_cloudant_v1.py | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index 7f4cc63c..aeb6ecf8 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -17,7 +17,7 @@ """ NoSQL database based on Apache CouchDB -See: https://cloud.ibm.com/docs/services/Cloudant/ +See: https://cloud.ibm.com/docs/Cloudant """ from datetime import datetime @@ -437,7 +437,7 @@ def post_changes( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -662,7 +662,7 @@ def post_changes_as_stream( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -4636,7 +4636,7 @@ def post_partition_explain( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -4814,7 +4814,7 @@ def post_partition_find( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -4992,7 +4992,7 @@ def post_partition_find_as_stream( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -5159,7 +5159,7 @@ def post_explain( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -5337,7 +5337,7 @@ def post_find( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -5515,7 +5515,7 @@ def post_find_as_stream( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -7084,8 +7084,8 @@ def put_cloudant_security_configuration( `_reader`. :param str db: Path parameter to specify the database name. - :param dict cloudant: Database permissions for Cloudant users and/or API - keys. + :param dict cloudant: Database permissions for Cloudant users, API keys or + both. :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. :param bool couchdb_auth_only: (optional) Manage permissions using the @@ -7217,8 +7217,8 @@ def put_security( :param str db: Path parameter to specify the database name. :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param dict cloudant: (optional) Database permissions for Cloudant users - and/or API keys. + :param dict cloudant: (optional) Database permissions for Cloudant users, + API keys or both. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. :param SecurityObject members: (optional) Schema for names and roles to map @@ -13767,8 +13767,8 @@ class ExplainResult: equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a list of - all available combination and conditional operators. + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list + of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param List[SelectorHint] selector_hints: Schema for a list of objects with @@ -13838,7 +13838,7 @@ def __init__( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -14813,8 +14813,8 @@ class IndexDefinition: equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a list of - all available combination and conditional operators. + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list + of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). """ @@ -14884,7 +14884,7 @@ def __init__( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -16497,8 +16497,8 @@ class ReplicationDocument: equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a list of - all available combination and conditional operators. + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list + of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). :param str since_seq: (optional) Start the replication at a specific sequence @@ -16667,7 +16667,7 @@ def __init__( conjunction with equality operators or create and use a partial index to reduce the number of documents that will need to be scanned. See [the Cloudant - Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators)for a + Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all available combination and conditional operators. For further reference see [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax). @@ -18720,8 +18720,8 @@ class Security: :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param dict cloudant: (optional) Database permissions for Cloudant users and/or - API keys. + :param dict cloudant: (optional) Database permissions for Cloudant users, API + keys or both. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. :param SecurityObject members: (optional) Schema for names and roles to map to a @@ -18741,8 +18741,8 @@ def __init__( :param SecurityObject admins: (optional) Schema for names and roles to map to a database permission. - :param dict cloudant: (optional) Database permissions for Cloudant users - and/or API keys. + :param dict cloudant: (optional) Database permissions for Cloudant users, + API keys or both. :param bool couchdb_auth_only: (optional) Manage permissions using the `_users` database only. :param SecurityObject members: (optional) Schema for names and roles to map @@ -18811,7 +18811,7 @@ def __ne__(self, other: 'Security') -> bool: class CloudantEnum(str, Enum): """ - Database permissions for Cloudant users and/or API keys. + Database permissions for Cloudant users, API keys or both. """ READER = '_reader' diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 29ee803f..0fbb061a 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -1811,7 +1811,7 @@ def test_put_security(self): response = self.cloudant_service.put_security( db='testString', admins=security_object_model, - cloudant={'key1': ['_reader']}, + cloudant={'antsellseadespecteposene': ['_reader', '_writer', '_admin']}, couchdb_auth_only=True, members=security_object_model, ) From bc42dd2c1305958650dfea54e75a9665e5337687 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Fri, 22 May 2026 13:15:06 +0000 Subject: [PATCH 632/669] Update version 0.11.6 -> 0.11.7 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 91652e23..e5465715 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.6" +current_version = "0.11.7" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 1aabe891..c50b1e02 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.6 +# IBM Cloudant Python SDK Version 0.11.7 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.6" +pip install --upgrade "ibmcloudant>=0.11.7" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.6" +easy_install --upgrade "ibmcloudant>=0.11.7" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index 72c86b09..1b30a047 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index e64f33f5..a7592234 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 63aea134..a8ca494c 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.6/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index dd6ca03a..f631da55 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.6 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.7 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index b9f92189..f21f1973 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.6' +__version__ = '0.11.7' diff --git a/pyproject.toml b/pyproject.toml index 3d668423..e8461ee6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.6" +version = "0.11.7" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.4", From f0624943a205b8fd99fd9c0ae93fb86273e7f853 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 23:32:26 +0000 Subject: [PATCH 633/669] build(deps-dev): Bump responses from 0.26.0 to 0.26.1 Bumps [responses](https://github.com/getsentry/responses) from 0.26.0 to 0.26.1. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.26.0...0.26.1) --- updated-dependencies: - dependency-name: responses dependency-version: 0.26.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2480caf1..d1e6421c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.12.0 # test dependencies pytest==9.0.3 -responses==0.26.0 +responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.5 # code coverage From e31e86c73b72c30a2024e328535695d2a056d148 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 19:55:26 +0000 Subject: [PATCH 634/669] build(deps): Bump github/codeql-action from 4.35.5 to 4.36.0 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.5 to 4.36.0. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/9e0d7b8d25671d64c341c19c0152d693099fb5ba...7211b7c8077ea37d8641b6271f6a365a22a5fbfa) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.36.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 538fdf08..3db4a209 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Initialize CodeQL - uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 + uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 + uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 + uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 with: category: "/language:${{matrix.language}}" From fa4d030f2cb8f1850ffe91b9f5bcaaabb96bb08e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:49:32 +0000 Subject: [PATCH 635/669] build(deps-dev): Bump coverage from 7.14.0 to 7.14.1 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.14.0 to 7.14.1. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.14.0...7.14.1) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.14.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d1e6421c..02712f2a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.5 # code coverage -coverage==7.14.0 +coverage==7.14.1 pytest-cov==7.1.0 From 6cc82f1a4bd960027ad2415d73cdbbb51d4539cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 17:47:33 +0000 Subject: [PATCH 636/669] build(deps): Bump actions/checkout from 6.0.2 to 6.0.3 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3db4a209..5cad68f0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Initialize CodeQL uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8290f563..33e13d75 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 203a4ff7..dec4036a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From ab5e5c9f45eebaa17631439f625fa883ad333241 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 07:46:05 +0000 Subject: [PATCH 637/669] build(deps): Bump github/codeql-action from 4.36.0 to 4.36.2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/7211b7c8077ea37d8641b6271f6a365a22a5fbfa...8aad20d150bbac5944a9f9d289da16a4b0d87c1e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.36.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5cad68f0..52e5de8a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Initialize CodeQL - uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: category: "/language:${{matrix.language}}" From fcf501aa1beda3765308ad4855d5316a69c3a06a Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 15 Jun 2026 09:48:41 +0000 Subject: [PATCH 638/669] Update version 0.11.7 -> 0.11.8 --- .bumpversion.toml | 2 +- README.md | 32 ++++++++++++++++---------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index e5465715..4191f42e 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.7" +current_version = "0.11.8" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index c50b1e02..28ead160 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.7 +# IBM Cloudant Python SDK Version 0.11.8 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -66,8 +66,8 @@ project: - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -84,13 +84,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.7" +pip install --upgrade "ibmcloudant>=0.11.8" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.7" +easy_install --upgrade "ibmcloudant>=0.11.8" ``` ## Using the SDK @@ -103,16 +103,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -158,10 +158,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#examples-for-python). ### Error handling @@ -184,7 +184,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -294,7 +294,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -317,7 +317,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -347,8 +347,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index 1b30a047..a0234337 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index a7592234..3f46fb98 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index a8ca494c..95f7a166 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.7/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index f631da55..0742f5dd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.7 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.8 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index f21f1973..b1a3a8a0 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.7' +__version__ = '0.11.8' diff --git a/pyproject.toml b/pyproject.toml index e8461ee6..6a71ca0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.7" +version = "0.11.8" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.24.4", From 3df5800660d24099550fd59a09724f38e19e0d22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jun 2026 17:42:25 +0000 Subject: [PATCH 639/669] build(deps-dev): Bump pytest from 9.0.3 to 9.1.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 9.0.3 to 9.1.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/9.0.3...9.1.0) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.1.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 02712f2a..716ab7a5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==9.0.3 +pytest==9.1.0 responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.5 From e879f4eeb30e1ded34fed6b5dbd5a91953369323 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 07:44:39 +0000 Subject: [PATCH 640/669] build(deps-dev): Bump pylint from 4.0.5 to 4.0.6 Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.5 to 4.0.6. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v4.0.5...v4.0.6) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.6 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 716ab7a5..368255c1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==3.12.0 pytest==9.1.0 responses==0.26.1 python_dotenv==1.2.2 -pylint==4.0.5 +pylint==4.0.6 # code coverage coverage==7.14.1 pytest-cov==7.1.0 From 954d7d953cae65b654b14e56c301c39d10000e44 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 23 Jun 2026 08:42:34 +0000 Subject: [PATCH 641/669] test(generated): update test example value Generated SDK source code using: - Generator version 3.114.4 - Specification version 1.0.0-dev0.1.39 - Automation (cloudant-sdks) version a6e4d7e --- stubs/gen-its-mappings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/gen-its-mappings.json b/stubs/gen-its-mappings.json index 5c5bce1b..16772714 100644 --- a/stubs/gen-its-mappings.json +++ b/stubs/gen-its-mappings.json @@ -1269,7 +1269,7 @@ "local" ], "authenticated": "iam", - "authentication_db": "bm-cc-us-east-05/users" + "authentication_db": "redacted_auth_db" } } }, From 9acb5f4d860941e419187c07578cb47706946e1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:42:45 +0000 Subject: [PATCH 642/669] build(deps-dev): Bump pytest from 9.1.0 to 9.1.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 9.1.0 to 9.1.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/9.1.0...9.1.1) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.1.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 368255c1..f02e206d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # build dependencies flit==3.12.0 # test dependencies -pytest==9.1.0 +pytest==9.1.1 responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.6 From 368d1dfa2009ec8831c05cf3b270437e097637e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:42:32 +0000 Subject: [PATCH 643/669] build(deps): Bump ibm-cloud-sdk-core from 3.24.4 to 3.25.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.24.4 to 3.25.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.24.4...v3.25.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 3.25.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6a71ca0a..acffe2b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.11.8" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.24.4", + "ibm_cloud_sdk_core==3.25.0", "requests>=2.32.4,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 43ecd3459fcf870531e2ed61a31656afc0b7e0e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 10:23:12 +0000 Subject: [PATCH 644/669] build(deps-dev): Bump coverage from 7.14.1 to 7.14.2 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.14.1 to 7.14.2. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.14.1...7.14.2) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.14.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f02e206d..1d58813c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.6 # code coverage -coverage==7.14.1 +coverage==7.14.2 pytest-cov==7.1.0 From 973fad3b91c5de0ff36dde3482229b9be9617bd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 10:56:05 +0000 Subject: [PATCH 645/669] build(deps): Bump actions/checkout from 6.0.3 to 7.0.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 52e5de8a..8aa56f12 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,7 +19,7 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Initialize CodeQL uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 33e13d75..6c74457a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dec4036a..b552bbe0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From 61d279d8770751941ae9d338b634199b04469d5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 17:42:30 +0000 Subject: [PATCH 646/669] build(deps-dev): Bump coverage from 7.14.2 to 7.14.3 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.14.2 to 7.14.3. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.14.2...7.14.3) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.14.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1d58813c..70a94702 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.6 # code coverage -coverage==7.14.2 +coverage==7.14.3 pytest-cov==7.1.0 From 72c37341a6a40178c3157a91a7971062ca8a66c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:46:26 +0000 Subject: [PATCH 647/669] build(deps): Bump actions/setup-python from 6.2.0 to 6.3.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/a309ff8b426b58ec0e2a45f0f869d46889d02405...ece7cb06caefa5fff74198d8649806c4678c61a1) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6c74457a..70c2a6b4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.14 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.14' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b552bbe0..81d6aca9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.python }} cache: 'pip' From 6672e2c6de8c27287faa74992bc7adc70bb4c3ea Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:23:56 +0000 Subject: [PATCH 648/669] docs(generated): Gen 2 compatibility notes Generated SDK source code using: - Generator version 3.114.4 - Specification version 1.0.0-dev0.1.39 - Automation (cloudant-sdks) version d586e4c --- KNOWN_ISSUES.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 0e1a21b9..1c9cde99 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -2,6 +2,60 @@ ## All Cloudant SDKs +### Cloudant (Gen 2) Compatibility + +Cloudant Gen 2 is compatible with IAM authentication only. +The SDK authentication types `BASIC` and `COUCHDB_SESSION` do not work with Cloudant Gen 2 instances. + +Instances of Cloudant Gen 2 do not provide some configuration and monitoring APIs that were available in Gen 1. + +Migrating an application using this SDK from Cloudant Gen 1 to Cloudant Gen 2 requires either removing calls to these operations +or replacing them with alternatives. + +This table summarizes the SDK operations that are incompatible with Cloudant Gen 2 instances and the recommended replacement operations. + +| Gen 1 operation | Summary | Gen 1 Endpoint | API docs link | Replacement operation for Gen 2 | +|---|---|---|---|---| +| **Authentication and authorization** | | | | | +| `post_api_keys` | Generates API keys for apps or persons to enable database access | `POST /_api/v2/api_keys` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#postapikeys) | Use IAM authentication | +| `put_cloudant_security_configuration` | Modify only Cloudant related database permissions | `PUT /_api/v2/db/{db}/_security` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#putcloudantsecurity) | Use [database level IAM policies](https://cloud.ibm.com/docs/cloudant-gen2?topic=cloudant-gen2-managing-access-for-cloudant#database-level-iam-policies) | +| **Audit events configuration** | | | | | +`get_activity_tracker_events` | Retrieve activity tracking events information | `GET /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getactivitytrackerevents) | `management` events are always enabled, `data` events are not currently available in Gen 2 | +`post_activity_tracker_events` | Modify activity tracking events configuration | `POST /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#postactivitytrackerevents) | `management` events are always enabled, `data` events are not currently available in Gen 2 | +| **CORS configuration** | | | | | +| `get_cors_information` | Retrieve CORS configuration information | `GET /_api/v2/user/config/cors` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getcorsinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) +| `put_cors_configuration` | Modify CORS configuration | `PUT /_api/v2/user/config/cors` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#putcorsconfiguration) | Use the [Platform Services SDK](#using-the-platform-services-sdk) +| **Capacity configuration** | | | | | +| `get_capacity_databases_information` | Retrieve maximum allowed database count | `GET /_api/v2/user/capacity/databases` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getcapacitydatabasesinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) +| `get_capacity_throughput_information` | Retrieve provisioned throughput capacity information | `GET /_api/v2/user/capacity/throughput` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getcapacitythroughputinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) +| `put_capacity_throughput_configuration` | Update the target provisioned throughput capacity | `PUT /_api/v2/user/capacity/throughput` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#putcapacitythroughputconfiguration) | Use the [Platform Services SDK](#using-the-platform-services-sdk) +| **Capacity monitoring** | | | | | +| `get_current_databases_information` | Retrieve current database count | `GET /_api/v2/user/current/databases` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getcurrentdatabasesinformation) | Use the length of the list returned from the `get_all_dbs` operation. +| `get_current_throughput_information` | Retrieve the current provisioned throughput capacity consumption | `GET /_api/v2/user/current/throughput` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getcurrentthroughputinformation) | Use a Prometheus instant query with IBM Cloud Monitoring APIs. For example to get the capacity consumption rate over the last minute use a query like `rate(ibm_cloudant_permitted_operations_total[1m])`. See the [IBM Cloud Monitoring docs for an example](https://cloud.ibm.com/docs/monitoring?topic=monitoring-metrics_api#metrics-api-sample-prom). + +#### Using the Platform Services SDK + +Use the [IBM Cloud Platform Services Python SDK](https://github.com/IBM/platform-services-python-sdk) Resource Controller APIs to programmatically configure your Cloudant Gen 2 instance. + +Update the configuration values in the `parameters` mapping of key-value pairs. +Read the current values from the `extensions` mapping of key-value pairs. + +| Key path in `parameters` or `extensions` | Value description | +| --- | --- | +`dataservices.cloudant.capacity_units` | The provisioned throughput capacity of the instance in [units](https://cloud.ibm.com/docs/cloudant-gen2?topic=cloudant-gen2-usage-and-charges#provisioned-throughput-capacity-units) +`dataservices.cloudant.configuration.cors` | The CORS configuration object of the instance with booleans for `enabled` and `allowCredentials` and a string array of `origins` +`dataservices.cloudant.configuration.db_count_limit` | Read only value of the maximum number of databases allowed on the instance + +##### Viewing configuration + +Use [Get a resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=python#get-resource-instance) to retrieve the resource instance configuration. + +##### Modifying configuration + +For a new instance use [Create (provision) a new resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=python#create-resource-instance). +For a pre-existing instance use [Update a resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=python#update-resource-instance). + + ### Path elements containing the `+` character Path elements containing the `+` character in the SDKs are not interoperable with: diff --git a/README.md b/README.md index 28ead160..961aa055 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ project: - Supported by IBM Cloudant. - Server compatibility with: - - IBM Cloudant. + - IBM Cloudant (Gen 1). + - IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/KNOWN_ISSUES.md#cloudant-gen-2-compatibility). - [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. - Includes all the most popular and latest supported endpoints for applications. From 9f21433bf699d6e1309aceea30290420423069c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 17:42:42 +0000 Subject: [PATCH 649/669] build(deps-dev): Bump coverage from 7.14.3 to 7.15.0 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.14.3 to 7.15.0. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.14.3...7.15.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.15.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 70a94702..dfbc862a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.1 python_dotenv==1.2.2 pylint==4.0.6 # code coverage -coverage==7.14.3 +coverage==7.15.0 pytest-cov==7.1.0 From e1a0aa76d0e94955494d4d9927fb02723e28eb0c Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 7 Jul 2026 09:33:19 +0000 Subject: [PATCH 650/669] Update version 0.11.8 -> 0.11.9 --- .bumpversion.toml | 2 +- README.md | 34 +++++++++++++++++----------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 4191f42e..3c547337 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.8" +current_version = "0.11.9" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index 961aa055..cbd39467 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.8 +# IBM Cloudant Python SDK Version 0.11.9 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -60,15 +60,15 @@ project: - Supported by IBM Cloudant. - Server compatibility with: - IBM Cloudant (Gen 1). - - IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/KNOWN_ISSUES.md#cloudant-gen-2-compatibility). + - IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/KNOWN_ISSUES.md#cloudant-gen-2-compatibility). - [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. - Includes all the most popular and latest supported endpoints for applications. - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -85,13 +85,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.8" +pip install --upgrade "ibmcloudant>=0.11.9" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.8" +easy_install --upgrade "ibmcloudant>=0.11.9" ``` ## Using the SDK @@ -104,16 +104,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -159,10 +159,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#examples-for-python). ### Error handling @@ -185,7 +185,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -295,7 +295,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -318,7 +318,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -348,8 +348,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index a0234337..ae076dc7 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index 3f46fb98..c071f5eb 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 95f7a166..1362e187 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.8/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index 0742f5dd..22af9fec 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.8 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.9 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index b1a3a8a0..4f07e4e5 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.8' +__version__ = '0.11.9' diff --git a/pyproject.toml b/pyproject.toml index acffe2b5..b57d3830 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.8" +version = "0.11.9" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.25.0", From 81f69ed9d899f433f01ab3529fbde154fcdf4730 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 17:42:34 +0000 Subject: [PATCH 651/669] build(deps-dev): Bump responses from 0.26.1 to 0.26.2 Bumps [responses](https://github.com/getsentry/responses) from 0.26.1 to 0.26.2. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.26.1...0.26.2) --- updated-dependencies: - dependency-name: responses dependency-version: 0.26.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dfbc862a..225a1a09 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ flit==3.12.0 # test dependencies pytest==9.1.1 -responses==0.26.1 +responses==0.26.2 python_dotenv==1.2.2 pylint==4.0.6 # code coverage From a521a3d20d33bc9e60e4627228573fce62ca94d9 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:42:19 +0000 Subject: [PATCH 652/669] chore(generated): group actions updates into fewer PRs Generated SDK source code using: - Generator version 3.114.4 - Specification version 1.0.0-dev0.1.39 - Automation (cloudant-sdks) version 4d2331b --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 69ce69e9..5c10e7de 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,10 @@ updates: default-days: 4 pull-request-branch-name: separator: "-" + groups: + actions-deps: + patterns: + - "*" - package-ecosystem: "pip" directory: "/" open-pull-requests-limit: 10 From ba46315609b2534b0ea380b46ac807fc5d9b79a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:17:40 +0000 Subject: [PATCH 653/669] build(deps): Bump the actions-deps group with 3 updates Bumps the actions-deps group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.36.2 to 4.36.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a) Updates `github/codeql-action/autobuild` from 4.36.2 to 4.36.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a) Updates `github/codeql-action/analyze` from 4.36.2 to 4.36.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...54f647b7e1bb85c95cddabcd46b0c578ec92bc1a) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.36.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.36.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.36.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8aa56f12..2a41a3e4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 with: category: "/language:${{matrix.language}}" From 8af12cd380e5d50157eb75d0ea5b38938590a723 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2026 17:46:38 +0000 Subject: [PATCH 654/669] build(deps): Bump the actions-deps group with 3 updates Bumps the actions-deps group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.36.3 to 4.37.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9) Updates `github/codeql-action/autobuild` from 4.36.3 to 4.37.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9) Updates `github/codeql-action/analyze` from 4.36.3 to 4.37.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/54f647b7e1bb85c95cddabcd46b0c578ec92bc1a...99df26d4f13ea111d4ec1a7dddef6063f76b97e9) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.37.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2a41a3e4..c43d2513 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 + uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 + uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3 + uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 with: category: "/language:${{matrix.language}}" From 6764bfe69c4cc09d0c0f5daabb7b26de0fab5211 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 08:12:34 +0000 Subject: [PATCH 655/669] build(deps-dev): Bump coverage from 7.15.0 to 7.15.2 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.15.0 to 7.15.2. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.15.0...7.15.2) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.15.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 225a1a09..45912f20 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.2 python_dotenv==1.2.2 pylint==4.0.6 # code coverage -coverage==7.15.0 +coverage==7.15.2 pytest-cov==7.1.0 From 1e85e37b906457ff7791f9c50aa48da4ba4e444a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 18:09:45 +0000 Subject: [PATCH 656/669] build(deps): Bump ibm-cloud-sdk-core from 3.25.0 to 3.26.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/python-sdk-core) from 3.25.0 to 3.26.0. - [Release notes](https://github.com/IBM/python-sdk-core/releases) - [Changelog](https://github.com/IBM/python-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/python-sdk-core/compare/v3.25.0...v3.26.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 3.26.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b57d3830..be1e36c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ibmcloudant" version = "0.11.9" description = "Python client library for IBM Cloudant" dependencies = [ - "ibm_cloud_sdk_core==3.25.0", + "ibm_cloud_sdk_core==3.26.0", "requests>=2.32.4,<3.0.0", "python_dateutil>=2.5.3,<3.0.0", "PyJWT>=2.0.1,<3.0.0", From 1ec27243deb0b05bad02136cbbb517269df574be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 17:46:35 +0000 Subject: [PATCH 657/669] build(deps): Bump the actions-deps group with 4 updates Bumps the actions-deps group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `actions/checkout` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1) Updates `github/codeql-action/init` from 4.37.0 to 4.37.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a) Updates `github/codeql-action/autobuild` from 4.37.0 to 4.37.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a) Updates `github/codeql-action/analyze` from 4.37.0 to 4.37.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/99df26d4f13ea111d4ec1a7dddef6063f76b97e9...7188fc363630916deb702c7fdcf4e481b751f97a) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/init dependency-version: 4.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c43d2513..7e8d88ed 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,17 +19,17 @@ jobs: language: ['python'] steps: - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 + uses: github/codeql-action/init@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 + uses: github/codeql-action/autobuild@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 + uses: github/codeql-action/analyze@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 70c2a6b4..255d3a39 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Setup python 3.14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81d6aca9..384ff557 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - 8080:8080 steps: - name: Checkout code - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Setup python ${{ matrix.python }} From c3e2fc1c10853c39cbae71dc5be5fb4e76cd3c17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 17:46:35 +0000 Subject: [PATCH 658/669] build(deps): Bump the actions-deps group with 4 updates Bumps the actions-deps group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [actions/setup-python](https://github.com/actions/setup-python). Updates `github/codeql-action/init` from 4.37.1 to 4.37.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81) Updates `github/codeql-action/autobuild` from 4.37.1 to 4.37.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81) Updates `github/codeql-action/analyze` from 4.37.1 to 4.37.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/7188fc363630916deb702c7fdcf4e481b751f97a...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81) Updates `actions/setup-python` from 6.3.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/ece7cb06caefa5fff74198d8649806c4678c61a1...5fda3b95a4ea91299a34e894583c3862153e4b97) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.37.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: actions/setup-python dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7e8d88ed..12447f08 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 + uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 + uses: github/codeql-action/autobuild@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 + uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 255d3a39..301b5cb4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: with: persist-credentials: false - name: Setup python 3.14 - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.14' cache: 'pip' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 384ff557..14004fac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: with: persist-credentials: false - name: Setup python ${{ matrix.python }} - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python }} cache: 'pip' From e41079cf05752404652fd1da2d98024f82d0d6b5 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:14:01 +0000 Subject: [PATCH 659/669] docs(generated): update audit data events Generated SDK source code using: - Generator version 3.116.0 - Specification version 1.0.0-dev0.1.39 - Automation (cloudant-sdks) version 577b08a --- KNOWN_ISSUES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 1c9cde99..a33f65cb 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -20,8 +20,8 @@ This table summarizes the SDK operations that are incompatible with Cloudant Gen | `post_api_keys` | Generates API keys for apps or persons to enable database access | `POST /_api/v2/api_keys` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#postapikeys) | Use IAM authentication | | `put_cloudant_security_configuration` | Modify only Cloudant related database permissions | `PUT /_api/v2/db/{db}/_security` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#putcloudantsecurity) | Use [database level IAM policies](https://cloud.ibm.com/docs/cloudant-gen2?topic=cloudant-gen2-managing-access-for-cloudant#database-level-iam-policies) | | **Audit events configuration** | | | | | -`get_activity_tracker_events` | Retrieve activity tracking events information | `GET /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getactivitytrackerevents) | `management` events are always enabled, `data` events are not currently available in Gen 2 | -`post_activity_tracker_events` | Modify activity tracking events configuration | `POST /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#postactivitytrackerevents) | `management` events are always enabled, `data` events are not currently available in Gen 2 | +| `get_activity_tracker_events` | Retrieve activity tracking events information | `GET /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getactivitytrackerevents) | The `management` events are always enabled. To view the `data` events configuration, use the [Platform Services SDK](#using-the-platform-services-sdk). | +| `post_activity_tracker_events` | Modify activity tracking events configuration | `POST /_api/v2/user/activity_tracker/events` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#postactivitytrackerevents) | The `management` events are always enabled. To enable the `data` events, use the [Platform Services SDK](#using-the-platform-services-sdk). | | **CORS configuration** | | | | | | `get_cors_information` | Retrieve CORS configuration information | `GET /_api/v2/user/config/cors` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#getcorsinformation) | Use the [Platform Services SDK](#using-the-platform-services-sdk) | `put_cors_configuration` | Modify CORS configuration | `PUT /_api/v2/user/config/cors` | [API docs link](https://cloud.ibm.com/apidocs/cloudant/cloudant-gen1?code=python#putcorsconfiguration) | Use the [Platform Services SDK](#using-the-platform-services-sdk) @@ -44,6 +44,7 @@ Read the current values from the `extensions` mapping of key-value pairs. | --- | --- | `dataservices.cloudant.capacity_units` | The provisioned throughput capacity of the instance in [units](https://cloud.ibm.com/docs/cloudant-gen2?topic=cloudant-gen2-usage-and-charges#provisioned-throughput-capacity-units) `dataservices.cloudant.configuration.cors` | The CORS configuration object of the instance with booleans for `enabled` and `allowCredentials` and a string array of `origins` +`dataservices.cloudant.configuration.audit.data_events` | Boolean to enable (`true`) or disable (`false`) `data` type audit events for the instance `dataservices.cloudant.configuration.db_count_limit` | Read only value of the maximum number of databases allowed on the instance ##### Viewing configuration From 69c03c9a96244ce1b5b7ea510385bbbe3ec95d96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 17:48:32 +0000 Subject: [PATCH 660/669] build(deps): Bump the actions-deps group with 3 updates Bumps the actions-deps group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.37.3 to 4.37.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38) Updates `github/codeql-action/autobuild` from 4.37.3 to 4.37.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38) Updates `github/codeql-action/analyze` from 4.37.3 to 4.37.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 12447f08..71184c0f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + uses: github/codeql-action/autobuild@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 with: category: "/language:${{matrix.language}}" From 17a4cc0725f3c7ee3d360c039687d6a6995426dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2026 10:03:13 +0000 Subject: [PATCH 661/669] build(deps-dev): Bump coverage from 7.15.2 to 7.15.3 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.15.2 to 7.15.3. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.15.2...7.15.3) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.15.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 45912f20..9024cdce 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.2 python_dotenv==1.2.2 pylint==4.0.6 # code coverage -coverage==7.15.2 +coverage==7.15.3 pytest-cov==7.1.0 From f62db4c7cf9a030fe85805a39d7d9998128787e5 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 10 Aug 2026 11:57:31 +0100 Subject: [PATCH 662/669] chore: upgrade build-system to flit 4.0.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index be1e36c7..71753071 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["flit_core >=3.9,<4"] +requires = ["flit_core >=4.0.2,<5"] build-backend = "flit_core.buildapi" [project] From 2720ad5ef097a4797cbc35db60b3cc606945c494 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Mon, 10 Aug 2026 11:58:57 +0100 Subject: [PATCH 663/669] build(deps-dev): upgrade flit to 4.0.2 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9024cdce..e904dce9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # build dependencies -flit==3.12.0 +flit==4.0.2 # test dependencies pytest==9.1.1 responses==0.26.2 From bd57c3bf5b7b15426b72ec77d3630b2ed8763d5d Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Mon, 10 Aug 2026 13:39:53 +0000 Subject: [PATCH 664/669] Update version 0.11.9 -> 0.11.10 --- .bumpversion.toml | 2 +- README.md | 34 +++++++++++++++++----------------- docs/Changes_Follower.md | 4 ++-- docs/Examples.md | 2 +- docs/Pagination.md | 18 +++++++++--------- docs/README.md | 2 +- ibmcloudant/version.py | 2 +- pyproject.toml | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 3c547337..4551724f 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.11.9" +current_version = "0.11.10" commit = true message = "Update version {current_version} -> {new_version}" parse = "^(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)(?P[a|b|rc](?:0|[1-9]\\d*))?(?P(?:\\.dev)(?:0|[1-9]\\d*))?(?P\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$" diff --git a/README.md b/README.md index cbd39467..3d3be2c8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Release](https://img.shields.io/github/v/release/IBM/cloudant-python-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-python-sdk/releases/latest) [![Docs](https://img.shields.io/static/v1?label=Pydoc&message=latest&color=blue)](https://ibm.github.io/cloudant-python-sdk/) -# IBM Cloudant Python SDK Version 0.11.9 +# IBM Cloudant Python SDK Version 0.11.10 IBM Cloudant Python SDK is a client library that interacts with the [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=python). @@ -60,15 +60,15 @@ project: - Supported by IBM Cloudant. - Server compatibility with: - IBM Cloudant (Gen 1). - - IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/KNOWN_ISSUES.md#cloudant-gen-2-compatibility). + - IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/KNOWN_ISSUES.md#cloudant-gen-2-compatibility). - [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. - Includes all the most popular and latest supported endpoints for applications. - Handles the authentication. - Familiar user experience with IBM Cloud SDKs. - Flexibility to use either built-in models or byte-based requests and responses for documents. -- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Changes_Follower.md) -- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Pagination.md) +- Built-in [Changes feed follower](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Changes_Follower.md) +- Built-in [Pagination](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Pagination.md) - Instances of the client are unconditionally thread-safe. ## Prerequisites @@ -85,13 +85,13 @@ project: To install, use `pip` or `easy_install`: ```bash -pip install --upgrade "ibmcloudant>=0.11.9" +pip install --upgrade "ibmcloudant>=0.11.10" ``` or ```bash -easy_install --upgrade "ibmcloudant>=0.11.9" +easy_install --upgrade "ibmcloudant>=0.11.10" ``` ## Using the SDK @@ -104,16 +104,16 @@ account. There are several ways to **set** these authentication properties: -1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md#authentication-with-environment-variables) -2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md#programmatic-authentication) -3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md#authentication-with-external-configuration) +1. As [environment variables](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Authentication.md#authentication-with-environment-variables) +2. The [programmatic approach](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Authentication.md#programmatic-authentication) +3. With an [external credentials file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Authentication.md#authentication-with-external-configuration) The following section describes the different authentication types and provides environment variable examples. Examples for other configuration methods are available by following the provided links. ### Authentication -Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Authentication.md) +Consult the [authentication document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Authentication.md) for comprehensive details of all the available authentication methods and how to configure them with environment settings or programmatically. @@ -159,10 +159,10 @@ response = service.get_all_dbs().get_result() print(response) ``` -[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Examples.md) for creating a database +[More tutorial examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Examples.md) for creating a database and document create, read, update and delete operations. -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/examples#examples-for-python). ### Error handling @@ -185,7 +185,7 @@ Response byte stream is supported in functions with the suffix of `_as_stream`. The returned byte stream allows the response body to be consumed without triggering JSON unmarshalling that is typically performed by the SDK. -The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs/Examples.md#3-update-your-previously-created-document) section +The [update document](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs/Examples.md#3-update-your-previously-created-document) section contains examples for both request and response byte stream cases. The API reference contains further examples of using byte streams. @@ -295,7 +295,7 @@ print(response) ### Further resources -- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/docs) +- [Cloudant Python SDK feature docs](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/docs) - [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python): API reference including usage examples for Cloudant Python SDK API. - [Pydoc](https://ibm.github.io/cloudant-python-sdk/): @@ -318,7 +318,7 @@ If you encounter an issue with the project, you are welcome to submit a Before you submit a bug report, search for [similar issues](https://github.com/IBM/cloudant-python-sdk/issues?q=is%3Aissue) and review the -[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. +[KNOWN_ISSUES file](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet. Please consult the [security policy](https://github.com/IBM/cloudant-python-sdk/security/policy) before opening security related issues. @@ -348,8 +348,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page. ## Contributing -For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/CONTRIBUTING.md). +For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/CONTRIBUTING.md). ## License -This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/LICENSE). +This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/LICENSE). diff --git a/docs/Changes_Follower.md b/docs/Changes_Follower.md index ae076dc7..47933be9 100644 --- a/docs/Changes_Follower.md +++ b/docs/Changes_Follower.md @@ -67,7 +67,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min instantiation if it is insufficient. The default client configuration has sufficiently long timeouts. For use-cases where these configuration limitations are too restrictive then write code to use the SDK's -[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#postchanges) instead of the follower. +[POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/examples#postchanges) instead of the follower. ## Error suppression @@ -101,7 +101,7 @@ The follower is not optimized for some use cases and it is not recommended to us * Setting `include_docs` and larger document sizes (for example > 10 kiB). * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it can never catch-up). -In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#postchanges) +In these use-cases use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/examples#postchanges) for specific control over the number of change requests made and the content size of the responses. ## Checkpoints diff --git a/docs/Examples.md b/docs/Examples.md index c071f5eb..8f0f31bd 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -322,4 +322,4 @@ You have deleted the document. ## Further code examples -For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/examples#examples-for-python). +For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/examples#examples-for-python). diff --git a/docs/Pagination.md b/docs/Pagination.md index 1362e187..6a641173 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -71,22 +71,22 @@ then a `429 Too Many Requests` error occurs. Pagination is available for these operations: * Query all documents [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postalldocs) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionalldocs) - * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/all_docs_pagination.py) - * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_all_docs_pagination.py) + * [Global all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/all_docs_pagination.py) + * [Partitioned all documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/partition_all_docs_pagination.py) * Query all [design documents](https://cloud.ibm.com/apidocs/cloudant?code=python#postdesigndocs) - * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/design_docs_pagination.py) + * [Design documents examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/design_docs_pagination.py) * Query with selector syntax [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postfind) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionfind) - * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/find_pagination.py) - * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_find_pagination.py) + * [Global find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/find_pagination.py) + * [Partitioned find selector query examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/partition_find_pagination.py) * Query a search index [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postsearch) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionsearch) - * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/search_pagination.py) - * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_search_pagination.py) + * [Global search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/search_pagination.py) + * [Partitioned search examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/partition_search_pagination.py) * Query a MapReduce view [global](https://cloud.ibm.com/apidocs/cloudant?code=python#postview) and [partitioned](https://cloud.ibm.com/apidocs/cloudant?code=python#postpartitionview) - * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/view_pagination.py) - * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.9/test/examples/src/features/pagination/partition_view_pagination.py) + * [Global view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/view_pagination.py) + * [Partitioned view examples](https://github.com/IBM/cloudant-python-sdk/tree/v0.11.10/test/examples/src/features/pagination/partition_view_pagination.py) The examples presented in this `README` are for all documents in a partition. The links in the list are to equivalent examples for each of the other available operations. diff --git a/docs/README.md b/docs/README.md index 22af9fec..9686b862 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# IBM Cloudant Python SDK Version 0.11.9 Detailed Documentation +# IBM Cloudant Python SDK Version 0.11.10 Detailed Documentation ## Table of Contents diff --git a/ibmcloudant/version.py b/ibmcloudant/version.py index 4f07e4e5..eef3bb98 100644 --- a/ibmcloudant/version.py +++ b/ibmcloudant/version.py @@ -17,4 +17,4 @@ """ Version of ibmcloudant """ -__version__ = '0.11.9' +__version__ = '0.11.10' diff --git a/pyproject.toml b/pyproject.toml index 71753071..faa1aaf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ibmcloudant" -version = "0.11.9" +version = "0.11.10" description = "Python client library for IBM Cloudant" dependencies = [ "ibm_cloud_sdk_core==3.26.0", From 7efdb94879741b9e76fd141202401dfefb23c5f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 17:42:31 +0000 Subject: [PATCH 665/669] build(deps-dev): Bump coverage from 7.15.3 to 7.15.4 Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.15.3 to 7.15.4. - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.15.3...7.15.4) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.15.4 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e904dce9..2318f3d1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ responses==0.26.2 python_dotenv==1.2.2 pylint==4.0.6 # code coverage -coverage==7.15.3 +coverage==7.15.4 pytest-cov==7.1.0 From a5e277df7c47ba08638e4f38870b792f8dcf6c93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 17:46:44 +0000 Subject: [PATCH 666/669] build(deps): Bump the actions-deps group with 3 updates Bumps the actions-deps group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.37.4 to 4.37.6 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f205ea1c3313d32999d8d6a48b4f6530d4437b38...5595ccaf912efad79be6eef63a5619ff05969be3) Updates `github/codeql-action/autobuild` from 4.37.4 to 4.37.6 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f205ea1c3313d32999d8d6a48b4f6530d4437b38...5595ccaf912efad79be6eef63a5619ff05969be3) Updates `github/codeql-action/analyze` from 4.37.4 to 4.37.6 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f205ea1c3313d32999d8d6a48b4f6530d4437b38...5595ccaf912efad79be6eef63a5619ff05969be3) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.37.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 71184c0f..ec4bbeaa 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + uses: github/codeql-action/autobuild@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 with: category: "/language:${{matrix.language}}" From 5bef4aa9fdee28ba76e5988196d8c628bb41aa87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2026 17:42:37 +0000 Subject: [PATCH 667/669] build(deps-dev): Bump pylint from 4.0.6 to 4.0.7 Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.6 to 4.0.7. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v4.0.6...v4.0.7) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.7 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2318f3d1..33d15360 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flit==4.0.2 pytest==9.1.1 responses==0.26.2 python_dotenv==1.2.2 -pylint==4.0.6 +pylint==4.0.7 # code coverage coverage==7.15.4 pytest-cov==7.1.0 From c64abb0b21405367c30ffbebd7cdb4a9bca19b09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:47:51 +0000 Subject: [PATCH 668/669] build(deps): Bump the actions-deps group with 3 updates Bumps the actions-deps group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.37.6 to 4.37.7 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/5595ccaf912efad79be6eef63a5619ff05969be3...ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd) Updates `github/codeql-action/autobuild` from 4.37.6 to 4.37.7 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/5595ccaf912efad79be6eef63a5619ff05969be3...ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd) Updates `github/codeql-action/analyze` from 4.37.6 to 4.37.7 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/5595ccaf912efad79be6eef63a5619ff05969be3...ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.37.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: github/codeql-action/analyze dependency-version: 4.37.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ec4bbeaa..de1f1f7d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,15 +21,15 @@ jobs: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 with: languages: ${{ matrix.language }} config: | paths-ignore: - 'examples/snippets/**/*.py' - name: Autobuild - uses: github/codeql-action/autobuild@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 with: category: "/language:${{matrix.language}}" From d95b4b4db9193a63905596a7b2077b63b5576928 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 17:42:47 +0000 Subject: [PATCH 669/669] build(deps-dev): Bump python-dotenv from 1.2.2 to 1.2.3 Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.2.2...v1.2.3) --- updated-dependencies: - dependency-name: python-dotenv dependency-version: 1.2.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 33d15360..c2adb262 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ flit==4.0.2 # test dependencies pytest==9.1.1 responses==0.26.2 -python_dotenv==1.2.2 +python_dotenv==1.2.3 pylint==4.0.7 # code coverage coverage==7.15.4