Class: Api::Dimass::Operations::Article
- Defined in:
- app/services/api/dimass/operations/article.rb
Overview
Service object: article.
Constant Summary collapse
- PATH =
Path.
"/papi/article/1.0".freeze
- NAMESPACE =
Namespace.
"art".freeze
- WSDL =
Wsdl.
"v1/article".freeze
- PARTNER_CODE =
The article codes must be prefixed with your partner code (which consist of four characters).
Please contact your SupportPlaza sales representative if you have questing regarding your partner code "WARM".freeze
Instance Attribute Summary
Attributes inherited from Base
#api_key, #api_secret, #api_url, #endpoint_url, #namespace, #wsdl, #wsdl_content
Instance Method Summary collapse
- #create_article(article_params) ⇒ Object
- #get_article(id) ⇒ Object
- #get_articles ⇒ Object
-
#initialize ⇒ Article
constructor
A new instance of Article.
- #update_article(article_params) ⇒ Object
- #update_articles(articles) ⇒ Object
Methods inherited from Base
#authenticated_endpoint_url, #client, #nonce, #operations, #refresh_wsdl, #retrieve_wsdl_content, #signature_params, #timestamp, #wsdl_local_path
Constructor Details
Instance Method Details
#create_article(article_params) ⇒ Object
26 27 28 29 |
# File 'app/services/api/dimass/operations/article.rb', line 26 def create_article(article_params) r = client.call(:create_article, message: { article: article_params }) r.body.dig(:create_article_response, :return) end |
#get_article(id) ⇒ Object
31 32 33 34 |
# File 'app/services/api/dimass/operations/article.rb', line 31 def get_article(id) r = client.call(:get_article, message: { id: id }) r.body.dig(:get_article_response, :return) end |
#get_articles ⇒ Object
21 22 23 24 |
# File 'app/services/api/dimass/operations/article.rb', line 21 def get_articles r = client.call(:get_articles) r.body.dig(:get_articles_response, :return, :item) end |
#update_article(article_params) ⇒ Object
36 37 38 |
# File 'app/services/api/dimass/operations/article.rb', line 36 def update_article(article_params) client.call(:update_article, message: { article: article_params }) end |
#update_articles(articles) ⇒ Object
40 41 42 |
# File 'app/services/api/dimass/operations/article.rb', line 40 def update_articles(articles) client.call(:update_articles, message: { articles: articles }) end |