dyspatch_client 3.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/README.md +45 -53
- data/Rakefile +2 -0
- data/docs/APIError.md +13 -2
- data/docs/CompiledRead.md +15 -0
- data/docs/Cursor.md +11 -1
- data/docs/DraftMetaRead.md +14 -1
- data/docs/DraftRead.md +17 -1
- data/docs/DraftsApi.md +140 -131
- data/docs/DraftsRead.md +12 -2
- data/docs/{Body.md → InlineObject.md} +10 -1
- data/docs/LocalizationKeyRead.md +10 -0
- data/docs/LocalizationMetaRead.md +15 -2
- data/docs/LocalizationRead.md +19 -1
- data/docs/LocalizationsApi.md +75 -13
- data/docs/TemplateMetaRead.md +16 -1
- data/docs/TemplateRead.md +17 -1
- data/docs/TemplatesApi.md +40 -36
- data/docs/TemplatesRead.md +11 -1
- data/dyspatch_client.gemspec +5 -11
- data/lib/dyspatch_client.rb +5 -20
- data/lib/dyspatch_client/api/drafts_api.rb +375 -234
- data/lib/dyspatch_client/api/localizations_api.rb +135 -31
- data/lib/dyspatch_client/api/templates_api.rb +99 -65
- data/lib/dyspatch_client/api_client.rb +46 -47
- data/lib/dyspatch_client/api_error.rb +23 -4
- data/lib/dyspatch_client/configuration.rb +48 -9
- data/lib/dyspatch_client/models/api_error.rb +46 -22
- data/lib/dyspatch_client/models/compiled_read.rb +56 -67
- data/lib/dyspatch_client/models/cursor.rb +43 -20
- data/lib/dyspatch_client/models/draft_meta_read.rb +49 -35
- data/lib/dyspatch_client/models/draft_read.rb +49 -25
- data/lib/dyspatch_client/models/drafts_read.rb +42 -19
- data/lib/dyspatch_client/models/{body.rb → inline_object.rb} +40 -17
- data/lib/dyspatch_client/models/localization_key_read.rb +41 -17
- data/lib/dyspatch_client/models/localization_meta_read.rb +62 -36
- data/lib/dyspatch_client/models/localization_read.rb +71 -35
- data/lib/dyspatch_client/models/template_meta_read.rb +48 -24
- data/lib/dyspatch_client/models/template_read.rb +49 -25
- data/lib/dyspatch_client/models/templates_read.rb +41 -17
- data/lib/dyspatch_client/version.rb +5 -5
- data/spec/api/drafts_api_spec.rb +61 -53
- data/spec/api/localizations_api_spec.rb +26 -10
- data/spec/api/templates_api_spec.rb +22 -20
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +4 -4
- data/spec/spec_helper.rb +4 -4
- metadata +11 -219
- data/LICENSE +0 -202
- data/docs/Body1.md +0 -8
- data/docs/CreatedAt.md +0 -7
- data/docs/DraftDescription.md +0 -7
- data/docs/DraftId.md +0 -7
- data/docs/DraftName.md +0 -7
- data/docs/DraftUrl.md +0 -7
- data/docs/LanguageId.md +0 -7
- data/docs/LocalizationId.md +0 -7
- data/docs/LocalizationName.md +0 -7
- data/docs/LocalizationUrl.md +0 -7
- data/docs/TemplateDescription.md +0 -7
- data/docs/TemplateId.md +0 -7
- data/docs/TemplateName.md +0 -7
- data/docs/TemplateUrl.md +0 -7
- data/docs/UpdatedAt.md +0 -7
- data/git_push.sh +0 -55
- data/lib/dyspatch_client/models/body_1.rb +0 -183
- data/lib/dyspatch_client/models/created_at.rb +0 -175
- data/lib/dyspatch_client/models/draft_description.rb +0 -175
- data/lib/dyspatch_client/models/draft_id.rb +0 -175
- data/lib/dyspatch_client/models/draft_name.rb +0 -175
- data/lib/dyspatch_client/models/draft_url.rb +0 -175
- data/lib/dyspatch_client/models/language_id.rb +0 -175
- data/lib/dyspatch_client/models/localization_id.rb +0 -175
- data/lib/dyspatch_client/models/localization_name.rb +0 -175
- data/lib/dyspatch_client/models/localization_url.rb +0 -175
- data/lib/dyspatch_client/models/template_description.rb +0 -175
- data/lib/dyspatch_client/models/template_id.rb +0 -175
- data/lib/dyspatch_client/models/template_name.rb +0 -175
- data/lib/dyspatch_client/models/template_url.rb +0 -175
- data/lib/dyspatch_client/models/updated_at.rb +0 -175
- data/spec/models/api_error_spec.rb +0 -57
- data/spec/models/body_1_spec.rb +0 -41
- data/spec/models/body_spec.rb +0 -41
- data/spec/models/compiled_read_spec.rb +0 -65
- data/spec/models/created_at_spec.rb +0 -35
- data/spec/models/cursor_spec.rb +0 -47
- data/spec/models/draft_description_spec.rb +0 -35
- data/spec/models/draft_id_spec.rb +0 -35
- data/spec/models/draft_meta_read_spec.rb +0 -77
- data/spec/models/draft_name_spec.rb +0 -35
- data/spec/models/draft_read_spec.rb +0 -83
- data/spec/models/draft_url_spec.rb +0 -35
- data/spec/models/drafts_read_spec.rb +0 -47
- data/spec/models/language_id_spec.rb +0 -35
- data/spec/models/localization_id_spec.rb +0 -35
- data/spec/models/localization_key_read_spec.rb +0 -47
- data/spec/models/localization_meta_read_spec.rb +0 -65
- data/spec/models/localization_name_spec.rb +0 -35
- data/spec/models/localization_read_spec.rb +0 -83
- data/spec/models/localization_url_spec.rb +0 -35
- data/spec/models/template_description_spec.rb +0 -35
- data/spec/models/template_id_spec.rb +0 -35
- data/spec/models/template_meta_read_spec.rb +0 -77
- data/spec/models/template_name_spec.rb +0 -35
- data/spec/models/template_read_spec.rb +0 -83
- data/spec/models/template_url_spec.rb +0 -35
- data/spec/models/templates_read_spec.rb +0 -47
- data/spec/models/updated_at_spec.rb +0 -35
@@ -1,18 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries
|
4
|
+
## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 2020.11
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module DyspatchClient
|
16
|
+
# list of template metadata
|
16
17
|
class TemplateRead
|
17
18
|
# An opaque, unique identifier for a template
|
18
19
|
attr_accessor :id
|
@@ -52,7 +53,7 @@ module DyspatchClient
|
|
52
53
|
end
|
53
54
|
|
54
55
|
# Attribute type mapping.
|
55
|
-
def self.
|
56
|
+
def self.openapi_types
|
56
57
|
{
|
57
58
|
:'id' => :'String',
|
58
59
|
:'name' => :'String',
|
@@ -65,43 +66,56 @@ module DyspatchClient
|
|
65
66
|
}
|
66
67
|
end
|
67
68
|
|
69
|
+
# List of attributes with nullable: true
|
70
|
+
def self.openapi_nullable
|
71
|
+
Set.new([
|
72
|
+
])
|
73
|
+
end
|
74
|
+
|
68
75
|
# Initializes the object
|
69
76
|
# @param [Hash] attributes Model attributes in the form of hash
|
70
77
|
def initialize(attributes = {})
|
71
|
-
|
78
|
+
if (!attributes.is_a?(Hash))
|
79
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DyspatchClient::TemplateRead` initialize method"
|
80
|
+
end
|
72
81
|
|
73
|
-
# convert string to symbol for hash key
|
74
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
83
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
84
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
85
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DyspatchClient::TemplateRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
86
|
+
end
|
87
|
+
h[k.to_sym] = v
|
88
|
+
}
|
75
89
|
|
76
|
-
if attributes.
|
90
|
+
if attributes.key?(:'id')
|
77
91
|
self.id = attributes[:'id']
|
78
92
|
end
|
79
93
|
|
80
|
-
if attributes.
|
94
|
+
if attributes.key?(:'name')
|
81
95
|
self.name = attributes[:'name']
|
82
96
|
end
|
83
97
|
|
84
|
-
if attributes.
|
98
|
+
if attributes.key?(:'description')
|
85
99
|
self.description = attributes[:'description']
|
86
100
|
end
|
87
101
|
|
88
|
-
if attributes.
|
102
|
+
if attributes.key?(:'url')
|
89
103
|
self.url = attributes[:'url']
|
90
104
|
end
|
91
105
|
|
92
|
-
if attributes.
|
106
|
+
if attributes.key?(:'compiled')
|
93
107
|
self.compiled = attributes[:'compiled']
|
94
108
|
end
|
95
109
|
|
96
|
-
if attributes.
|
97
|
-
self.created_at = attributes[:'
|
110
|
+
if attributes.key?(:'created_at')
|
111
|
+
self.created_at = attributes[:'created_at']
|
98
112
|
end
|
99
113
|
|
100
|
-
if attributes.
|
101
|
-
self.updated_at = attributes[:'
|
114
|
+
if attributes.key?(:'updated_at')
|
115
|
+
self.updated_at = attributes[:'updated_at']
|
102
116
|
end
|
103
117
|
|
104
|
-
if attributes.
|
118
|
+
if attributes.key?(:'localizations')
|
105
119
|
if (value = attributes[:'localizations']).is_a?(Array)
|
106
120
|
self.localizations = value
|
107
121
|
end
|
@@ -143,19 +157,26 @@ module DyspatchClient
|
|
143
157
|
end
|
144
158
|
|
145
159
|
# Calculates hash code according to all attributes.
|
146
|
-
# @return [
|
160
|
+
# @return [Integer] Hash code
|
147
161
|
def hash
|
148
162
|
[id, name, description, url, compiled, created_at, updated_at, localizations].hash
|
149
163
|
end
|
150
164
|
|
165
|
+
# Builds the object from hash
|
166
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
167
|
+
# @return [Object] Returns the model itself
|
168
|
+
def self.build_from_hash(attributes)
|
169
|
+
new.build_from_hash(attributes)
|
170
|
+
end
|
171
|
+
|
151
172
|
# Builds the object from hash
|
152
173
|
# @param [Hash] attributes Model attributes in the form of hash
|
153
174
|
# @return [Object] Returns the model itself
|
154
175
|
def build_from_hash(attributes)
|
155
176
|
return nil unless attributes.is_a?(Hash)
|
156
|
-
self.class.
|
177
|
+
self.class.openapi_types.each_pair do |key, type|
|
157
178
|
if type =~ /\AArray<(.*)>/i
|
158
|
-
# check to ensure the input is an array given that the
|
179
|
+
# check to ensure the input is an array given that the attribute
|
159
180
|
# is documented as an array but the input is not
|
160
181
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
161
182
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -184,7 +205,7 @@ module DyspatchClient
|
|
184
205
|
value.to_i
|
185
206
|
when :Float
|
186
207
|
value.to_f
|
187
|
-
when :
|
208
|
+
when :Boolean
|
188
209
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
189
210
|
true
|
190
211
|
else
|
@@ -205,8 +226,7 @@ module DyspatchClient
|
|
205
226
|
end
|
206
227
|
end
|
207
228
|
else # model
|
208
|
-
|
209
|
-
temp_model.build_from_hash(value)
|
229
|
+
DyspatchClient.const_get(type).build_from_hash(value)
|
210
230
|
end
|
211
231
|
end
|
212
232
|
|
@@ -228,7 +248,11 @@ module DyspatchClient
|
|
228
248
|
hash = {}
|
229
249
|
self.class.attribute_map.each_pair do |attr, param|
|
230
250
|
value = self.send(attr)
|
231
|
-
|
251
|
+
if value.nil?
|
252
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
253
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
254
|
+
end
|
255
|
+
|
232
256
|
hash[param] = _to_hash(value)
|
233
257
|
end
|
234
258
|
hash
|
@@ -1,18 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries
|
4
|
+
## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 2020.11
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module DyspatchClient
|
16
|
+
# list of template metadata
|
16
17
|
class TemplatesRead
|
17
18
|
attr_accessor :cursor
|
18
19
|
|
@@ -28,26 +29,39 @@ module DyspatchClient
|
|
28
29
|
end
|
29
30
|
|
30
31
|
# Attribute type mapping.
|
31
|
-
def self.
|
32
|
+
def self.openapi_types
|
32
33
|
{
|
33
34
|
:'cursor' => :'Cursor',
|
34
35
|
:'data' => :'Array<TemplateMetaRead>'
|
35
36
|
}
|
36
37
|
end
|
37
38
|
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
38
45
|
# Initializes the object
|
39
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
40
47
|
def initialize(attributes = {})
|
41
|
-
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DyspatchClient::TemplatesRead` initialize method"
|
50
|
+
end
|
42
51
|
|
43
|
-
# convert string to symbol for hash key
|
44
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DyspatchClient::TemplatesRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
45
59
|
|
46
|
-
if attributes.
|
60
|
+
if attributes.key?(:'cursor')
|
47
61
|
self.cursor = attributes[:'cursor']
|
48
62
|
end
|
49
63
|
|
50
|
-
if attributes.
|
64
|
+
if attributes.key?(:'data')
|
51
65
|
if (value = attributes[:'data']).is_a?(Array)
|
52
66
|
self.data = value
|
53
67
|
end
|
@@ -83,19 +97,26 @@ module DyspatchClient
|
|
83
97
|
end
|
84
98
|
|
85
99
|
# Calculates hash code according to all attributes.
|
86
|
-
# @return [
|
100
|
+
# @return [Integer] Hash code
|
87
101
|
def hash
|
88
102
|
[cursor, data].hash
|
89
103
|
end
|
90
104
|
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def self.build_from_hash(attributes)
|
109
|
+
new.build_from_hash(attributes)
|
110
|
+
end
|
111
|
+
|
91
112
|
# Builds the object from hash
|
92
113
|
# @param [Hash] attributes Model attributes in the form of hash
|
93
114
|
# @return [Object] Returns the model itself
|
94
115
|
def build_from_hash(attributes)
|
95
116
|
return nil unless attributes.is_a?(Hash)
|
96
|
-
self.class.
|
117
|
+
self.class.openapi_types.each_pair do |key, type|
|
97
118
|
if type =~ /\AArray<(.*)>/i
|
98
|
-
# check to ensure the input is an array given that the
|
119
|
+
# check to ensure the input is an array given that the attribute
|
99
120
|
# is documented as an array but the input is not
|
100
121
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
101
122
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -124,7 +145,7 @@ module DyspatchClient
|
|
124
145
|
value.to_i
|
125
146
|
when :Float
|
126
147
|
value.to_f
|
127
|
-
when :
|
148
|
+
when :Boolean
|
128
149
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
150
|
true
|
130
151
|
else
|
@@ -145,8 +166,7 @@ module DyspatchClient
|
|
145
166
|
end
|
146
167
|
end
|
147
168
|
else # model
|
148
|
-
|
149
|
-
temp_model.build_from_hash(value)
|
169
|
+
DyspatchClient.const_get(type).build_from_hash(value)
|
150
170
|
end
|
151
171
|
end
|
152
172
|
|
@@ -168,7 +188,11 @@ module DyspatchClient
|
|
168
188
|
hash = {}
|
169
189
|
self.class.attribute_map.each_pair do |attr, param|
|
170
190
|
value = self.send(attr)
|
171
|
-
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
172
196
|
hash[param] = _to_hash(value)
|
173
197
|
end
|
174
198
|
hash
|
@@ -1,15 +1,15 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries
|
4
|
+
## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 2020.11
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
module DyspatchClient
|
14
|
-
VERSION = '
|
14
|
+
VERSION = '6.0.0'
|
15
15
|
end
|
data/spec/api/drafts_api_spec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries
|
4
|
+
## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 2020.11
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,12 +14,12 @@ require 'spec_helper'
|
|
14
14
|
require 'json'
|
15
15
|
|
16
16
|
# Unit tests for DyspatchClient::DraftsApi
|
17
|
-
# Automatically generated by
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
18
|
# Please update as you see appropriate
|
19
19
|
describe 'DraftsApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@
|
22
|
+
@api_instance = DyspatchClient::DraftsApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,108 +28,116 @@ describe 'DraftsApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of DraftsApi' do
|
30
30
|
it 'should create an instance of DraftsApi' do
|
31
|
-
expect(@
|
31
|
+
expect(@api_instance).to be_instance_of(DyspatchClient::DraftsApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# unit tests for
|
36
|
-
#
|
37
|
-
#
|
35
|
+
# unit tests for delete_localization
|
36
|
+
# Remove a localization
|
37
|
+
# Deletes the localization with the given language ID if it exists
|
38
38
|
# @param draft_id A draft ID
|
39
|
-
# @param
|
39
|
+
# @param language_id A language ID (eg: en-US)
|
40
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
40
41
|
# @param [Hash] opts the optional parameters
|
41
|
-
# @return [
|
42
|
-
describe '
|
42
|
+
# @return [nil]
|
43
|
+
describe 'delete_localization test' do
|
43
44
|
it 'should work' do
|
44
45
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
48
|
-
# unit tests for
|
49
|
-
# Get
|
50
|
-
#
|
49
|
+
# unit tests for get_draft_by_id
|
50
|
+
# Get Draft by ID
|
51
|
+
# Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form.
|
51
52
|
# @param draft_id A draft ID
|
53
|
+
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
54
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
52
55
|
# @param [Hash] opts the optional parameters
|
53
|
-
# @
|
54
|
-
|
55
|
-
describe 'drafts_draft_id_localization_keys_get test' do
|
56
|
+
# @return [DraftRead]
|
57
|
+
describe 'get_draft_by_id test' do
|
56
58
|
it 'should work' do
|
57
59
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
61
|
-
# unit tests for
|
62
|
-
# Get
|
63
|
-
# Returns
|
63
|
+
# unit tests for get_draft_localization_keys
|
64
|
+
# Get localization keys
|
65
|
+
# Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2020.11+json` to get a JSON object, or `text/vnd.dyspatch.2020.11+x-gettext-translation` to get the POT file.
|
64
66
|
# @param draft_id A draft ID
|
67
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
65
68
|
# @param [Hash] opts the optional parameters
|
66
|
-
# @return [Array<
|
67
|
-
describe '
|
69
|
+
# @return [Array<LocalizationKeyRead>]
|
70
|
+
describe 'get_draft_localization_keys test' do
|
68
71
|
it 'should work' do
|
69
72
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
70
73
|
end
|
71
74
|
end
|
72
75
|
|
73
|
-
# unit tests for
|
74
|
-
#
|
75
|
-
#
|
76
|
-
# @param
|
77
|
-
# @param language_id A language ID (eg: en-US)
|
76
|
+
# unit tests for get_drafts
|
77
|
+
# List Drafts
|
78
|
+
# Returns all drafts for your organization.
|
79
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
78
80
|
# @param [Hash] opts the optional parameters
|
79
|
-
# @
|
80
|
-
|
81
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
82
|
+
# @option opts [String] :status Filter the list of drafts by a particular status
|
83
|
+
# @return [DraftsRead]
|
84
|
+
describe 'get_drafts test' do
|
81
85
|
it 'should work' do
|
82
86
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
83
87
|
end
|
84
88
|
end
|
85
89
|
|
86
|
-
# unit tests for
|
87
|
-
#
|
88
|
-
#
|
90
|
+
# unit tests for get_localization_for_draft
|
91
|
+
# Get localizations on a draft
|
92
|
+
# Returns localization metadata for the draft
|
89
93
|
# @param draft_id A draft ID
|
90
|
-
# @param
|
91
|
-
# @param body
|
94
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
92
95
|
# @param [Hash] opts the optional parameters
|
93
|
-
# @return [
|
94
|
-
describe '
|
96
|
+
# @return [Array<LocalizationMetaRead>]
|
97
|
+
describe 'get_localization_for_draft test' do
|
95
98
|
it 'should work' do
|
96
99
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
100
|
end
|
98
101
|
end
|
99
102
|
|
100
|
-
# unit tests for
|
101
|
-
#
|
102
|
-
#
|
103
|
+
# unit tests for save_localization
|
104
|
+
# Create or update a localization
|
105
|
+
# Inserts a localization or sets the name on an existing localization that already uses the languageId
|
103
106
|
# @param draft_id A draft ID
|
104
107
|
# @param language_id A language ID (eg: en-US)
|
105
|
-
# @param
|
108
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
109
|
+
# @param inline_object
|
106
110
|
# @param [Hash] opts the optional parameters
|
107
111
|
# @return [nil]
|
108
|
-
describe '
|
112
|
+
describe 'save_localization test' do
|
109
113
|
it 'should work' do
|
110
114
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
111
115
|
end
|
112
116
|
end
|
113
117
|
|
114
|
-
# unit tests for
|
115
|
-
#
|
116
|
-
#
|
118
|
+
# unit tests for set_translation
|
119
|
+
# Set translations for language
|
120
|
+
# Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format `%(my_variable)s` and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set `Content-Type` header to `application/json`. For gettext PO format set `Content-Type` header to `text/x-gettext-translation`.
|
117
121
|
# @param draft_id A draft ID
|
122
|
+
# @param language_id A language ID (eg: en-US)
|
123
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
124
|
+
# @param request_body
|
118
125
|
# @param [Hash] opts the optional parameters
|
119
126
|
# @return [nil]
|
120
|
-
describe '
|
127
|
+
describe 'set_translation test' do
|
121
128
|
it 'should work' do
|
122
129
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
123
130
|
end
|
124
131
|
end
|
125
132
|
|
126
|
-
# unit tests for
|
127
|
-
#
|
128
|
-
#
|
133
|
+
# unit tests for submit_draft_for_approval
|
134
|
+
# Submit the draft for approval
|
135
|
+
# Moves the draft into submitted state.
|
136
|
+
# @param draft_id A draft ID
|
137
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
129
138
|
# @param [Hash] opts the optional parameters
|
130
|
-
# @
|
131
|
-
|
132
|
-
describe 'drafts_get test' do
|
139
|
+
# @return [nil]
|
140
|
+
describe 'submit_draft_for_approval test' do
|
133
141
|
it 'should work' do
|
134
142
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
135
143
|
end
|