Class: OrderCloud::EmailTemplateApi
- Inherits:
-
Object
- Object
- OrderCloud::EmailTemplateApi
- Defined in:
- lib/order_cloud/api/email_template_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
- #get(buyer_id, email_template_type, opts = {}) ⇒ EmailTemplate
-
#get_with_http_info(buyer_id, email_template_type, opts = {}) ⇒ Array<(EmailTemplate, Fixnum, Hash)>
EmailTemplate data, response status code and response headers.
-
#initialize(api_client = ApiClient.default) ⇒ EmailTemplateApi
constructor
A new instance of EmailTemplateApi.
- #patch(buyer_id, email_template_type, email_template, opts = {}) ⇒ nil
-
#patch_with_http_info(buyer_id, email_template_type, email_template, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
- #reset_to_default(buyer_id, email_template_type, opts = {}) ⇒ nil
-
#reset_to_default_with_http_info(buyer_id, email_template_type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
- #update(buyer_id, email_template_type, email_template, opts = {}) ⇒ nil
-
#update_with_http_info(buyer_id, email_template_type, email_template, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Nil, response status code and response headers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ EmailTemplateApi
Returns a new instance of EmailTemplateApi.
30 31 32 |
# File 'lib/order_cloud/api/email_template_api.rb', line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
28 29 30 |
# File 'lib/order_cloud/api/email_template_api.rb', line 28 def api_client @api_client end |
Instance Method Details
#get(buyer_id, email_template_type, opts = {}) ⇒ EmailTemplate
40 41 42 43 |
# File 'lib/order_cloud/api/email_template_api.rb', line 40 def get(buyer_id, email_template_type, opts = {}) data, _status_code, _headers = get_with_http_info(buyer_id, email_template_type, opts) return data end |
#get_with_http_info(buyer_id, email_template_type, opts = {}) ⇒ Array<(EmailTemplate, Fixnum, Hash)>
Returns EmailTemplate data, response status code and response headers.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/order_cloud/api/email_template_api.rb', line 51 def get_with_http_info(buyer_id, email_template_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EmailTemplateApi.get ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling EmailTemplateApi.get" if buyer_id.nil? # verify the required parameter 'email_template_type' is set fail ArgumentError, "Missing the required parameter 'email_template_type' when calling EmailTemplateApi.get" if email_template_type.nil? # resource path local_var_path = "/buyers/{buyerID}/emailtemplates/{emailTemplateType}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'emailTemplateType' + '}', email_template_type.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'EmailTemplate') if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailTemplateApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch(buyer_id, email_template_type, email_template, opts = {}) ⇒ nil
102 103 104 105 |
# File 'lib/order_cloud/api/email_template_api.rb', line 102 def patch(buyer_id, email_template_type, email_template, opts = {}) patch_with_http_info(buyer_id, email_template_type, email_template, opts) return nil end |
#patch_with_http_info(buyer_id, email_template_type, email_template, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Returns nil, response status code and response headers.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/order_cloud/api/email_template_api.rb', line 114 def patch_with_http_info(buyer_id, email_template_type, email_template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EmailTemplateApi.patch ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling EmailTemplateApi.patch" if buyer_id.nil? # verify the required parameter 'email_template_type' is set fail ArgumentError, "Missing the required parameter 'email_template_type' when calling EmailTemplateApi.patch" if email_template_type.nil? # verify the required parameter 'email_template' is set fail ArgumentError, "Missing the required parameter 'email_template' when calling EmailTemplateApi.patch" if email_template.nil? # resource path local_var_path = "/buyers/{buyerID}/emailtemplates/{emailTemplateType}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'emailTemplateType' + '}', email_template_type.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(email_template) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailTemplateApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#reset_to_default(buyer_id, email_template_type, opts = {}) ⇒ nil
165 166 167 168 |
# File 'lib/order_cloud/api/email_template_api.rb', line 165 def reset_to_default(buyer_id, email_template_type, opts = {}) reset_to_default_with_http_info(buyer_id, email_template_type, opts) return nil end |
#reset_to_default_with_http_info(buyer_id, email_template_type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Returns nil, response status code and response headers.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/order_cloud/api/email_template_api.rb', line 176 def reset_to_default_with_http_info(buyer_id, email_template_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EmailTemplateApi.reset_to_default ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling EmailTemplateApi.reset_to_default" if buyer_id.nil? # verify the required parameter 'email_template_type' is set fail ArgumentError, "Missing the required parameter 'email_template_type' when calling EmailTemplateApi.reset_to_default" if email_template_type.nil? # resource path local_var_path = "/buyers/{buyerID}/emailtemplates/{emailTemplateType}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'emailTemplateType' + '}', email_template_type.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailTemplateApi#reset_to_default\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update(buyer_id, email_template_type, email_template, opts = {}) ⇒ nil
226 227 228 229 |
# File 'lib/order_cloud/api/email_template_api.rb', line 226 def update(buyer_id, email_template_type, email_template, opts = {}) update_with_http_info(buyer_id, email_template_type, email_template, opts) return nil end |
#update_with_http_info(buyer_id, email_template_type, email_template, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Returns nil, response status code and response headers.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/order_cloud/api/email_template_api.rb', line 238 def update_with_http_info(buyer_id, email_template_type, email_template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EmailTemplateApi.update ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling EmailTemplateApi.update" if buyer_id.nil? # verify the required parameter 'email_template_type' is set fail ArgumentError, "Missing the required parameter 'email_template_type' when calling EmailTemplateApi.update" if email_template_type.nil? # verify the required parameter 'email_template' is set fail ArgumentError, "Missing the required parameter 'email_template' when calling EmailTemplateApi.update" if email_template.nil? # resource path local_var_path = "/buyers/{buyerID}/emailtemplates/{emailTemplateType}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'emailTemplateType' + '}', email_template_type.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(email_template) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailTemplateApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |