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.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/README.md +35 -41
  4. data/Rakefile +2 -0
  5. data/docs/APIError.md +13 -2
  6. data/docs/CompiledRead.md +13 -0
  7. data/docs/Cursor.md +11 -1
  8. data/docs/DraftMetaRead.md +15 -0
  9. data/docs/DraftRead.md +17 -1
  10. data/docs/DraftsApi.md +140 -133
  11. data/docs/DraftsRead.md +11 -1
  12. data/docs/{Body.md → InlineObject.md} +10 -1
  13. data/docs/LocalizationKeyRead.md +10 -0
  14. data/docs/LocalizationMetaRead.md +14 -3
  15. data/docs/LocalizationRead.md +17 -1
  16. data/docs/LocalizationsApi.md +14 -13
  17. data/docs/TemplateMetaRead.md +16 -1
  18. data/docs/TemplateRead.md +17 -1
  19. data/docs/TemplatesApi.md +40 -36
  20. data/docs/TemplatesRead.md +11 -1
  21. data/dyspatch_client.gemspec +5 -11
  22. data/lib/dyspatch_client.rb +5 -19
  23. data/lib/dyspatch_client/api/drafts_api.rb +372 -236
  24. data/lib/dyspatch_client/api/localizations_api.rb +47 -30
  25. data/lib/dyspatch_client/api/templates_api.rb +98 -64
  26. data/lib/dyspatch_client/api_client.rb +40 -43
  27. data/lib/dyspatch_client/api_error.rb +23 -4
  28. data/lib/dyspatch_client/configuration.rb +48 -9
  29. data/lib/dyspatch_client/models/api_error.rb +46 -22
  30. data/lib/dyspatch_client/models/compiled_read.rb +45 -66
  31. data/lib/dyspatch_client/models/cursor.rb +43 -20
  32. data/lib/dyspatch_client/models/draft_meta_read.rb +49 -25
  33. data/lib/dyspatch_client/models/draft_read.rb +49 -25
  34. data/lib/dyspatch_client/models/drafts_read.rb +41 -17
  35. data/lib/dyspatch_client/models/{body.rb → inline_object.rb} +40 -17
  36. data/lib/dyspatch_client/models/localization_key_read.rb +41 -17
  37. data/lib/dyspatch_client/models/localization_meta_read.rb +53 -39
  38. data/lib/dyspatch_client/models/localization_read.rb +50 -26
  39. data/lib/dyspatch_client/models/template_meta_read.rb +48 -24
  40. data/lib/dyspatch_client/models/template_read.rb +49 -25
  41. data/lib/dyspatch_client/models/templates_read.rb +41 -17
  42. data/lib/dyspatch_client/version.rb +5 -5
  43. data/spec/api/drafts_api_spec.rb +61 -53
  44. data/spec/api/localizations_api_spec.rb +11 -10
  45. data/spec/api/templates_api_spec.rb +22 -20
  46. data/spec/api_client_spec.rb +5 -5
  47. data/spec/configuration_spec.rb +12 -14
  48. data/spec/integration_spec.rb +41 -0
  49. data/spec/models/api_error_spec.rb +6 -6
  50. data/spec/models/compiled_read_spec.rb +5 -5
  51. data/spec/models/cursor_spec.rb +5 -5
  52. data/spec/models/draft_meta_read_spec.rb +5 -5
  53. data/spec/models/draft_read_spec.rb +5 -5
  54. data/spec/models/drafts_read_spec.rb +5 -5
  55. data/spec/models/inline_object_spec.rb +41 -0
  56. data/spec/models/localization_key_read_spec.rb +5 -5
  57. data/spec/models/localization_meta_read_spec.rb +6 -12
  58. data/spec/models/localization_read_spec.rb +5 -5
  59. data/spec/models/template_meta_read_spec.rb +5 -5
  60. data/spec/models/template_read_spec.rb +5 -5
  61. data/spec/models/templates_read_spec.rb +5 -5
  62. data/spec/spec_helper.rb +4 -4
  63. metadata +15 -190
  64. data/docs/CreatedAt.md +0 -7
  65. data/docs/DraftDescription.md +0 -7
  66. data/docs/DraftId.md +0 -7
  67. data/docs/DraftName.md +0 -7
  68. data/docs/DraftUrl.md +0 -7
  69. data/docs/LanguageId.md +0 -7
  70. data/docs/LocalizationId.md +0 -7
  71. data/docs/LocalizationName.md +0 -7
  72. data/docs/LocalizationUrl.md +0 -7
  73. data/docs/TemplateDescription.md +0 -7
  74. data/docs/TemplateId.md +0 -7
  75. data/docs/TemplateName.md +0 -7
  76. data/docs/TemplateUrl.md +0 -7
  77. data/docs/UpdatedAt.md +0 -7
  78. data/git_push.sh +0 -55
  79. data/lib/dyspatch_client/models/created_at.rb +0 -175
  80. data/lib/dyspatch_client/models/draft_description.rb +0 -175
  81. data/lib/dyspatch_client/models/draft_id.rb +0 -175
  82. data/lib/dyspatch_client/models/draft_name.rb +0 -175
  83. data/lib/dyspatch_client/models/draft_url.rb +0 -175
  84. data/lib/dyspatch_client/models/language_id.rb +0 -175
  85. data/lib/dyspatch_client/models/localization_id.rb +0 -175
  86. data/lib/dyspatch_client/models/localization_name.rb +0 -175
  87. data/lib/dyspatch_client/models/localization_url.rb +0 -175
  88. data/lib/dyspatch_client/models/template_description.rb +0 -175
  89. data/lib/dyspatch_client/models/template_id.rb +0 -175
  90. data/lib/dyspatch_client/models/template_name.rb +0 -175
  91. data/lib/dyspatch_client/models/template_url.rb +0 -175
  92. data/lib/dyspatch_client/models/updated_at.rb +0 -175
  93. data/spec/models/body_spec.rb +0 -41
  94. data/spec/models/created_at_spec.rb +0 -35
  95. data/spec/models/draft_description_spec.rb +0 -35
  96. data/spec/models/draft_id_spec.rb +0 -35
  97. data/spec/models/draft_name_spec.rb +0 -35
  98. data/spec/models/draft_url_spec.rb +0 -35
  99. data/spec/models/language_id_spec.rb +0 -35
  100. data/spec/models/localization_id_spec.rb +0 -35
  101. data/spec/models/localization_name_spec.rb +0 -35
  102. data/spec/models/localization_url_spec.rb +0 -35
  103. data/spec/models/template_description_spec.rb +0 -35
  104. data/spec/models/template_id_spec.rb +0 -35
  105. data/spec/models/template_name_spec.rb +0 -35
  106. data/spec/models/template_url_spec.rb +0 -35
  107. 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 Dyspatch provides API Clients for the following 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)
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 spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.10
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 = '3.0.1'
14
+ VERSION = '4.0.0'
15
15
  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 Dyspatch provides API Clients for the following 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)
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 spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.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 swagger-codegen (github.com/swagger-api/swagger-codegen)
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
- @instance = DyspatchClient::DraftsApi.new
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(@instance).to be_instance_of(DyspatchClient::DraftsApi)
31
+ expect(@api_instance).to be_instance_of(DyspatchClient::DraftsApi)
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for drafts_draft_id_get
36
- # Get Draft by ID
37
- # Gets a draft object with the matching ID. The "compiled" field will contain the unlocalized default template object.
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 target_language The type of templating language to compile as. Should only be used for visual templates.
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 [DraftRead]
42
- describe 'drafts_draft_id_get test' do
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 drafts_draft_id_localization_keys_get
49
- # Get Localization Keys
50
- # 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.
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
- # @option opts [String] :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".
54
- # @return [Array<LocalizationKeyRead>]
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 drafts_draft_id_localizations_get
62
- # Get Localizations on a Draft
63
- # Returns localization metadata object for a template draft.
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 &#x60;Accept&#x60; header to &#x60;application/vnd.dyspatch.2019.10+json&#x60; to get a JSON object, or &#x60;text/vnd.dyspatch.2019.10+x-gettext-translation&#x60; 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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
65
68
  # @param [Hash] opts the optional parameters
66
- # @return [Array<LocalizationMetaRead>]
67
- describe 'drafts_draft_id_localizations_get test' do
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 drafts_draft_id_localizations_language_id_delete
74
- # Remove a Localization
75
- # Deletes the localization with the given `languageId` if it exists.
76
- # @param draft_id A draft ID
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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
78
80
  # @param [Hash] opts the optional parameters
79
- # @return [nil]
80
- describe 'drafts_draft_id_localizations_language_id_delete test' do
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 drafts_draft_id_localizations_language_id_put
87
- # Create or Update a Localization
88
- # Inserts a localization or sets the name on an existing localization that already uses the `languageId`.
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 language_id A language ID (eg: en-US)
91
- # @param body
94
+ # @param accept A version of the API that should be used for the request. For example, to use version \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
92
95
  # @param [Hash] opts the optional parameters
93
- # @return [nil]
94
- describe 'drafts_draft_id_localizations_language_id_put test' do
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 drafts_draft_id_localizations_language_id_translations_put
101
- # Set Translations for Language
102
- # 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`.
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 body
108
+ # @param accept A version of the API that should be used for the request. For example, to use version \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
109
+ # @param inline_object
106
110
  # @param [Hash] opts the optional parameters
107
111
  # @return [nil]
108
- describe 'drafts_draft_id_localizations_language_id_translations_put test' do
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 drafts_draft_id_publish_request_post
115
- # Submit the Draft for Approval
116
- # Moves the draft into [submitted and locked state](https://docs.dyspatch.io/templates/submitting_a_template/#awaiting-approval). This will allow your email stakeholders to review the template draft and provide feedback.
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 &#x60;%(my_variable)s&#x60; 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 &#x60;Content-Type&#x60; header to &#x60;application/json&#x60;. For gettext PO format set &#x60;Content-Type&#x60; header to &#x60;text/x-gettext-translation&#x60;.
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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
124
+ # @param request_body
118
125
  # @param [Hash] opts the optional parameters
119
126
  # @return [nil]
120
- describe 'drafts_draft_id_publish_request_post test' do
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 drafts_get
127
- # List Drafts
128
- # Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated.
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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
129
138
  # @param [Hash] opts the optional parameters
130
- # @option opts [String] :status Filter the list of drafts by a particular status
131
- # @return [DraftsRead]
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 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 the following 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)
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 spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.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 swagger-codegen (github.com/swagger-api/swagger-codegen)
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
- @instance = DyspatchClient::LocalizationsApi.new
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(@instance).to be_instance_of(DyspatchClient::LocalizationsApi)
31
+ expect(@api_instance).to be_instance_of(DyspatchClient::LocalizationsApi)
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for localizations_localization_id_get
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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
40
41
  # @param [Hash] opts the optional parameters
41
42
  # @return [LocalizationRead]
42
- describe 'localizations_localization_id_get test' do
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 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 the following 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)
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 spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.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 swagger-codegen (github.com/swagger-api/swagger-codegen)
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
- @instance = DyspatchClient::TemplatesApi.new
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(@instance).to be_instance_of(DyspatchClient::TemplatesApi)
31
+ expect(@api_instance).to be_instance_of(DyspatchClient::TemplatesApi)
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for templates_get
36
- # List Templates
37
- # Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.
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 \&quot;compiled\&quot; 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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
38
41
  # @param [Hash] opts the optional parameters
39
- # @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
40
- # @return [TemplatesRead]
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 templates_template_id_get
48
- # Get Template by ID
49
- # Gets a template object with the matching ID. If the template has published content the "compiled" field will contain the template .
50
- # @param template_id A template ID
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 \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;
52
53
  # @param [Hash] opts the optional parameters
53
- # @return [TemplateRead]
54
- describe 'templates_template_id_get test' 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
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
@@ -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 Dyspatch provides API Clients for the following 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)
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 spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.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(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
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
 
@@ -1,41 +1,39 @@
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 Dyspatch provides API Clients for the following 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)
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 spec version: 2019.10
6
+ The version of the OpenAPI document: 2019.10
7
7
  Contact: support@dyspatch.io
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.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
- # uncomment below to setup host and base_path
20
- # require 'URI'
21
- # uri = URI.parse("https://api.dyspatch.io")
22
- # DyspatchClient.configure do |c|
23
- # c.host = uri.host
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
- # expect(config.base_url).to eq("https://api.dyspatch.io")
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
- # uncomment below to test trailing slashes
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