dyspatch_client 2.0.0 → 5.0.1
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 +50 -34
- data/Rakefile +2 -0
- data/docs/APIError.md +12 -1
- data/docs/CompiledRead.md +13 -0
- data/docs/Cursor.md +11 -1
- data/docs/DraftMetaRead.md +27 -0
- data/docs/DraftRead.md +31 -0
- data/docs/DraftsApi.md +476 -0
- data/docs/DraftsRead.md +19 -0
- data/docs/InlineObject.md +17 -0
- data/docs/LocalizationKeyRead.md +19 -0
- data/docs/LocalizationMetaRead.md +15 -1
- data/docs/LocalizationRead.md +19 -1
- data/docs/LocalizationsApi.md +16 -18
- data/docs/TemplateMetaRead.md +15 -0
- data/docs/TemplateRead.md +16 -0
- data/docs/TemplatesApi.md +39 -40
- data/docs/TemplatesRead.md +10 -0
- data/dyspatch_client.gemspec +10 -16
- data/lib/dyspatch_client.rb +10 -4
- data/lib/dyspatch_client/api/drafts_api.rb +620 -0
- data/lib/dyspatch_client/api/localizations_api.rb +52 -34
- data/lib/dyspatch_client/api/templates_api.rb +100 -69
- data/lib/dyspatch_client/api_client.rb +54 -55
- data/lib/dyspatch_client/api_error.rb +23 -4
- data/lib/dyspatch_client/configuration.rb +49 -10
- data/lib/dyspatch_client/models/api_error.rb +50 -30
- data/lib/dyspatch_client/models/compiled_read.rb +49 -78
- data/lib/dyspatch_client/models/cursor.rb +47 -28
- data/lib/dyspatch_client/models/draft_meta_read.rb +258 -0
- data/lib/dyspatch_client/models/draft_read.rb +279 -0
- data/lib/dyspatch_client/models/drafts_read.rb +219 -0
- data/lib/dyspatch_client/models/inline_object.rb +206 -0
- data/lib/dyspatch_client/models/localization_key_read.rb +216 -0
- data/lib/dyspatch_client/models/localization_meta_read.rb +70 -39
- data/lib/dyspatch_client/models/localization_read.rb +73 -42
- data/lib/dyspatch_client/models/template_meta_read.rb +52 -33
- data/lib/dyspatch_client/models/template_read.rb +53 -34
- data/lib/dyspatch_client/models/templates_read.rb +45 -26
- data/lib/dyspatch_client/version.rb +5 -5
- data/pkg/dyspatch_client-5.0.0.gem +0 -0
- data/pkg/dyspatch_client-5.0.1.gem +0 -0
- data/spec/api/drafts_api_spec.rb +146 -0
- data/spec/api/localizations_api_spec.rb +12 -12
- data/spec/api/templates_api_spec.rb +24 -24
- data/spec/api_client_spec.rb +39 -39
- data/spec/configuration_spec.rb +12 -12
- data/spec/integration_spec.rb +41 -0
- data/spec/models/api_error_spec.rb +12 -13
- data/spec/models/compiled_read_spec.rb +10 -11
- data/spec/models/cursor_spec.rb +7 -8
- data/spec/models/draft_meta_read_spec.rb +77 -0
- data/spec/models/draft_read_spec.rb +83 -0
- data/spec/models/drafts_read_spec.rb +47 -0
- data/spec/models/inline_object_spec.rb +41 -0
- data/spec/models/localization_key_read_spec.rb +47 -0
- data/spec/models/localization_meta_read_spec.rb +18 -13
- data/spec/models/localization_read_spec.rb +20 -15
- data/spec/models/template_meta_read_spec.rb +12 -13
- data/spec/models/template_read_spec.rb +13 -14
- data/spec/models/templates_read_spec.rb +7 -8
- data/spec/spec_helper.rb +4 -4
- metadata +34 -128
- data/git_push.sh +0 -55
@@ -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.04
|
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 = '5.0.1'
|
15
15
|
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,146 @@
|
|
1
|
+
=begin
|
2
|
+
#Dyspatch API
|
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 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
|
+
|
6
|
+
The version of the OpenAPI document: 2020.04
|
7
|
+
Contact: support@dyspatch.io
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for DyspatchClient::DraftsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'DraftsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = DyspatchClient::DraftsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of DraftsApi' do
|
30
|
+
it 'should create an instance of DraftsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(DyspatchClient::DraftsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for delete_localization
|
36
|
+
# Remove a localization
|
37
|
+
# Deletes the localization with the given language ID if it exists
|
38
|
+
# @param draft_id A draft ID
|
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @return [nil]
|
43
|
+
describe 'delete_localization test' do
|
44
|
+
it 'should work' do
|
45
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
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.
|
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
55
|
+
# @param [Hash] opts the optional parameters
|
56
|
+
# @return [DraftRead]
|
57
|
+
describe 'get_draft_by_id test' do
|
58
|
+
it 'should work' do
|
59
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
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.04+json` to get a JSON object, or `text/vnd.dyspatch.2020.04+x-gettext-translation` to get the POT file.
|
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
68
|
+
# @param [Hash] opts the optional parameters
|
69
|
+
# @return [Array<LocalizationKeyRead>]
|
70
|
+
describe 'get_draft_localization_keys test' do
|
71
|
+
it 'should work' do
|
72
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
80
|
+
# @param [Hash] opts the optional parameters
|
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
|
85
|
+
it 'should work' do
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# unit tests for get_localization_for_draft
|
91
|
+
# Get localizations on a draft
|
92
|
+
# Returns localization metadata for the draft
|
93
|
+
# @param draft_id A draft ID
|
94
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<LocalizationMetaRead>]
|
97
|
+
describe 'get_localization_for_draft test' do
|
98
|
+
it 'should work' do
|
99
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
100
|
+
end
|
101
|
+
end
|
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
|
106
|
+
# @param draft_id A draft ID
|
107
|
+
# @param language_id A language ID (eg: en-US)
|
108
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
109
|
+
# @param inline_object
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @return [nil]
|
112
|
+
describe 'save_localization test' do
|
113
|
+
it 'should work' do
|
114
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
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`.
|
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
124
|
+
# @param request_body
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @return [nil]
|
127
|
+
describe 'set_translation test' do
|
128
|
+
it 'should work' do
|
129
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
138
|
+
# @param [Hash] opts the optional parameters
|
139
|
+
# @return [nil]
|
140
|
+
describe 'submit_draft_for_approval test' do
|
141
|
+
it 'should work' do
|
142
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
end
|
@@ -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.04
|
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::LocalizationsApi
|
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 'LocalizationsApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@
|
22
|
+
@api_instance = DyspatchClient::LocalizationsApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,20 +28,20 @@ describe 'LocalizationsApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of LocalizationsApi' do
|
30
30
|
it 'should create an instance of LocalizationsApi' do
|
31
|
-
expect(@
|
31
|
+
expect(@api_instance).to be_instance_of(DyspatchClient::LocalizationsApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# unit tests for
|
35
|
+
# unit tests for get_localization_by_id
|
36
36
|
# Get Localization Object by ID
|
37
37
|
# Returns a specific localization object with a matching ID
|
38
38
|
# @param localization_id A localization ID
|
39
|
+
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
40
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
39
41
|
# @param [Hash] opts the optional parameters
|
40
|
-
# @option opts [String] :target_language The type of templating language to compile as. Should only be used for visual templates.
|
41
|
-
# @option opts [String] :accept A version of the API that should be used for the request. For example, to use version "2019.03", set the value to "application/vnd.dyspatch.2019.03+json"
|
42
42
|
# @return [LocalizationRead]
|
43
|
-
describe '
|
44
|
-
it
|
43
|
+
describe 'get_localization_by_id test' do
|
44
|
+
it 'should work' do
|
45
45
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
46
46
|
end
|
47
47
|
end
|
@@ -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.04
|
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::TemplatesApi
|
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 'TemplatesApi' do
|
20
20
|
before do
|
21
21
|
# run before each test
|
22
|
-
@
|
22
|
+
@api_instance = DyspatchClient::TemplatesApi.new
|
23
23
|
end
|
24
24
|
|
25
25
|
after do
|
@@ -28,33 +28,33 @@ describe 'TemplatesApi' do
|
|
28
28
|
|
29
29
|
describe 'test an instance of TemplatesApi' do
|
30
30
|
it 'should create an instance of TemplatesApi' do
|
31
|
-
expect(@
|
31
|
+
expect(@api_instance).to be_instance_of(DyspatchClient::TemplatesApi)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# unit tests for
|
36
|
-
#
|
37
|
-
# Gets a
|
35
|
+
# unit tests for get_template_by_id
|
36
|
+
# Get Template by ID
|
37
|
+
# Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template .
|
38
|
+
# @param template_id A template ID
|
39
|
+
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
40
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
38
41
|
# @param [Hash] opts the optional parameters
|
39
|
-
# @
|
40
|
-
|
41
|
-
|
42
|
-
describe 'templates_get test' do
|
43
|
-
it "should work" do
|
42
|
+
# @return [TemplateRead]
|
43
|
+
describe 'get_template_by_id test' do
|
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
|
-
#
|
50
|
-
# Gets a
|
51
|
-
# @param
|
49
|
+
# unit tests for get_templates
|
50
|
+
# List Templates
|
51
|
+
# Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.
|
52
|
+
# @param accept A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
|
52
53
|
# @param [Hash] opts the optional parameters
|
53
|
-
# @option opts [String] :
|
54
|
-
# @
|
55
|
-
|
56
|
-
|
57
|
-
it "should work" do
|
54
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
55
|
+
# @return [TemplatesRead]
|
56
|
+
describe 'get_templates test' do
|
57
|
+
it 'should work' do
|
58
58
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
59
59
|
end
|
60
60
|
end
|
data/spec/api_client_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.04
|
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
|
|
@@ -51,11 +51,11 @@ describe DyspatchClient::ApiClient do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
describe
|
54
|
+
describe 'params_encoding in #build_request' do
|
55
55
|
let(:config) { DyspatchClient::Configuration.new }
|
56
56
|
let(:api_client) { DyspatchClient::ApiClient.new(config) }
|
57
57
|
|
58
|
-
it
|
58
|
+
it 'defaults to nil' do
|
59
59
|
expect(DyspatchClient::Configuration.default.params_encoding).to eq(nil)
|
60
60
|
expect(config.params_encoding).to eq(nil)
|
61
61
|
|
@@ -63,18 +63,18 @@ describe DyspatchClient::ApiClient do
|
|
63
63
|
expect(request.options[:params_encoding]).to eq(nil)
|
64
64
|
end
|
65
65
|
|
66
|
-
it
|
66
|
+
it 'can be customized' do
|
67
67
|
config.params_encoding = :multi
|
68
68
|
request = api_client.build_request(:get, '/test')
|
69
69
|
expect(request.options[:params_encoding]).to eq(:multi)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
describe
|
73
|
+
describe 'timeout in #build_request' do
|
74
74
|
let(:config) { DyspatchClient::Configuration.new }
|
75
75
|
let(:api_client) { DyspatchClient::ApiClient.new(config) }
|
76
76
|
|
77
|
-
it
|
77
|
+
it 'defaults to 0' do
|
78
78
|
expect(DyspatchClient::Configuration.default.timeout).to eq(0)
|
79
79
|
expect(config.timeout).to eq(0)
|
80
80
|
|
@@ -82,88 +82,88 @@ describe DyspatchClient::ApiClient do
|
|
82
82
|
expect(request.options[:timeout]).to eq(0)
|
83
83
|
end
|
84
84
|
|
85
|
-
it
|
85
|
+
it 'can be customized' do
|
86
86
|
config.timeout = 100
|
87
87
|
request = api_client.build_request(:get, '/test')
|
88
88
|
expect(request.options[:timeout]).to eq(100)
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe
|
92
|
+
describe '#deserialize' do
|
93
93
|
it "handles Array<Integer>" do
|
94
94
|
api_client = DyspatchClient::ApiClient.new
|
95
|
-
headers = {'Content-Type' => 'application/json'}
|
95
|
+
headers = { 'Content-Type' => 'application/json' }
|
96
96
|
response = double('response', headers: headers, body: '[12, 34]')
|
97
97
|
data = api_client.deserialize(response, 'Array<Integer>')
|
98
98
|
expect(data).to be_instance_of(Array)
|
99
99
|
expect(data).to eq([12, 34])
|
100
100
|
end
|
101
101
|
|
102
|
-
it
|
102
|
+
it 'handles Array<Array<Integer>>' do
|
103
103
|
api_client = DyspatchClient::ApiClient.new
|
104
|
-
headers = {'Content-Type' => 'application/json'}
|
104
|
+
headers = { 'Content-Type' => 'application/json' }
|
105
105
|
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
106
|
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
107
|
expect(data).to be_instance_of(Array)
|
108
108
|
expect(data).to eq([[12, 34], [56]])
|
109
109
|
end
|
110
110
|
|
111
|
-
it
|
111
|
+
it 'handles Hash<String, String>' do
|
112
112
|
api_client = DyspatchClient::ApiClient.new
|
113
|
-
headers = {'Content-Type' => 'application/json'}
|
113
|
+
headers = { 'Content-Type' => 'application/json' }
|
114
114
|
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
115
|
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
116
|
expect(data).to be_instance_of(Hash)
|
117
|
-
expect(data).to eq(
|
117
|
+
expect(data).to eq(:message => 'Hello')
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
121
|
describe "#object_to_hash" do
|
122
|
-
it
|
122
|
+
it 'ignores nils and includes empty arrays' do
|
123
123
|
# uncomment below to test object_to_hash for model
|
124
|
-
#api_client = DyspatchClient::ApiClient.new
|
125
|
-
#_model = DyspatchClient::ModelName.new
|
124
|
+
# api_client = DyspatchClient::ApiClient.new
|
125
|
+
# _model = DyspatchClient::ModelName.new
|
126
126
|
# update the model attribute below
|
127
|
-
#_model.id = 1
|
127
|
+
# _model.id = 1
|
128
128
|
# update the expected value (hash) below
|
129
|
-
#expected = {id: 1, name: '', tags: []}
|
130
|
-
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
129
|
+
# expected = {id: 1, name: '', tags: []}
|
130
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
describe
|
134
|
+
describe '#build_collection_param' do
|
135
135
|
let(:param) { ['aa', 'bb', 'cc'] }
|
136
136
|
let(:api_client) { DyspatchClient::ApiClient.new }
|
137
137
|
|
138
|
-
it
|
138
|
+
it 'works for csv' do
|
139
139
|
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
140
|
end
|
141
141
|
|
142
|
-
it
|
142
|
+
it 'works for ssv' do
|
143
143
|
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
144
|
end
|
145
145
|
|
146
|
-
it
|
146
|
+
it 'works for tsv' do
|
147
147
|
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
148
|
end
|
149
149
|
|
150
|
-
it
|
150
|
+
it 'works for pipes' do
|
151
151
|
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
152
|
end
|
153
153
|
|
154
|
-
it
|
154
|
+
it 'works for multi' do
|
155
155
|
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
156
|
end
|
157
157
|
|
158
|
-
it
|
159
|
-
expect
|
158
|
+
it 'fails for invalid collection format' do
|
159
|
+
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
-
describe
|
163
|
+
describe '#json_mime?' do
|
164
164
|
let(:api_client) { DyspatchClient::ApiClient.new }
|
165
165
|
|
166
|
-
it
|
166
|
+
it 'works' do
|
167
167
|
expect(api_client.json_mime?(nil)).to eq false
|
168
168
|
expect(api_client.json_mime?('')).to eq false
|
169
169
|
|
@@ -177,10 +177,10 @@ describe DyspatchClient::ApiClient do
|
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
|
-
describe
|
180
|
+
describe '#select_header_accept' do
|
181
181
|
let(:api_client) { DyspatchClient::ApiClient.new }
|
182
182
|
|
183
|
-
it
|
183
|
+
it 'works' do
|
184
184
|
expect(api_client.select_header_accept(nil)).to be_nil
|
185
185
|
expect(api_client.select_header_accept([])).to be_nil
|
186
186
|
|
@@ -193,10 +193,10 @@ describe DyspatchClient::ApiClient do
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
-
describe
|
196
|
+
describe '#select_header_content_type' do
|
197
197
|
let(:api_client) { DyspatchClient::ApiClient.new }
|
198
198
|
|
199
|
-
it
|
199
|
+
it 'works' do
|
200
200
|
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
201
|
expect(api_client.select_header_content_type([])).to eq('application/json')
|
202
202
|
|
@@ -208,10 +208,10 @@ describe DyspatchClient::ApiClient do
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
|
211
|
-
describe
|
211
|
+
describe '#sanitize_filename' do
|
212
212
|
let(:api_client) { DyspatchClient::ApiClient.new }
|
213
213
|
|
214
|
-
it
|
214
|
+
it 'works' do
|
215
215
|
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
216
|
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
217
|
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|