tableau_server_client 0.3.0 → 0.4.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2b753dc351bba7fa961e4772449b2ef68789fd24f6ca632983f506c729d596e
|
4
|
+
data.tar.gz: a6de27794f5a2fcf43f393f4f259cda8250860c30176852b586d458d87e2e60b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc52e212245271db396f36989401102e78377e5b794977e580d17d65394033bd36398dcf50249a96c7f595ef4cbc07f447dcf92d7a28c090d19264a2019d98f3
|
7
|
+
data.tar.gz: 5f4a6ea560350dcc8641b9ad1c8b04187d8973d14ac5679546ec66f595e7decc65aafda880b2021aca962c2d88b265950b58e14defb7012c31aed802bcc53eb8
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'tableau_server_client/resources/resource'
|
2
|
+
|
3
|
+
module TableauServerClient
|
4
|
+
module Resources
|
5
|
+
|
6
|
+
class Group < Resource
|
7
|
+
|
8
|
+
attr_reader :id, :name, :site_role
|
9
|
+
|
10
|
+
def self.from_response(client, path, xml)
|
11
|
+
attrs = extract_attributes(xml)
|
12
|
+
if xml.xpath("xmlns:import")[0]
|
13
|
+
attrs['site_role'] = xml.xpath("xmlns:import")[0]['siteRole']
|
14
|
+
end
|
15
|
+
new(client, path, attrs)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.from_collection_response(client, path, xml)
|
19
|
+
xml.xpath("//xmlns:groups/xmlns:group").each do |s|
|
20
|
+
id = s['id']
|
21
|
+
yield from_response(client, "#{path}/#{id}", s)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def users
|
26
|
+
@client.get_collection(User.location(path))
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -5,6 +5,7 @@ require 'tableau_server_client/resources/user'
|
|
5
5
|
require 'tableau_server_client/resources/subscription'
|
6
6
|
require 'tableau_server_client/resources/extract_refresh'
|
7
7
|
require 'tableau_server_client/resources/view'
|
8
|
+
require 'tableau_server_client/resources/group'
|
8
9
|
|
9
10
|
module TableauServerClient
|
10
11
|
module Resources
|
@@ -77,6 +78,11 @@ module TableauServerClient
|
|
77
78
|
@client.get_collection ExtractRefresh.location("#{path}/tasks")
|
78
79
|
end
|
79
80
|
|
81
|
+
def groups(filter: [])
|
82
|
+
@client.get_collection Group.location(path, filter: filter)
|
83
|
+
end
|
84
|
+
|
85
|
+
|
80
86
|
end
|
81
87
|
end
|
82
88
|
end
|
@@ -20,7 +20,7 @@ module TableauServerClient
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def reload
|
23
|
-
@client.get
|
23
|
+
@client.get location
|
24
24
|
end
|
25
25
|
|
26
26
|
def full_name
|
@@ -39,6 +39,23 @@ module TableauServerClient
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
def to_request
|
43
|
+
request = build_request {|b|
|
44
|
+
b.user(siteRole: site_role)
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def update_site_role!(role)
|
49
|
+
@site_role = role
|
50
|
+
# Using location to get corretct path
|
51
|
+
# When initialized from Group path will be groups/group_id/users/user_id
|
52
|
+
@client.update(self, path: location.path)
|
53
|
+
end
|
54
|
+
|
55
|
+
def location
|
56
|
+
User.location(site_path, id)
|
57
|
+
end
|
58
|
+
|
42
59
|
end
|
43
60
|
end
|
44
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tableau_server_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shimpeko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/tableau_server_client/resources/datasource.rb
|
146
146
|
- lib/tableau_server_client/resources/downloadable.rb
|
147
147
|
- lib/tableau_server_client/resources/extract_refresh.rb
|
148
|
+
- lib/tableau_server_client/resources/group.rb
|
148
149
|
- lib/tableau_server_client/resources/job.rb
|
149
150
|
- lib/tableau_server_client/resources/project.rb
|
150
151
|
- lib/tableau_server_client/resources/resource.rb
|