Class: TableauApi::Resources::Projects
- Inherits:
-
Base
- Object
- Base
- TableauApi::Resources::Projects
show all
- Defined in:
- lib/tableau_api/resources/projects.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#create(name:, description: '') ⇒ Object
4
5
6
7
8
9
10
11
12
|
# File 'lib/tableau_api/resources/projects.rb', line 4
def create(name:, description: '')
request = Builder::XmlMarkup.new.tsRequest do |ts|
ts.project(name: name, description: description)
end
res = @client.connection.api_post("sites/#{@client.auth.site_id}/projects", body: request)
res['tsResponse']['project'] if res.code == 201
end
|
#list ⇒ Object
14
15
16
17
|
# File 'lib/tableau_api/resources/projects.rb', line 14
def list
url = "sites/#{@client.auth.site_id}/projects"
@client.connection.api_get_collection(url, 'projects.project')
end
|