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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 238489323d4d8e321f2ce5059e9baf4dd5975175b8b6058b1d2061a280e2002c
4
- data.tar.gz: ea5d07242807bf52ce5f7f9f2d41fb3e774b45cc3a56fe8cca3d81af523d4fe0
3
+ metadata.gz: 506b511bcf51b01de550903e22b0ce4758c7a6a8b1bb3796deaa599d140e5f9d
4
+ data.tar.gz: d78408ecc189018bdf49924b5708fdbabc42d2687efa8271d355828bf04aafa6
5
5
  SHA512:
6
- metadata.gz: 68018572834ebfc10c1318dafc3f0019c6be4049105dd7f331c1c06ffd05568790c2ba5b0779f2434f54a116b0276f8322a141a8ff31ffaffcbfd663c231573f
7
- data.tar.gz: fb59200c0c2e719fec0ccf7e8148dced12b57c0bf2e6f7b148f76a8070b34c5e5c79611c87b79d7efe4c14637f4a844c29bc0d543a632a2ca5f02c07bb6a230e
6
+ metadata.gz: 9f0b7a4e848cabaaff65d1f0ad7d9d431df3faa38c357e6baf951cddcd5e2c43155969c6c4e12fcd61aeaa89f6a93d820289f7343a77bd854d10d3b378307f59
7
+ data.tar.gz: 5d687adb4d35a9477fa9a9fe687f7c5433fabcf6be3cf0db92bf9603c7c3f7de848011951f47581dbc298da7ba8c45ad0233fb0638422dafaf6210a9f1a43623
data/Gemfile CHANGED
@@ -4,4 +4,6 @@ gemspec
4
4
 
5
5
  group :development, :test do
6
6
  gem 'rake', '~> 12.0.0'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
7
9
  end
data/README.md CHANGED
@@ -1,17 +1,27 @@
1
1
  # Dyspatch Ruby API Client
2
2
 
3
- # Introduction
4
-
5
- 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.
6
-
7
3
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
4
 
9
5
  - API version: 2019.10
10
- - Package version: 3.0.1
6
+ - Package version: 4.0.0
11
7
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
8
 
13
9
  For more information, please visit [https://docs.dyspatch.io](https://docs.dyspatch.io)
14
10
 
11
+ # Introduction
12
+
13
+ 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.
14
+
15
+ ## API Client Libraries
16
+ Dyspatch provides API Clients for popular languages and web frameworks.
17
+
18
+ - [Java](https://github.com/getdyspatch/dyspatch-java)
19
+ - [Javascript](https://github.com/getdyspatch/dyspatch-javascript)
20
+ - [Python](https://github.com/getdyspatch/dyspatch-python)
21
+ - [C#](https://github.com/getdyspatch/dyspatch-dotnet)
22
+ - [Go](https://github.com/getdyspatch/dyspatch-golang)
23
+ - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
24
+
15
25
  ## Installation
16
26
 
17
27
  ### RubyGems
@@ -60,6 +70,7 @@ ruby -Ilib script.rb
60
70
  ## Getting Started
61
71
 
62
72
  Please follow the [installation](#installation) procedure and then run the following code:
73
+
63
74
  ```ruby
64
75
  # Load the gem
65
76
  require 'dyspatch_client'
@@ -68,22 +79,20 @@ require 'dyspatch_client'
68
79
  DyspatchClient.configure do |config|
69
80
  # Configure API key authorization: Bearer
70
81
  config.api_key['Authorization'] = 'YOUR API KEY'
71
- config.api_key_prefix['Authorization'] = 'Bearer'
82
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
83
+ #config.api_key_prefix['Authorization'] = 'Bearer'
72
84
  end
73
85
 
74
86
  api_instance = DyspatchClient::DraftsApi.new
75
-
76
87
  draft_id = 'draft_id_example' # String | A draft ID
77
-
78
- target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
79
-
88
+ language_id = 'language_id_example' # String | A language ID (eg: en-US)
89
+ 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\"
80
90
 
81
91
  begin
82
- # Get Draft by ID
83
- result = api_instance.drafts_draft_id_get(draft_id, target_language)
84
- p result
92
+ #Remove a localization
93
+ api_instance.delete_localization(draft_id, language_id, accept)
85
94
  rescue DyspatchClient::ApiError => e
86
- puts "Exception when calling DraftsApi->drafts_draft_id_get: #{e}"
95
+ puts "Exception when calling DraftsApi->delete_localization: #{e}"
87
96
  end
88
97
 
89
98
  ```
@@ -94,48 +103,34 @@ All URIs are relative to *https://api.dyspatch.io*
94
103
 
95
104
  Class | Method | HTTP request | Description
96
105
  ------------ | ------------- | ------------- | -------------
97
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_get**](docs/DraftsApi.md#drafts_draft_id_get) | **GET** /drafts/{draftId} | Get Draft by ID
98
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localization_keys_get**](docs/DraftsApi.md#drafts_draft_id_localization_keys_get) | **GET** /drafts/{draftId}/localizationKeys | Get Localization Keys
99
- *DyspatchClient::DraftsApi* | [**drafts_draft_id_localizations_get**](docs/DraftsApi.md#drafts_draft_id_localizations_get) | **GET** /drafts/{draftId}/localizations | Get Localizations on a Draft
100
- *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
101
- *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
102
- *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
103
- *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
104
- *DyspatchClient::DraftsApi* | [**drafts_get**](docs/DraftsApi.md#drafts_get) | **GET** /drafts | List Drafts
105
- *DyspatchClient::LocalizationsApi* | [**localizations_localization_id_get**](docs/LocalizationsApi.md#localizations_localization_id_get) | **GET** /localizations/{localizationId} | Get Localization Object by ID
106
- *DyspatchClient::TemplatesApi* | [**templates_get**](docs/TemplatesApi.md#templates_get) | **GET** /templates | List Templates
107
- *DyspatchClient::TemplatesApi* | [**templates_template_id_get**](docs/TemplatesApi.md#templates_template_id_get) | **GET** /templates/{templateId} | Get Template by ID
106
+ *DyspatchClient::DraftsApi* | [**delete_localization**](docs/DraftsApi.md#delete_localization) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a localization
107
+ *DyspatchClient::DraftsApi* | [**get_draft_by_id**](docs/DraftsApi.md#get_draft_by_id) | **GET** /drafts/{draftId} | Get Draft by ID
108
+ *DyspatchClient::DraftsApi* | [**get_draft_localization_keys**](docs/DraftsApi.md#get_draft_localization_keys) | **GET** /drafts/{draftId}/localizationKeys | Get localization keys
109
+ *DyspatchClient::DraftsApi* | [**get_drafts**](docs/DraftsApi.md#get_drafts) | **GET** /drafts | List Drafts
110
+ *DyspatchClient::DraftsApi* | [**get_localization_for_draft**](docs/DraftsApi.md#get_localization_for_draft) | **GET** /drafts/{draftId}/localizations | Get localizations on a draft
111
+ *DyspatchClient::DraftsApi* | [**save_localization**](docs/DraftsApi.md#save_localization) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or update a localization
112
+ *DyspatchClient::DraftsApi* | [**set_translation**](docs/DraftsApi.md#set_translation) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set translations for language
113
+ *DyspatchClient::DraftsApi* | [**submit_draft_for_approval**](docs/DraftsApi.md#submit_draft_for_approval) | **POST** /drafts/{draftId}/publishRequest | Submit the draft for approval
114
+ *DyspatchClient::LocalizationsApi* | [**get_localization_by_id**](docs/LocalizationsApi.md#get_localization_by_id) | **GET** /localizations/{localizationId} | Get Localization Object by ID
115
+ *DyspatchClient::TemplatesApi* | [**get_template_by_id**](docs/TemplatesApi.md#get_template_by_id) | **GET** /templates/{templateId} | Get Template by ID
116
+ *DyspatchClient::TemplatesApi* | [**get_templates**](docs/TemplatesApi.md#get_templates) | **GET** /templates | List Templates
108
117
 
109
118
 
110
119
  ## Documentation for Models
111
120
 
112
121
  - [DyspatchClient::APIError](docs/APIError.md)
113
- - [DyspatchClient::Body](docs/Body.md)
114
122
  - [DyspatchClient::CompiledRead](docs/CompiledRead.md)
115
- - [DyspatchClient::CreatedAt](docs/CreatedAt.md)
116
123
  - [DyspatchClient::Cursor](docs/Cursor.md)
117
- - [DyspatchClient::DraftDescription](docs/DraftDescription.md)
118
- - [DyspatchClient::DraftId](docs/DraftId.md)
119
124
  - [DyspatchClient::DraftMetaRead](docs/DraftMetaRead.md)
120
- - [DyspatchClient::DraftName](docs/DraftName.md)
121
125
  - [DyspatchClient::DraftRead](docs/DraftRead.md)
122
- - [DyspatchClient::DraftUrl](docs/DraftUrl.md)
123
126
  - [DyspatchClient::DraftsRead](docs/DraftsRead.md)
124
- - [DyspatchClient::LanguageId](docs/LanguageId.md)
125
- - [DyspatchClient::LocalizationId](docs/LocalizationId.md)
127
+ - [DyspatchClient::InlineObject](docs/InlineObject.md)
126
128
  - [DyspatchClient::LocalizationKeyRead](docs/LocalizationKeyRead.md)
127
129
  - [DyspatchClient::LocalizationMetaRead](docs/LocalizationMetaRead.md)
128
- - [DyspatchClient::LocalizationName](docs/LocalizationName.md)
129
130
  - [DyspatchClient::LocalizationRead](docs/LocalizationRead.md)
130
- - [DyspatchClient::LocalizationUrl](docs/LocalizationUrl.md)
131
- - [DyspatchClient::TemplateDescription](docs/TemplateDescription.md)
132
- - [DyspatchClient::TemplateId](docs/TemplateId.md)
133
131
  - [DyspatchClient::TemplateMetaRead](docs/TemplateMetaRead.md)
134
- - [DyspatchClient::TemplateName](docs/TemplateName.md)
135
132
  - [DyspatchClient::TemplateRead](docs/TemplateRead.md)
136
- - [DyspatchClient::TemplateUrl](docs/TemplateUrl.md)
137
133
  - [DyspatchClient::TemplatesRead](docs/TemplatesRead.md)
138
- - [DyspatchClient::UpdatedAt](docs/UpdatedAt.md)
139
134
 
140
135
 
141
136
  ## Documentation for Authorization
@@ -146,4 +141,3 @@ Class | Method | HTTP request | Description
146
141
  - **Type**: API key
147
142
  - **API key parameter name**: Authorization
148
143
  - **Location**: HTTP header
149
-
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
 
data/docs/APIError.md CHANGED
@@ -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
 
data/docs/CompiledRead.md CHANGED
@@ -1,6 +1,7 @@
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]
@@ -9,4 +10,16 @@ Name | Type | Description | Notes
9
10
  **html** | **String** | Base64 encoded template HTML body | [optional]
10
11
  **text** | **String** | Base64 encoded template text body | [optional]
11
12
 
13
+ ## Code Sample
14
+
15
+ ```ruby
16
+ require 'DyspatchClient'
17
+
18
+ instance = DyspatchClient::CompiledRead.new(sender: Example,
19
+ reply_to: Example,
20
+ subject: null,
21
+ html: null,
22
+ text: null)
23
+ ```
24
+
12
25
 
data/docs/Cursor.md CHANGED
@@ -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,6 +1,7 @@
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]
@@ -11,4 +12,18 @@ Name | Type | Description | Notes
11
12
  **created_at** | **DateTime** | The time of initial creation | [optional]
12
13
  **updated_at** | **DateTime** | The time of last update | [optional]
13
14
 
15
+ ## Code Sample
16
+
17
+ ```ruby
18
+ require 'DyspatchClient'
19
+
20
+ instance = DyspatchClient::DraftMetaRead.new(id: tdft_g3L7Cw6Hp5wU,
21
+ template_id: tem_g3L7Cw6Hp5wU,
22
+ name: null,
23
+ description: null,
24
+ url: /drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU,
25
+ created_at: null,
26
+ updated_at: null)
27
+ ```
28
+
14
29
 
data/docs/DraftRead.md CHANGED
@@ -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
 
data/docs/DraftsApi.md CHANGED
@@ -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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+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.2019.10+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.2019.10+json` to get a JSON object, or `text/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+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.2019.10+json, text/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+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.2019.10+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::Body.new # Body |
268
-
272
+ 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\"
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** | [**Body**](Body.md)| |
289
+ **accept** | **String**| 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; |
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.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+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**: Not defined
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,31 +442,28 @@ DyspatchClient.configure do |config|
430
442
  end
431
443
 
432
444
  api_instance = DyspatchClient::DraftsApi.new
433
-
434
- opts = {
435
- cursor: 'cursor_example', # String | A cursor value used to retrieve a specific page from a paginated result set.
436
- status: 'status_example' # String | Filter the list of drafts by a particular status
437
- }
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 \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\"
438
447
 
439
448
  begin
440
- #List Drafts
441
- result = api_instance.drafts_get(opts)
442
- p result
449
+ #Submit the draft for approval
450
+ api_instance.submit_draft_for_approval(draft_id, accept)
443
451
  rescue DyspatchClient::ApiError => e
444
- puts "Exception when calling DraftsApi->drafts_get: #{e}"
452
+ puts "Exception when calling DraftsApi->submit_draft_for_approval: #{e}"
445
453
  end
446
454
  ```
447
455
 
448
456
  ### Parameters
449
457
 
458
+
450
459
  Name | Type | Description | Notes
451
460
  ------------- | ------------- | ------------- | -------------
452
- **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional]
453
- **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;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot; |
454
463
 
455
464
  ### Return type
456
465
 
457
- [**DraftsRead**](DraftsRead.md)
466
+ nil (empty response body)
458
467
 
459
468
  ### Authorization
460
469
 
@@ -462,8 +471,6 @@ Name | Type | Description | Notes
462
471
 
463
472
  ### HTTP request headers
464
473
 
465
- - **Content-Type**: Not defined
466
- - **Accept**: application/vnd.dyspatch.2019.10+json
467
-
468
-
474
+ - **Content-Type**: Not defined
475
+ - **Accept**: */*
469
476