dyspatch_client 2.0.0 → 3.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 (102) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +42 -16
  3. data/docs/APIError.md +1 -1
  4. data/docs/Body.md +8 -0
  5. data/docs/Body1.md +8 -0
  6. data/docs/CreatedAt.md +7 -0
  7. data/docs/DraftDescription.md +7 -0
  8. data/docs/DraftId.md +7 -0
  9. data/docs/DraftMetaRead.md +14 -0
  10. data/docs/DraftName.md +7 -0
  11. data/docs/DraftRead.md +15 -0
  12. data/docs/DraftUrl.md +7 -0
  13. data/docs/DraftsApi.md +467 -0
  14. data/docs/DraftsRead.md +9 -0
  15. data/docs/LanguageId.md +7 -0
  16. data/docs/LocalizationId.md +7 -0
  17. data/docs/LocalizationKeyRead.md +9 -0
  18. data/docs/LocalizationMetaRead.md +1 -0
  19. data/docs/LocalizationName.md +7 -0
  20. data/docs/LocalizationUrl.md +7 -0
  21. data/docs/LocalizationsApi.md +8 -11
  22. data/docs/TemplateDescription.md +7 -0
  23. data/docs/TemplateId.md +7 -0
  24. data/docs/TemplateMetaRead.md +1 -1
  25. data/docs/TemplateName.md +7 -0
  26. data/docs/TemplateRead.md +1 -1
  27. data/docs/TemplateUrl.md +7 -0
  28. data/docs/TemplatesApi.md +9 -14
  29. data/docs/TemplatesRead.md +1 -1
  30. data/docs/UpdatedAt.md +7 -0
  31. data/dyspatch_client.gemspec +8 -8
  32. data/lib/dyspatch_client.rb +24 -3
  33. data/lib/dyspatch_client/api/drafts_api.rb +479 -0
  34. data/lib/dyspatch_client/api/localizations_api.rb +23 -22
  35. data/lib/dyspatch_client/api/templates_api.rb +25 -28
  36. data/lib/dyspatch_client/api_client.rb +11 -11
  37. data/lib/dyspatch_client/api_error.rb +3 -3
  38. data/lib/dyspatch_client/configuration.rb +4 -4
  39. data/lib/dyspatch_client/models/api_error.rb +11 -15
  40. data/lib/dyspatch_client/models/body.rb +183 -0
  41. data/lib/dyspatch_client/models/body_1.rb +183 -0
  42. data/lib/dyspatch_client/models/compiled_read.rb +14 -22
  43. data/lib/dyspatch_client/models/created_at.rb +175 -0
  44. data/lib/dyspatch_client/models/cursor.rb +8 -12
  45. data/lib/dyspatch_client/models/draft_description.rb +175 -0
  46. data/lib/dyspatch_client/models/draft_id.rb +175 -0
  47. data/lib/dyspatch_client/models/draft_meta_read.rb +244 -0
  48. data/lib/dyspatch_client/models/draft_name.rb +175 -0
  49. data/lib/dyspatch_client/models/draft_read.rb +255 -0
  50. data/lib/dyspatch_client/models/draft_url.rb +175 -0
  51. data/lib/dyspatch_client/models/drafts_read.rb +196 -0
  52. data/lib/dyspatch_client/models/language_id.rb +175 -0
  53. data/lib/dyspatch_client/models/localization_id.rb +175 -0
  54. data/lib/dyspatch_client/models/localization_key_read.rb +192 -0
  55. data/lib/dyspatch_client/models/localization_meta_read.rb +20 -15
  56. data/lib/dyspatch_client/models/localization_name.rb +175 -0
  57. data/lib/dyspatch_client/models/localization_read.rb +8 -13
  58. data/lib/dyspatch_client/models/localization_url.rb +175 -0
  59. data/lib/dyspatch_client/models/template_description.rb +175 -0
  60. data/lib/dyspatch_client/models/template_id.rb +175 -0
  61. data/lib/dyspatch_client/models/template_meta_read.rb +8 -13
  62. data/lib/dyspatch_client/models/template_name.rb +175 -0
  63. data/lib/dyspatch_client/models/template_read.rb +8 -13
  64. data/lib/dyspatch_client/models/template_url.rb +175 -0
  65. data/lib/dyspatch_client/models/templates_read.rb +8 -13
  66. data/lib/dyspatch_client/models/updated_at.rb +175 -0
  67. data/lib/dyspatch_client/version.rb +4 -4
  68. data/spec/api/drafts_api_spec.rb +138 -0
  69. data/spec/api/localizations_api_spec.rb +6 -7
  70. data/spec/api/templates_api_spec.rb +6 -8
  71. data/spec/api_client_spec.rb +37 -37
  72. data/spec/configuration_spec.rb +11 -11
  73. data/spec/models/api_error_spec.rb +10 -11
  74. data/spec/models/body_1_spec.rb +41 -0
  75. data/spec/models/body_spec.rb +41 -0
  76. data/spec/models/compiled_read_spec.rb +8 -9
  77. data/spec/models/created_at_spec.rb +35 -0
  78. data/spec/models/cursor_spec.rb +5 -6
  79. data/spec/models/draft_description_spec.rb +35 -0
  80. data/spec/models/draft_id_spec.rb +35 -0
  81. data/spec/models/draft_meta_read_spec.rb +77 -0
  82. data/spec/models/draft_name_spec.rb +35 -0
  83. data/spec/models/draft_read_spec.rb +83 -0
  84. data/spec/models/draft_url_spec.rb +35 -0
  85. data/spec/models/drafts_read_spec.rb +47 -0
  86. data/spec/models/language_id_spec.rb +35 -0
  87. data/spec/models/localization_id_spec.rb +35 -0
  88. data/spec/models/localization_key_read_spec.rb +47 -0
  89. data/spec/models/localization_meta_read_spec.rb +13 -8
  90. data/spec/models/localization_name_spec.rb +35 -0
  91. data/spec/models/localization_read_spec.rb +11 -12
  92. data/spec/models/localization_url_spec.rb +35 -0
  93. data/spec/models/template_description_spec.rb +35 -0
  94. data/spec/models/template_id_spec.rb +35 -0
  95. data/spec/models/template_meta_read_spec.rb +10 -11
  96. data/spec/models/template_name_spec.rb +35 -0
  97. data/spec/models/template_read_spec.rb +11 -12
  98. data/spec/models/template_url_spec.rb +35 -0
  99. data/spec/models/templates_read_spec.rb +5 -6
  100. data/spec/models/updated_at_spec.rb +35 -0
  101. data/spec/spec_helper.rb +3 -3
  102. metadata +106 -22
@@ -0,0 +1,9 @@
1
+ # DyspatchClient::DraftsRead
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **cursor** | **Object** | Information about paginated results | [optional]
7
+ **data** | [**Array<DraftMetaRead>**](DraftMetaRead.md) | A list of draft metadata objects | [optional]
8
+
9
+
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::LanguageId
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::LocalizationId
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,9 @@
1
+ # DyspatchClient::LocalizationKeyRead
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **key** | **String** | | [optional]
7
+ **comment** | **String** | | [optional]
8
+
9
+
@@ -7,5 +7,6 @@ Name | Type | Description | Notes
7
7
  **language** | **String** | A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). | [optional]
8
8
  **name** | **String** | The user-specified name of a localization | [optional]
9
9
  **url** | **String** | The API url for a specific localization | [optional]
10
+ **draft** | **String** | An opaque, unique identifier for a draft | [optional]
10
11
 
11
12
 
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::LocalizationName
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::LocalizationUrl
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -8,11 +8,11 @@ Method | HTTP request | Description
8
8
 
9
9
 
10
10
  # **localizations_localization_id_get**
11
- > LocalizationRead localizations_localization_id_get(localization_id, opts)
11
+ > LocalizationRead localizations_localization_id_get(localization_id, target_language)
12
12
 
13
13
  Get Localization Object by ID
14
14
 
15
- Returns a specific localization object with a matching ID
15
+ Returns a specific localization object with a matching ID.
16
16
 
17
17
  ### Example
18
18
  ```ruby
@@ -28,16 +28,14 @@ end
28
28
 
29
29
  api_instance = DyspatchClient::LocalizationsApi.new
30
30
 
31
- localization_id = "localization_id_example" # String | A localization ID
31
+ localization_id = 'localization_id_example' # String | A localization ID
32
+
33
+ target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
32
34
 
33
- opts = {
34
- target_language: "target_language_example", # String | The type of templating language to compile as. Should only be used for visual templates.
35
- 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"
36
- }
37
35
 
38
36
  begin
39
37
  #Get Localization Object by ID
40
- result = api_instance.localizations_localization_id_get(localization_id, opts)
38
+ result = api_instance.localizations_localization_id_get(localization_id, target_language)
41
39
  p result
42
40
  rescue DyspatchClient::ApiError => e
43
41
  puts "Exception when calling LocalizationsApi->localizations_localization_id_get: #{e}"
@@ -49,8 +47,7 @@ end
49
47
  Name | Type | Description | Notes
50
48
  ------------- | ------------- | ------------- | -------------
51
49
  **localization_id** | **String**| A localization ID |
52
- **target_language** | **String**| The type of templating language to compile as. Should only be used for visual templates. | [optional]
53
- **accept** | **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" | [optional]
50
+ **target_language** | **String**| The type of templating language to compile as. Should only be used for visual templates. |
54
51
 
55
52
  ### Return type
56
53
 
@@ -63,7 +60,7 @@ Name | Type | Description | Notes
63
60
  ### HTTP request headers
64
61
 
65
62
  - **Content-Type**: Not defined
66
- - **Accept**: application/vnd.dyspatch.2019.03+json
63
+ - **Accept**: application/vnd.dyspatch.2019.10+json
67
64
 
68
65
 
69
66
 
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::TemplateDescription
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::TemplateId
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
7
7
  **name** | **String** | The name of a template | [optional]
8
8
  **description** | **String** | A description of the template | [optional]
9
9
  **url** | **String** | The API url for a specific template | [optional]
10
- **localizations** | [**Array&lt;LocalizationMetaRead&gt;**](LocalizationMetaRead.md) | A list of the template&#39;s available localization objects | [optional]
10
+ **localizations** | [**Array<LocalizationMetaRead>**](LocalizationMetaRead.md) | A list of the template's available localization objects | [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
 
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::TemplateName
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -10,6 +10,6 @@ Name | Type | Description | Notes
10
10
  **compiled** | [**CompiledRead**](CompiledRead.md) | | [optional]
11
11
  **created_at** | **DateTime** | The time of initial creation | [optional]
12
12
  **updated_at** | **DateTime** | The time of last update | [optional]
13
- **localizations** | [**Array&lt;LocalizationMetaRead&gt;**](LocalizationMetaRead.md) | A list of the Template&#39;s available localizations | [optional]
13
+ **localizations** | [**Array<LocalizationMetaRead>**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional]
14
14
 
15
15
 
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::TemplateUrl
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -30,8 +30,7 @@ end
30
30
  api_instance = DyspatchClient::TemplatesApi.new
31
31
 
32
32
  opts = {
33
- cursor: "cursor_example", # String | A cursor value used to retrieve a specific page from a paginated result set.
34
- 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"
33
+ cursor: 'cursor_example' # String | A cursor value used to retrieve a specific page from a paginated result set.
35
34
  }
36
35
 
37
36
  begin
@@ -48,7 +47,6 @@ end
48
47
  Name | Type | Description | Notes
49
48
  ------------- | ------------- | ------------- | -------------
50
49
  **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional]
51
- **accept** | **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" | [optional]
52
50
 
53
51
  ### Return type
54
52
 
@@ -61,12 +59,12 @@ Name | Type | Description | Notes
61
59
  ### HTTP request headers
62
60
 
63
61
  - **Content-Type**: Not defined
64
- - **Accept**: application/vnd.dyspatch.2019.03+json
62
+ - **Accept**: application/vnd.dyspatch.2019.10+json
65
63
 
66
64
 
67
65
 
68
66
  # **templates_template_id_get**
69
- > TemplateRead templates_template_id_get(template_id, opts)
67
+ > TemplateRead templates_template_id_get(template_id, target_language)
70
68
 
71
69
  Get Template by ID
72
70
 
@@ -86,16 +84,14 @@ end
86
84
 
87
85
  api_instance = DyspatchClient::TemplatesApi.new
88
86
 
89
- template_id = "template_id_example" # String | A template ID
87
+ template_id = 'template_id_example' # String | A template ID
88
+
89
+ target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
90
90
 
91
- opts = {
92
- target_language: "target_language_example", # String | The type of templating language to compile as. Should only be used for visual templates.
93
- 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"
94
- }
95
91
 
96
92
  begin
97
93
  #Get Template by ID
98
- result = api_instance.templates_template_id_get(template_id, opts)
94
+ result = api_instance.templates_template_id_get(template_id, target_language)
99
95
  p result
100
96
  rescue DyspatchClient::ApiError => e
101
97
  puts "Exception when calling TemplatesApi->templates_template_id_get: #{e}"
@@ -107,8 +103,7 @@ end
107
103
  Name | Type | Description | Notes
108
104
  ------------- | ------------- | ------------- | -------------
109
105
  **template_id** | **String**| A template ID |
110
- **target_language** | **String**| The type of templating language to compile as. Should only be used for visual templates. | [optional]
111
- **accept** | **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" | [optional]
106
+ **target_language** | **String**| The type of templating language to compile as. Should only be used for visual templates. |
112
107
 
113
108
  ### Return type
114
109
 
@@ -121,7 +116,7 @@ Name | Type | Description | Notes
121
116
  ### HTTP request headers
122
117
 
123
118
  - **Content-Type**: Not defined
124
- - **Accept**: application/vnd.dyspatch.2019.03+json
119
+ - **Accept**: application/vnd.dyspatch.2019.10+json
125
120
 
126
121
 
127
122
 
@@ -4,6 +4,6 @@
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **cursor** | [**Cursor**](Cursor.md) | | [optional]
7
- **data** | [**Array&lt;TemplateMetaRead&gt;**](TemplateMetaRead.md) | A list of template metadata objects | [optional]
7
+ **data** | [**Array<TemplateMetaRead>**](TemplateMetaRead.md) | A list of template metadata objects | [optional]
8
8
 
9
9
 
@@ -0,0 +1,7 @@
1
+ # DyspatchClient::UpdatedAt
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- #
2
+
3
3
  =begin
4
4
  #Dyspatch API
5
5
 
6
- ## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
6
+ ## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks: - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
7
7
 
8
- OpenAPI spec version: 2019.03
8
+ OpenAPI spec version: 2019.10
9
9
  Contact: support@dyspatch.io
10
10
  Generated by: https://github.com/swagger-api/swagger-codegen.git
11
- Swagger Codegen version: 2.3.1
11
+ Swagger Codegen version: 2.4.9
12
12
 
13
13
  =end
14
14
 
@@ -22,9 +22,9 @@ Gem::Specification.new do |s|
22
22
  s.authors = ["Dyspatch"]
23
23
  s.email = ["support@dyspatch.io"]
24
24
  s.homepage = "https://www.dyspatch.io"
25
- s.summary = "Dyspatch is an email production platform that helps teams create and change transactional and triggered emails faster. See https://www.dyspatch.io for more information."
26
- s.description = "# Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) "
27
- s.license = "Apache-2.0"
25
+ s.summary = "Dyspatch is an email production platform that helps teams create and change emails faster. See https://www.dyspatch.io for more information."
26
+ s.description = "# Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks: - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) "
27
+ s.license = 'Apache-2.0'
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
30
30
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
39
39
  s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
40
40
 
41
- s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? }
41
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
42
42
  s.test_files = `find spec/*`.split("\n")
43
43
  s.executables = []
44
44
  s.require_paths = ["lib"]
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Dyspatch API
3
3
 
4
- ## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
4
+ ## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks: - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
5
5
 
6
- OpenAPI spec version: 2019.03
6
+ OpenAPI spec version: 2019.10
7
7
  Contact: support@dyspatch.io
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.9
10
10
 
11
11
  =end
12
12
 
@@ -18,15 +18,36 @@ require 'dyspatch_client/configuration'
18
18
 
19
19
  # Models
20
20
  require 'dyspatch_client/models/api_error'
21
+ require 'dyspatch_client/models/body'
22
+ require 'dyspatch_client/models/body_1'
21
23
  require 'dyspatch_client/models/compiled_read'
24
+ require 'dyspatch_client/models/created_at'
22
25
  require 'dyspatch_client/models/cursor'
26
+ require 'dyspatch_client/models/draft_description'
27
+ require 'dyspatch_client/models/draft_id'
28
+ require 'dyspatch_client/models/draft_meta_read'
29
+ require 'dyspatch_client/models/draft_name'
30
+ require 'dyspatch_client/models/draft_read'
31
+ require 'dyspatch_client/models/draft_url'
32
+ require 'dyspatch_client/models/drafts_read'
33
+ require 'dyspatch_client/models/language_id'
34
+ require 'dyspatch_client/models/localization_id'
35
+ require 'dyspatch_client/models/localization_key_read'
23
36
  require 'dyspatch_client/models/localization_meta_read'
37
+ require 'dyspatch_client/models/localization_name'
24
38
  require 'dyspatch_client/models/localization_read'
39
+ require 'dyspatch_client/models/localization_url'
40
+ require 'dyspatch_client/models/template_description'
41
+ require 'dyspatch_client/models/template_id'
25
42
  require 'dyspatch_client/models/template_meta_read'
43
+ require 'dyspatch_client/models/template_name'
26
44
  require 'dyspatch_client/models/template_read'
45
+ require 'dyspatch_client/models/template_url'
27
46
  require 'dyspatch_client/models/templates_read'
47
+ require 'dyspatch_client/models/updated_at'
28
48
 
29
49
  # APIs
50
+ require 'dyspatch_client/api/drafts_api'
30
51
  require 'dyspatch_client/api/localizations_api'
31
52
  require 'dyspatch_client/api/templates_api'
32
53
 
@@ -0,0 +1,479 @@
1
+ =begin
2
+ #Dyspatch API
3
+
4
+ ## Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for the following languages and web frameworks: - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
5
+
6
+ OpenAPI spec version: 2019.10
7
+ Contact: support@dyspatch.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.9
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module DyspatchClient
16
+ class DraftsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Draft by ID
23
+ # Gets a draft object with the matching ID. The "compiled" field will contain the unlocalized default template object.
24
+ # @param draft_id A draft ID
25
+ # @param target_language The type of templating language to compile as. Should only be used for visual templates.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [DraftRead]
28
+ def drafts_draft_id_get(draft_id, target_language, opts = {})
29
+ data, _status_code, _headers = drafts_draft_id_get_with_http_info(draft_id, target_language, opts)
30
+ data
31
+ end
32
+
33
+ # Get Draft by ID
34
+ # Gets a draft object with the matching ID. The "compiled" field will contain the unlocalized default template object.
35
+ # @param draft_id A draft ID
36
+ # @param target_language The type of templating language to compile as. Should only be used for visual templates.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(DraftRead, Fixnum, Hash)>] DraftRead data, response status code and response headers
39
+ def drafts_draft_id_get_with_http_info(draft_id, target_language, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_get ...'
42
+ end
43
+ # verify the required parameter 'draft_id' is set
44
+ if @api_client.config.client_side_validation && draft_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_get"
46
+ end
47
+ # verify the required parameter 'target_language' is set
48
+ if @api_client.config.client_side_validation && target_language.nil?
49
+ fail ArgumentError, "Missing the required parameter 'target_language' when calling DraftsApi.drafts_draft_id_get"
50
+ end
51
+ # verify enum value
52
+ if @api_client.config.client_side_validation && !['html', 'jinja', 'handlebars', 'ampscript', 'freemarker', 'cheetah'].include?(target_language)
53
+ fail ArgumentError, "invalid value for 'target_language', must be one of html, jinja, handlebars, ampscript, freemarker, cheetah"
54
+ end
55
+ # resource path
56
+ local_var_path = '/drafts/{draftId}'.sub('{' + 'draftId' + '}', draft_id.to_s)
57
+
58
+ # query parameters
59
+ query_params = {}
60
+ query_params[:'targetLanguage'] = target_language
61
+
62
+ # header parameters
63
+ header_params = {}
64
+ # HTTP header 'Accept' (if needed)
65
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
66
+
67
+ # form parameters
68
+ form_params = {}
69
+
70
+ # http body (model)
71
+ post_body = nil
72
+ auth_names = ['Bearer']
73
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => 'DraftRead')
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+ # Get Localization Keys
86
+ # 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.
87
+ # @param draft_id A draft ID
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [String] :accept A version of the API that should be used for the request. For example, to use version "2019.10", set the value to "application/vnd.dyspatch.2019.10+json".
90
+ # @return [Array<LocalizationKeyRead>]
91
+ def drafts_draft_id_localization_keys_get(draft_id, opts = {})
92
+ data, _status_code, _headers = drafts_draft_id_localization_keys_get_with_http_info(draft_id, opts)
93
+ data
94
+ end
95
+
96
+ # Get Localization Keys
97
+ # 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.
98
+ # @param draft_id A draft ID
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [String] :accept A version of the API that should be used for the request. For example, to use version "2019.10", set the value to "application/vnd.dyspatch.2019.10+json".
101
+ # @return [Array<(Array<LocalizationKeyRead>, Fixnum, Hash)>] Array<LocalizationKeyRead> data, response status code and response headers
102
+ def drafts_draft_id_localization_keys_get_with_http_info(draft_id, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_localization_keys_get ...'
105
+ end
106
+ # verify the required parameter 'draft_id' is set
107
+ if @api_client.config.client_side_validation && draft_id.nil?
108
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_localization_keys_get"
109
+ end
110
+ # resource path
111
+ local_var_path = '/drafts/{draftId}/localizationKeys'.sub('{' + 'draftId' + '}', draft_id.to_s)
112
+
113
+ # query parameters
114
+ query_params = {}
115
+
116
+ # header parameters
117
+ header_params = {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json', 'text/vnd.dyspatch.2019.10+x-gettext-translation'])
120
+ header_params[:'Accept'] = opts[:'accept'] if !opts[:'accept'].nil?
121
+
122
+ # form parameters
123
+ form_params = {}
124
+
125
+ # http body (model)
126
+ post_body = nil
127
+ auth_names = ['Bearer']
128
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
129
+ :header_params => header_params,
130
+ :query_params => query_params,
131
+ :form_params => form_params,
132
+ :body => post_body,
133
+ :auth_names => auth_names,
134
+ :return_type => 'Array<LocalizationKeyRead>')
135
+ if @api_client.config.debugging
136
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_localization_keys_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
137
+ end
138
+ return data, status_code, headers
139
+ end
140
+ # Get Localizations on a Draft
141
+ # Returns localization metadata object for a template draft.
142
+ # @param draft_id A draft ID
143
+ # @param [Hash] opts the optional parameters
144
+ # @return [Array<LocalizationMetaRead>]
145
+ def drafts_draft_id_localizations_get(draft_id, opts = {})
146
+ data, _status_code, _headers = drafts_draft_id_localizations_get_with_http_info(draft_id, opts)
147
+ data
148
+ end
149
+
150
+ # Get Localizations on a Draft
151
+ # Returns localization metadata object for a template draft.
152
+ # @param draft_id A draft ID
153
+ # @param [Hash] opts the optional parameters
154
+ # @return [Array<(Array<LocalizationMetaRead>, Fixnum, Hash)>] Array<LocalizationMetaRead> data, response status code and response headers
155
+ def drafts_draft_id_localizations_get_with_http_info(draft_id, opts = {})
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_localizations_get ...'
158
+ end
159
+ # verify the required parameter 'draft_id' is set
160
+ if @api_client.config.client_side_validation && draft_id.nil?
161
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_localizations_get"
162
+ end
163
+ # resource path
164
+ local_var_path = '/drafts/{draftId}/localizations'.sub('{' + 'draftId' + '}', draft_id.to_s)
165
+
166
+ # query parameters
167
+ query_params = {}
168
+
169
+ # header parameters
170
+ header_params = {}
171
+ # HTTP header 'Accept' (if needed)
172
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
173
+
174
+ # form parameters
175
+ form_params = {}
176
+
177
+ # http body (model)
178
+ post_body = nil
179
+ auth_names = ['Bearer']
180
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => 'Array<LocalizationMetaRead>')
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_localizations_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+ # Remove a Localization
193
+ # Deletes the localization with the given `languageId` if it exists.
194
+ # @param draft_id A draft ID
195
+ # @param language_id A language ID (eg: en-US)
196
+ # @param [Hash] opts the optional parameters
197
+ # @return [nil]
198
+ def drafts_draft_id_localizations_language_id_delete(draft_id, language_id, opts = {})
199
+ drafts_draft_id_localizations_language_id_delete_with_http_info(draft_id, language_id, opts)
200
+ nil
201
+ end
202
+
203
+ # Remove a Localization
204
+ # Deletes the localization with the given `languageId` if it exists.
205
+ # @param draft_id A draft ID
206
+ # @param language_id A language ID (eg: en-US)
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
209
+ def drafts_draft_id_localizations_language_id_delete_with_http_info(draft_id, language_id, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_localizations_language_id_delete ...'
212
+ end
213
+ # verify the required parameter 'draft_id' is set
214
+ if @api_client.config.client_side_validation && draft_id.nil?
215
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_localizations_language_id_delete"
216
+ end
217
+ # verify the required parameter 'language_id' is set
218
+ if @api_client.config.client_side_validation && language_id.nil?
219
+ fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.drafts_draft_id_localizations_language_id_delete"
220
+ end
221
+ # resource path
222
+ local_var_path = '/drafts/{draftId}/localizations/{languageId}'.sub('{' + 'draftId' + '}', draft_id.to_s).sub('{' + 'languageId' + '}', language_id.to_s)
223
+
224
+ # query parameters
225
+ query_params = {}
226
+
227
+ # header parameters
228
+ header_params = {}
229
+ # HTTP header 'Accept' (if needed)
230
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
231
+
232
+ # form parameters
233
+ form_params = {}
234
+
235
+ # http body (model)
236
+ post_body = nil
237
+ auth_names = ['Bearer']
238
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
239
+ :header_params => header_params,
240
+ :query_params => query_params,
241
+ :form_params => form_params,
242
+ :body => post_body,
243
+ :auth_names => auth_names)
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_localizations_language_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+ return data, status_code, headers
248
+ end
249
+ # Create or Update a Localization
250
+ # Inserts a localization or sets the name on an existing localization that already uses the `languageId`.
251
+ # @param draft_id A draft ID
252
+ # @param language_id A language ID (eg: en-US)
253
+ # @param body
254
+ # @param [Hash] opts the optional parameters
255
+ # @return [nil]
256
+ def drafts_draft_id_localizations_language_id_put(draft_id, language_id, body, opts = {})
257
+ drafts_draft_id_localizations_language_id_put_with_http_info(draft_id, language_id, body, opts)
258
+ nil
259
+ end
260
+
261
+ # Create or Update a Localization
262
+ # Inserts a localization or sets the name on an existing localization that already uses the `languageId`.
263
+ # @param draft_id A draft ID
264
+ # @param language_id A language ID (eg: en-US)
265
+ # @param body
266
+ # @param [Hash] opts the optional parameters
267
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
268
+ def drafts_draft_id_localizations_language_id_put_with_http_info(draft_id, language_id, body, opts = {})
269
+ if @api_client.config.debugging
270
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_localizations_language_id_put ...'
271
+ end
272
+ # verify the required parameter 'draft_id' is set
273
+ if @api_client.config.client_side_validation && draft_id.nil?
274
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_localizations_language_id_put"
275
+ end
276
+ # verify the required parameter 'language_id' is set
277
+ if @api_client.config.client_side_validation && language_id.nil?
278
+ fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.drafts_draft_id_localizations_language_id_put"
279
+ end
280
+ # verify the required parameter 'body' is set
281
+ if @api_client.config.client_side_validation && body.nil?
282
+ fail ArgumentError, "Missing the required parameter 'body' when calling DraftsApi.drafts_draft_id_localizations_language_id_put"
283
+ end
284
+ # resource path
285
+ local_var_path = '/drafts/{draftId}/localizations/{languageId}'.sub('{' + 'draftId' + '}', draft_id.to_s).sub('{' + 'languageId' + '}', language_id.to_s)
286
+
287
+ # query parameters
288
+ query_params = {}
289
+
290
+ # header parameters
291
+ header_params = {}
292
+ # HTTP header 'Accept' (if needed)
293
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
294
+
295
+ # form parameters
296
+ form_params = {}
297
+
298
+ # http body (model)
299
+ post_body = @api_client.object_to_http_body(body)
300
+ auth_names = ['Bearer']
301
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
302
+ :header_params => header_params,
303
+ :query_params => query_params,
304
+ :form_params => form_params,
305
+ :body => post_body,
306
+ :auth_names => auth_names)
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_localizations_language_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
309
+ end
310
+ return data, status_code, headers
311
+ end
312
+ # Set Translations for Language
313
+ # 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`.
314
+ # @param draft_id A draft ID
315
+ # @param language_id A language ID (eg: en-US)
316
+ # @param body
317
+ # @param [Hash] opts the optional parameters
318
+ # @return [nil]
319
+ def drafts_draft_id_localizations_language_id_translations_put(draft_id, language_id, body, opts = {})
320
+ drafts_draft_id_localizations_language_id_translations_put_with_http_info(draft_id, language_id, body, opts)
321
+ nil
322
+ end
323
+
324
+ # Set Translations for Language
325
+ # 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`.
326
+ # @param draft_id A draft ID
327
+ # @param language_id A language ID (eg: en-US)
328
+ # @param body
329
+ # @param [Hash] opts the optional parameters
330
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
331
+ def drafts_draft_id_localizations_language_id_translations_put_with_http_info(draft_id, language_id, body, opts = {})
332
+ if @api_client.config.debugging
333
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_localizations_language_id_translations_put ...'
334
+ end
335
+ # verify the required parameter 'draft_id' is set
336
+ if @api_client.config.client_side_validation && draft_id.nil?
337
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_localizations_language_id_translations_put"
338
+ end
339
+ # verify the required parameter 'language_id' is set
340
+ if @api_client.config.client_side_validation && language_id.nil?
341
+ fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.drafts_draft_id_localizations_language_id_translations_put"
342
+ end
343
+ # verify the required parameter 'body' is set
344
+ if @api_client.config.client_side_validation && body.nil?
345
+ fail ArgumentError, "Missing the required parameter 'body' when calling DraftsApi.drafts_draft_id_localizations_language_id_translations_put"
346
+ end
347
+ # resource path
348
+ local_var_path = '/drafts/{draftId}/localizations/{languageId}/translations'.sub('{' + 'draftId' + '}', draft_id.to_s).sub('{' + 'languageId' + '}', language_id.to_s)
349
+
350
+ # query parameters
351
+ query_params = {}
352
+
353
+ # header parameters
354
+ header_params = {}
355
+ # HTTP header 'Accept' (if needed)
356
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
357
+
358
+ # form parameters
359
+ form_params = {}
360
+
361
+ # http body (model)
362
+ post_body = @api_client.object_to_http_body(body)
363
+ auth_names = ['Bearer']
364
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
365
+ :header_params => header_params,
366
+ :query_params => query_params,
367
+ :form_params => form_params,
368
+ :body => post_body,
369
+ :auth_names => auth_names)
370
+ if @api_client.config.debugging
371
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_localizations_language_id_translations_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
372
+ end
373
+ return data, status_code, headers
374
+ end
375
+ # Submit the Draft for Approval
376
+ # 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.
377
+ # @param draft_id A draft ID
378
+ # @param [Hash] opts the optional parameters
379
+ # @return [nil]
380
+ def drafts_draft_id_publish_request_post(draft_id, opts = {})
381
+ drafts_draft_id_publish_request_post_with_http_info(draft_id, opts)
382
+ nil
383
+ end
384
+
385
+ # Submit the Draft for Approval
386
+ # 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.
387
+ # @param draft_id A draft ID
388
+ # @param [Hash] opts the optional parameters
389
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
390
+ def drafts_draft_id_publish_request_post_with_http_info(draft_id, opts = {})
391
+ if @api_client.config.debugging
392
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_draft_id_publish_request_post ...'
393
+ end
394
+ # verify the required parameter 'draft_id' is set
395
+ if @api_client.config.client_side_validation && draft_id.nil?
396
+ fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.drafts_draft_id_publish_request_post"
397
+ end
398
+ # resource path
399
+ local_var_path = '/drafts/{draftId}/publishRequest'.sub('{' + 'draftId' + '}', draft_id.to_s)
400
+
401
+ # query parameters
402
+ query_params = {}
403
+
404
+ # header parameters
405
+ header_params = {}
406
+ # HTTP header 'Accept' (if needed)
407
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
408
+
409
+ # form parameters
410
+ form_params = {}
411
+
412
+ # http body (model)
413
+ post_body = nil
414
+ auth_names = ['Bearer']
415
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
416
+ :header_params => header_params,
417
+ :query_params => query_params,
418
+ :form_params => form_params,
419
+ :body => post_body,
420
+ :auth_names => auth_names)
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_draft_id_publish_request_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
423
+ end
424
+ return data, status_code, headers
425
+ end
426
+ # List Drafts
427
+ # Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated.
428
+ # @param [Hash] opts the optional parameters
429
+ # @option opts [String] :status Filter the list of drafts by a particular status
430
+ # @return [DraftsRead]
431
+ def drafts_get(opts = {})
432
+ data, _status_code, _headers = drafts_get_with_http_info(opts)
433
+ data
434
+ end
435
+
436
+ # List Drafts
437
+ # Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated.
438
+ # @param [Hash] opts the optional parameters
439
+ # @option opts [String] :status Filter the list of drafts by a particular status
440
+ # @return [Array<(DraftsRead, Fixnum, Hash)>] DraftsRead data, response status code and response headers
441
+ def drafts_get_with_http_info(opts = {})
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug 'Calling API: DraftsApi.drafts_get ...'
444
+ end
445
+ if @api_client.config.client_side_validation && opts[:'status'] && !['awaitingTranslation'].include?(opts[:'status'])
446
+ fail ArgumentError, 'invalid value for "status", must be one of awaitingTranslation'
447
+ end
448
+ # resource path
449
+ local_var_path = '/drafts'
450
+
451
+ # query parameters
452
+ query_params = {}
453
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
454
+
455
+ # header parameters
456
+ header_params = {}
457
+ # HTTP header 'Accept' (if needed)
458
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
459
+
460
+ # form parameters
461
+ form_params = {}
462
+
463
+ # http body (model)
464
+ post_body = nil
465
+ auth_names = ['Bearer']
466
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
467
+ :header_params => header_params,
468
+ :query_params => query_params,
469
+ :form_params => form_params,
470
+ :body => post_body,
471
+ :auth_names => auth_names,
472
+ :return_type => 'DraftsRead')
473
+ if @api_client.config.debugging
474
+ @api_client.config.logger.debug "API called: DraftsApi#drafts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
475
+ end
476
+ return data, status_code, headers
477
+ end
478
+ end
479
+ end