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.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +35 -41
- data/Rakefile +2 -0
- data/docs/APIError.md +13 -2
- data/docs/CompiledRead.md +13 -0
- data/docs/Cursor.md +11 -1
- data/docs/DraftMetaRead.md +15 -0
- data/docs/DraftRead.md +17 -1
- data/docs/DraftsApi.md +140 -133
- data/docs/DraftsRead.md +11 -1
- data/docs/{Body.md → InlineObject.md} +10 -1
- data/docs/LocalizationKeyRead.md +10 -0
- data/docs/LocalizationMetaRead.md +14 -3
- data/docs/LocalizationRead.md +17 -1
- data/docs/LocalizationsApi.md +14 -13
- data/docs/TemplateMetaRead.md +16 -1
- data/docs/TemplateRead.md +17 -1
- data/docs/TemplatesApi.md +40 -36
- data/docs/TemplatesRead.md +11 -1
- data/dyspatch_client.gemspec +5 -11
- data/lib/dyspatch_client.rb +5 -19
- data/lib/dyspatch_client/api/drafts_api.rb +372 -236
- data/lib/dyspatch_client/api/localizations_api.rb +47 -30
- data/lib/dyspatch_client/api/templates_api.rb +98 -64
- data/lib/dyspatch_client/api_client.rb +40 -43
- data/lib/dyspatch_client/api_error.rb +23 -4
- data/lib/dyspatch_client/configuration.rb +48 -9
- data/lib/dyspatch_client/models/api_error.rb +46 -22
- data/lib/dyspatch_client/models/compiled_read.rb +45 -66
- data/lib/dyspatch_client/models/cursor.rb +43 -20
- data/lib/dyspatch_client/models/draft_meta_read.rb +49 -25
- data/lib/dyspatch_client/models/draft_read.rb +49 -25
- data/lib/dyspatch_client/models/drafts_read.rb +41 -17
- data/lib/dyspatch_client/models/{body.rb → inline_object.rb} +40 -17
- data/lib/dyspatch_client/models/localization_key_read.rb +41 -17
- data/lib/dyspatch_client/models/localization_meta_read.rb +53 -39
- data/lib/dyspatch_client/models/localization_read.rb +50 -26
- data/lib/dyspatch_client/models/template_meta_read.rb +48 -24
- data/lib/dyspatch_client/models/template_read.rb +49 -25
- data/lib/dyspatch_client/models/templates_read.rb +41 -17
- data/lib/dyspatch_client/version.rb +5 -5
- data/spec/api/drafts_api_spec.rb +61 -53
- data/spec/api/localizations_api_spec.rb +11 -10
- data/spec/api/templates_api_spec.rb +22 -20
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +12 -14
- data/spec/integration_spec.rb +41 -0
- data/spec/models/api_error_spec.rb +6 -6
- data/spec/models/compiled_read_spec.rb +5 -5
- data/spec/models/cursor_spec.rb +5 -5
- data/spec/models/draft_meta_read_spec.rb +5 -5
- data/spec/models/draft_read_spec.rb +5 -5
- data/spec/models/drafts_read_spec.rb +5 -5
- data/spec/models/inline_object_spec.rb +41 -0
- data/spec/models/localization_key_read_spec.rb +5 -5
- data/spec/models/localization_meta_read_spec.rb +6 -12
- data/spec/models/localization_read_spec.rb +5 -5
- data/spec/models/template_meta_read_spec.rb +5 -5
- data/spec/models/template_read_spec.rb +5 -5
- data/spec/models/templates_read_spec.rb +5 -5
- data/spec/spec_helper.rb +4 -4
- metadata +15 -190
- data/docs/CreatedAt.md +0 -7
- data/docs/DraftDescription.md +0 -7
- data/docs/DraftId.md +0 -7
- data/docs/DraftName.md +0 -7
- data/docs/DraftUrl.md +0 -7
- data/docs/LanguageId.md +0 -7
- data/docs/LocalizationId.md +0 -7
- data/docs/LocalizationName.md +0 -7
- data/docs/LocalizationUrl.md +0 -7
- data/docs/TemplateDescription.md +0 -7
- data/docs/TemplateId.md +0 -7
- data/docs/TemplateName.md +0 -7
- data/docs/TemplateUrl.md +0 -7
- data/docs/UpdatedAt.md +0 -7
- data/git_push.sh +0 -55
- data/lib/dyspatch_client/models/created_at.rb +0 -175
- data/lib/dyspatch_client/models/draft_description.rb +0 -175
- data/lib/dyspatch_client/models/draft_id.rb +0 -175
- data/lib/dyspatch_client/models/draft_name.rb +0 -175
- data/lib/dyspatch_client/models/draft_url.rb +0 -175
- data/lib/dyspatch_client/models/language_id.rb +0 -175
- data/lib/dyspatch_client/models/localization_id.rb +0 -175
- data/lib/dyspatch_client/models/localization_name.rb +0 -175
- data/lib/dyspatch_client/models/localization_url.rb +0 -175
- data/lib/dyspatch_client/models/template_description.rb +0 -175
- data/lib/dyspatch_client/models/template_id.rb +0 -175
- data/lib/dyspatch_client/models/template_name.rb +0 -175
- data/lib/dyspatch_client/models/template_url.rb +0 -175
- data/lib/dyspatch_client/models/updated_at.rb +0 -175
- data/spec/models/body_spec.rb +0 -41
- data/spec/models/created_at_spec.rb +0 -35
- data/spec/models/draft_description_spec.rb +0 -35
- data/spec/models/draft_id_spec.rb +0 -35
- data/spec/models/draft_name_spec.rb +0 -35
- data/spec/models/draft_url_spec.rb +0 -35
- data/spec/models/language_id_spec.rb +0 -35
- data/spec/models/localization_id_spec.rb +0 -35
- data/spec/models/localization_name_spec.rb +0 -35
- data/spec/models/localization_url_spec.rb +0 -35
- data/spec/models/template_description_spec.rb +0 -35
- data/spec/models/template_id_spec.rb +0 -35
- data/spec/models/template_name_spec.rb +0 -35
- data/spec/models/template_url_spec.rb +0 -35
- data/spec/models/updated_at_spec.rb +0 -35
data/lib/dyspatch_client.rb
CHANGED
@@ -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
|
4
|
+
## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -18,32 +18,18 @@ require 'dyspatch_client/configuration'
|
|
18
18
|
|
19
19
|
# Models
|
20
20
|
require 'dyspatch_client/models/api_error'
|
21
|
-
require 'dyspatch_client/models/body'
|
22
21
|
require 'dyspatch_client/models/compiled_read'
|
23
|
-
require 'dyspatch_client/models/created_at'
|
24
22
|
require 'dyspatch_client/models/cursor'
|
25
|
-
require 'dyspatch_client/models/draft_description'
|
26
|
-
require 'dyspatch_client/models/draft_id'
|
27
23
|
require 'dyspatch_client/models/draft_meta_read'
|
28
|
-
require 'dyspatch_client/models/draft_name'
|
29
24
|
require 'dyspatch_client/models/draft_read'
|
30
|
-
require 'dyspatch_client/models/draft_url'
|
31
25
|
require 'dyspatch_client/models/drafts_read'
|
32
|
-
require 'dyspatch_client/models/
|
33
|
-
require 'dyspatch_client/models/localization_id'
|
26
|
+
require 'dyspatch_client/models/inline_object'
|
34
27
|
require 'dyspatch_client/models/localization_key_read'
|
35
28
|
require 'dyspatch_client/models/localization_meta_read'
|
36
|
-
require 'dyspatch_client/models/localization_name'
|
37
29
|
require 'dyspatch_client/models/localization_read'
|
38
|
-
require 'dyspatch_client/models/localization_url'
|
39
|
-
require 'dyspatch_client/models/template_description'
|
40
|
-
require 'dyspatch_client/models/template_id'
|
41
30
|
require 'dyspatch_client/models/template_meta_read'
|
42
|
-
require 'dyspatch_client/models/template_name'
|
43
31
|
require 'dyspatch_client/models/template_read'
|
44
|
-
require 'dyspatch_client/models/template_url'
|
45
32
|
require 'dyspatch_client/models/templates_read'
|
46
|
-
require 'dyspatch_client/models/updated_at'
|
47
33
|
|
48
34
|
# APIs
|
49
35
|
require 'dyspatch_client/api/drafts_api'
|
@@ -1,16 +1,16 @@
|
|
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
|
4
|
+
## Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby)
|
5
5
|
|
6
|
-
OpenAPI
|
6
|
+
The version of the OpenAPI document: 2019.10
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module DyspatchClient
|
16
16
|
class DraftsApi
|
@@ -19,462 +19,598 @@ module DyspatchClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
#
|
24
|
-
# @param draft_id A draft ID
|
25
|
-
# @param
|
22
|
+
# Remove a localization
|
23
|
+
# Deletes the localization with the given language ID if it exists
|
24
|
+
# @param draft_id [String] A draft ID
|
25
|
+
# @param language_id [String] A language ID (eg: en-US)
|
26
|
+
# @param 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\"
|
26
27
|
# @param [Hash] opts the optional parameters
|
27
|
-
# @return [
|
28
|
-
def
|
29
|
-
|
30
|
-
|
28
|
+
# @return [nil]
|
29
|
+
def delete_localization(draft_id, language_id, accept, opts = {})
|
30
|
+
delete_localization_with_http_info(draft_id, language_id, accept, opts)
|
31
|
+
nil
|
31
32
|
end
|
32
33
|
|
33
|
-
#
|
34
|
-
#
|
35
|
-
# @param draft_id A draft ID
|
36
|
-
# @param
|
34
|
+
# Remove a localization
|
35
|
+
# Deletes the localization with the given language ID if it exists
|
36
|
+
# @param draft_id [String] A draft ID
|
37
|
+
# @param language_id [String] A language ID (eg: en-US)
|
38
|
+
# @param 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\"
|
37
39
|
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [Array<(
|
39
|
-
def
|
40
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
41
|
+
def delete_localization_with_http_info(draft_id, language_id, accept, opts = {})
|
40
42
|
if @api_client.config.debugging
|
41
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
43
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.delete_localization ...'
|
42
44
|
end
|
43
45
|
# verify the required parameter 'draft_id' is set
|
44
46
|
if @api_client.config.client_side_validation && draft_id.nil?
|
45
|
-
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.
|
47
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.delete_localization"
|
46
48
|
end
|
47
|
-
# verify the required parameter '
|
48
|
-
if @api_client.config.client_side_validation &&
|
49
|
-
fail ArgumentError, "Missing the required parameter '
|
49
|
+
# verify the required parameter 'language_id' is set
|
50
|
+
if @api_client.config.client_side_validation && language_id.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.delete_localization"
|
50
52
|
end
|
51
|
-
# verify
|
52
|
-
if @api_client.config.client_side_validation &&
|
53
|
-
fail ArgumentError, "
|
53
|
+
# verify the required parameter 'accept' is set
|
54
|
+
if @api_client.config.client_side_validation && accept.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.delete_localization"
|
54
56
|
end
|
55
57
|
# resource path
|
56
|
-
local_var_path = '/drafts/{draftId}'.sub('{' + 'draftId' + '}', draft_id.to_s)
|
58
|
+
local_var_path = '/drafts/{draftId}/localizations/{languageId}'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s)).sub('{' + 'languageId' + '}', CGI.escape(language_id.to_s))
|
57
59
|
|
58
60
|
# query parameters
|
59
|
-
query_params = {}
|
60
|
-
query_params[:'targetLanguage'] = target_language
|
61
|
+
query_params = opts[:query_params] || {}
|
61
62
|
|
62
63
|
# header parameters
|
63
|
-
header_params = {}
|
64
|
-
|
65
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
|
64
|
+
header_params = opts[:header_params] || {}
|
65
|
+
header_params[:'Accept'] = accept
|
66
66
|
|
67
67
|
# form parameters
|
68
|
-
form_params = {}
|
68
|
+
form_params = opts[:form_params] || {}
|
69
69
|
|
70
70
|
# http body (model)
|
71
|
-
post_body =
|
72
|
-
|
73
|
-
|
71
|
+
post_body = opts[:body]
|
72
|
+
|
73
|
+
# return_type
|
74
|
+
return_type = opts[:return_type]
|
75
|
+
|
76
|
+
# auth_names
|
77
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
78
|
+
|
79
|
+
new_options = opts.merge(
|
74
80
|
:header_params => header_params,
|
75
81
|
:query_params => query_params,
|
76
82
|
:form_params => form_params,
|
77
83
|
:body => post_body,
|
78
84
|
:auth_names => auth_names,
|
79
|
-
:return_type =>
|
85
|
+
:return_type => return_type
|
86
|
+
)
|
87
|
+
|
88
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
80
89
|
if @api_client.config.debugging
|
81
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
90
|
+
@api_client.config.logger.debug "API called: DraftsApi#delete_localization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
91
|
end
|
83
92
|
return data, status_code, headers
|
84
93
|
end
|
85
|
-
|
86
|
-
#
|
87
|
-
#
|
94
|
+
|
95
|
+
# Get Draft by ID
|
96
|
+
# Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form.
|
97
|
+
# @param draft_id [String] A draft ID
|
98
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
99
|
+
# @param 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\"
|
88
100
|
# @param [Hash] opts the optional parameters
|
89
|
-
# @
|
90
|
-
|
91
|
-
|
92
|
-
data, _status_code, _headers = drafts_draft_id_localization_keys_get_with_http_info(draft_id, opts)
|
101
|
+
# @return [DraftRead]
|
102
|
+
def get_draft_by_id(draft_id, target_language, accept, opts = {})
|
103
|
+
data, _status_code, _headers = get_draft_by_id_with_http_info(draft_id, target_language, accept, opts)
|
93
104
|
data
|
94
105
|
end
|
95
106
|
|
96
|
-
# Get
|
97
|
-
#
|
98
|
-
# @param draft_id A draft ID
|
107
|
+
# Get Draft by ID
|
108
|
+
# Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form.
|
109
|
+
# @param draft_id [String] A draft ID
|
110
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
111
|
+
# @param 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\"
|
99
112
|
# @param [Hash] opts the optional parameters
|
100
|
-
# @
|
101
|
-
|
102
|
-
def drafts_draft_id_localization_keys_get_with_http_info(draft_id, opts = {})
|
113
|
+
# @return [Array<(DraftRead, Integer, Hash)>] DraftRead data, response status code and response headers
|
114
|
+
def get_draft_by_id_with_http_info(draft_id, target_language, accept, opts = {})
|
103
115
|
if @api_client.config.debugging
|
104
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
116
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.get_draft_by_id ...'
|
105
117
|
end
|
106
118
|
# verify the required parameter 'draft_id' is set
|
107
119
|
if @api_client.config.client_side_validation && draft_id.nil?
|
108
|
-
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.
|
120
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.get_draft_by_id"
|
121
|
+
end
|
122
|
+
# verify the required parameter 'target_language' is set
|
123
|
+
if @api_client.config.client_side_validation && target_language.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'target_language' when calling DraftsApi.get_draft_by_id"
|
125
|
+
end
|
126
|
+
# verify enum value
|
127
|
+
allowable_values = ["html", "handlebars", "ampscript", "freemarker", "cheetah"]
|
128
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(target_language)
|
129
|
+
fail ArgumentError, "invalid value for \"target_language\", must be one of #{allowable_values}"
|
130
|
+
end
|
131
|
+
# verify the required parameter 'accept' is set
|
132
|
+
if @api_client.config.client_side_validation && accept.nil?
|
133
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.get_draft_by_id"
|
109
134
|
end
|
110
135
|
# resource path
|
111
|
-
local_var_path = '/drafts/{draftId}
|
136
|
+
local_var_path = '/drafts/{draftId}'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s))
|
112
137
|
|
113
138
|
# query parameters
|
114
|
-
query_params = {}
|
139
|
+
query_params = opts[:query_params] || {}
|
140
|
+
query_params[:'targetLanguage'] = target_language
|
115
141
|
|
116
142
|
# header parameters
|
117
|
-
header_params = {}
|
143
|
+
header_params = opts[:header_params] || {}
|
118
144
|
# HTTP header 'Accept' (if needed)
|
119
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json', '
|
120
|
-
header_params[:'Accept'] =
|
145
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json', '*/*'])
|
146
|
+
header_params[:'Accept'] = accept
|
121
147
|
|
122
148
|
# form parameters
|
123
|
-
form_params = {}
|
149
|
+
form_params = opts[:form_params] || {}
|
124
150
|
|
125
151
|
# http body (model)
|
126
|
-
post_body =
|
127
|
-
|
128
|
-
|
152
|
+
post_body = opts[:body]
|
153
|
+
|
154
|
+
# return_type
|
155
|
+
return_type = opts[:return_type] || 'DraftRead'
|
156
|
+
|
157
|
+
# auth_names
|
158
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
159
|
+
|
160
|
+
new_options = opts.merge(
|
129
161
|
:header_params => header_params,
|
130
162
|
:query_params => query_params,
|
131
163
|
:form_params => form_params,
|
132
164
|
:body => post_body,
|
133
165
|
:auth_names => auth_names,
|
134
|
-
:return_type =>
|
166
|
+
:return_type => return_type
|
167
|
+
)
|
168
|
+
|
169
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
135
170
|
if @api_client.config.debugging
|
136
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
171
|
+
@api_client.config.logger.debug "API called: DraftsApi#get_draft_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
137
172
|
end
|
138
173
|
return data, status_code, headers
|
139
174
|
end
|
140
|
-
|
141
|
-
#
|
142
|
-
#
|
175
|
+
|
176
|
+
# Get localization keys
|
177
|
+
# 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.
|
178
|
+
# @param draft_id [String] A draft ID
|
179
|
+
# @param 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\"
|
143
180
|
# @param [Hash] opts the optional parameters
|
144
|
-
# @return [Array<
|
145
|
-
def
|
146
|
-
data, _status_code, _headers =
|
181
|
+
# @return [Array<LocalizationKeyRead>]
|
182
|
+
def get_draft_localization_keys(draft_id, accept, opts = {})
|
183
|
+
data, _status_code, _headers = get_draft_localization_keys_with_http_info(draft_id, accept, opts)
|
147
184
|
data
|
148
185
|
end
|
149
186
|
|
150
|
-
# Get
|
151
|
-
# Returns
|
152
|
-
# @param draft_id A draft ID
|
187
|
+
# Get localization keys
|
188
|
+
# 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.
|
189
|
+
# @param draft_id [String] A draft ID
|
190
|
+
# @param 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\"
|
153
191
|
# @param [Hash] opts the optional parameters
|
154
|
-
# @return [Array<(Array<
|
155
|
-
def
|
192
|
+
# @return [Array<(Array<LocalizationKeyRead>, Integer, Hash)>] Array<LocalizationKeyRead> data, response status code and response headers
|
193
|
+
def get_draft_localization_keys_with_http_info(draft_id, accept, opts = {})
|
156
194
|
if @api_client.config.debugging
|
157
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
195
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.get_draft_localization_keys ...'
|
158
196
|
end
|
159
197
|
# verify the required parameter 'draft_id' is set
|
160
198
|
if @api_client.config.client_side_validation && draft_id.nil?
|
161
|
-
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.
|
199
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.get_draft_localization_keys"
|
200
|
+
end
|
201
|
+
# verify the required parameter 'accept' is set
|
202
|
+
if @api_client.config.client_side_validation && accept.nil?
|
203
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.get_draft_localization_keys"
|
162
204
|
end
|
163
205
|
# resource path
|
164
|
-
local_var_path = '/drafts/{draftId}/
|
206
|
+
local_var_path = '/drafts/{draftId}/localizationKeys'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s))
|
165
207
|
|
166
208
|
# query parameters
|
167
|
-
query_params = {}
|
209
|
+
query_params = opts[:query_params] || {}
|
168
210
|
|
169
211
|
# header parameters
|
170
|
-
header_params = {}
|
212
|
+
header_params = opts[:header_params] || {}
|
171
213
|
# HTTP header 'Accept' (if needed)
|
172
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
|
214
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json', 'text/vnd.dyspatch.2019.10+x-gettext-translation'])
|
215
|
+
header_params[:'Accept'] = accept
|
173
216
|
|
174
217
|
# form parameters
|
175
|
-
form_params = {}
|
218
|
+
form_params = opts[:form_params] || {}
|
176
219
|
|
177
220
|
# http body (model)
|
178
|
-
post_body =
|
179
|
-
|
180
|
-
|
221
|
+
post_body = opts[:body]
|
222
|
+
|
223
|
+
# return_type
|
224
|
+
return_type = opts[:return_type] || 'Array<LocalizationKeyRead>'
|
225
|
+
|
226
|
+
# auth_names
|
227
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
228
|
+
|
229
|
+
new_options = opts.merge(
|
181
230
|
:header_params => header_params,
|
182
231
|
:query_params => query_params,
|
183
232
|
:form_params => form_params,
|
184
233
|
:body => post_body,
|
185
234
|
:auth_names => auth_names,
|
186
|
-
:return_type =>
|
235
|
+
:return_type => return_type
|
236
|
+
)
|
237
|
+
|
238
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
187
239
|
if @api_client.config.debugging
|
188
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
240
|
+
@api_client.config.logger.debug "API called: DraftsApi#get_draft_localization_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
189
241
|
end
|
190
242
|
return data, status_code, headers
|
191
243
|
end
|
192
|
-
|
193
|
-
#
|
194
|
-
#
|
195
|
-
# @param
|
244
|
+
|
245
|
+
# List Drafts
|
246
|
+
# Returns all drafts for your organization.
|
247
|
+
# @param 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\"
|
196
248
|
# @param [Hash] opts the optional parameters
|
197
|
-
# @
|
198
|
-
|
199
|
-
|
200
|
-
|
249
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
250
|
+
# @option opts [String] :status Filter the list of drafts by a particular status
|
251
|
+
# @return [DraftsRead]
|
252
|
+
def get_drafts(accept, opts = {})
|
253
|
+
data, _status_code, _headers = get_drafts_with_http_info(accept, opts)
|
254
|
+
data
|
201
255
|
end
|
202
256
|
|
203
|
-
#
|
204
|
-
#
|
205
|
-
# @param
|
206
|
-
# @param language_id A language ID (eg: en-US)
|
257
|
+
# List Drafts
|
258
|
+
# Returns all drafts for your organization.
|
259
|
+
# @param 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\"
|
207
260
|
# @param [Hash] opts the optional parameters
|
208
|
-
# @
|
209
|
-
|
261
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
262
|
+
# @option opts [String] :status Filter the list of drafts by a particular status
|
263
|
+
# @return [Array<(DraftsRead, Integer, Hash)>] DraftsRead data, response status code and response headers
|
264
|
+
def get_drafts_with_http_info(accept, opts = {})
|
210
265
|
if @api_client.config.debugging
|
211
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
266
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.get_drafts ...'
|
212
267
|
end
|
213
|
-
# verify the required parameter '
|
214
|
-
if @api_client.config.client_side_validation &&
|
215
|
-
fail ArgumentError, "Missing the required parameter '
|
268
|
+
# verify the required parameter 'accept' is set
|
269
|
+
if @api_client.config.client_side_validation && accept.nil?
|
270
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.get_drafts"
|
216
271
|
end
|
217
|
-
|
218
|
-
if @api_client.config.client_side_validation &&
|
219
|
-
fail ArgumentError, "
|
272
|
+
allowable_values = ["awaitingTranslation"]
|
273
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
274
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
220
275
|
end
|
221
276
|
# resource path
|
222
|
-
local_var_path = '/drafts
|
277
|
+
local_var_path = '/drafts'
|
223
278
|
|
224
279
|
# query parameters
|
225
|
-
query_params = {}
|
280
|
+
query_params = opts[:query_params] || {}
|
281
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
282
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
226
283
|
|
227
284
|
# header parameters
|
228
|
-
header_params = {}
|
285
|
+
header_params = opts[:header_params] || {}
|
229
286
|
# HTTP header 'Accept' (if needed)
|
230
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
|
287
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json', '*/*'])
|
288
|
+
header_params[:'Accept'] = accept
|
231
289
|
|
232
290
|
# form parameters
|
233
|
-
form_params = {}
|
291
|
+
form_params = opts[:form_params] || {}
|
234
292
|
|
235
293
|
# http body (model)
|
236
|
-
post_body =
|
237
|
-
|
238
|
-
|
294
|
+
post_body = opts[:body]
|
295
|
+
|
296
|
+
# return_type
|
297
|
+
return_type = opts[:return_type] || 'DraftsRead'
|
298
|
+
|
299
|
+
# auth_names
|
300
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
301
|
+
|
302
|
+
new_options = opts.merge(
|
239
303
|
:header_params => header_params,
|
240
304
|
:query_params => query_params,
|
241
305
|
:form_params => form_params,
|
242
306
|
:body => post_body,
|
243
|
-
:auth_names => auth_names
|
307
|
+
:auth_names => auth_names,
|
308
|
+
:return_type => return_type
|
309
|
+
)
|
310
|
+
|
311
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
244
312
|
if @api_client.config.debugging
|
245
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
313
|
+
@api_client.config.logger.debug "API called: DraftsApi#get_drafts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
246
314
|
end
|
247
315
|
return data, status_code, headers
|
248
316
|
end
|
249
|
-
|
250
|
-
#
|
251
|
-
#
|
252
|
-
# @param
|
253
|
-
# @param
|
317
|
+
|
318
|
+
# Get localizations on a draft
|
319
|
+
# Returns localization metadata for the draft
|
320
|
+
# @param draft_id [String] A draft ID
|
321
|
+
# @param 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\"
|
254
322
|
# @param [Hash] opts the optional parameters
|
255
|
-
# @return [
|
256
|
-
def
|
257
|
-
|
258
|
-
|
323
|
+
# @return [Array<LocalizationMetaRead>]
|
324
|
+
def get_localization_for_draft(draft_id, accept, opts = {})
|
325
|
+
data, _status_code, _headers = get_localization_for_draft_with_http_info(draft_id, accept, opts)
|
326
|
+
data
|
259
327
|
end
|
260
328
|
|
261
|
-
#
|
262
|
-
#
|
263
|
-
# @param draft_id A draft ID
|
264
|
-
# @param
|
265
|
-
# @param body
|
329
|
+
# Get localizations on a draft
|
330
|
+
# Returns localization metadata for the draft
|
331
|
+
# @param draft_id [String] A draft ID
|
332
|
+
# @param 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\"
|
266
333
|
# @param [Hash] opts the optional parameters
|
267
|
-
# @return [Array<(
|
268
|
-
def
|
334
|
+
# @return [Array<(Array<LocalizationMetaRead>, Integer, Hash)>] Array<LocalizationMetaRead> data, response status code and response headers
|
335
|
+
def get_localization_for_draft_with_http_info(draft_id, accept, opts = {})
|
269
336
|
if @api_client.config.debugging
|
270
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
337
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.get_localization_for_draft ...'
|
271
338
|
end
|
272
339
|
# verify the required parameter 'draft_id' is set
|
273
340
|
if @api_client.config.client_side_validation && draft_id.nil?
|
274
|
-
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.
|
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"
|
341
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.get_localization_for_draft"
|
279
342
|
end
|
280
|
-
# verify the required parameter '
|
281
|
-
if @api_client.config.client_side_validation &&
|
282
|
-
fail ArgumentError, "Missing the required parameter '
|
343
|
+
# verify the required parameter 'accept' is set
|
344
|
+
if @api_client.config.client_side_validation && accept.nil?
|
345
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.get_localization_for_draft"
|
283
346
|
end
|
284
347
|
# resource path
|
285
|
-
local_var_path = '/drafts/{draftId}/localizations
|
348
|
+
local_var_path = '/drafts/{draftId}/localizations'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s))
|
286
349
|
|
287
350
|
# query parameters
|
288
|
-
query_params = {}
|
351
|
+
query_params = opts[:query_params] || {}
|
289
352
|
|
290
353
|
# header parameters
|
291
|
-
header_params = {}
|
354
|
+
header_params = opts[:header_params] || {}
|
292
355
|
# HTTP header 'Accept' (if needed)
|
293
356
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2019.10+json'])
|
357
|
+
header_params[:'Accept'] = accept
|
294
358
|
|
295
359
|
# form parameters
|
296
|
-
form_params = {}
|
360
|
+
form_params = opts[:form_params] || {}
|
297
361
|
|
298
362
|
# http body (model)
|
299
|
-
post_body =
|
300
|
-
|
301
|
-
|
363
|
+
post_body = opts[:body]
|
364
|
+
|
365
|
+
# return_type
|
366
|
+
return_type = opts[:return_type] || 'Array<LocalizationMetaRead>'
|
367
|
+
|
368
|
+
# auth_names
|
369
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
370
|
+
|
371
|
+
new_options = opts.merge(
|
302
372
|
:header_params => header_params,
|
303
373
|
:query_params => query_params,
|
304
374
|
:form_params => form_params,
|
305
375
|
:body => post_body,
|
306
|
-
:auth_names => auth_names
|
376
|
+
:auth_names => auth_names,
|
377
|
+
:return_type => return_type
|
378
|
+
)
|
379
|
+
|
380
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
307
381
|
if @api_client.config.debugging
|
308
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
382
|
+
@api_client.config.logger.debug "API called: DraftsApi#get_localization_for_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
309
383
|
end
|
310
384
|
return data, status_code, headers
|
311
385
|
end
|
312
|
-
|
313
|
-
#
|
314
|
-
#
|
315
|
-
# @param
|
316
|
-
# @param
|
386
|
+
|
387
|
+
# Create or update a localization
|
388
|
+
# Inserts a localization or sets the name on an existing localization that already uses the languageId
|
389
|
+
# @param draft_id [String] A draft ID
|
390
|
+
# @param language_id [String] A language ID (eg: en-US)
|
391
|
+
# @param 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\"
|
392
|
+
# @param inline_object [InlineObject]
|
317
393
|
# @param [Hash] opts the optional parameters
|
318
394
|
# @return [nil]
|
319
|
-
def
|
320
|
-
|
395
|
+
def save_localization(draft_id, language_id, accept, inline_object, opts = {})
|
396
|
+
save_localization_with_http_info(draft_id, language_id, accept, inline_object, opts)
|
321
397
|
nil
|
322
398
|
end
|
323
399
|
|
324
|
-
#
|
325
|
-
#
|
326
|
-
# @param draft_id A draft ID
|
327
|
-
# @param language_id A language ID (eg: en-US)
|
328
|
-
# @param
|
400
|
+
# Create or update a localization
|
401
|
+
# Inserts a localization or sets the name on an existing localization that already uses the languageId
|
402
|
+
# @param draft_id [String] A draft ID
|
403
|
+
# @param language_id [String] A language ID (eg: en-US)
|
404
|
+
# @param 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\"
|
405
|
+
# @param inline_object [InlineObject]
|
329
406
|
# @param [Hash] opts the optional parameters
|
330
|
-
# @return [Array<(nil,
|
331
|
-
def
|
407
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
408
|
+
def save_localization_with_http_info(draft_id, language_id, accept, inline_object, opts = {})
|
332
409
|
if @api_client.config.debugging
|
333
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
410
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.save_localization ...'
|
334
411
|
end
|
335
412
|
# verify the required parameter 'draft_id' is set
|
336
413
|
if @api_client.config.client_side_validation && draft_id.nil?
|
337
|
-
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.
|
414
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.save_localization"
|
338
415
|
end
|
339
416
|
# verify the required parameter 'language_id' is set
|
340
417
|
if @api_client.config.client_side_validation && language_id.nil?
|
341
|
-
fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.
|
418
|
+
fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.save_localization"
|
419
|
+
end
|
420
|
+
# verify the required parameter 'accept' is set
|
421
|
+
if @api_client.config.client_side_validation && accept.nil?
|
422
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.save_localization"
|
342
423
|
end
|
343
|
-
# verify the required parameter '
|
344
|
-
if @api_client.config.client_side_validation &&
|
345
|
-
fail ArgumentError, "Missing the required parameter '
|
424
|
+
# verify the required parameter 'inline_object' is set
|
425
|
+
if @api_client.config.client_side_validation && inline_object.nil?
|
426
|
+
fail ArgumentError, "Missing the required parameter 'inline_object' when calling DraftsApi.save_localization"
|
346
427
|
end
|
347
428
|
# resource path
|
348
|
-
local_var_path = '/drafts/{draftId}/localizations/{languageId}
|
429
|
+
local_var_path = '/drafts/{draftId}/localizations/{languageId}'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s)).sub('{' + 'languageId' + '}', CGI.escape(language_id.to_s))
|
349
430
|
|
350
431
|
# query parameters
|
351
|
-
query_params = {}
|
432
|
+
query_params = opts[:query_params] || {}
|
352
433
|
|
353
434
|
# header parameters
|
354
|
-
header_params = {}
|
355
|
-
# HTTP header '
|
356
|
-
header_params['
|
435
|
+
header_params = opts[:header_params] || {}
|
436
|
+
# HTTP header 'Content-Type'
|
437
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
438
|
+
header_params[:'Accept'] = accept
|
357
439
|
|
358
440
|
# form parameters
|
359
|
-
form_params = {}
|
441
|
+
form_params = opts[:form_params] || {}
|
360
442
|
|
361
443
|
# http body (model)
|
362
|
-
post_body = @api_client.object_to_http_body(
|
363
|
-
|
364
|
-
|
444
|
+
post_body = opts[:body] || @api_client.object_to_http_body(inline_object)
|
445
|
+
|
446
|
+
# return_type
|
447
|
+
return_type = opts[:return_type]
|
448
|
+
|
449
|
+
# auth_names
|
450
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
451
|
+
|
452
|
+
new_options = opts.merge(
|
365
453
|
:header_params => header_params,
|
366
454
|
:query_params => query_params,
|
367
455
|
:form_params => form_params,
|
368
456
|
:body => post_body,
|
369
|
-
:auth_names => auth_names
|
457
|
+
:auth_names => auth_names,
|
458
|
+
:return_type => return_type
|
459
|
+
)
|
460
|
+
|
461
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
370
462
|
if @api_client.config.debugging
|
371
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
463
|
+
@api_client.config.logger.debug "API called: DraftsApi#save_localization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
372
464
|
end
|
373
465
|
return data, status_code, headers
|
374
466
|
end
|
375
|
-
|
376
|
-
#
|
377
|
-
#
|
467
|
+
|
468
|
+
# Set translations for language
|
469
|
+
# 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`.
|
470
|
+
# @param draft_id [String] A draft ID
|
471
|
+
# @param language_id [String] A language ID (eg: en-US)
|
472
|
+
# @param 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\"
|
473
|
+
# @param request_body [Hash<String, String>]
|
378
474
|
# @param [Hash] opts the optional parameters
|
379
475
|
# @return [nil]
|
380
|
-
def
|
381
|
-
|
476
|
+
def set_translation(draft_id, language_id, accept, request_body, opts = {})
|
477
|
+
set_translation_with_http_info(draft_id, language_id, accept, request_body, opts)
|
382
478
|
nil
|
383
479
|
end
|
384
480
|
|
385
|
-
#
|
386
|
-
#
|
387
|
-
# @param draft_id A draft ID
|
481
|
+
# Set translations for language
|
482
|
+
# 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`.
|
483
|
+
# @param draft_id [String] A draft ID
|
484
|
+
# @param language_id [String] A language ID (eg: en-US)
|
485
|
+
# @param 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\"
|
486
|
+
# @param request_body [Hash<String, String>]
|
388
487
|
# @param [Hash] opts the optional parameters
|
389
|
-
# @return [Array<(nil,
|
390
|
-
def
|
488
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
489
|
+
def set_translation_with_http_info(draft_id, language_id, accept, request_body, opts = {})
|
391
490
|
if @api_client.config.debugging
|
392
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
491
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.set_translation ...'
|
393
492
|
end
|
394
493
|
# verify the required parameter 'draft_id' is set
|
395
494
|
if @api_client.config.client_side_validation && draft_id.nil?
|
396
|
-
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.
|
495
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.set_translation"
|
496
|
+
end
|
497
|
+
# verify the required parameter 'language_id' is set
|
498
|
+
if @api_client.config.client_side_validation && language_id.nil?
|
499
|
+
fail ArgumentError, "Missing the required parameter 'language_id' when calling DraftsApi.set_translation"
|
500
|
+
end
|
501
|
+
# verify the required parameter 'accept' is set
|
502
|
+
if @api_client.config.client_side_validation && accept.nil?
|
503
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.set_translation"
|
504
|
+
end
|
505
|
+
# verify the required parameter 'request_body' is set
|
506
|
+
if @api_client.config.client_side_validation && request_body.nil?
|
507
|
+
fail ArgumentError, "Missing the required parameter 'request_body' when calling DraftsApi.set_translation"
|
397
508
|
end
|
398
509
|
# resource path
|
399
|
-
local_var_path = '/drafts/{draftId}/
|
510
|
+
local_var_path = '/drafts/{draftId}/localizations/{languageId}/translations'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s)).sub('{' + 'languageId' + '}', CGI.escape(language_id.to_s))
|
400
511
|
|
401
512
|
# query parameters
|
402
|
-
query_params = {}
|
513
|
+
query_params = opts[:query_params] || {}
|
403
514
|
|
404
515
|
# header parameters
|
405
|
-
header_params = {}
|
406
|
-
# HTTP header '
|
407
|
-
header_params['
|
516
|
+
header_params = opts[:header_params] || {}
|
517
|
+
# HTTP header 'Content-Type'
|
518
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
519
|
+
header_params[:'Accept'] = accept
|
408
520
|
|
409
521
|
# form parameters
|
410
|
-
form_params = {}
|
522
|
+
form_params = opts[:form_params] || {}
|
411
523
|
|
412
524
|
# http body (model)
|
413
|
-
post_body =
|
414
|
-
|
415
|
-
|
525
|
+
post_body = opts[:body] || @api_client.object_to_http_body(request_body)
|
526
|
+
|
527
|
+
# return_type
|
528
|
+
return_type = opts[:return_type]
|
529
|
+
|
530
|
+
# auth_names
|
531
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
532
|
+
|
533
|
+
new_options = opts.merge(
|
416
534
|
:header_params => header_params,
|
417
535
|
:query_params => query_params,
|
418
536
|
:form_params => form_params,
|
419
537
|
:body => post_body,
|
420
|
-
:auth_names => auth_names
|
538
|
+
:auth_names => auth_names,
|
539
|
+
:return_type => return_type
|
540
|
+
)
|
541
|
+
|
542
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
421
543
|
if @api_client.config.debugging
|
422
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
544
|
+
@api_client.config.logger.debug "API called: DraftsApi#set_translation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
423
545
|
end
|
424
546
|
return data, status_code, headers
|
425
547
|
end
|
426
|
-
|
427
|
-
#
|
548
|
+
|
549
|
+
# Submit the draft for approval
|
550
|
+
# Moves the draft into submitted state.
|
551
|
+
# @param draft_id [String] A draft ID
|
552
|
+
# @param 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\"
|
428
553
|
# @param [Hash] opts the optional parameters
|
429
|
-
# @
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
data, _status_code, _headers = drafts_get_with_http_info(opts)
|
434
|
-
data
|
554
|
+
# @return [nil]
|
555
|
+
def submit_draft_for_approval(draft_id, accept, opts = {})
|
556
|
+
submit_draft_for_approval_with_http_info(draft_id, accept, opts)
|
557
|
+
nil
|
435
558
|
end
|
436
559
|
|
437
|
-
#
|
438
|
-
#
|
560
|
+
# Submit the draft for approval
|
561
|
+
# Moves the draft into submitted state.
|
562
|
+
# @param draft_id [String] A draft ID
|
563
|
+
# @param 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\"
|
439
564
|
# @param [Hash] opts the optional parameters
|
440
|
-
# @
|
441
|
-
|
442
|
-
# @return [Array<(DraftsRead, Fixnum, Hash)>] DraftsRead data, response status code and response headers
|
443
|
-
def drafts_get_with_http_info(opts = {})
|
565
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
566
|
+
def submit_draft_for_approval_with_http_info(draft_id, accept, opts = {})
|
444
567
|
if @api_client.config.debugging
|
445
|
-
@api_client.config.logger.debug 'Calling API: DraftsApi.
|
568
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.submit_draft_for_approval ...'
|
569
|
+
end
|
570
|
+
# verify the required parameter 'draft_id' is set
|
571
|
+
if @api_client.config.client_side_validation && draft_id.nil?
|
572
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling DraftsApi.submit_draft_for_approval"
|
446
573
|
end
|
447
|
-
|
448
|
-
|
574
|
+
# verify the required parameter 'accept' is set
|
575
|
+
if @api_client.config.client_side_validation && accept.nil?
|
576
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling DraftsApi.submit_draft_for_approval"
|
449
577
|
end
|
450
578
|
# resource path
|
451
|
-
local_var_path = '/drafts'
|
579
|
+
local_var_path = '/drafts/{draftId}/publishRequest'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s))
|
452
580
|
|
453
581
|
# query parameters
|
454
|
-
query_params = {}
|
455
|
-
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
456
|
-
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
582
|
+
query_params = opts[:query_params] || {}
|
457
583
|
|
458
584
|
# header parameters
|
459
|
-
header_params = {}
|
585
|
+
header_params = opts[:header_params] || {}
|
460
586
|
# HTTP header 'Accept' (if needed)
|
461
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
587
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
588
|
+
header_params[:'Accept'] = accept
|
462
589
|
|
463
590
|
# form parameters
|
464
|
-
form_params = {}
|
591
|
+
form_params = opts[:form_params] || {}
|
465
592
|
|
466
593
|
# http body (model)
|
467
|
-
post_body =
|
468
|
-
|
469
|
-
|
594
|
+
post_body = opts[:body]
|
595
|
+
|
596
|
+
# return_type
|
597
|
+
return_type = opts[:return_type]
|
598
|
+
|
599
|
+
# auth_names
|
600
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
601
|
+
|
602
|
+
new_options = opts.merge(
|
470
603
|
:header_params => header_params,
|
471
604
|
:query_params => query_params,
|
472
605
|
:form_params => form_params,
|
473
606
|
:body => post_body,
|
474
607
|
:auth_names => auth_names,
|
475
|
-
:return_type =>
|
608
|
+
:return_type => return_type
|
609
|
+
)
|
610
|
+
|
611
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
476
612
|
if @api_client.config.debugging
|
477
|
-
@api_client.config.logger.debug "API called: DraftsApi#
|
613
|
+
@api_client.config.logger.debug "API called: DraftsApi#submit_draft_for_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
478
614
|
end
|
479
615
|
return data, status_code, headers
|
480
616
|
end
|