Documentation
¶
Overview ¶
Package analytics provides Reports and Dashboards API operations.
Index ¶
- type AggregateResult
- type ComponentMetadata
- type ComponentResult
- type Dashboard
- type DashboardResult
- type DataCell
- type DataRow
- type DateFilter
- type FactEntry
- type Grouping
- type GroupingResults
- type GroupingValue
- type HTTPClient
- type Report
- type ReportFilter
- type ReportInstance
- type ReportMetadata
- type ReportResult
- type ReportType
- type Service
- func (s *Service) GetDashboard(ctx context.Context, dashboardID string) (*DashboardResult, error)
- func (s *Service) GetReport(ctx context.Context, reportID string) (*Report, error)
- func (s *Service) GetReportInstance(ctx context.Context, reportID, instanceID string) (*ReportResult, error)
- func (s *Service) ListDashboards(ctx context.Context) ([]Dashboard, error)
- func (s *Service) ListReportInstances(ctx context.Context, reportID string) ([]ReportInstance, error)
- func (s *Service) ListReports(ctx context.Context) ([]Report, error)
- func (s *Service) RefreshDashboard(ctx context.Context, dashboardID string) (*DashboardResult, error)
- func (s *Service) RunReport(ctx context.Context, reportID string, includeDetails bool) (*ReportResult, error)
- func (s *Service) RunReportAsync(ctx context.Context, reportID string) (*ReportInstance, error)
- func (s *Service) RunReportWithFilters(ctx context.Context, reportID string, metadata ReportMetadata, ...) (*ReportResult, error)
- func (s *Service) SearchReports(ctx context.Context, searchText string) ([]Report, error)
- type SortColumn
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateResult ¶
type AggregateResult struct {
Label string `json:"label"`
Value interface{} `json:"value"`
}
AggregateResult represents an aggregate value.
type ComponentMetadata ¶
type ComponentMetadata struct {
ID string `json:"id"`
Name string `json:"name"`
ReportID string `json:"reportId"`
}
ComponentMetadata contains component metadata.
type ComponentResult ¶
type ComponentResult struct {
ComponentId string `json:"componentId"`
Status string `json:"status"`
ReportResult *ReportResult `json:"reportResult,omitempty"`
}
ComponentResult contains component data.
type Dashboard ¶
type Dashboard struct {
ID string `json:"id"`
Name string `json:"name"`
FolderID string `json:"folderId"`
FolderName string `json:"folderName"`
DeveloperName string `json:"developerName"`
RunningUser User `json:"runningUser,omitempty"`
StatusURL string `json:"statusUrl"`
ComponentsURL string `json:"componentsUrl"`
}
Dashboard represents a dashboard.
type DashboardResult ¶
type DashboardResult struct {
StatusURL string `json:"statusUrl"`
ComponentData []ComponentResult `json:"componentData"`
ComponentMetadata []ComponentMetadata `json:"componentMetadata"`
}
DashboardResult contains dashboard execution results.
type DataCell ¶
type DataCell struct {
Label string `json:"label"`
Value interface{} `json:"value"`
}
DataCell represents a data cell.
type DataRow ¶
type DataRow struct {
DataCells []DataCell `json:"dataCells"`
}
DataRow represents a data row.
type DateFilter ¶
type DateFilter struct {
Column string `json:"column"`
DurationValue string `json:"durationValue"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
}
DateFilter represents a date filter.
type FactEntry ¶
type FactEntry struct {
Aggregates []AggregateResult `json:"aggregates"`
Rows []DataRow `json:"rows,omitempty"`
}
FactEntry represents a fact map entry.
type Grouping ¶
type Grouping struct {
Name string `json:"name"`
SortOrder string `json:"sortOrder"`
DateGranularity string `json:"dateGranularity,omitempty"`
}
Grouping represents a report grouping.
type GroupingResults ¶
type GroupingResults struct {
Groupings []GroupingValue `json:"groupings"`
}
GroupingResults contains grouping results.
type GroupingValue ¶
type GroupingValue struct {
Key string `json:"key"`
Label string `json:"label"`
Value interface{} `json:"value"`
Groupings []GroupingValue `json:"groupings,omitempty"`
}
GroupingValue represents a grouping value.
type HTTPClient ¶
type HTTPClient interface {
Get(ctx context.Context, path string) ([]byte, error)
Post(ctx context.Context, path string, body interface{}) ([]byte, error)
Patch(ctx context.Context, path string, body interface{}) ([]byte, error)
Put(ctx context.Context, path string, body interface{}) ([]byte, error)
Delete(ctx context.Context, path string) ([]byte, error)
}
HTTPClient interface for dependency injection.
type Report ¶
type Report struct {
ID string `json:"id"`
Name string `json:"name"`
DescribeURL string `json:"describeUrl"`
InstancesURL string `json:"instancesUrl"`
ReportMetadata ReportMetadata `json:"reportMetadata,omitempty"`
ReportTypeMetadata interface{} `json:"reportTypeMetadata,omitempty"`
ReportExtendedMetadata interface{} `json:"reportExtendedMetadata,omitempty"`
}
Report represents a report definition.
type ReportFilter ¶
type ReportFilter struct {
Column string `json:"column"`
Operator string `json:"operator"`
Value interface{} `json:"value"`
FilterType string `json:"filterType,omitempty"`
}
ReportFilter represents a report filter.
type ReportInstance ¶
type ReportInstance struct {
ID string `json:"id"`
Status string `json:"status"`
URL string `json:"url"`
OwnerId string `json:"ownerId"`
CompletionDate string `json:"completionDate,omitempty"`
RequestDate string `json:"requestDate"`
HasDetailRows bool `json:"hasDetailRows"`
}
ReportInstance represents a report run instance.
type ReportMetadata ¶
type ReportMetadata struct {
ID string `json:"id"`
Name string `json:"name"`
ReportType ReportType `json:"reportType"`
ReportFormat string `json:"reportFormat"`
Description string `json:"description"`
FolderID string `json:"folderId"`
DeveloperName string `json:"developerName"`
DetailColumns []string `json:"detailColumns"`
SortBy []SortColumn `json:"sortBy,omitempty"`
GroupingsDown []Grouping `json:"groupingsDown,omitempty"`
GroupingsAcross []Grouping `json:"groupingsAcross,omitempty"`
ReportFilters []ReportFilter `json:"reportFilters,omitempty"`
ReportBooleanFilter string `json:"reportBooleanFilter,omitempty"`
Aggregates []string `json:"aggregates,omitempty"`
StandardDateFilter DateFilter `json:"standardDateFilter,omitempty"`
}
ReportMetadata contains report configuration.
type ReportResult ¶
type ReportResult struct {
Attributes map[string]interface{} `json:"attributes"`
AllData bool `json:"allData"`
FactMap map[string]FactEntry `json:"factMap"`
GroupingsDown GroupingResults `json:"groupingsDown"`
GroupingsAcross GroupingResults `json:"groupingsAcross"`
HasDetailRows bool `json:"hasDetailRows"`
ReportMetadata ReportMetadata `json:"reportMetadata"`
}
ReportResult contains report execution results.
type ReportType ¶
ReportType contains report type information.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides Analytics API operations.
func NewService ¶
func NewService(client HTTPClient, apiVersion string) *Service
NewService creates a new Analytics service.
func (*Service) GetDashboard ¶
GetDashboard retrieves a dashboard.
func (*Service) GetReportInstance ¶
func (s *Service) GetReportInstance(ctx context.Context, reportID, instanceID string) (*ReportResult, error)
GetReportInstance retrieves an async report instance.
func (*Service) ListDashboards ¶
ListDashboards lists all dashboards.
func (*Service) ListReportInstances ¶
func (s *Service) ListReportInstances(ctx context.Context, reportID string) ([]ReportInstance, error)
ListReportInstances lists async report instances.
func (*Service) ListReports ¶
ListReports lists all reports.
func (*Service) RefreshDashboard ¶
func (s *Service) RefreshDashboard(ctx context.Context, dashboardID string) (*DashboardResult, error)
RefreshDashboard refreshes a dashboard.
func (*Service) RunReport ¶
func (s *Service) RunReport(ctx context.Context, reportID string, includeDetails bool) (*ReportResult, error)
RunReport runs a report synchronously.
func (*Service) RunReportAsync ¶
RunReportAsync runs a report asynchronously.
func (*Service) RunReportWithFilters ¶
func (s *Service) RunReportWithFilters(ctx context.Context, reportID string, metadata ReportMetadata, includeDetails bool) (*ReportResult, error)
RunReportWithFilters runs a report with filters.
type SortColumn ¶
type SortColumn struct {
SortColumn string `json:"sortColumn"`
SortOrder string `json:"sortOrder"`
}
SortColumn represents a sort column.