dyspatch_client 3.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/README.md +45 -53
- data/Rakefile +2 -0
- data/docs/APIError.md +13 -2
- data/docs/CompiledRead.md +15 -0
- data/docs/Cursor.md +11 -1
- data/docs/DraftMetaRead.md +14 -1
- data/docs/DraftRead.md +17 -1
- data/docs/DraftsApi.md +140 -131
- data/docs/DraftsRead.md +12 -2
- data/docs/{Body.md → InlineObject.md} +10 -1
- data/docs/LocalizationKeyRead.md +10 -0
- data/docs/LocalizationMetaRead.md +15 -2
- data/docs/LocalizationRead.md +19 -1
- data/docs/LocalizationsApi.md +75 -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 -20
- data/lib/dyspatch_client/api/drafts_api.rb +375 -234
- data/lib/dyspatch_client/api/localizations_api.rb +135 -31
- data/lib/dyspatch_client/api/templates_api.rb +99 -65
- data/lib/dyspatch_client/api_client.rb +46 -47
- 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 +56 -67
- data/lib/dyspatch_client/models/cursor.rb +43 -20
- data/lib/dyspatch_client/models/draft_meta_read.rb +49 -35
- data/lib/dyspatch_client/models/draft_read.rb +49 -25
- data/lib/dyspatch_client/models/drafts_read.rb +42 -19
- 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 +62 -36
- data/lib/dyspatch_client/models/localization_read.rb +71 -35
- 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 +26 -10
- data/spec/api/templates_api_spec.rb +22 -20
- data/spec/api_client_spec.rb +5 -5
- data/spec/configuration_spec.rb +4 -4
- data/spec/spec_helper.rb +4 -4
- metadata +11 -219
- data/LICENSE +0 -202
- data/docs/Body1.md +0 -8
- 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/body_1.rb +0 -183
- 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/api_error_spec.rb +0 -57
- data/spec/models/body_1_spec.rb +0 -41
- data/spec/models/body_spec.rb +0 -41
- data/spec/models/compiled_read_spec.rb +0 -65
- data/spec/models/created_at_spec.rb +0 -35
- data/spec/models/cursor_spec.rb +0 -47
- data/spec/models/draft_description_spec.rb +0 -35
- data/spec/models/draft_id_spec.rb +0 -35
- data/spec/models/draft_meta_read_spec.rb +0 -77
- data/spec/models/draft_name_spec.rb +0 -35
- data/spec/models/draft_read_spec.rb +0 -83
- data/spec/models/draft_url_spec.rb +0 -35
- data/spec/models/drafts_read_spec.rb +0 -47
- data/spec/models/language_id_spec.rb +0 -35
- data/spec/models/localization_id_spec.rb +0 -35
- data/spec/models/localization_key_read_spec.rb +0 -47
- data/spec/models/localization_meta_read_spec.rb +0 -65
- data/spec/models/localization_name_spec.rb +0 -35
- data/spec/models/localization_read_spec.rb +0 -83
- 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_meta_read_spec.rb +0 -77
- data/spec/models/template_name_spec.rb +0 -35
- data/spec/models/template_read_spec.rb +0 -83
- data/spec/models/template_url_spec.rb +0 -35
- data/spec/models/templates_read_spec.rb +0 -47
- data/spec/models/updated_at_spec.rb +0 -35
@@ -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: 2020.11
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module DyspatchClient
|
16
16
|
class LocalizationsApi
|
@@ -19,68 +19,172 @@ module DyspatchClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Get Draft Localization Object by ID
|
23
|
+
# Returns a specific localization object of the matching draft with a matching localization ID
|
24
|
+
# @param draft_id [String] A draft ID
|
25
|
+
# @param localization_id [String] A localization ID
|
26
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
27
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @return [LocalizationRead]
|
30
|
+
def get_draft_localization_by_id(draft_id, localization_id, target_language, accept, opts = {})
|
31
|
+
data, _status_code, _headers = get_draft_localization_by_id_with_http_info(draft_id, localization_id, target_language, accept, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Get Draft Localization Object by ID
|
36
|
+
# Returns a specific localization object of the matching draft with a matching localization ID
|
37
|
+
# @param draft_id [String] A draft ID
|
38
|
+
# @param localization_id [String] A localization ID
|
39
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
40
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @return [Array<(LocalizationRead, Integer, Hash)>] LocalizationRead data, response status code and response headers
|
43
|
+
def get_draft_localization_by_id_with_http_info(draft_id, localization_id, target_language, accept, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: LocalizationsApi.get_draft_localization_by_id ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'draft_id' is set
|
48
|
+
if @api_client.config.client_side_validation && draft_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'draft_id' when calling LocalizationsApi.get_draft_localization_by_id"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'localization_id' is set
|
52
|
+
if @api_client.config.client_side_validation && localization_id.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'localization_id' when calling LocalizationsApi.get_draft_localization_by_id"
|
54
|
+
end
|
55
|
+
# verify the required parameter 'target_language' is set
|
56
|
+
if @api_client.config.client_side_validation && target_language.nil?
|
57
|
+
fail ArgumentError, "Missing the required parameter 'target_language' when calling LocalizationsApi.get_draft_localization_by_id"
|
58
|
+
end
|
59
|
+
# verify enum value
|
60
|
+
allowable_values = ["html", "handlebars", "ampscript", "freemarker", "cheetah", "jinja", "liquid"]
|
61
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(target_language)
|
62
|
+
fail ArgumentError, "invalid value for \"target_language\", must be one of #{allowable_values}"
|
63
|
+
end
|
64
|
+
# verify the required parameter 'accept' is set
|
65
|
+
if @api_client.config.client_side_validation && accept.nil?
|
66
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling LocalizationsApi.get_draft_localization_by_id"
|
67
|
+
end
|
68
|
+
# resource path
|
69
|
+
local_var_path = '/localizations/{localizationId}/drafts/{draftId}'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s)).sub('{' + 'localizationId' + '}', CGI.escape(localization_id.to_s))
|
70
|
+
|
71
|
+
# query parameters
|
72
|
+
query_params = opts[:query_params] || {}
|
73
|
+
query_params[:'targetLanguage'] = target_language
|
74
|
+
|
75
|
+
# header parameters
|
76
|
+
header_params = opts[:header_params] || {}
|
77
|
+
# HTTP header 'Accept' (if needed)
|
78
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2020.11+json', '*/*'])
|
79
|
+
header_params[:'Accept'] = accept
|
80
|
+
|
81
|
+
# form parameters
|
82
|
+
form_params = opts[:form_params] || {}
|
83
|
+
|
84
|
+
# http body (model)
|
85
|
+
post_body = opts[:body]
|
86
|
+
|
87
|
+
# return_type
|
88
|
+
return_type = opts[:return_type] || 'LocalizationRead'
|
89
|
+
|
90
|
+
# auth_names
|
91
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
92
|
+
|
93
|
+
new_options = opts.merge(
|
94
|
+
:header_params => header_params,
|
95
|
+
:query_params => query_params,
|
96
|
+
:form_params => form_params,
|
97
|
+
:body => post_body,
|
98
|
+
:auth_names => auth_names,
|
99
|
+
:return_type => return_type
|
100
|
+
)
|
101
|
+
|
102
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
103
|
+
if @api_client.config.debugging
|
104
|
+
@api_client.config.logger.debug "API called: LocalizationsApi#get_draft_localization_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
105
|
+
end
|
106
|
+
return data, status_code, headers
|
107
|
+
end
|
108
|
+
|
22
109
|
# Get Localization Object by ID
|
23
|
-
# Returns
|
24
|
-
# @param localization_id A localization ID
|
25
|
-
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
110
|
+
# Returns the published content associated with the localization of the matching ID
|
111
|
+
# @param localization_id [String] A localization ID
|
112
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
113
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
26
114
|
# @param [Hash] opts the optional parameters
|
27
115
|
# @return [LocalizationRead]
|
28
|
-
def
|
29
|
-
data, _status_code, _headers =
|
116
|
+
def get_published_localization_by_id(localization_id, target_language, accept, opts = {})
|
117
|
+
data, _status_code, _headers = get_published_localization_by_id_with_http_info(localization_id, target_language, accept, opts)
|
30
118
|
data
|
31
119
|
end
|
32
120
|
|
33
121
|
# Get Localization Object by ID
|
34
|
-
# Returns
|
35
|
-
# @param localization_id A localization ID
|
36
|
-
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
122
|
+
# Returns the published content associated with the localization of the matching ID
|
123
|
+
# @param localization_id [String] A localization ID
|
124
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
125
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
37
126
|
# @param [Hash] opts the optional parameters
|
38
|
-
# @return [Array<(LocalizationRead,
|
39
|
-
def
|
127
|
+
# @return [Array<(LocalizationRead, Integer, Hash)>] LocalizationRead data, response status code and response headers
|
128
|
+
def get_published_localization_by_id_with_http_info(localization_id, target_language, accept, opts = {})
|
40
129
|
if @api_client.config.debugging
|
41
|
-
@api_client.config.logger.debug 'Calling API: LocalizationsApi.
|
130
|
+
@api_client.config.logger.debug 'Calling API: LocalizationsApi.get_published_localization_by_id ...'
|
42
131
|
end
|
43
132
|
# verify the required parameter 'localization_id' is set
|
44
133
|
if @api_client.config.client_side_validation && localization_id.nil?
|
45
|
-
fail ArgumentError, "Missing the required parameter 'localization_id' when calling LocalizationsApi.
|
134
|
+
fail ArgumentError, "Missing the required parameter 'localization_id' when calling LocalizationsApi.get_published_localization_by_id"
|
46
135
|
end
|
47
136
|
# verify the required parameter 'target_language' is set
|
48
137
|
if @api_client.config.client_side_validation && target_language.nil?
|
49
|
-
fail ArgumentError, "Missing the required parameter 'target_language' when calling LocalizationsApi.
|
138
|
+
fail ArgumentError, "Missing the required parameter 'target_language' when calling LocalizationsApi.get_published_localization_by_id"
|
50
139
|
end
|
51
140
|
# verify enum value
|
52
|
-
|
53
|
-
|
141
|
+
allowable_values = ["html", "handlebars", "ampscript", "freemarker", "cheetah", "jinja", "liquid"]
|
142
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(target_language)
|
143
|
+
fail ArgumentError, "invalid value for \"target_language\", must be one of #{allowable_values}"
|
144
|
+
end
|
145
|
+
# verify the required parameter 'accept' is set
|
146
|
+
if @api_client.config.client_side_validation && accept.nil?
|
147
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling LocalizationsApi.get_published_localization_by_id"
|
54
148
|
end
|
55
149
|
# resource path
|
56
|
-
local_var_path = '/localizations/{localizationId}'.sub('{' + 'localizationId' + '}', localization_id.to_s)
|
150
|
+
local_var_path = '/localizations/{localizationId}'.sub('{' + 'localizationId' + '}', CGI.escape(localization_id.to_s))
|
57
151
|
|
58
152
|
# query parameters
|
59
|
-
query_params = {}
|
153
|
+
query_params = opts[:query_params] || {}
|
60
154
|
query_params[:'targetLanguage'] = target_language
|
61
155
|
|
62
156
|
# header parameters
|
63
|
-
header_params = {}
|
157
|
+
header_params = opts[:header_params] || {}
|
64
158
|
# HTTP header 'Accept' (if needed)
|
65
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.
|
159
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2020.11+json', '*/*'])
|
160
|
+
header_params[:'Accept'] = accept
|
66
161
|
|
67
162
|
# form parameters
|
68
|
-
form_params = {}
|
163
|
+
form_params = opts[:form_params] || {}
|
69
164
|
|
70
165
|
# http body (model)
|
71
|
-
post_body =
|
72
|
-
|
73
|
-
|
166
|
+
post_body = opts[:body]
|
167
|
+
|
168
|
+
# return_type
|
169
|
+
return_type = opts[:return_type] || 'LocalizationRead'
|
170
|
+
|
171
|
+
# auth_names
|
172
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
173
|
+
|
174
|
+
new_options = opts.merge(
|
74
175
|
:header_params => header_params,
|
75
176
|
:query_params => query_params,
|
76
177
|
:form_params => form_params,
|
77
178
|
:body => post_body,
|
78
179
|
:auth_names => auth_names,
|
79
|
-
:return_type =>
|
180
|
+
:return_type => return_type
|
181
|
+
)
|
182
|
+
|
183
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
80
184
|
if @api_client.config.debugging
|
81
|
-
@api_client.config.logger.debug "API called: LocalizationsApi#
|
185
|
+
@api_client.config.logger.debug "API called: LocalizationsApi#get_published_localization_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
186
|
end
|
83
187
|
return data, status_code, headers
|
84
188
|
end
|
85
189
|
end
|
86
|
-
end
|
190
|
+
end
|
@@ -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: 2020.11
|
7
7
|
Contact: support@dyspatch.io
|
8
|
-
Generated by: https://
|
9
|
-
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module DyspatchClient
|
16
16
|
class TemplatesApi
|
@@ -19,117 +19,151 @@ module DyspatchClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
# Gets a
|
22
|
+
# Get Template by ID
|
23
|
+
# Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template .
|
24
|
+
# @param template_id [String] A template ID
|
25
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
26
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
24
27
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @
|
26
|
-
|
27
|
-
|
28
|
-
data, _status_code, _headers = templates_get_with_http_info(opts)
|
28
|
+
# @return [TemplateRead]
|
29
|
+
def get_template_by_id(template_id, target_language, accept, opts = {})
|
30
|
+
data, _status_code, _headers = get_template_by_id_with_http_info(template_id, target_language, accept, opts)
|
29
31
|
data
|
30
32
|
end
|
31
33
|
|
32
|
-
#
|
33
|
-
# Gets a
|
34
|
+
# Get Template by ID
|
35
|
+
# Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template .
|
36
|
+
# @param template_id [String] A template ID
|
37
|
+
# @param target_language [String] The type of templating language to compile as. Should only be used for visual templates.
|
38
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
34
39
|
# @param [Hash] opts the optional parameters
|
35
|
-
# @
|
36
|
-
|
37
|
-
def templates_get_with_http_info(opts = {})
|
40
|
+
# @return [Array<(TemplateRead, Integer, Hash)>] TemplateRead data, response status code and response headers
|
41
|
+
def get_template_by_id_with_http_info(template_id, target_language, accept, opts = {})
|
38
42
|
if @api_client.config.debugging
|
39
|
-
@api_client.config.logger.debug 'Calling API: TemplatesApi.
|
43
|
+
@api_client.config.logger.debug 'Calling API: TemplatesApi.get_template_by_id ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'template_id' is set
|
46
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_template_by_id"
|
48
|
+
end
|
49
|
+
# verify the required parameter 'target_language' is set
|
50
|
+
if @api_client.config.client_side_validation && target_language.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'target_language' when calling TemplatesApi.get_template_by_id"
|
52
|
+
end
|
53
|
+
# verify enum value
|
54
|
+
allowable_values = ["html", "handlebars", "ampscript", "freemarker", "cheetah", "jinja", "liquid"]
|
55
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(target_language)
|
56
|
+
fail ArgumentError, "invalid value for \"target_language\", must be one of #{allowable_values}"
|
57
|
+
end
|
58
|
+
# verify the required parameter 'accept' is set
|
59
|
+
if @api_client.config.client_side_validation && accept.nil?
|
60
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling TemplatesApi.get_template_by_id"
|
40
61
|
end
|
41
62
|
# resource path
|
42
|
-
local_var_path = '/templates'
|
63
|
+
local_var_path = '/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
|
43
64
|
|
44
65
|
# query parameters
|
45
|
-
query_params = {}
|
46
|
-
query_params[:'
|
66
|
+
query_params = opts[:query_params] || {}
|
67
|
+
query_params[:'targetLanguage'] = target_language
|
47
68
|
|
48
69
|
# header parameters
|
49
|
-
header_params = {}
|
70
|
+
header_params = opts[:header_params] || {}
|
50
71
|
# HTTP header 'Accept' (if needed)
|
51
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.
|
72
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2020.11+json', '*/*'])
|
73
|
+
header_params[:'Accept'] = accept
|
52
74
|
|
53
75
|
# form parameters
|
54
|
-
form_params = {}
|
76
|
+
form_params = opts[:form_params] || {}
|
55
77
|
|
56
78
|
# http body (model)
|
57
|
-
post_body =
|
58
|
-
|
59
|
-
|
79
|
+
post_body = opts[:body]
|
80
|
+
|
81
|
+
# return_type
|
82
|
+
return_type = opts[:return_type] || 'TemplateRead'
|
83
|
+
|
84
|
+
# auth_names
|
85
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
86
|
+
|
87
|
+
new_options = opts.merge(
|
60
88
|
:header_params => header_params,
|
61
89
|
:query_params => query_params,
|
62
90
|
:form_params => form_params,
|
63
91
|
:body => post_body,
|
64
92
|
:auth_names => auth_names,
|
65
|
-
:return_type =>
|
93
|
+
:return_type => return_type
|
94
|
+
)
|
95
|
+
|
96
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
66
97
|
if @api_client.config.debugging
|
67
|
-
@api_client.config.logger.debug "API called: TemplatesApi#
|
98
|
+
@api_client.config.logger.debug "API called: TemplatesApi#get_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
68
99
|
end
|
69
100
|
return data, status_code, headers
|
70
101
|
end
|
71
|
-
|
72
|
-
#
|
73
|
-
#
|
74
|
-
# @param
|
102
|
+
|
103
|
+
# List Templates
|
104
|
+
# Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.
|
105
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
75
106
|
# @param [Hash] opts the optional parameters
|
76
|
-
# @
|
77
|
-
|
78
|
-
|
107
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
108
|
+
# @return [TemplatesRead]
|
109
|
+
def get_templates(accept, opts = {})
|
110
|
+
data, _status_code, _headers = get_templates_with_http_info(accept, opts)
|
79
111
|
data
|
80
112
|
end
|
81
113
|
|
82
|
-
#
|
83
|
-
# Gets a
|
84
|
-
# @param
|
85
|
-
# @param target_language The type of templating language to compile as. Should only be used for visual templates.
|
114
|
+
# List Templates
|
115
|
+
# Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.
|
116
|
+
# @param accept [String] A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
|
86
117
|
# @param [Hash] opts the optional parameters
|
87
|
-
# @
|
88
|
-
|
118
|
+
# @option opts [String] :cursor A cursor value used to retrieve a specific page from a paginated result set.
|
119
|
+
# @return [Array<(TemplatesRead, Integer, Hash)>] TemplatesRead data, response status code and response headers
|
120
|
+
def get_templates_with_http_info(accept, opts = {})
|
89
121
|
if @api_client.config.debugging
|
90
|
-
@api_client.config.logger.debug 'Calling API: TemplatesApi.
|
122
|
+
@api_client.config.logger.debug 'Calling API: TemplatesApi.get_templates ...'
|
91
123
|
end
|
92
|
-
# verify the required parameter '
|
93
|
-
if @api_client.config.client_side_validation &&
|
94
|
-
fail ArgumentError, "Missing the required parameter '
|
95
|
-
end
|
96
|
-
# verify the required parameter 'target_language' is set
|
97
|
-
if @api_client.config.client_side_validation && target_language.nil?
|
98
|
-
fail ArgumentError, "Missing the required parameter 'target_language' when calling TemplatesApi.templates_template_id_get"
|
99
|
-
end
|
100
|
-
# verify enum value
|
101
|
-
if @api_client.config.client_side_validation && !['html', 'jinja', 'handlebars', 'ampscript', 'freemarker', 'cheetah'].include?(target_language)
|
102
|
-
fail ArgumentError, "invalid value for 'target_language', must be one of html, jinja, handlebars, ampscript, freemarker, cheetah"
|
124
|
+
# verify the required parameter 'accept' is set
|
125
|
+
if @api_client.config.client_side_validation && accept.nil?
|
126
|
+
fail ArgumentError, "Missing the required parameter 'accept' when calling TemplatesApi.get_templates"
|
103
127
|
end
|
104
128
|
# resource path
|
105
|
-
local_var_path = '/templates
|
129
|
+
local_var_path = '/templates'
|
106
130
|
|
107
131
|
# query parameters
|
108
|
-
query_params = {}
|
109
|
-
query_params[:'
|
132
|
+
query_params = opts[:query_params] || {}
|
133
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
110
134
|
|
111
135
|
# header parameters
|
112
|
-
header_params = {}
|
136
|
+
header_params = opts[:header_params] || {}
|
113
137
|
# HTTP header 'Accept' (if needed)
|
114
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.
|
138
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2020.11+json', '*/*'])
|
139
|
+
header_params[:'Accept'] = accept
|
115
140
|
|
116
141
|
# form parameters
|
117
|
-
form_params = {}
|
142
|
+
form_params = opts[:form_params] || {}
|
118
143
|
|
119
144
|
# http body (model)
|
120
|
-
post_body =
|
121
|
-
|
122
|
-
|
145
|
+
post_body = opts[:body]
|
146
|
+
|
147
|
+
# return_type
|
148
|
+
return_type = opts[:return_type] || 'TemplatesRead'
|
149
|
+
|
150
|
+
# auth_names
|
151
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
152
|
+
|
153
|
+
new_options = opts.merge(
|
123
154
|
:header_params => header_params,
|
124
155
|
:query_params => query_params,
|
125
156
|
:form_params => form_params,
|
126
157
|
:body => post_body,
|
127
158
|
:auth_names => auth_names,
|
128
|
-
:return_type =>
|
159
|
+
:return_type => return_type
|
160
|
+
)
|
161
|
+
|
162
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
129
163
|
if @api_client.config.debugging
|
130
|
-
@api_client.config.logger.debug "API called: TemplatesApi#
|
164
|
+
@api_client.config.logger.debug "API called: TemplatesApi#get_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
131
165
|
end
|
132
166
|
return data, status_code, headers
|
133
167
|
end
|
134
168
|
end
|
135
|
-
end
|
169
|
+
end
|