dyspatch_client 3.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/README.md +45 -53
  4. data/Rakefile +2 -0
  5. data/docs/APIError.md +13 -2
  6. data/docs/CompiledRead.md +15 -0
  7. data/docs/Cursor.md +11 -1
  8. data/docs/DraftMetaRead.md +14 -1
  9. data/docs/DraftRead.md +17 -1
  10. data/docs/DraftsApi.md +140 -131
  11. data/docs/DraftsRead.md +12 -2
  12. data/docs/{Body.md → InlineObject.md} +10 -1
  13. data/docs/LocalizationKeyRead.md +10 -0
  14. data/docs/LocalizationMetaRead.md +15 -2
  15. data/docs/LocalizationRead.md +19 -1
  16. data/docs/LocalizationsApi.md +75 -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 -20
  23. data/lib/dyspatch_client/api/drafts_api.rb +375 -234
  24. data/lib/dyspatch_client/api/localizations_api.rb +135 -31
  25. data/lib/dyspatch_client/api/templates_api.rb +99 -65
  26. data/lib/dyspatch_client/api_client.rb +46 -47
  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 +56 -67
  31. data/lib/dyspatch_client/models/cursor.rb +43 -20
  32. data/lib/dyspatch_client/models/draft_meta_read.rb +49 -35
  33. data/lib/dyspatch_client/models/draft_read.rb +49 -25
  34. data/lib/dyspatch_client/models/drafts_read.rb +42 -19
  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 +62 -36
  38. data/lib/dyspatch_client/models/localization_read.rb +71 -35
  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 +26 -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 +4 -4
  48. data/spec/spec_helper.rb +4 -4
  49. metadata +11 -219
  50. data/LICENSE +0 -202
  51. data/docs/Body1.md +0 -8
  52. data/docs/CreatedAt.md +0 -7
  53. data/docs/DraftDescription.md +0 -7
  54. data/docs/DraftId.md +0 -7
  55. data/docs/DraftName.md +0 -7
  56. data/docs/DraftUrl.md +0 -7
  57. data/docs/LanguageId.md +0 -7
  58. data/docs/LocalizationId.md +0 -7
  59. data/docs/LocalizationName.md +0 -7
  60. data/docs/LocalizationUrl.md +0 -7
  61. data/docs/TemplateDescription.md +0 -7
  62. data/docs/TemplateId.md +0 -7
  63. data/docs/TemplateName.md +0 -7
  64. data/docs/TemplateUrl.md +0 -7
  65. data/docs/UpdatedAt.md +0 -7
  66. data/git_push.sh +0 -55
  67. data/lib/dyspatch_client/models/body_1.rb +0 -183
  68. data/lib/dyspatch_client/models/created_at.rb +0 -175
  69. data/lib/dyspatch_client/models/draft_description.rb +0 -175
  70. data/lib/dyspatch_client/models/draft_id.rb +0 -175
  71. data/lib/dyspatch_client/models/draft_name.rb +0 -175
  72. data/lib/dyspatch_client/models/draft_url.rb +0 -175
  73. data/lib/dyspatch_client/models/language_id.rb +0 -175
  74. data/lib/dyspatch_client/models/localization_id.rb +0 -175
  75. data/lib/dyspatch_client/models/localization_name.rb +0 -175
  76. data/lib/dyspatch_client/models/localization_url.rb +0 -175
  77. data/lib/dyspatch_client/models/template_description.rb +0 -175
  78. data/lib/dyspatch_client/models/template_id.rb +0 -175
  79. data/lib/dyspatch_client/models/template_name.rb +0 -175
  80. data/lib/dyspatch_client/models/template_url.rb +0 -175
  81. data/lib/dyspatch_client/models/updated_at.rb +0 -175
  82. data/spec/models/api_error_spec.rb +0 -57
  83. data/spec/models/body_1_spec.rb +0 -41
  84. data/spec/models/body_spec.rb +0 -41
  85. data/spec/models/compiled_read_spec.rb +0 -65
  86. data/spec/models/created_at_spec.rb +0 -35
  87. data/spec/models/cursor_spec.rb +0 -47
  88. data/spec/models/draft_description_spec.rb +0 -35
  89. data/spec/models/draft_id_spec.rb +0 -35
  90. data/spec/models/draft_meta_read_spec.rb +0 -77
  91. data/spec/models/draft_name_spec.rb +0 -35
  92. data/spec/models/draft_read_spec.rb +0 -83
  93. data/spec/models/draft_url_spec.rb +0 -35
  94. data/spec/models/drafts_read_spec.rb +0 -47
  95. data/spec/models/language_id_spec.rb +0 -35
  96. data/spec/models/localization_id_spec.rb +0 -35
  97. data/spec/models/localization_key_read_spec.rb +0 -47
  98. data/spec/models/localization_meta_read_spec.rb +0 -65
  99. data/spec/models/localization_name_spec.rb +0 -35
  100. data/spec/models/localization_read_spec.rb +0 -83
  101. data/spec/models/localization_url_spec.rb +0 -35
  102. data/spec/models/template_description_spec.rb +0 -35
  103. data/spec/models/template_id_spec.rb +0 -35
  104. data/spec/models/template_meta_read_spec.rb +0 -77
  105. data/spec/models/template_name_spec.rb +0 -35
  106. data/spec/models/template_read_spec.rb +0 -83
  107. data/spec/models/template_url_spec.rb +0 -35
  108. data/spec/models/templates_read_spec.rb +0 -47
  109. data/spec/models/updated_at_spec.rb +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d968f402243af33665a9e94bffff96ea5486490b
4
- data.tar.gz: d6c060c99bc7e076bd8c6f63301e796d7e3b3c04
3
+ metadata.gz: 1bca48e6247df466eb49fab54a5f2ff7a2aba594
4
+ data.tar.gz: 1cc120d620ec9d5543327019a73aa71b58b7a1f0
5
5
  SHA512:
6
- metadata.gz: 2005c2159497c7480de663a7a40cdcaf3e7bc7dca8f9d6de66e7d36b3c884839422be380d8f483549a416e03459a3a0f24cd2be2cb2624edb422a670c5d4f978
7
- data.tar.gz: 784df20371eb8d2b2f029476c1d3bb7955054a4a71106b893644a83ada8995d67bb1b0475cfde34b8a2c17e56554f6f55f68387c149e573b785f76a4d1661d1e
6
+ metadata.gz: e8192f911b43b0149a1c90f97fa7b1911c96dedab1ac6dd364eba8f8c039779248fb03303e8bdc7bf77c995f0ee7919d53714f2b139f8872dfcd8a2e96ce20ec
7
+ data.tar.gz: fb5be5156122be9a99582b47b832fc75897bdb04faf2905d2548348fbb01fd65ae0196960c4da0cb0c4321d6f109687bc160d48e58254d6cc420d5f01e686e5e
data/Gemfile CHANGED
@@ -3,5 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'rake', '~> 12.0.0'
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
7
9
  end
data/README.md CHANGED
@@ -2,23 +2,29 @@
2
2
 
3
3
  DyspatchClient - the Ruby gem for the Dyspatch API
4
4
 
5
- # Introduction
5
+ # Introduction
6
6
 
7
- 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.
7
+ The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response
8
+ codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted.
9
+ See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on
10
+ how to implement Dyspatch.
8
11
 
9
- ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks:
10
- - [Java](https://github.com/getdyspatch/dyspatch-java)
11
- - [Javascript](https://github.com/getdyspatch/dyspatch-javascript)
12
- - [Python](https://github.com/getdyspatch/dyspatch-python)
13
- - [C#](https://github.com/getdyspatch/dyspatch-dotnet)
14
- - [Go](https://github.com/getdyspatch/dyspatch-golang)
15
- - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
12
+ ## API Client Libraries
13
+ Dyspatch provides API Clients for popular languages and web frameworks.
16
14
 
17
- This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
15
+ - [Java](https://github.com/getdyspatch/dyspatch-java)
16
+ - [Javascript](https://github.com/getdyspatch/dyspatch-javascript)
17
+ - [Python](https://github.com/getdyspatch/dyspatch-python)
18
+ - [C#](https://github.com/getdyspatch/dyspatch-dotnet)
19
+ - [Go](https://github.com/getdyspatch/dyspatch-golang)
20
+ - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
18
21
 
19
- - API version: 2019.10
20
- - Package version: 3.0.0
21
- - Build package: io.swagger.codegen.languages.RubyClientCodegen
22
+
23
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
24
+
25
+ - API version: 2020.11
26
+ - Package version: 6.0.0
27
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
22
28
  For more information, please visit [https://docs.dyspatch.io](https://docs.dyspatch.io)
23
29
 
24
30
  ## Installation
@@ -34,21 +40,22 @@ gem build dyspatch_client.gemspec
34
40
  Then either install the gem locally:
35
41
 
36
42
  ```shell
37
- gem install ./dyspatch_client-3.0.0.gem
43
+ gem install ./dyspatch_client-6.0.0.gem
38
44
  ```
39
- (for development, run `gem install --dev ./dyspatch_client-3.0.0.gem` to install the development dependencies)
45
+
46
+ (for development, run `gem install --dev ./dyspatch_client-6.0.0.gem` to install the development dependencies)
40
47
 
41
48
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
42
49
 
43
50
  Finally add this to the Gemfile:
44
51
 
45
- gem 'dyspatch_client', '~> 3.0.0'
52
+ gem 'dyspatch_client', '~> 6.0.0'
46
53
 
47
54
  ### Install from Git
48
55
 
49
- If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
56
+ If the Ruby gem is hosted at a git repository: https://github.com/getdyspatch/dyspatch-ruby, then add the following in the Gemfile:
50
57
 
51
- gem 'dyspatch_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
58
+ gem 'dyspatch_client', :git => 'https://github.com/getdyspatch/dyspatch-ruby.git'
52
59
 
53
60
  ### Include the Ruby code directly
54
61
 
@@ -61,6 +68,7 @@ ruby -Ilib script.rb
61
68
  ## Getting Started
62
69
 
63
70
  Please follow the [installation](#installation) procedure and then run the following code:
71
+
64
72
  ```ruby
65
73
  # Load the gem
66
74
  require 'dyspatch_client'
@@ -74,18 +82,15 @@ DyspatchClient.configure do |config|
74
82
  end
75
83
 
76
84
  api_instance = DyspatchClient::DraftsApi.new
77
-
78
85
  draft_id = 'draft_id_example' # String | A draft ID
79
-
80
- target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
81
-
86
+ language_id = 'language_id_example' # String | A language ID (eg: en-US)
87
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
82
88
 
83
89
  begin
84
- #Get Draft by ID
85
- result = api_instance.drafts_draft_id_get(draft_id, target_language)
86
- p result
90
+ #Remove a localization
91
+ api_instance.delete_localization(draft_id, language_id, accept)
87
92
  rescue DyspatchClient::ApiError => e
88
- puts "Exception when calling DraftsApi->drafts_draft_id_get: #{e}"
93
+ puts "Exception when calling DraftsApi->delete_localization: #{e}"
89
94
  end
90
95
 
91
96
  ```
@@ -96,49 +101,35 @@ All URIs are relative to *https://api.dyspatch.io*
96
101
 
97
102
  Class | Method | HTTP request | Description
98
103
  ------------ | ------------- | ------------- | -------------
99
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_get**](docs/DraftsApi.md#drafts_draft_id_get) | **GET** /drafts/{draftId} | Get Draft by ID
100
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localization_keys_get**](docs/DraftsApi.md#drafts_draft_id_localization_keys_get) | **GET** /drafts/{draftId}/localizationKeys | Get Localization Keys
101
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localizations_get**](docs/DraftsApi.md#drafts_draft_id_localizations_get) | **GET** /drafts/{draftId}/localizations | Get Localizations on a Draft
102
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localizations_language_id_delete**](docs/DraftsApi.md#drafts_draft_id_localizations_language_id_delete) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a Localization
103
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localizations_language_id_put**](docs/DraftsApi.md#drafts_draft_id_localizations_language_id_put) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or Update a Localization
104
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localizations_language_id_translations_put**](docs/DraftsApi.md#drafts_draft_id_localizations_language_id_translations_put) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set Translations for Language
105
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_publish_request_post**](docs/DraftsApi.md#drafts_draft_id_publish_request_post) | **POST** /drafts/{draftId}/publishRequest | Submit the Draft for Approval
106
- *DyspatchClient::DraftsApi* | [**drafts_get**](docs/DraftsApi.md#drafts_get) | **GET** /drafts | List Drafts
107
- *DyspatchClient::LocalizationsApi* | [**localizations_localization_id_get**](docs/LocalizationsApi.md#localizations_localization_id_get) | **GET** /localizations/{localizationId} | Get Localization Object by ID
108
- *DyspatchClient::TemplatesApi* | [**templates_get**](docs/TemplatesApi.md#templates_get) | **GET** /templates | List Templates
109
- *DyspatchClient::TemplatesApi* | [**templates_template_id_get**](docs/TemplatesApi.md#templates_template_id_get) | **GET** /templates/{templateId} | Get Template by ID
104
+ *DyspatchClient::DraftsApi* | [**delete_localization**](docs/DraftsApi.md#delete_localization) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a localization
105
+ *DyspatchClient::DraftsApi* | [**get_draft_by_id**](docs/DraftsApi.md#get_draft_by_id) | **GET** /drafts/{draftId} | Get Draft by ID
106
+ *DyspatchClient::DraftsApi* | [**get_draft_localization_keys**](docs/DraftsApi.md#get_draft_localization_keys) | **GET** /drafts/{draftId}/localizationKeys | Get localization keys
107
+ *DyspatchClient::DraftsApi* | [**get_drafts**](docs/DraftsApi.md#get_drafts) | **GET** /drafts | List Drafts
108
+ *DyspatchClient::DraftsApi* | [**get_localization_for_draft**](docs/DraftsApi.md#get_localization_for_draft) | **GET** /drafts/{draftId}/localizations | Get localizations on a draft
109
+ *DyspatchClient::DraftsApi* | [**save_localization**](docs/DraftsApi.md#save_localization) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or update a localization
110
+ *DyspatchClient::DraftsApi* | [**set_translation**](docs/DraftsApi.md#set_translation) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set translations for language
111
+ *DyspatchClient::DraftsApi* | [**submit_draft_for_approval**](docs/DraftsApi.md#submit_draft_for_approval) | **POST** /drafts/{draftId}/publishRequest | Submit the draft for approval
112
+ *DyspatchClient::LocalizationsApi* | [**get_draft_localization_by_id**](docs/LocalizationsApi.md#get_draft_localization_by_id) | **GET** /localizations/{localizationId}/drafts/{draftId} | Get Draft Localization Object by ID
113
+ *DyspatchClient::LocalizationsApi* | [**get_published_localization_by_id**](docs/LocalizationsApi.md#get_published_localization_by_id) | **GET** /localizations/{localizationId} | Get Localization Object by ID
114
+ *DyspatchClient::TemplatesApi* | [**get_template_by_id**](docs/TemplatesApi.md#get_template_by_id) | **GET** /templates/{templateId} | Get Template by ID
115
+ *DyspatchClient::TemplatesApi* | [**get_templates**](docs/TemplatesApi.md#get_templates) | **GET** /templates | List Templates
110
116
 
111
117
 
112
118
  ## Documentation for Models
113
119
 
114
120
  - [DyspatchClient::APIError](docs/APIError.md)
115
- - [DyspatchClient::Body](docs/Body.md)
116
- - [DyspatchClient::Body1](docs/Body1.md)
117
121
  - [DyspatchClient::CompiledRead](docs/CompiledRead.md)
118
- - [DyspatchClient::CreatedAt](docs/CreatedAt.md)
119
122
  - [DyspatchClient::Cursor](docs/Cursor.md)
120
- - [DyspatchClient::DraftDescription](docs/DraftDescription.md)
121
- - [DyspatchClient::DraftId](docs/DraftId.md)
122
123
  - [DyspatchClient::DraftMetaRead](docs/DraftMetaRead.md)
123
- - [DyspatchClient::DraftName](docs/DraftName.md)
124
124
  - [DyspatchClient::DraftRead](docs/DraftRead.md)
125
- - [DyspatchClient::DraftUrl](docs/DraftUrl.md)
126
125
  - [DyspatchClient::DraftsRead](docs/DraftsRead.md)
127
- - [DyspatchClient::LanguageId](docs/LanguageId.md)
128
- - [DyspatchClient::LocalizationId](docs/LocalizationId.md)
126
+ - [DyspatchClient::InlineObject](docs/InlineObject.md)
129
127
  - [DyspatchClient::LocalizationKeyRead](docs/LocalizationKeyRead.md)
130
128
  - [DyspatchClient::LocalizationMetaRead](docs/LocalizationMetaRead.md)
131
- - [DyspatchClient::LocalizationName](docs/LocalizationName.md)
132
129
  - [DyspatchClient::LocalizationRead](docs/LocalizationRead.md)
133
- - [DyspatchClient::LocalizationUrl](docs/LocalizationUrl.md)
134
- - [DyspatchClient::TemplateDescription](docs/TemplateDescription.md)
135
- - [DyspatchClient::TemplateId](docs/TemplateId.md)
136
130
  - [DyspatchClient::TemplateMetaRead](docs/TemplateMetaRead.md)
137
- - [DyspatchClient::TemplateName](docs/TemplateName.md)
138
131
  - [DyspatchClient::TemplateRead](docs/TemplateRead.md)
139
- - [DyspatchClient::TemplateUrl](docs/TemplateUrl.md)
140
132
  - [DyspatchClient::TemplatesRead](docs/TemplatesRead.md)
141
- - [DyspatchClient::UpdatedAt](docs/UpdatedAt.md)
142
133
 
143
134
 
144
135
  ## Documentation for Authorization
@@ -146,6 +137,7 @@ Class | Method | HTTP request | Description
146
137
 
147
138
  ### Bearer
148
139
 
140
+
149
141
  - **Type**: API key
150
142
  - **API key parameter name**: Authorization
151
143
  - **Location**: HTTP header
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+
1
3
  begin
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,10 +1,21 @@
1
1
  # DyspatchClient::APIError
2
2
 
3
3
  ## Properties
4
+
4
5
  Name | Type | Description | Notes
5
6
  ------------ | ------------- | ------------- | -------------
6
- **code** | **String** | Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. | [optional]
7
+ **code** | **String** | Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. * prohibited_action - The request was refused because an action was not valid for the requested resource. Typically this will happen if you try to make changes to a locked resource. | [optional]
7
8
  **message** | **String** | Human readable error message | [optional]
8
- **parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional]
9
+ **parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'DyspatchClient'
15
+
16
+ instance = DyspatchClient::APIError.new(code: null,
17
+ message: null,
18
+ parameter: null)
19
+ ```
9
20
 
10
21
 
@@ -1,12 +1,27 @@
1
1
  # DyspatchClient::CompiledRead
2
2
 
3
3
  ## Properties
4
+
4
5
  Name | Type | Description | Notes
5
6
  ------------ | ------------- | ------------- | -------------
6
7
  **sender** | **String** | Sender address | [optional]
7
8
  **reply_to** | **String** | Reply-To address | [optional]
8
9
  **subject** | **String** | Base64 encoded template subject line | [optional]
9
10
  **html** | **String** | Base64 encoded template HTML body | [optional]
11
+ **amp_html** | **String** | Base64 encoded template AMP body | [optional]
10
12
  **text** | **String** | Base64 encoded template text body | [optional]
11
13
 
14
+ ## Code Sample
15
+
16
+ ```ruby
17
+ require 'DyspatchClient'
18
+
19
+ instance = DyspatchClient::CompiledRead.new(sender: example@example.com,
20
+ reply_to: example@example.com,
21
+ subject: null,
22
+ html: null,
23
+ amp_html: null,
24
+ text: null)
25
+ ```
26
+
12
27
 
@@ -1,9 +1,19 @@
1
1
  # DyspatchClient::Cursor
2
2
 
3
3
  ## Properties
4
+
4
5
  Name | Type | Description | Notes
5
6
  ------------ | ------------- | ------------- | -------------
6
7
  **_next** | **String** | A cursor to fetch the next page of results | [optional]
7
- **has_more** | **BOOLEAN** | Whether there is a next page of results | [optional]
8
+ **has_more** | **Boolean** | Whether there is a next page of results | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'DyspatchClient'
14
+
15
+ instance = DyspatchClient::Cursor.new(_next: null,
16
+ has_more: null)
17
+ ```
8
18
 
9
19
 
@@ -1,14 +1,27 @@
1
1
  # DyspatchClient::DraftMetaRead
2
2
 
3
3
  ## Properties
4
+
4
5
  Name | Type | Description | Notes
5
6
  ------------ | ------------- | ------------- | -------------
6
7
  **id** | **String** | An opaque, unique identifier for a draft | [optional]
7
8
  **template_id** | **String** | An opaque, unique identifier for a template | [optional]
8
9
  **name** | **String** | The name of a draft | [optional]
9
- **description** | **String** | A description of the draft | [optional]
10
10
  **url** | **String** | The API url for a specific draft | [optional]
11
11
  **created_at** | **DateTime** | The time of initial creation | [optional]
12
12
  **updated_at** | **DateTime** | The time of last update | [optional]
13
13
 
14
+ ## Code Sample
15
+
16
+ ```ruby
17
+ require 'DyspatchClient'
18
+
19
+ instance = DyspatchClient::DraftMetaRead.new(id: tdft_g3L7Cw6Hp5wU,
20
+ template_id: tem_g3L7Cw6Hp5wU,
21
+ name: null,
22
+ url: /drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU,
23
+ created_at: null,
24
+ updated_at: null)
25
+ ```
26
+
14
27
 
@@ -1,6 +1,7 @@
1
1
  # DyspatchClient::DraftRead
2
2
 
3
3
  ## Properties
4
+
4
5
  Name | Type | Description | Notes
5
6
  ------------ | ------------- | ------------- | -------------
6
7
  **id** | **String** | An opaque, unique identifier for a draft | [optional]
@@ -10,6 +11,21 @@ Name | Type | Description | Notes
10
11
  **compiled** | [**CompiledRead**](CompiledRead.md) | | [optional]
11
12
  **created_at** | **DateTime** | The time of initial creation | [optional]
12
13
  **updated_at** | **DateTime** | The time of last update | [optional]
13
- **localizations** | [**Array<LocalizationMetaRead>**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional]
14
+ **localizations** | [**Array&lt;LocalizationMetaRead&gt;**](LocalizationMetaRead.md) | A list of the Template&#39;s available localizations | [optional]
15
+
16
+ ## Code Sample
17
+
18
+ ```ruby
19
+ require 'DyspatchClient'
20
+
21
+ instance = DyspatchClient::DraftRead.new(id: tdft_g3L7Cw6Hp5wU,
22
+ template: tem_g3L7Cw6Hp5wU,
23
+ name: null,
24
+ url: /drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU,
25
+ compiled: null,
26
+ created_at: null,
27
+ updated_at: null,
28
+ localizations: null)
29
+ ```
14
30
 
15
31
 
@@ -4,24 +4,27 @@ All URIs are relative to *https://api.dyspatch.io*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
- [**drafts_draft_id_get**](DraftsApi.md#drafts_draft_id_get) | **GET** /drafts/{draftId} | Get Draft by ID
8
- [**drafts_draft_id_localization_keys_get**](DraftsApi.md#drafts_draft_id_localization_keys_get) | **GET** /drafts/{draftId}/localizationKeys | Get Localization Keys
9
- [**drafts_draft_id_localizations_get**](DraftsApi.md#drafts_draft_id_localizations_get) | **GET** /drafts/{draftId}/localizations | Get Localizations on a Draft
10
- [**drafts_draft_id_localizations_language_id_delete**](DraftsApi.md#drafts_draft_id_localizations_language_id_delete) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a Localization
11
- [**drafts_draft_id_localizations_language_id_put**](DraftsApi.md#drafts_draft_id_localizations_language_id_put) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or Update a Localization
12
- [**drafts_draft_id_localizations_language_id_translations_put**](DraftsApi.md#drafts_draft_id_localizations_language_id_translations_put) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set Translations for Language
13
- [**drafts_draft_id_publish_request_post**](DraftsApi.md#drafts_draft_id_publish_request_post) | **POST** /drafts/{draftId}/publishRequest | Submit the Draft for Approval
14
- [**drafts_get**](DraftsApi.md#drafts_get) | **GET** /drafts | List Drafts
7
+ [**delete_localization**](DraftsApi.md#delete_localization) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a localization
8
+ [**get_draft_by_id**](DraftsApi.md#get_draft_by_id) | **GET** /drafts/{draftId} | Get Draft by ID
9
+ [**get_draft_localization_keys**](DraftsApi.md#get_draft_localization_keys) | **GET** /drafts/{draftId}/localizationKeys | Get localization keys
10
+ [**get_drafts**](DraftsApi.md#get_drafts) | **GET** /drafts | List Drafts
11
+ [**get_localization_for_draft**](DraftsApi.md#get_localization_for_draft) | **GET** /drafts/{draftId}/localizations | Get localizations on a draft
12
+ [**save_localization**](DraftsApi.md#save_localization) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or update a localization
13
+ [**set_translation**](DraftsApi.md#set_translation) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set translations for language
14
+ [**submit_draft_for_approval**](DraftsApi.md#submit_draft_for_approval) | **POST** /drafts/{draftId}/publishRequest | Submit the draft for approval
15
15
 
16
16
 
17
- # **drafts_draft_id_get**
18
- > DraftRead drafts_draft_id_get(draft_id, target_language)
19
17
 
20
- Get Draft by ID
18
+ ## delete_localization
19
+
20
+ > delete_localization(draft_id, language_id, accept)
21
+
22
+ Remove a localization
21
23
 
22
- Gets a draft object with the matching ID. The "compiled" field will contain the unlocalized default template object.
24
+ Deletes the localization with the given language ID if it exists
23
25
 
24
26
  ### Example
27
+
25
28
  ```ruby
26
29
  # load the gem
27
30
  require 'dyspatch_client'
@@ -34,31 +37,30 @@ DyspatchClient.configure do |config|
34
37
  end
35
38
 
36
39
  api_instance = DyspatchClient::DraftsApi.new
37
-
38
40
  draft_id = 'draft_id_example' # String | A draft ID
39
-
40
- target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
41
-
41
+ language_id = 'language_id_example' # String | A language ID (eg: en-US)
42
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
42
43
 
43
44
  begin
44
- #Get Draft by ID
45
- result = api_instance.drafts_draft_id_get(draft_id, target_language)
46
- p result
45
+ #Remove a localization
46
+ api_instance.delete_localization(draft_id, language_id, accept)
47
47
  rescue DyspatchClient::ApiError => e
48
- puts "Exception when calling DraftsApi->drafts_draft_id_get: #{e}"
48
+ puts "Exception when calling DraftsApi->delete_localization: #{e}"
49
49
  end
50
50
  ```
51
51
 
52
52
  ### Parameters
53
53
 
54
+
54
55
  Name | Type | Description | Notes
55
56
  ------------- | ------------- | ------------- | -------------
56
57
  **draft_id** | **String**| A draft ID |
57
- **target_language** | **String**| The type of templating language to compile as. Should only be used for visual templates. |
58
+ **language_id** | **String**| A language ID (eg: en-US) |
59
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
58
60
 
59
61
  ### Return type
60
62
 
61
- [**DraftRead**](DraftRead.md)
63
+ nil (empty response body)
62
64
 
63
65
  ### Authorization
64
66
 
@@ -66,19 +68,20 @@ Name | Type | Description | Notes
66
68
 
67
69
  ### HTTP request headers
68
70
 
69
- - **Content-Type**: Not defined
70
- - **Accept**: application/vnd.dyspatch.2019.10+json
71
+ - **Content-Type**: Not defined
72
+ - **Accept**: Not defined
71
73
 
72
74
 
75
+ ## get_draft_by_id
73
76
 
74
- # **drafts_draft_id_localization_keys_get**
75
- > Array<LocalizationKeyRead> drafts_draft_id_localization_keys_get(draft_id, , opts)
77
+ > DraftRead get_draft_by_id(draft_id, target_language, accept)
76
78
 
77
- Get Localization Keys
79
+ Get Draft by ID
78
80
 
79
- 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.
81
+ Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form.
80
82
 
81
83
  ### Example
84
+
82
85
  ```ruby
83
86
  # load the gem
84
87
  require 'dyspatch_client'
@@ -91,32 +94,31 @@ DyspatchClient.configure do |config|
91
94
  end
92
95
 
93
96
  api_instance = DyspatchClient::DraftsApi.new
94
-
95
97
  draft_id = 'draft_id_example' # String | A draft ID
96
-
97
- opts = {
98
- accept: 'accept_example' # String | 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".
99
- }
98
+ target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
99
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
100
100
 
101
101
  begin
102
- #Get Localization Keys
103
- result = api_instance.drafts_draft_id_localization_keys_get(draft_id, , opts)
102
+ #Get Draft by ID
103
+ result = api_instance.get_draft_by_id(draft_id, target_language, accept)
104
104
  p result
105
105
  rescue DyspatchClient::ApiError => e
106
- puts "Exception when calling DraftsApi->drafts_draft_id_localization_keys_get: #{e}"
106
+ puts "Exception when calling DraftsApi->get_draft_by_id: #{e}"
107
107
  end
108
108
  ```
109
109
 
110
110
  ### Parameters
111
111
 
112
+
112
113
  Name | Type | Description | Notes
113
114
  ------------- | ------------- | ------------- | -------------
114
115
  **draft_id** | **String**| A draft ID |
115
- **accept** | **String**| 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". | [optional]
116
+ **target_language** | **String**| The type of templating language to compile as. Should only be used for visual templates. |
117
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
116
118
 
117
119
  ### Return type
118
120
 
119
- [**Array<LocalizationKeyRead>**](LocalizationKeyRead.md)
121
+ [**DraftRead**](DraftRead.md)
120
122
 
121
123
  ### Authorization
122
124
 
@@ -124,19 +126,20 @@ Name | Type | Description | Notes
124
126
 
125
127
  ### HTTP request headers
126
128
 
127
- - **Content-Type**: Not defined
128
- - **Accept**: application/vnd.dyspatch.2019.10+json, text/vnd.dyspatch.2019.10+x-gettext-translation
129
+ - **Content-Type**: Not defined
130
+ - **Accept**: application/vnd.dyspatch.2020.11+json, */*
129
131
 
130
132
 
133
+ ## get_draft_localization_keys
131
134
 
132
- # **drafts_draft_id_localizations_get**
133
- > Array<LocalizationMetaRead> drafts_draft_id_localizations_get(draft_id, )
135
+ > Array&lt;LocalizationKeyRead&gt; get_draft_localization_keys(draft_id, accept)
134
136
 
135
- Get Localizations on a Draft
137
+ Get localization keys
136
138
 
137
- Returns localization metadata object for a template draft.
139
+ Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2020.11+json` to get a JSON object, or `text/vnd.dyspatch.2020.11+x-gettext-translation` to get the POT file.
138
140
 
139
141
  ### Example
142
+
140
143
  ```ruby
141
144
  # load the gem
142
145
  require 'dyspatch_client'
@@ -149,28 +152,29 @@ DyspatchClient.configure do |config|
149
152
  end
150
153
 
151
154
  api_instance = DyspatchClient::DraftsApi.new
152
-
153
155
  draft_id = 'draft_id_example' # String | A draft ID
154
-
156
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
155
157
 
156
158
  begin
157
- #Get Localizations on a Draft
158
- result = api_instance.drafts_draft_id_localizations_get(draft_id, )
159
+ #Get localization keys
160
+ result = api_instance.get_draft_localization_keys(draft_id, accept)
159
161
  p result
160
162
  rescue DyspatchClient::ApiError => e
161
- puts "Exception when calling DraftsApi->drafts_draft_id_localizations_get: #{e}"
163
+ puts "Exception when calling DraftsApi->get_draft_localization_keys: #{e}"
162
164
  end
163
165
  ```
164
166
 
165
167
  ### Parameters
166
168
 
169
+
167
170
  Name | Type | Description | Notes
168
171
  ------------- | ------------- | ------------- | -------------
169
172
  **draft_id** | **String**| A draft ID |
173
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
170
174
 
171
175
  ### Return type
172
176
 
173
- [**Array<LocalizationMetaRead>**](LocalizationMetaRead.md)
177
+ [**Array&lt;LocalizationKeyRead&gt;**](LocalizationKeyRead.md)
174
178
 
175
179
  ### Authorization
176
180
 
@@ -178,19 +182,20 @@ Name | Type | Description | Notes
178
182
 
179
183
  ### HTTP request headers
180
184
 
181
- - **Content-Type**: Not defined
182
- - **Accept**: application/vnd.dyspatch.2019.10+json
185
+ - **Content-Type**: Not defined
186
+ - **Accept**: application/vnd.dyspatch.2020.11+json, text/vnd.dyspatch.2020.11+x-gettext-translation
183
187
 
184
188
 
189
+ ## get_drafts
185
190
 
186
- # **drafts_draft_id_localizations_language_id_delete**
187
- > drafts_draft_id_localizations_language_id_delete(draft_id, language_id)
191
+ > DraftsRead get_drafts(accept, opts)
188
192
 
189
- Remove a Localization
193
+ List Drafts
190
194
 
191
- Deletes the localization with the given `languageId` if it exists.
195
+ Returns all drafts for your organization.
192
196
 
193
197
  ### Example
198
+
194
199
  ```ruby
195
200
  # load the gem
196
201
  require 'dyspatch_client'
@@ -203,30 +208,33 @@ DyspatchClient.configure do |config|
203
208
  end
204
209
 
205
210
  api_instance = DyspatchClient::DraftsApi.new
206
-
207
- draft_id = 'draft_id_example' # String | A draft ID
208
-
209
- language_id = 'language_id_example' # String | A language ID (eg: en-US)
210
-
211
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
212
+ opts = {
213
+ cursor: 'cursor_example', # String | A cursor value used to retrieve a specific page from a paginated result set.
214
+ status: 'status_example' # String | Filter the list of drafts by a particular status
215
+ }
211
216
 
212
217
  begin
213
- #Remove a Localization
214
- api_instance.drafts_draft_id_localizations_language_id_delete(draft_id, language_id)
218
+ #List Drafts
219
+ result = api_instance.get_drafts(accept, opts)
220
+ p result
215
221
  rescue DyspatchClient::ApiError => e
216
- puts "Exception when calling DraftsApi->drafts_draft_id_localizations_language_id_delete: #{e}"
222
+ puts "Exception when calling DraftsApi->get_drafts: #{e}"
217
223
  end
218
224
  ```
219
225
 
220
226
  ### Parameters
221
227
 
228
+
222
229
  Name | Type | Description | Notes
223
230
  ------------- | ------------- | ------------- | -------------
224
- **draft_id** | **String**| A draft ID |
225
- **language_id** | **String**| A language ID (eg: en-US) |
231
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
232
+ **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional]
233
+ **status** | **String**| Filter the list of drafts by a particular status | [optional]
226
234
 
227
235
  ### Return type
228
236
 
229
- nil (empty response body)
237
+ [**DraftsRead**](DraftsRead.md)
230
238
 
231
239
  ### Authorization
232
240
 
@@ -234,19 +242,20 @@ nil (empty response body)
234
242
 
235
243
  ### HTTP request headers
236
244
 
237
- - **Content-Type**: Not defined
238
- - **Accept**: application/vnd.dyspatch.2019.10+json
245
+ - **Content-Type**: Not defined
246
+ - **Accept**: application/vnd.dyspatch.2020.11+json, */*
239
247
 
240
248
 
249
+ ## get_localization_for_draft
241
250
 
242
- # **drafts_draft_id_localizations_language_id_put**
243
- > drafts_draft_id_localizations_language_id_put(draft_id, language_idbody)
251
+ > Array&lt;LocalizationMetaRead&gt; get_localization_for_draft(draft_id, accept)
244
252
 
245
- Create or Update a Localization
253
+ Get localizations on a draft
246
254
 
247
- Inserts a localization or sets the name on an existing localization that already uses the `languageId`.
255
+ Returns localization metadata for the draft
248
256
 
249
257
  ### Example
258
+
250
259
  ```ruby
251
260
  # load the gem
252
261
  require 'dyspatch_client'
@@ -259,33 +268,29 @@ DyspatchClient.configure do |config|
259
268
  end
260
269
 
261
270
  api_instance = DyspatchClient::DraftsApi.new
262
-
263
271
  draft_id = 'draft_id_example' # String | A draft ID
264
-
265
- language_id = 'language_id_example' # String | A language ID (eg: en-US)
266
-
267
- body = DyspatchClient::Body1.new # Body1 |
268
-
272
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
269
273
 
270
274
  begin
271
- #Create or Update a Localization
272
- api_instance.drafts_draft_id_localizations_language_id_put(draft_id, language_idbody)
275
+ #Get localizations on a draft
276
+ result = api_instance.get_localization_for_draft(draft_id, accept)
277
+ p result
273
278
  rescue DyspatchClient::ApiError => e
274
- puts "Exception when calling DraftsApi->drafts_draft_id_localizations_language_id_put: #{e}"
279
+ puts "Exception when calling DraftsApi->get_localization_for_draft: #{e}"
275
280
  end
276
281
  ```
277
282
 
278
283
  ### Parameters
279
284
 
285
+
280
286
  Name | Type | Description | Notes
281
287
  ------------- | ------------- | ------------- | -------------
282
288
  **draft_id** | **String**| A draft ID |
283
- **language_id** | **String**| A language ID (eg: en-US) |
284
- **body** | [**Body1**](Body1.md)| |
289
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
285
290
 
286
291
  ### Return type
287
292
 
288
- nil (empty response body)
293
+ [**Array&lt;LocalizationMetaRead&gt;**](LocalizationMetaRead.md)
289
294
 
290
295
  ### Authorization
291
296
 
@@ -293,19 +298,20 @@ nil (empty response body)
293
298
 
294
299
  ### HTTP request headers
295
300
 
296
- - **Content-Type**: Not defined
297
- - **Accept**: application/vnd.dyspatch.2019.10+json
301
+ - **Content-Type**: Not defined
302
+ - **Accept**: application/vnd.dyspatch.2020.11+json
298
303
 
299
304
 
305
+ ## save_localization
300
306
 
301
- # **drafts_draft_id_localizations_language_id_translations_put**
302
- > drafts_draft_id_localizations_language_id_translations_put(draft_id, language_idbody)
307
+ > save_localization(draft_id, language_id, accept, inline_object)
303
308
 
304
- Set Translations for Language
309
+ Create or update a localization
305
310
 
306
- 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`.
311
+ Inserts a localization or sets the name on an existing localization that already uses the languageId
307
312
 
308
313
  ### Example
314
+
309
315
  ```ruby
310
316
  # load the gem
311
317
  require 'dyspatch_client'
@@ -318,29 +324,28 @@ DyspatchClient.configure do |config|
318
324
  end
319
325
 
320
326
  api_instance = DyspatchClient::DraftsApi.new
321
-
322
327
  draft_id = 'draft_id_example' # String | A draft ID
323
-
324
328
  language_id = 'language_id_example' # String | A language ID (eg: en-US)
325
-
326
- body = DyspatchClient::Body.new # Body |
327
-
329
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
330
+ inline_object = DyspatchClient::InlineObject.new # InlineObject |
328
331
 
329
332
  begin
330
- #Set Translations for Language
331
- api_instance.drafts_draft_id_localizations_language_id_translations_put(draft_id, language_idbody)
333
+ #Create or update a localization
334
+ api_instance.save_localization(draft_id, language_id, accept, inline_object)
332
335
  rescue DyspatchClient::ApiError => e
333
- puts "Exception when calling DraftsApi->drafts_draft_id_localizations_language_id_translations_put: #{e}"
336
+ puts "Exception when calling DraftsApi->save_localization: #{e}"
334
337
  end
335
338
  ```
336
339
 
337
340
  ### Parameters
338
341
 
342
+
339
343
  Name | Type | Description | Notes
340
344
  ------------- | ------------- | ------------- | -------------
341
345
  **draft_id** | **String**| A draft ID |
342
346
  **language_id** | **String**| A language ID (eg: en-US) |
343
- **body** | [**Body**](Body.md)| |
347
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
348
+ **inline_object** | [**InlineObject**](InlineObject.md)| |
344
349
 
345
350
  ### Return type
346
351
 
@@ -352,19 +357,20 @@ nil (empty response body)
352
357
 
353
358
  ### HTTP request headers
354
359
 
355
- - **Content-Type**: Not defined
356
- - **Accept**: application/vnd.dyspatch.2019.10+json
360
+ - **Content-Type**: application/json
361
+ - **Accept**: Not defined
357
362
 
358
363
 
364
+ ## set_translation
359
365
 
360
- # **drafts_draft_id_publish_request_post**
361
- > drafts_draft_id_publish_request_post(draft_id, )
366
+ > set_translation(draft_id, language_id, accept, request_body)
362
367
 
363
- Submit the Draft for Approval
368
+ Set translations for language
364
369
 
365
- 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.
370
+ 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`.
366
371
 
367
372
  ### Example
373
+
368
374
  ```ruby
369
375
  # load the gem
370
376
  require 'dyspatch_client'
@@ -377,23 +383,28 @@ DyspatchClient.configure do |config|
377
383
  end
378
384
 
379
385
  api_instance = DyspatchClient::DraftsApi.new
380
-
381
386
  draft_id = 'draft_id_example' # String | A draft ID
382
-
387
+ language_id = 'language_id_example' # String | A language ID (eg: en-US)
388
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
389
+ request_body = {'key' => 'request_body_example'} # Hash<String, String> |
383
390
 
384
391
  begin
385
- #Submit the Draft for Approval
386
- api_instance.drafts_draft_id_publish_request_post(draft_id, )
392
+ #Set translations for language
393
+ api_instance.set_translation(draft_id, language_id, accept, request_body)
387
394
  rescue DyspatchClient::ApiError => e
388
- puts "Exception when calling DraftsApi->drafts_draft_id_publish_request_post: #{e}"
395
+ puts "Exception when calling DraftsApi->set_translation: #{e}"
389
396
  end
390
397
  ```
391
398
 
392
399
  ### Parameters
393
400
 
401
+
394
402
  Name | Type | Description | Notes
395
403
  ------------- | ------------- | ------------- | -------------
396
404
  **draft_id** | **String**| A draft ID |
405
+ **language_id** | **String**| A language ID (eg: en-US) |
406
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
407
+ **request_body** | [**Hash&lt;String, String&gt;**](String.md)| |
397
408
 
398
409
  ### Return type
399
410
 
@@ -405,19 +416,20 @@ nil (empty response body)
405
416
 
406
417
  ### HTTP request headers
407
418
 
408
- - **Content-Type**: Not defined
409
- - **Accept**: application/vnd.dyspatch.2019.10+json
419
+ - **Content-Type**: application/json
420
+ - **Accept**: */*
410
421
 
411
422
 
423
+ ## submit_draft_for_approval
412
424
 
413
- # **drafts_get**
414
- > DraftsRead drafts_get(opts)
425
+ > submit_draft_for_approval(draft_id, accept)
415
426
 
416
- List Drafts
427
+ Submit the draft for approval
417
428
 
418
- Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated.
429
+ Moves the draft into submitted state.
419
430
 
420
431
  ### Example
432
+
421
433
  ```ruby
422
434
  # load the gem
423
435
  require 'dyspatch_client'
@@ -430,29 +442,28 @@ DyspatchClient.configure do |config|
430
442
  end
431
443
 
432
444
  api_instance = DyspatchClient::DraftsApi.new
433
-
434
- opts = {
435
- status: 'status_example' # String | Filter the list of drafts by a particular status
436
- }
445
+ draft_id = 'draft_id_example' # String | A draft ID
446
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
437
447
 
438
448
  begin
439
- #List Drafts
440
- result = api_instance.drafts_get(opts)
441
- p result
449
+ #Submit the draft for approval
450
+ api_instance.submit_draft_for_approval(draft_id, accept)
442
451
  rescue DyspatchClient::ApiError => e
443
- puts "Exception when calling DraftsApi->drafts_get: #{e}"
452
+ puts "Exception when calling DraftsApi->submit_draft_for_approval: #{e}"
444
453
  end
445
454
  ```
446
455
 
447
456
  ### Parameters
448
457
 
458
+
449
459
  Name | Type | Description | Notes
450
460
  ------------- | ------------- | ------------- | -------------
451
- **status** | **String**| Filter the list of drafts by a particular status | [optional]
461
+ **draft_id** | **String**| A draft ID |
462
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2020.11\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.11+json\&quot; |
452
463
 
453
464
  ### Return type
454
465
 
455
- [**DraftsRead**](DraftsRead.md)
466
+ nil (empty response body)
456
467
 
457
468
  ### Authorization
458
469
 
@@ -460,8 +471,6 @@ Name | Type | Description | Notes
460
471
 
461
472
  ### HTTP request headers
462
473
 
463
- - **Content-Type**: Not defined
464
- - **Accept**: application/vnd.dyspatch.2019.10+json
465
-
466
-
474
+ - **Content-Type**: Not defined
475
+ - **Accept**: */*
467
476