Module: Views
- Included in:
- Config
- Defined in:
- lib/user/config/views.rb
Instance Method Summary collapse
-
#create_view(data) ⇒ Object
Create export.
-
#export_view_to_bigquery(id_or_slug) ⇒ Object
Export view to BigQuery.
-
#get_view(id) ⇒ Object
Get export.
-
#get_view_query(id_or_slug) ⇒ Object
Get view query.
-
#get_views(options = nil) ⇒ Object
Get views.
-
#update_view(id, data) ⇒ Object
Update export configuration.
Instance Method Details
permalink #create_view(data) ⇒ Object
Create export.
Create an export with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New configuration',
slug: 'new-configuration',
object_model: 'Contact',
config_json: {}
}
@data = @cxf_user.create_export(data)
46 47 48 |
# File 'lib/user/config/views.rb', line 46 def create_view(data) @client.raw('post', '/config/views', nil, data_transform(data)) end |
permalink #export_view_to_bigquery(id_or_slug) ⇒ Object
Export view to BigQuery.
Export a view to BigQuery using its id or slug.
Parameters
- id_or_slug
-
(String) – The id or slug of the view to be exported.
Example
@data = @cxf_user.export_view_to_bigquery('view-slug')
89 90 91 |
# File 'lib/user/config/views.rb', line 89 def export_view_to_bigquery(id_or_slug) @client.raw('post', "/config/views/#{id_or_slug}/export") end |
permalink #get_view(id) ⇒ Object
Get export.
Get an export configuration info.
Parameters
- id
-
(Integer) – Export configuration id.
Example
@data = @cxf_user.get_export(10)
28 29 30 |
# File 'lib/user/config/views.rb', line 28 def get_view(id) @client.raw('get', "/config/views/#{id}") end |
permalink #get_view_query(id_or_slug) ⇒ Object
Get view query.
Get a view query.
Parameters
- id_or_slug
-
(String) – The id or slug of the view to be queried.
Example
@data = @cxf_user.get_view_query('view-slug')
77 78 79 |
# File 'lib/user/config/views.rb', line 77 def get_view_query(id_or_slug) @client.raw('get', "/config/views/#{id_or_slug}/query") end |
permalink #get_views(options = nil) ⇒ Object
Get views.
Get a collection of views.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @cxf_user.get_views
Second Example
= { sort: 'id' }
@data = @cxf_user.get_views()
16 17 18 |
# File 'lib/user/config/views.rb', line 16 def get_views( = nil) @client.raw('get', '/config/views', ) end |
permalink #update_view(id, data) ⇒ Object
Update export configuration.
Update an export configuration info.
Parameters
- id
-
(Integer) – Export configuration id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New configuration',
slug: 'new-configuration',
object_model: 'Contact',
config_json: {}
}
@data = @cxf_user.update_export(36, data)
65 66 67 |
# File 'lib/user/config/views.rb', line 65 def update_view(id, data) @client.raw('put', "/config/views/#{id}", nil, data_transform(data)) end |