Skip to content

Commit 1444f0b

Browse files
committed
forced replication method object or string
1 parent 845f8a3 commit 1444f0b

File tree

7 files changed

+211
-68
lines changed

7 files changed

+211
-68
lines changed

docs/ForcedReplicationMethod.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# ForcedReplicationMethod
22

3-
A stream will sometimes be forced to use a particular Replication Method. This describes the replication method and the reason for the requirement.
3+
A stream will sometimes be forced to use a particular Replication Method. For non-Salesforce sources, this will be a string indicating which replication method is required. Otherwise, it will be an object.
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**reason** | **str** | The reason for the forced Replication Method | [optional]
8-
**replication_method** | **str** | Indicates which Replication Method is required for the stream. Possible values are: FULL_TABLE - The stream is using Full Table Replication INCREMENTAL - The stream is using Key-based Incremental Replication LOG_BASED - The stream is using Log-based Incremental Replication. | [optional]
97

108
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
119

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ForcedReplicationMethodObject
2+
3+
A stream will sometimes be forced to use a particular Replication Method. This describes the replication method and the reason for the requirement. This is only used for Salesforce sources.
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**reason** | **str** | The reason for the forced Replication Method | [optional]
8+
**replication_method** | **str** | Indicates which Replication Method is required for the stream. Possible values are: FULL_TABLE - The stream is using Full Table Replication INCREMENTAL - The stream is using Key-based Incremental Replication LOG_BASED - The stream is using Log-based Incremental Replication. | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

stitch_connect_client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from stitch_connect_client.models.error_object_error import ErrorObjectError
4747
from stitch_connect_client.models.field_level_metadata import FieldLevelMetadata
4848
from stitch_connect_client.models.forced_replication_method import ForcedReplicationMethod
49+
from stitch_connect_client.models.forced_replication_method_object import ForcedReplicationMethodObject
4950
from stitch_connect_client.models.hook_notification import HookNotification
5051
from stitch_connect_client.models.hook_notification_config import HookNotificationConfig
5152
from stitch_connect_client.models.metadata import Metadata

stitch_connect_client/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from stitch_connect_client.models.error_object_error import ErrorObjectError
3131
from stitch_connect_client.models.field_level_metadata import FieldLevelMetadata
3232
from stitch_connect_client.models.forced_replication_method import ForcedReplicationMethod
33+
from stitch_connect_client.models.forced_replication_method_object import ForcedReplicationMethodObject
3334
from stitch_connect_client.models.hook_notification import HookNotification
3435
from stitch_connect_client.models.hook_notification_config import HookNotificationConfig
3536
from stitch_connect_client.models.metadata import Metadata

stitch_connect_client/models/forced_replication_method.py

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -33,82 +33,18 @@ class ForcedReplicationMethod(object):
3333
and the value is json key in definition.
3434
"""
3535
openapi_types = {
36-
'reason': 'str',
37-
'replication_method': 'str'
3836
}
3937

4038
attribute_map = {
41-
'reason': 'reason',
42-
'replication_method': 'replication-method'
4339
}
4440

45-
def __init__(self, reason=None, replication_method=None, local_vars_configuration=None): # noqa: E501
41+
def __init__(self, local_vars_configuration=None): # noqa: E501
4642
"""ForcedReplicationMethod - a model defined in OpenAPI""" # noqa: E501
4743
if local_vars_configuration is None:
4844
local_vars_configuration = Configuration()
4945
self.local_vars_configuration = local_vars_configuration
50-
51-
self._reason = None
52-
self._replication_method = None
5346
self.discriminator = None
5447

55-
if reason is not None:
56-
self.reason = reason
57-
if replication_method is not None:
58-
self.replication_method = replication_method
59-
60-
@property
61-
def reason(self):
62-
"""Gets the reason of this ForcedReplicationMethod. # noqa: E501
63-
64-
The reason for the forced Replication Method # noqa: E501
65-
66-
:return: The reason of this ForcedReplicationMethod. # noqa: E501
67-
:rtype: str
68-
"""
69-
return self._reason
70-
71-
@reason.setter
72-
def reason(self, reason):
73-
"""Sets the reason of this ForcedReplicationMethod.
74-
75-
The reason for the forced Replication Method # noqa: E501
76-
77-
:param reason: The reason of this ForcedReplicationMethod. # noqa: E501
78-
:type: str
79-
"""
80-
81-
self._reason = reason
82-
83-
@property
84-
def replication_method(self):
85-
"""Gets the replication_method of this ForcedReplicationMethod. # noqa: E501
86-
87-
Indicates which Replication Method is required for the stream. Possible values are: FULL_TABLE - The stream is using Full Table Replication INCREMENTAL - The stream is using Key-based Incremental Replication LOG_BASED - The stream is using Log-based Incremental Replication. # noqa: E501
88-
89-
:return: The replication_method of this ForcedReplicationMethod. # noqa: E501
90-
:rtype: str
91-
"""
92-
return self._replication_method
93-
94-
@replication_method.setter
95-
def replication_method(self, replication_method):
96-
"""Sets the replication_method of this ForcedReplicationMethod.
97-
98-
Indicates which Replication Method is required for the stream. Possible values are: FULL_TABLE - The stream is using Full Table Replication INCREMENTAL - The stream is using Key-based Incremental Replication LOG_BASED - The stream is using Log-based Incremental Replication. # noqa: E501
99-
100-
:param replication_method: The replication_method of this ForcedReplicationMethod. # noqa: E501
101-
:type: str
102-
"""
103-
allowed_values = ["FULL_TABLE", "INCREMENTAL", "LOG_BASED"] # noqa: E501
104-
if self.local_vars_configuration.client_side_validation and replication_method not in allowed_values: # noqa: E501
105-
raise ValueError(
106-
"Invalid value for `replication_method` ({0}), must be one of {1}" # noqa: E501
107-
.format(replication_method, allowed_values)
108-
)
109-
110-
self._replication_method = replication_method
111-
11248
def to_dict(self):
11349
"""Returns the model properties as a dict"""
11450
result = {}
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# coding: utf-8
2+
3+
"""
4+
Stitch Connect
5+
6+
https://www.stitchdata.com/docs/developers/stitch-connect/api # noqa: E501
7+
8+
The version of the OpenAPI document: 0.1
9+
Generated by: https://openapi-generator.tech
10+
"""
11+
12+
13+
import pprint
14+
import re # noqa: F401
15+
16+
import six
17+
18+
from stitch_connect_client.configuration import Configuration
19+
20+
21+
class ForcedReplicationMethodObject(object):
22+
"""NOTE: This class is auto generated by OpenAPI Generator.
23+
Ref: https://openapi-generator.tech
24+
25+
Do not edit the class manually.
26+
"""
27+
28+
"""
29+
Attributes:
30+
openapi_types (dict): The key is attribute name
31+
and the value is attribute type.
32+
attribute_map (dict): The key is attribute name
33+
and the value is json key in definition.
34+
"""
35+
openapi_types = {
36+
'reason': 'str',
37+
'replication_method': 'str'
38+
}
39+
40+
attribute_map = {
41+
'reason': 'reason',
42+
'replication_method': 'replication-method'
43+
}
44+
45+
def __init__(self, reason=None, replication_method=None, local_vars_configuration=None): # noqa: E501
46+
"""ForcedReplicationMethodObject - a model defined in OpenAPI""" # noqa: E501
47+
if local_vars_configuration is None:
48+
local_vars_configuration = Configuration()
49+
self.local_vars_configuration = local_vars_configuration
50+
51+
self._reason = None
52+
self._replication_method = None
53+
self.discriminator = None
54+
55+
if reason is not None:
56+
self.reason = reason
57+
if replication_method is not None:
58+
self.replication_method = replication_method
59+
60+
@property
61+
def reason(self):
62+
"""Gets the reason of this ForcedReplicationMethodObject. # noqa: E501
63+
64+
The reason for the forced Replication Method # noqa: E501
65+
66+
:return: The reason of this ForcedReplicationMethodObject. # noqa: E501
67+
:rtype: str
68+
"""
69+
return self._reason
70+
71+
@reason.setter
72+
def reason(self, reason):
73+
"""Sets the reason of this ForcedReplicationMethodObject.
74+
75+
The reason for the forced Replication Method # noqa: E501
76+
77+
:param reason: The reason of this ForcedReplicationMethodObject. # noqa: E501
78+
:type: str
79+
"""
80+
81+
self._reason = reason
82+
83+
@property
84+
def replication_method(self):
85+
"""Gets the replication_method of this ForcedReplicationMethodObject. # noqa: E501
86+
87+
Indicates which Replication Method is required for the stream. Possible values are: FULL_TABLE - The stream is using Full Table Replication INCREMENTAL - The stream is using Key-based Incremental Replication LOG_BASED - The stream is using Log-based Incremental Replication. # noqa: E501
88+
89+
:return: The replication_method of this ForcedReplicationMethodObject. # noqa: E501
90+
:rtype: str
91+
"""
92+
return self._replication_method
93+
94+
@replication_method.setter
95+
def replication_method(self, replication_method):
96+
"""Sets the replication_method of this ForcedReplicationMethodObject.
97+
98+
Indicates which Replication Method is required for the stream. Possible values are: FULL_TABLE - The stream is using Full Table Replication INCREMENTAL - The stream is using Key-based Incremental Replication LOG_BASED - The stream is using Log-based Incremental Replication. # noqa: E501
99+
100+
:param replication_method: The replication_method of this ForcedReplicationMethodObject. # noqa: E501
101+
:type: str
102+
"""
103+
allowed_values = ["FULL_TABLE", "INCREMENTAL", "LOG_BASED"] # noqa: E501
104+
if self.local_vars_configuration.client_side_validation and replication_method not in allowed_values: # noqa: E501
105+
raise ValueError(
106+
"Invalid value for `replication_method` ({0}), must be one of {1}" # noqa: E501
107+
.format(replication_method, allowed_values)
108+
)
109+
110+
self._replication_method = replication_method
111+
112+
def to_dict(self):
113+
"""Returns the model properties as a dict"""
114+
result = {}
115+
116+
for attr, _ in six.iteritems(self.openapi_types):
117+
value = getattr(self, attr)
118+
if isinstance(value, list):
119+
result[attr] = list(map(
120+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
121+
value
122+
))
123+
elif hasattr(value, "to_dict"):
124+
result[attr] = value.to_dict()
125+
elif isinstance(value, dict):
126+
result[attr] = dict(map(
127+
lambda item: (item[0], item[1].to_dict())
128+
if hasattr(item[1], "to_dict") else item,
129+
value.items()
130+
))
131+
else:
132+
result[attr] = value
133+
134+
return result
135+
136+
def to_str(self):
137+
"""Returns the string representation of the model"""
138+
return pprint.pformat(self.to_dict())
139+
140+
def __repr__(self):
141+
"""For `print` and `pprint`"""
142+
return self.to_str()
143+
144+
def __eq__(self, other):
145+
"""Returns true if both objects are equal"""
146+
if not isinstance(other, ForcedReplicationMethodObject):
147+
return False
148+
149+
return self.to_dict() == other.to_dict()
150+
151+
def __ne__(self, other):
152+
"""Returns true if both objects are not equal"""
153+
if not isinstance(other, ForcedReplicationMethodObject):
154+
return True
155+
156+
return self.to_dict() != other.to_dict()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# coding: utf-8
2+
3+
"""
4+
Stitch Connect
5+
6+
https://www.stitchdata.com/docs/developers/stitch-connect/api # noqa: E501
7+
8+
The version of the OpenAPI document: 0.1
9+
Generated by: https://openapi-generator.tech
10+
"""
11+
12+
13+
from __future__ import absolute_import
14+
15+
import unittest
16+
17+
import stitch_connect_client
18+
from stitch_connect_client.models.forced_replication_method_object import ForcedReplicationMethodObject # noqa: E501
19+
from stitch_connect_client.rest import ApiException
20+
21+
22+
class TestForcedReplicationMethodObject(unittest.TestCase):
23+
"""ForcedReplicationMethodObject unit test stubs"""
24+
25+
def setUp(self):
26+
pass
27+
28+
def tearDown(self):
29+
pass
30+
31+
def testForcedReplicationMethodObject(self):
32+
"""Test ForcedReplicationMethodObject"""
33+
# FIXME: construct object with mandatory attributes with example values
34+
# model = stitch_connect_client.models.forced_replication_method_object.ForcedReplicationMethodObject() # noqa: E501
35+
pass
36+
37+
38+
if __name__ == '__main__':
39+
unittest.main()

0 commit comments

Comments
 (0)