Class: Api::Dimass::Operations::Article

Inherits:
Base
  • Object
show all
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

Methods inherited from Base

#authenticated_endpoint_url, #client, #nonce, #operations, #refresh_wsdl, #retrieve_wsdl_content, #signature_params, #timestamp, #wsdl_local_path

Constructor Details

#initializeArticle

Returns a new instance of Article.



17
18
19
# File 'app/services/api/dimass/operations/article.rb', line 17

def initialize
  super(PATH, NAMESPACE, WSDL)
end

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_articlesObject



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