zendesk_help_center_api 0.3.0 → 0.4.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/README.md +25 -4
- data/lib/zendesk_api/help_center.rb +6 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b67b53e94d91961aee51435f3056417f8272dc1
|
4
|
+
data.tar.gz: e34cfb70f3b12686391ac917227b0b21c94c4241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c827ac9c0a7917cebfb5a3eff9d5322e1cdd3b36eaac07f2532f27ac040c891b7168280f021ed3208350b12e034c2b2aedb3e22935645068c971f866bb5bb9cb
|
7
|
+
data.tar.gz: 5a1a4eb9e7ec31214f53ca738870e15811631532685a4c89c8c07f9bbb0e4c9a0f6737538a9c4d75ab74ab764daabb970336ba2f95a877f270c40e9024f2d364
|
data/README.md
CHANGED
@@ -44,29 +44,46 @@ end
|
|
44
44
|
|
45
45
|
#### Categories
|
46
46
|
|
47
|
+
These endpoints only update category-level metadata such as the sorting position.
|
48
|
+
They don't update category translations.
|
49
|
+
|
47
50
|
```ruby
|
48
51
|
categories = client.hc_categories
|
49
52
|
category = categories.build(name: 'Test Category')
|
50
53
|
category.save
|
51
|
-
category.update(description: 'This is a test')
|
52
54
|
category.destroy
|
53
55
|
```
|
54
56
|
|
55
57
|
#### Sections
|
56
58
|
|
59
|
+
These endpoints only update section-level metadata such as the sorting position.
|
60
|
+
They don't update section translations.
|
61
|
+
See Translations.
|
62
|
+
|
57
63
|
```ruby
|
58
64
|
sections = category.sections
|
59
65
|
section = sections.first
|
60
|
-
category.update(name: 'This is a test')
|
61
66
|
```
|
62
67
|
|
63
68
|
#### Articles
|
64
69
|
|
70
|
+
Create Article:
|
71
|
+
|
65
72
|
```ruby
|
66
73
|
articles = section.articles
|
67
74
|
articles.build(title: 'Test Article')
|
68
|
-
|
69
|
-
|
75
|
+
```
|
76
|
+
|
77
|
+
Update Article:
|
78
|
+
|
79
|
+
These endpoints update article-level metadata such as its promotion status or sorting position.
|
80
|
+
The endpoints do not update translation properties such as the article's title, body, locale, or draft.
|
81
|
+
See Translations section.
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
article = section.articles.first
|
85
|
+
article.update(position: 42)
|
86
|
+
article.save
|
70
87
|
```
|
71
88
|
|
72
89
|
### Help Center Translations
|
@@ -85,6 +102,10 @@ section_tr.save
|
|
85
102
|
articles_tr = article.translations
|
86
103
|
article_tr = article_translations.build(locale: 'uk', title: 'Тестова Стаття', body: '')
|
87
104
|
article_tr.save
|
105
|
+
|
106
|
+
article_tr = article.translations.select { |tr| tr.locale == "en-us" }.first
|
107
|
+
artile_tr.update(title: "New Title", body: "New Body")
|
108
|
+
article_tr.save
|
88
109
|
```
|
89
110
|
|
90
111
|
## Development
|
@@ -132,7 +132,12 @@ module ZendeskAPI
|
|
132
132
|
|
133
133
|
def save!(*)
|
134
134
|
super do |req|
|
135
|
-
req.
|
135
|
+
case req.method
|
136
|
+
when :post # create article
|
137
|
+
req.path = "help_center/sections/#{association.options["parent"].id}/articles"
|
138
|
+
when :put # update article
|
139
|
+
# do nothing
|
140
|
+
end
|
136
141
|
end
|
137
142
|
end
|
138
143
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_help_center_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zendesk_api
|
@@ -64,6 +64,20 @@ dependencies:
|
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '12.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: pry
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
67
81
|
description: Ruby wrapper for the REST API at http://www.zendesk.com. Documentation
|
68
82
|
at https://developer.zendesk.com/rest_api/docs/help_center/introduction.
|
69
83
|
email:
|
@@ -94,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
108
|
version: '0'
|
95
109
|
requirements: []
|
96
110
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.6.
|
111
|
+
rubygems_version: 2.6.13
|
98
112
|
signing_key:
|
99
113
|
specification_version: 4
|
100
114
|
summary: Zendesk Help Center REST API Client
|