dyspatch_client 3.0.1 → 4.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 +2 -0
- data/README.md +35 -41
- data/Rakefile +2 -0
- data/docs/APIError.md +13 -2
- data/docs/CompiledRead.md +13 -0
- data/docs/Cursor.md +11 -1
- data/docs/DraftMetaRead.md +15 -0
- data/docs/DraftRead.md +17 -1
- data/docs/DraftsApi.md +140 -133
- data/docs/DraftsRead.md +11 -1
- data/docs/{Body.md → InlineObject.md} +10 -1
- data/docs/LocalizationKeyRead.md +10 -0
- data/docs/LocalizationMetaRead.md +14 -3
- data/docs/LocalizationRead.md +17 -1
- data/docs/LocalizationsApi.md +14 -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 -19
- data/lib/dyspatch_client/api/drafts_api.rb +372 -236
- data/lib/dyspatch_client/api/localizations_api.rb +47 -30
- data/lib/dyspatch_client/api/templates_api.rb +98 -64
- data/lib/dyspatch_client/api_client.rb +40 -43
- 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 +45 -66
- data/lib/dyspatch_client/models/cursor.rb +43 -20
- data/lib/dyspatch_client/models/draft_meta_read.rb +49 -25
- data/lib/dyspatch_client/models/draft_read.rb +49 -25
- data/lib/dyspatch_client/models/drafts_read.rb +41 -17
- 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 +53 -39
- data/lib/dyspatch_client/models/localization_read.rb +50 -26
- 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 +11 -10
- data/spec/api/templates_api_spec.rb +22 -20
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +12 -14
- data/spec/integration_spec.rb +41 -0
- data/spec/models/api_error_spec.rb +6 -6
- data/spec/models/compiled_read_spec.rb +5 -5
- data/spec/models/cursor_spec.rb +5 -5
- data/spec/models/draft_meta_read_spec.rb +5 -5
- data/spec/models/draft_read_spec.rb +5 -5
- data/spec/models/drafts_read_spec.rb +5 -5
- data/spec/models/inline_object_spec.rb +41 -0
- data/spec/models/localization_key_read_spec.rb +5 -5
- data/spec/models/localization_meta_read_spec.rb +6 -12
- data/spec/models/localization_read_spec.rb +5 -5
- data/spec/models/template_meta_read_spec.rb +5 -5
- data/spec/models/template_read_spec.rb +5 -5
- data/spec/models/templates_read_spec.rb +5 -5
- data/spec/spec_helper.rb +4 -4
- metadata +15 -190
- 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/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/body_spec.rb +0 -41
- data/spec/models/created_at_spec.rb +0 -35
- data/spec/models/draft_description_spec.rb +0 -35
- data/spec/models/draft_id_spec.rb +0 -35
- data/spec/models/draft_name_spec.rb +0 -35
- data/spec/models/draft_url_spec.rb +0 -35
- data/spec/models/language_id_spec.rb +0 -35
- data/spec/models/localization_id_spec.rb +0 -35
- data/spec/models/localization_name_spec.rb +0 -35
- 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_name_spec.rb +0 -35
- data/spec/models/template_url_spec.rb +0 -35
- data/spec/models/updated_at_spec.rb +0 -35
@@ -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: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
module DyspatchClient
|
14
|
-
VERSION = '
|
14
|
+
VERSION = '4.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
|
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: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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.2019.10+json` to get a JSON object, or `text/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction
|
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: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
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,18 +28,19 @@ 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
|
-
# Returns a specific localization object with a matching ID
|
37
|
+
# Returns a specific localization object with a matching ID
|
38
38
|
# @param localization_id A localization ID
|
39
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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\"
|
40
41
|
# @param [Hash] opts the optional parameters
|
41
42
|
# @return [LocalizationRead]
|
42
|
-
describe '
|
43
|
+
describe 'get_localization_by_id 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
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction
|
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: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
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,30 +28,32 @@ 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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\"
|
38
41
|
# @param [Hash] opts the optional parameters
|
39
|
-
# @
|
40
|
-
|
41
|
-
describe 'templates_get test' do
|
42
|
+
# @return [TemplateRead]
|
43
|
+
describe 'get_template_by_id test' do
|
42
44
|
it 'should work' do
|
43
45
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
47
|
-
# unit tests for
|
48
|
-
#
|
49
|
-
# Gets a
|
50
|
-
# @param
|
51
|
-
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\"
|
52
53
|
# @param [Hash] opts the optional parameters
|
53
|
-
# @
|
54
|
-
|
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
|
55
57
|
it 'should work' do
|
56
58
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
59
|
end
|
data/spec/api_client_spec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction
|
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: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -156,7 +156,7 @@ describe DyspatchClient::ApiClient do
|
|
156
156
|
end
|
157
157
|
|
158
158
|
it 'fails for invalid collection format' do
|
159
|
-
expect
|
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
|
|
data/spec/configuration_spec.rb
CHANGED
@@ -1,41 +1,39 @@
|
|
1
1
|
=begin
|
2
2
|
#Dyspatch API
|
3
3
|
|
4
|
-
## Introduction
|
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: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
+
require 'uri'
|
14
15
|
|
15
16
|
describe DyspatchClient::Configuration do
|
16
17
|
let(:config) { DyspatchClient::Configuration.default }
|
17
18
|
|
18
19
|
before(:each) do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# c.base_path = uri.path
|
25
|
-
# end
|
20
|
+
uri = URI.parse("https://api.dyspatch.io")
|
21
|
+
DyspatchClient.configure do |c|
|
22
|
+
c.host = uri.host
|
23
|
+
c.base_path = uri.path
|
24
|
+
end
|
26
25
|
end
|
27
26
|
|
28
27
|
describe '#base_url' do
|
29
28
|
it 'should have the default value' do
|
30
29
|
# uncomment below to test default value of the base path
|
31
|
-
|
30
|
+
expect(config.base_url).to eq("https://api.dyspatch.io")
|
32
31
|
end
|
33
32
|
|
34
33
|
it 'should remove trailing slashes' do
|
35
34
|
[nil, '', '/', '//'].each do |base_path|
|
36
35
|
config.base_path = base_path
|
37
|
-
|
38
|
-
# expect(config.base_url).to eq("https://api.dyspatch.io")
|
36
|
+
expect(config.base_url).to eq("https://api.dyspatch.io")
|
39
37
|
end
|
40
38
|
end
|
41
39
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
version = "application/vnd.dyspatch.2019.10+json"
|
5
|
+
|
6
|
+
describe 'Integration' do
|
7
|
+
let(:drafts) { DyspatchClient::DraftsApi.new }
|
8
|
+
let(:templates) { DyspatchClient::TemplatesApi.new }
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
# uncomment below to setup host and base_path
|
12
|
+
uri = URI.parse("https://api.dyspatch.io")
|
13
|
+
DyspatchClient.configure do |c|
|
14
|
+
c.host = uri.host
|
15
|
+
c.base_path = uri.path
|
16
|
+
c.api_key['Authorization'] = "Bearer #{ENV['DYSPATCH_API_KEY']}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'templates' do
|
21
|
+
it 'should list templates' do
|
22
|
+
result = templates.get_templates(version)
|
23
|
+
puts result
|
24
|
+
|
25
|
+
template_id = 'tem_01de5teh6k59kya8q92mb01qzq'
|
26
|
+
result = templates.get_template_by_id(template_id, "handlebars", version)
|
27
|
+
puts result
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe 'drafts' do
|
32
|
+
it 'should list drafts' do
|
33
|
+
result = drafts.get_drafts(version)
|
34
|
+
puts result
|
35
|
+
draft = result.data[0]
|
36
|
+
|
37
|
+
result = drafts.get_draft_by_id(draft.id, "handlebars", version)
|
38
|
+
puts result
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|