Skip to content

Commit 98c7025

Browse files
cloudant-sdks-automationricellis
authored andcommitted
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
1 parent a520b52 commit 98c7025

File tree

3 files changed

+3
-165
lines changed

3 files changed

+3
-165
lines changed

ibmcloudant/cloudant_v1.py

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -12238,28 +12238,22 @@ class DesignDocumentViewsMapReduce:
1223812238
Schema for view functions definition.
1223912239

1224012240
:param str map: JavaScript map function as a string.
12241-
:param DesignDocumentViewsMapReduceOptions options: (optional) Options of view
12242-
build resuls.
1224312241
:param str reduce: (optional) JavaScript reduce function as a string.
1224412242
"""
1224512243

1224612244
def __init__(
1224712245
self,
1224812246
map: str,
1224912247
*,
12250-
options: Optional['DesignDocumentViewsMapReduceOptions'] = None,
1225112248
reduce: Optional[str] = None,
1225212249
) -> None:
1225312250
"""
1225412251
Initialize a DesignDocumentViewsMapReduce object.
1225512252

1225612253
:param str map: JavaScript map function as a string.
12257-
:param DesignDocumentViewsMapReduceOptions options: (optional) Options of
12258-
view build resuls.
1225912254
:param str reduce: (optional) JavaScript reduce function as a string.
1226012255
"""
1226112256
self.map = map
12262-
self.options = options
1226312257
self.reduce = reduce
1226412258

1226512259
@classmethod
@@ -12270,8 +12264,6 @@ def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduce':
1227012264
args['map'] = map
1227112265
else:
1227212266
raise ValueError('Required property \'map\' not present in DesignDocumentViewsMapReduce JSON')
12273-
if (options := _dict.get('options')) is not None:
12274-
args['options'] = DesignDocumentViewsMapReduceOptions.from_dict(options)
1227512267
if (reduce := _dict.get('reduce')) is not None:
1227612268
args['reduce'] = reduce
1227712269
return cls(**args)
@@ -12286,11 +12278,6 @@ def to_dict(self) -> Dict:
1228612278
_dict = {}
1228712279
if hasattr(self, 'map') and self.map is not None:
1228812280
_dict['map'] = self.map
12289-
if hasattr(self, 'options') and self.options is not None:
12290-
if isinstance(self.options, dict):
12291-
_dict['options'] = self.options
12292-
else:
12293-
_dict['options'] = self.options.to_dict()
1229412281
if hasattr(self, 'reduce') and self.reduce is not None:
1229512282
_dict['reduce'] = self.reduce
1229612283
return _dict
@@ -12314,85 +12301,6 @@ def __ne__(self, other: 'DesignDocumentViewsMapReduce') -> bool:
1231412301
return not self == other
1231512302

1231612303

12317-
class DesignDocumentViewsMapReduceOptions:
12318-
"""
12319-
Options of view build resuls.
12320-
12321-
12322-
This type supports additional properties of type object.
12323-
"""
12324-
12325-
def __init__(
12326-
self,
12327-
**kwargs: Optional[object],
12328-
) -> None:
12329-
"""
12330-
Initialize a DesignDocumentViewsMapReduceOptions object.
12331-
12332-
:param object **kwargs: (optional) Additional properties of type object
12333-
"""
12334-
for k, v in kwargs.items():
12335-
if not isinstance(v, object):
12336-
raise ValueError('Value for additional property {} must be of type object'.format(k))
12337-
setattr(self, k, v)
12338-
12339-
@classmethod
12340-
def from_dict(cls, _dict: Dict) -> 'DesignDocumentViewsMapReduceOptions':
12341-
"""Initialize a DesignDocumentViewsMapReduceOptions object from a json dictionary."""
12342-
args = {}
12343-
for k, v in _dict.items():
12344-
if not isinstance(v, object):
12345-
raise ValueError('Value for additional property {} must be of type object'.format(k))
12346-
args[k] = v
12347-
return cls(**args)
12348-
12349-
@classmethod
12350-
def _from_dict(cls, _dict):
12351-
"""Initialize a DesignDocumentViewsMapReduceOptions object from a json dictionary."""
12352-
return cls.from_dict(_dict)
12353-
12354-
def to_dict(self) -> Dict:
12355-
"""Return a json dictionary representing this model."""
12356-
_dict = {}
12357-
for k in [_k for _k in vars(self).keys()]:
12358-
_dict[k] = getattr(self, k)
12359-
return _dict
12360-
12361-
def _to_dict(self):
12362-
"""Return a json dictionary representing this model."""
12363-
return self.to_dict()
12364-
12365-
def get_properties(self) -> Dict:
12366-
"""Return the additional properties from this instance of DesignDocumentViewsMapReduceOptions in the form of a dict."""
12367-
_dict = {}
12368-
for k in [_k for _k in vars(self).keys()]:
12369-
_dict[k] = getattr(self, k)
12370-
return _dict
12371-
12372-
def set_properties(self, _dict: dict):
12373-
"""Set a dictionary of additional properties in this instance of DesignDocumentViewsMapReduceOptions"""
12374-
for k in [_k for _k in vars(self).keys()]:
12375-
delattr(self, k)
12376-
for k, v in _dict.items():
12377-
if not isinstance(v, object):
12378-
raise ValueError('Value for additional property {} must be of type object'.format(k))
12379-
setattr(self, k, v)
12380-
12381-
def __str__(self) -> str:
12382-
"""Return a `str` version of this DesignDocumentViewsMapReduceOptions object."""
12383-
return json.dumps(self.to_dict(), indent=2)
12384-
12385-
def __eq__(self, other: 'DesignDocumentViewsMapReduceOptions') -> bool:
12386-
"""Return `true` when self and other are equal, false otherwise."""
12387-
if not isinstance(other, self.__class__):
12388-
return False
12389-
return self.__dict__ == other.__dict__
12390-
12391-
def __ne__(self, other: 'DesignDocumentViewsMapReduceOptions') -> bool:
12392-
"""Return `true` when self and other are not equal, false otherwise."""
12393-
return not self == other
12394-
12395-
1239612304
class DocsResultRow:
1239712305
"""
1239812306
Schema for a row of document information in a DocsResult.

test/integration/test_cloudant_v1.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,9 @@ def test_put_design_document(self):
755755
design_document_options_model = {
756756
'partitioned': True,
757757
}
758-
# Construct a dict representation of a DesignDocumentViewsMapReduceOptions model
759-
design_document_views_map_reduce_options_model = {
760-
'foo': 'testString',
761-
}
762758
# Construct a dict representation of a DesignDocumentViewsMapReduce model
763759
design_document_views_map_reduce_model = {
764760
'map': 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}',
765-
'options': design_document_views_map_reduce_options_model,
766761
'reduce': 'testString',
767762
}
768763
# Construct a dict representation of a DesignDocument model

test/unit/test_cloudant_v1.py

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4709,7 +4709,7 @@ def test_get_design_document_all_params(self):
47094709
"""
47104710
# Set up mock
47114711
url = preprocess_url('/testString/_design/testString')
4712-
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"}}}'
4712+
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"}}}'
47134713
responses.add(
47144714
responses.GET,
47154715
url,
@@ -4784,7 +4784,7 @@ def test_get_design_document_required_params(self):
47844784
"""
47854785
# Set up mock
47864786
url = preprocess_url('/testString/_design/testString')
4787-
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"}}}'
4787+
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"}}}'
47884788
responses.add(
47894789
responses.GET,
47904790
url,
@@ -4824,7 +4824,7 @@ def test_get_design_document_value_error(self):
48244824
"""
48254825
# Set up mock
48264826
url = preprocess_url('/testString/_design/testString')
4827-
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"}}}'
4827+
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"}}}'
48284828
responses.add(
48294829
responses.GET,
48304830
url,
@@ -4920,14 +4920,9 @@ def test_put_design_document_all_params(self):
49204920
design_document_options_model = {}
49214921
design_document_options_model['partitioned'] = True
49224922

4923-
# Construct a dict representation of a DesignDocumentViewsMapReduceOptions model
4924-
design_document_views_map_reduce_options_model = {}
4925-
design_document_views_map_reduce_options_model['foo'] = 'testString'
4926-
49274923
# Construct a dict representation of a DesignDocumentViewsMapReduce model
49284924
design_document_views_map_reduce_model = {}
49294925
design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}'
4930-
design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model
49314926
design_document_views_map_reduce_model['reduce'] = 'testString'
49324927

49334928
# Construct a dict representation of a DesignDocument model
@@ -5055,14 +5050,9 @@ def test_put_design_document_required_params(self):
50555050
design_document_options_model = {}
50565051
design_document_options_model['partitioned'] = True
50575052

5058-
# Construct a dict representation of a DesignDocumentViewsMapReduceOptions model
5059-
design_document_views_map_reduce_options_model = {}
5060-
design_document_views_map_reduce_options_model['foo'] = 'testString'
5061-
50625053
# Construct a dict representation of a DesignDocumentViewsMapReduce model
50635054
design_document_views_map_reduce_model = {}
50645055
design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}'
5065-
design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model
50665056
design_document_views_map_reduce_model['reduce'] = 'testString'
50675057

50685058
# Construct a dict representation of a DesignDocument model
@@ -5176,14 +5166,9 @@ def test_put_design_document_value_error(self):
51765166
design_document_options_model = {}
51775167
design_document_options_model['partitioned'] = True
51785168

5179-
# Construct a dict representation of a DesignDocumentViewsMapReduceOptions model
5180-
design_document_views_map_reduce_options_model = {}
5181-
design_document_views_map_reduce_options_model['foo'] = 'testString'
5182-
51835169
# Construct a dict representation of a DesignDocumentViewsMapReduce model
51845170
design_document_views_map_reduce_model = {}
51855171
design_document_views_map_reduce_model['map'] = 'function(doc) { \n emit(doc.productid, [doc.brand, doc.name, doc.description]) \n}'
5186-
design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model
51875172
design_document_views_map_reduce_model['reduce'] = 'testString'
51885173

51895174
# Construct a dict representation of a DesignDocument model
@@ -14653,12 +14638,8 @@ def test_design_document_serialization(self):
1465314638
design_document_options_model = {} # DesignDocumentOptions
1465414639
design_document_options_model['partitioned'] = True
1465514640

14656-
design_document_views_map_reduce_options_model = {} # DesignDocumentViewsMapReduceOptions
14657-
design_document_views_map_reduce_options_model['foo'] = 'testString'
14658-
1465914641
design_document_views_map_reduce_model = {} # DesignDocumentViewsMapReduce
1466014642
design_document_views_map_reduce_model['map'] = 'testString'
14661-
design_document_views_map_reduce_model['options'] = design_document_views_map_reduce_options_model
1466214643
design_document_views_map_reduce_model['reduce'] = 'testString'
1466314644

1466414645
# Construct a json representation of a DesignDocument model
@@ -14851,15 +14832,9 @@ def test_design_document_views_map_reduce_serialization(self):
1485114832
Test serialization/deserialization for DesignDocumentViewsMapReduce
1485214833
"""
1485314834

14854-
# Construct dict forms of any model objects needed in order to build this model.
14855-
14856-
design_document_views_map_reduce_options_model = {} # DesignDocumentViewsMapReduceOptions
14857-
design_document_views_map_reduce_options_model['foo'] = 'testString'
14858-
1485914835
# Construct a json representation of a DesignDocumentViewsMapReduce model
1486014836
design_document_views_map_reduce_model_json = {}
1486114837
design_document_views_map_reduce_model_json['map'] = 'testString'
14862-
design_document_views_map_reduce_model_json['options'] = design_document_views_map_reduce_options_model
1486314838
design_document_views_map_reduce_model_json['reduce'] = 'testString'
1486414839

1486514840
# 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):
1487814853
assert design_document_views_map_reduce_model_json2 == design_document_views_map_reduce_model_json
1487914854

1488014855

14881-
class TestModel_DesignDocumentViewsMapReduceOptions:
14882-
"""
14883-
Test Class for DesignDocumentViewsMapReduceOptions
14884-
"""
14885-
14886-
def test_design_document_views_map_reduce_options_serialization(self):
14887-
"""
14888-
Test serialization/deserialization for DesignDocumentViewsMapReduceOptions
14889-
"""
14890-
14891-
# Construct a json representation of a DesignDocumentViewsMapReduceOptions model
14892-
design_document_views_map_reduce_options_model_json = {}
14893-
design_document_views_map_reduce_options_model_json['foo'] = 'testString'
14894-
14895-
# Construct a model instance of DesignDocumentViewsMapReduceOptions by calling from_dict on the json representation
14896-
design_document_views_map_reduce_options_model = DesignDocumentViewsMapReduceOptions.from_dict(design_document_views_map_reduce_options_model_json)
14897-
assert design_document_views_map_reduce_options_model != False
14898-
14899-
# Construct a model instance of DesignDocumentViewsMapReduceOptions by calling from_dict on the json representation
14900-
design_document_views_map_reduce_options_model_dict = DesignDocumentViewsMapReduceOptions.from_dict(design_document_views_map_reduce_options_model_json).__dict__
14901-
design_document_views_map_reduce_options_model2 = DesignDocumentViewsMapReduceOptions(**design_document_views_map_reduce_options_model_dict)
14902-
14903-
# Verify the model instances are equivalent
14904-
assert design_document_views_map_reduce_options_model == design_document_views_map_reduce_options_model2
14905-
14906-
# Convert model instance back to dict and verify no loss of data
14907-
design_document_views_map_reduce_options_model_json2 = design_document_views_map_reduce_options_model.to_dict()
14908-
assert design_document_views_map_reduce_options_model_json2 == design_document_views_map_reduce_options_model_json
14909-
14910-
# Test get_properties and set_properties methods.
14911-
design_document_views_map_reduce_options_model.set_properties({})
14912-
actual_dict = design_document_views_map_reduce_options_model.get_properties()
14913-
assert actual_dict == {}
14914-
14915-
expected_dict = {'foo': 'testString'}
14916-
design_document_views_map_reduce_options_model.set_properties(expected_dict)
14917-
actual_dict = design_document_views_map_reduce_options_model.get_properties()
14918-
assert actual_dict.keys() == expected_dict.keys()
14919-
14920-
1492114856
class TestModel_DocsResultRow:
1492214857
"""
1492314858
Test Class for DocsResultRow

0 commit comments

Comments
 (0)