dyspatch_client 2.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/README.md +50 -34
  4. data/Rakefile +2 -0
  5. data/docs/APIError.md +12 -1
  6. data/docs/CompiledRead.md +13 -0
  7. data/docs/Cursor.md +11 -1
  8. data/docs/DraftMetaRead.md +27 -0
  9. data/docs/DraftRead.md +31 -0
  10. data/docs/DraftsApi.md +476 -0
  11. data/docs/DraftsRead.md +19 -0
  12. data/docs/InlineObject.md +17 -0
  13. data/docs/LocalizationKeyRead.md +19 -0
  14. data/docs/LocalizationMetaRead.md +15 -1
  15. data/docs/LocalizationRead.md +19 -1
  16. data/docs/LocalizationsApi.md +16 -18
  17. data/docs/TemplateMetaRead.md +15 -0
  18. data/docs/TemplateRead.md +16 -0
  19. data/docs/TemplatesApi.md +39 -40
  20. data/docs/TemplatesRead.md +10 -0
  21. data/dyspatch_client.gemspec +10 -16
  22. data/lib/dyspatch_client.rb +10 -4
  23. data/lib/dyspatch_client/api/drafts_api.rb +620 -0
  24. data/lib/dyspatch_client/api/localizations_api.rb +52 -34
  25. data/lib/dyspatch_client/api/templates_api.rb +100 -69
  26. data/lib/dyspatch_client/api_client.rb +54 -55
  27. data/lib/dyspatch_client/api_error.rb +23 -4
  28. data/lib/dyspatch_client/configuration.rb +49 -10
  29. data/lib/dyspatch_client/models/api_error.rb +50 -30
  30. data/lib/dyspatch_client/models/compiled_read.rb +49 -78
  31. data/lib/dyspatch_client/models/cursor.rb +47 -28
  32. data/lib/dyspatch_client/models/draft_meta_read.rb +258 -0
  33. data/lib/dyspatch_client/models/draft_read.rb +279 -0
  34. data/lib/dyspatch_client/models/drafts_read.rb +219 -0
  35. data/lib/dyspatch_client/models/inline_object.rb +206 -0
  36. data/lib/dyspatch_client/models/localization_key_read.rb +216 -0
  37. data/lib/dyspatch_client/models/localization_meta_read.rb +70 -39
  38. data/lib/dyspatch_client/models/localization_read.rb +73 -42
  39. data/lib/dyspatch_client/models/template_meta_read.rb +52 -33
  40. data/lib/dyspatch_client/models/template_read.rb +53 -34
  41. data/lib/dyspatch_client/models/templates_read.rb +45 -26
  42. data/lib/dyspatch_client/version.rb +5 -5
  43. data/pkg/dyspatch_client-5.0.0.gem +0 -0
  44. data/pkg/dyspatch_client-5.0.1.gem +0 -0
  45. data/spec/api/drafts_api_spec.rb +146 -0
  46. data/spec/api/localizations_api_spec.rb +12 -12
  47. data/spec/api/templates_api_spec.rb +24 -24
  48. data/spec/api_client_spec.rb +39 -39
  49. data/spec/configuration_spec.rb +12 -12
  50. data/spec/integration_spec.rb +41 -0
  51. data/spec/models/api_error_spec.rb +12 -13
  52. data/spec/models/compiled_read_spec.rb +10 -11
  53. data/spec/models/cursor_spec.rb +7 -8
  54. data/spec/models/draft_meta_read_spec.rb +77 -0
  55. data/spec/models/draft_read_spec.rb +83 -0
  56. data/spec/models/drafts_read_spec.rb +47 -0
  57. data/spec/models/inline_object_spec.rb +41 -0
  58. data/spec/models/localization_key_read_spec.rb +47 -0
  59. data/spec/models/localization_meta_read_spec.rb +18 -13
  60. data/spec/models/localization_read_spec.rb +20 -15
  61. data/spec/models/template_meta_read_spec.rb +12 -13
  62. data/spec/models/template_read_spec.rb +13 -14
  63. data/spec/models/templates_read_spec.rb +7 -8
  64. data/spec/spec_helper.rb +4 -4
  65. metadata +34 -128
  66. data/git_push.sh +0 -55
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 186daaf94c5a9a3dff6c571280a8502175c39bb6f12714e0d8da88c949a4c6fa
4
- data.tar.gz: a5c5e4b3e944805de6d407c4fbabe41dacc40fb13348db01b6d1adde04316a79
3
+ metadata.gz: efc7d9ea4c7fcb547486a77d1f04877f8fbdd412501b3a7bea81fbc6a0d5b3c4
4
+ data.tar.gz: b7f721a5488733bd98ac18609e6d8f776d78b1278008f04536fbf65bb29c4f11
5
5
  SHA512:
6
- metadata.gz: 50f2c2ae41235ff6e3ff5fcd11a79e1daa75ee28469ac7cffe386c57df601eb0b1222db67908d73273d8dbf66fb0ae993bf0052c027ddf470b596bd99fa9f8ae
7
- data.tar.gz: 7671fa4aa1642199e9750c109a7045823cddc6755349dfff2d42044a234eb17020d3a56ea88dd854d99d42b8b9b548710e12aad29d860b42b1a413da0e320d7b
6
+ metadata.gz: 4bb84b56ba3e0250ff3a23401feba616e5d055e1dee3f581f6cf2fdfe771fb792739cafb1e3c5300b4b9b792d67a0e3a631b552b8b511249141566b840b9afa5
7
+ data.tar.gz: '08494dc1e12148ddf48ff7e30f090514c69da14665cebea973be5e788272661a53d96f0a29fb92398f5ca167a4924f5108767a781df5cef4c5856b4a2d06d9ad'
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 popular 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.03
20
- - Package version: 2.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.04
26
+ - Package version: 5.0.1
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-2.0.0.gem
43
+ gem install ./dyspatch_client-5.0.1.gem
38
44
  ```
39
- (for development, run `gem install --dev ./dyspatch_client-2.0.0.gem` to install the development dependencies)
45
+
46
+ (for development, run `gem install --dev ./dyspatch_client-5.0.1.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', '~> 2.0.0'
52
+ gem 'dyspatch_client', '~> 5.0.1'
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'
@@ -73,21 +81,16 @@ DyspatchClient.configure do |config|
73
81
  #config.api_key_prefix['Authorization'] = 'Bearer'
74
82
  end
75
83
 
76
- api_instance = DyspatchClient::LocalizationsApi.new
77
-
78
- localization_id = "localization_id_example" # String | A localization ID
79
-
80
- opts = {
81
- target_language: "target_language_example", # String | The type of templating language to compile as. Should only be used for visual templates.
82
- accept: "accept_example" # String | A version of the API that should be used for the request. For example, to use version "2019.03", set the value to "application/vnd.dyspatch.2019.03+json"
83
- }
84
+ api_instance = DyspatchClient::DraftsApi.new
85
+ draft_id = 'draft_id_example' # String | A draft ID
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
84
88
 
85
89
  begin
86
- #Get Localization Object by ID
87
- result = api_instance.localizations_localization_id_get(localization_id, opts)
88
- p result
90
+ #Remove a localization
91
+ api_instance.delete_localization(draft_id, language_id, accept)
89
92
  rescue DyspatchClient::ApiError => e
90
- puts "Exception when calling LocalizationsApi->localizations_localization_id_get: #{e}"
93
+ puts "Exception when calling DraftsApi->delete_localization: #{e}"
91
94
  end
92
95
 
93
96
  ```
@@ -98,9 +101,17 @@ All URIs are relative to *https://api.dyspatch.io*
98
101
 
99
102
  Class | Method | HTTP request | Description
100
103
  ------------ | ------------- | ------------- | -------------
101
- *DyspatchClient::LocalizationsApi* | [**localizations_localization_id_get**](docs/LocalizationsApi.md#localizations_localization_id_get) | **GET** /localizations/{localizationId} | Get Localization Object by ID
102
- *DyspatchClient::TemplatesApi* | [**templates_get**](docs/TemplatesApi.md#templates_get) | **GET** /templates | List Templates
103
- *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_localization_by_id**](docs/LocalizationsApi.md#get_localization_by_id) | **GET** /localizations/{localizationId} | Get Localization Object by ID
113
+ *DyspatchClient::TemplatesApi* | [**get_template_by_id**](docs/TemplatesApi.md#get_template_by_id) | **GET** /templates/{templateId} | Get Template by ID
114
+ *DyspatchClient::TemplatesApi* | [**get_templates**](docs/TemplatesApi.md#get_templates) | **GET** /templates | List Templates
104
115
 
105
116
 
106
117
  ## Documentation for Models
@@ -108,6 +119,11 @@ Class | Method | HTTP request | Description
108
119
  - [DyspatchClient::APIError](docs/APIError.md)
109
120
  - [DyspatchClient::CompiledRead](docs/CompiledRead.md)
110
121
  - [DyspatchClient::Cursor](docs/Cursor.md)
122
+ - [DyspatchClient::DraftMetaRead](docs/DraftMetaRead.md)
123
+ - [DyspatchClient::DraftRead](docs/DraftRead.md)
124
+ - [DyspatchClient::DraftsRead](docs/DraftsRead.md)
125
+ - [DyspatchClient::InlineObject](docs/InlineObject.md)
126
+ - [DyspatchClient::LocalizationKeyRead](docs/LocalizationKeyRead.md)
111
127
  - [DyspatchClient::LocalizationMetaRead](docs/LocalizationMetaRead.md)
112
128
  - [DyspatchClient::LocalizationRead](docs/LocalizationRead.md)
113
129
  - [DyspatchClient::TemplateMetaRead](docs/TemplateMetaRead.md)
@@ -120,7 +136,7 @@ Class | Method | HTTP request | Description
120
136
 
121
137
  ### Bearer
122
138
 
139
+
123
140
  - **Type**: API key
124
141
  - **API key parameter name**: Authorization
125
142
  - **Location**: HTTP header
126
-
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
9
  **parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional]
9
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
+ ```
20
+
10
21
 
@@ -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
 
@@ -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
 
@@ -0,0 +1,27 @@
1
+ # DyspatchClient::DraftMetaRead
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | An opaque, unique identifier for a draft | [optional]
8
+ **template_id** | **String** | An opaque, unique identifier for a template | [optional]
9
+ **name** | **String** | The name of a draft | [optional]
10
+ **url** | **String** | The API url for a specific draft | [optional]
11
+ **created_at** | **DateTime** | The time of initial creation | [optional]
12
+ **updated_at** | **DateTime** | The time of last update | [optional]
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
+
27
+
@@ -0,0 +1,31 @@
1
+ # DyspatchClient::DraftRead
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | An opaque, unique identifier for a draft | [optional]
8
+ **template** | **String** | An opaque, unique identifier for a template | [optional]
9
+ **name** | **String** | The name of a draft | [optional]
10
+ **url** | **String** | The API url for a specific draft | [optional]
11
+ **compiled** | [**CompiledRead**](CompiledRead.md) | | [optional]
12
+ **created_at** | **DateTime** | The time of initial creation | [optional]
13
+ **updated_at** | **DateTime** | The time of last update | [optional]
14
+ **localizations** | [**Array<LocalizationMetaRead>**](LocalizationMetaRead.md) | A list of the Template'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
+ ```
30
+
31
+
@@ -0,0 +1,476 @@
1
+ # DyspatchClient::DraftsApi
2
+
3
+ All URIs are relative to *https://api.dyspatch.io*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
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
+
16
+
17
+
18
+ ## delete_localization
19
+
20
+ > delete_localization(draft_id, language_id, accept)
21
+
22
+ Remove a localization
23
+
24
+ Deletes the localization with the given language ID if it exists
25
+
26
+ ### Example
27
+
28
+ ```ruby
29
+ # load the gem
30
+ require 'dyspatch_client'
31
+ # setup authorization
32
+ DyspatchClient.configure do |config|
33
+ # Configure API key authorization: Bearer
34
+ config.api_key['Authorization'] = 'YOUR API KEY'
35
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
36
+ #config.api_key_prefix['Authorization'] = 'Bearer'
37
+ end
38
+
39
+ api_instance = DyspatchClient::DraftsApi.new
40
+ draft_id = 'draft_id_example' # String | A draft ID
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
43
+
44
+ begin
45
+ #Remove a localization
46
+ api_instance.delete_localization(draft_id, language_id, accept)
47
+ rescue DyspatchClient::ApiError => e
48
+ puts "Exception when calling DraftsApi->delete_localization: #{e}"
49
+ end
50
+ ```
51
+
52
+ ### Parameters
53
+
54
+
55
+ Name | Type | Description | Notes
56
+ ------------- | ------------- | ------------- | -------------
57
+ **draft_id** | **String**| A draft ID |
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 \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\" |
60
+
61
+ ### Return type
62
+
63
+ nil (empty response body)
64
+
65
+ ### Authorization
66
+
67
+ [Bearer](../README.md#Bearer)
68
+
69
+ ### HTTP request headers
70
+
71
+ - **Content-Type**: Not defined
72
+ - **Accept**: Not defined
73
+
74
+
75
+ ## get_draft_by_id
76
+
77
+ > DraftRead get_draft_by_id(draft_id, target_language, accept)
78
+
79
+ Get Draft by ID
80
+
81
+ Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form.
82
+
83
+ ### Example
84
+
85
+ ```ruby
86
+ # load the gem
87
+ require 'dyspatch_client'
88
+ # setup authorization
89
+ DyspatchClient.configure do |config|
90
+ # Configure API key authorization: Bearer
91
+ config.api_key['Authorization'] = 'YOUR API KEY'
92
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
93
+ #config.api_key_prefix['Authorization'] = 'Bearer'
94
+ end
95
+
96
+ api_instance = DyspatchClient::DraftsApi.new
97
+ draft_id = 'draft_id_example' # String | A draft ID
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
100
+
101
+ begin
102
+ #Get Draft by ID
103
+ result = api_instance.get_draft_by_id(draft_id, target_language, accept)
104
+ p result
105
+ rescue DyspatchClient::ApiError => e
106
+ puts "Exception when calling DraftsApi->get_draft_by_id: #{e}"
107
+ end
108
+ ```
109
+
110
+ ### Parameters
111
+
112
+
113
+ Name | Type | Description | Notes
114
+ ------------- | ------------- | ------------- | -------------
115
+ **draft_id** | **String**| A draft ID |
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 \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\" |
118
+
119
+ ### Return type
120
+
121
+ [**DraftRead**](DraftRead.md)
122
+
123
+ ### Authorization
124
+
125
+ [Bearer](../README.md#Bearer)
126
+
127
+ ### HTTP request headers
128
+
129
+ - **Content-Type**: Not defined
130
+ - **Accept**: application/vnd.dyspatch.2020.04+json, */*
131
+
132
+
133
+ ## get_draft_localization_keys
134
+
135
+ > Array<LocalizationKeyRead> get_draft_localization_keys(draft_id, accept)
136
+
137
+ Get localization keys
138
+
139
+ Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2020.04+json` to get a JSON object, or `text/vnd.dyspatch.2020.04+x-gettext-translation` to get the POT file.
140
+
141
+ ### Example
142
+
143
+ ```ruby
144
+ # load the gem
145
+ require 'dyspatch_client'
146
+ # setup authorization
147
+ DyspatchClient.configure do |config|
148
+ # Configure API key authorization: Bearer
149
+ config.api_key['Authorization'] = 'YOUR API KEY'
150
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
151
+ #config.api_key_prefix['Authorization'] = 'Bearer'
152
+ end
153
+
154
+ api_instance = DyspatchClient::DraftsApi.new
155
+ draft_id = 'draft_id_example' # String | A draft ID
156
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
157
+
158
+ begin
159
+ #Get localization keys
160
+ result = api_instance.get_draft_localization_keys(draft_id, accept)
161
+ p result
162
+ rescue DyspatchClient::ApiError => e
163
+ puts "Exception when calling DraftsApi->get_draft_localization_keys: #{e}"
164
+ end
165
+ ```
166
+
167
+ ### Parameters
168
+
169
+
170
+ Name | Type | Description | Notes
171
+ ------------- | ------------- | ------------- | -------------
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 \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\" |
174
+
175
+ ### Return type
176
+
177
+ [**Array<LocalizationKeyRead>**](LocalizationKeyRead.md)
178
+
179
+ ### Authorization
180
+
181
+ [Bearer](../README.md#Bearer)
182
+
183
+ ### HTTP request headers
184
+
185
+ - **Content-Type**: Not defined
186
+ - **Accept**: application/vnd.dyspatch.2020.04+json, text/vnd.dyspatch.2020.04+x-gettext-translation
187
+
188
+
189
+ ## get_drafts
190
+
191
+ > DraftsRead get_drafts(accept, opts)
192
+
193
+ List Drafts
194
+
195
+ Returns all drafts for your organization.
196
+
197
+ ### Example
198
+
199
+ ```ruby
200
+ # load the gem
201
+ require 'dyspatch_client'
202
+ # setup authorization
203
+ DyspatchClient.configure do |config|
204
+ # Configure API key authorization: Bearer
205
+ config.api_key['Authorization'] = 'YOUR API KEY'
206
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
207
+ #config.api_key_prefix['Authorization'] = 'Bearer'
208
+ end
209
+
210
+ api_instance = DyspatchClient::DraftsApi.new
211
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
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
+ }
216
+
217
+ begin
218
+ #List Drafts
219
+ result = api_instance.get_drafts(accept, opts)
220
+ p result
221
+ rescue DyspatchClient::ApiError => e
222
+ puts "Exception when calling DraftsApi->get_drafts: #{e}"
223
+ end
224
+ ```
225
+
226
+ ### Parameters
227
+
228
+
229
+ Name | Type | Description | Notes
230
+ ------------- | ------------- | ------------- | -------------
231
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\" |
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]
234
+
235
+ ### Return type
236
+
237
+ [**DraftsRead**](DraftsRead.md)
238
+
239
+ ### Authorization
240
+
241
+ [Bearer](../README.md#Bearer)
242
+
243
+ ### HTTP request headers
244
+
245
+ - **Content-Type**: Not defined
246
+ - **Accept**: application/vnd.dyspatch.2020.04+json, */*
247
+
248
+
249
+ ## get_localization_for_draft
250
+
251
+ > Array<LocalizationMetaRead> get_localization_for_draft(draft_id, accept)
252
+
253
+ Get localizations on a draft
254
+
255
+ Returns localization metadata for the draft
256
+
257
+ ### Example
258
+
259
+ ```ruby
260
+ # load the gem
261
+ require 'dyspatch_client'
262
+ # setup authorization
263
+ DyspatchClient.configure do |config|
264
+ # Configure API key authorization: Bearer
265
+ config.api_key['Authorization'] = 'YOUR API KEY'
266
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
267
+ #config.api_key_prefix['Authorization'] = 'Bearer'
268
+ end
269
+
270
+ api_instance = DyspatchClient::DraftsApi.new
271
+ draft_id = 'draft_id_example' # String | A draft ID
272
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
273
+
274
+ begin
275
+ #Get localizations on a draft
276
+ result = api_instance.get_localization_for_draft(draft_id, accept)
277
+ p result
278
+ rescue DyspatchClient::ApiError => e
279
+ puts "Exception when calling DraftsApi->get_localization_for_draft: #{e}"
280
+ end
281
+ ```
282
+
283
+ ### Parameters
284
+
285
+
286
+ Name | Type | Description | Notes
287
+ ------------- | ------------- | ------------- | -------------
288
+ **draft_id** | **String**| A draft ID |
289
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\" |
290
+
291
+ ### Return type
292
+
293
+ [**Array<LocalizationMetaRead>**](LocalizationMetaRead.md)
294
+
295
+ ### Authorization
296
+
297
+ [Bearer](../README.md#Bearer)
298
+
299
+ ### HTTP request headers
300
+
301
+ - **Content-Type**: Not defined
302
+ - **Accept**: application/vnd.dyspatch.2020.04+json
303
+
304
+
305
+ ## save_localization
306
+
307
+ > save_localization(draft_id, language_id, accept, inline_object)
308
+
309
+ Create or update a localization
310
+
311
+ Inserts a localization or sets the name on an existing localization that already uses the languageId
312
+
313
+ ### Example
314
+
315
+ ```ruby
316
+ # load the gem
317
+ require 'dyspatch_client'
318
+ # setup authorization
319
+ DyspatchClient.configure do |config|
320
+ # Configure API key authorization: Bearer
321
+ config.api_key['Authorization'] = 'YOUR API KEY'
322
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
323
+ #config.api_key_prefix['Authorization'] = 'Bearer'
324
+ end
325
+
326
+ api_instance = DyspatchClient::DraftsApi.new
327
+ draft_id = 'draft_id_example' # String | A draft ID
328
+ language_id = 'language_id_example' # String | A language ID (eg: en-US)
329
+ accept = 'accept_example' # String | A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
330
+ inline_object = DyspatchClient::InlineObject.new # InlineObject |
331
+
332
+ begin
333
+ #Create or update a localization
334
+ api_instance.save_localization(draft_id, language_id, accept, inline_object)
335
+ rescue DyspatchClient::ApiError => e
336
+ puts "Exception when calling DraftsApi->save_localization: #{e}"
337
+ end
338
+ ```
339
+
340
+ ### Parameters
341
+
342
+
343
+ Name | Type | Description | Notes
344
+ ------------- | ------------- | ------------- | -------------
345
+ **draft_id** | **String**| A draft ID |
346
+ **language_id** | **String**| A language ID (eg: en-US) |
347
+ **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2020.04\", set the value to \"application/vnd.dyspatch.2020.04+json\" |
348
+ **inline_object** | [**InlineObject**](InlineObject.md)| |
349
+
350
+ ### Return type
351
+
352
+ nil (empty response body)
353
+
354
+ ### Authorization
355
+
356
+ [Bearer](../README.md#Bearer)
357
+
358
+ ### HTTP request headers
359
+
360
+ - **Content-Type**: application/json
361
+ - **Accept**: Not defined
362
+
363
+
364
+ ## set_translation
365
+
366
+ > set_translation(draft_id, language_id, accept, request_body)
367
+
368
+ Set translations for language
369
+
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`.
371
+
372
+ ### Example
373
+
374
+ ```ruby
375
+ # load the gem
376
+ require 'dyspatch_client'
377
+ # setup authorization
378
+ DyspatchClient.configure do |config|
379
+ # Configure API key authorization: Bearer
380
+ config.api_key['Authorization'] = 'YOUR API KEY'
381
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
382
+ #config.api_key_prefix['Authorization'] = 'Bearer'
383
+ end
384
+
385
+ api_instance = DyspatchClient::DraftsApi.new
386
+ draft_id = 'draft_id_example' # String | A draft ID
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
389
+ request_body = {'key' => 'request_body_example'} # Hash<String, String> |
390
+
391
+ begin
392
+ #Set translations for language
393
+ api_instance.set_translation(draft_id, language_id, accept, request_body)
394
+ rescue DyspatchClient::ApiError => e
395
+ puts "Exception when calling DraftsApi->set_translation: #{e}"
396
+ end
397
+ ```
398
+
399
+ ### Parameters
400
+
401
+
402
+ Name | Type | Description | Notes
403
+ ------------- | ------------- | ------------- | -------------
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.04\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.04+json\&quot; |
407
+ **request_body** | [**Hash&lt;String, String&gt;**](String.md)| |
408
+
409
+ ### Return type
410
+
411
+ nil (empty response body)
412
+
413
+ ### Authorization
414
+
415
+ [Bearer](../README.md#Bearer)
416
+
417
+ ### HTTP request headers
418
+
419
+ - **Content-Type**: application/json
420
+ - **Accept**: */*
421
+
422
+
423
+ ## submit_draft_for_approval
424
+
425
+ > submit_draft_for_approval(draft_id, accept)
426
+
427
+ Submit the draft for approval
428
+
429
+ Moves the draft into submitted state.
430
+
431
+ ### Example
432
+
433
+ ```ruby
434
+ # load the gem
435
+ require 'dyspatch_client'
436
+ # setup authorization
437
+ DyspatchClient.configure do |config|
438
+ # Configure API key authorization: Bearer
439
+ config.api_key['Authorization'] = 'YOUR API KEY'
440
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
441
+ #config.api_key_prefix['Authorization'] = 'Bearer'
442
+ end
443
+
444
+ api_instance = DyspatchClient::DraftsApi.new
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.04\", set the value to \"application/vnd.dyspatch.2020.04+json\"
447
+
448
+ begin
449
+ #Submit the draft for approval
450
+ api_instance.submit_draft_for_approval(draft_id, accept)
451
+ rescue DyspatchClient::ApiError => e
452
+ puts "Exception when calling DraftsApi->submit_draft_for_approval: #{e}"
453
+ end
454
+ ```
455
+
456
+ ### Parameters
457
+
458
+
459
+ Name | Type | Description | Notes
460
+ ------------- | ------------- | ------------- | -------------
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.04\&quot;, set the value to \&quot;application/vnd.dyspatch.2020.04+json\&quot; |
463
+
464
+ ### Return type
465
+
466
+ nil (empty response body)
467
+
468
+ ### Authorization
469
+
470
+ [Bearer](../README.md#Bearer)
471
+
472
+ ### HTTP request headers
473
+
474
+ - **Content-Type**: Not defined
475
+ - **Accept**: */*
476
+