tableau

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeInternal = "-1" // Internal error.

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	UserAgent string

	SiteID string

	DataSources *dataSourcesService
	Projects    *projectsService
	// contains filtered or unexported fields
}

Client encapsulates a client that talks to the Tableau API

func NewClient

func NewClient(serverAddr, personalAccessTokenName, personalAccessTokenSecret, site string) (*Client, error)

NewClient instantiates an instance of the Tableau API client.

type CreateProjectRequest

type CreateProjectRequest struct {
	ParentProjectId    string                   `json:"parentProjectId,omitempty"`
	Name               string                   `json:"name"`
	Description        string                   `json:"description,omitempty"`
	ContentPermissions ProjectContentPermission `json:"contentPermissions,omitempty"`
}

CreateProjectRequest encapsulates the request for creating a new project.

type DataSource

type DataSource struct {
	ID                  string            `json:"id"`
	Name                string            `json:"name"`
	CertificationNote   string            `json:"CertificationNote"`
	ContentUrl          string            `json:"contentUrl"`
	EncryptExtracts     string            `json:"encryptExtracts"`
	Description         string            `json:"description"`
	WebpageUrl          string            `json:"webpageUrl"`
	IsCertified         bool              `json:"isCertified"`
	UseRemoteQueryAgent bool              `json:"useRemoteQueryAgent"`
	Type                string            `json:"type"`
	Tags                map[string]string `json:"tags"`
	Owner               struct {
		ID string `json:"id"`
	}
	Project struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	}
	CreatedAt time.Time `json:"CreatedAt"`
	UpdatedAt time.Time `json:"UpdatedAt"`
}

DataSource represents a Tableau data source

type DeleteDataSourceRequest

type DeleteDataSourceRequest struct {
	ID string
}

DeleteDataSourceRequest encapsulates the request for deleting a single DataSource.

type DeleteProjectRequest

type DeleteProjectRequest struct {
	ID string `json:"id"`
}

DeleteProjectRequest encapsulates the request for deleting a new project.

type Error

type Error struct {

	// code specifies the error code. i.e; NotFound, RateLimited, etc...
	Code string

	// Meta contains additional information depending on the error code. As an
	// example, if the Code is "ErrResponseMalformed", the map will be: ["body"]
	// = "body of the response"
	Meta map[string]string
	// contains filtered or unexported fields
}

Error represents common errors originating from the Client.

func (*Error) Error

func (e *Error) Error() string

Error returns the string representation of the error.

type GetDataSourceRequest

type GetDataSourceRequest struct {
	ID string
}

GetDataSourceRequest encapsulates the request for getting a single DataSource.

type Project

type Project struct {
	ID                              string `json:"id"`
	ParentProjectId                 string `json:"parentProjectId"`
	Name                            string `json:"name"`
	Description                     string `json:"description"`
	ContentPermissions              string `json:"contentPermissions"`
	ControllingPermissionsProjectId string `json:"controllingPermissionsProjectId"`
	Writeable                       bool   `json:"writeable"`
	TopLevelProject                 bool   `json:"topLevelProject"`
	Owner                           struct {
		ID        string    `json:"id"`
		Email     string    `json:"email"`
		Name      string    `json:"name"`
		FullName  string    `json:"fullName"`
		SiteRole  string    `json:"siteRole"`
		LastLogin time.Time `json:"lastLogin"`
	}
	ContentCounts struct {
		ProjectCount    int `json:"projectCount"`
		WorkbookCount   int `json:"workbookCount"`
		ViewCount       int `json:"viewCount"`
		DatasourceCount int `json:"datasourceCount"`
	}
	CreatedAt time.Time `json:"CreatedAt"`
	UpdatedAt time.Time `json:"UpdatedAt"`
}

Project represents a Tableau project

type ProjectContentPermission

type ProjectContentPermission string

ProjectContentPermission represents a projects' content permissions

const (
	ProjectContentPermissionLockedToProject              ProjectContentPermission = "LockedToProject"
	ProjectContentPermissionManagedByOwner               ProjectContentPermission = "ManagedByOwner"
	ProjectContentPermissionLockedToProjectWithoutNested ProjectContentPermission = "LockedToProjectWithoutNested"
)

type QueryOption

type QueryOption func(*QueryOptions) error

func WithFilterExpression

func WithFilterExpression(filterExp string) QueryOption

WithFilterExpression returns a QueryOption that sets the "filter" URL parameter.

func WithPageNumber

func WithPageNumber(pageNumber int) QueryOption

WithPageNumber returns a QueryOption that sets the "pageNumber" URL parameter.

func WithPageSize

func WithPageSize(pageSize int) QueryOption

WithPageSize returns a QueryOption that sets the "pageSize" URL parameter.

func WithSortExpression

func WithSortExpression(sortExp string) QueryOption

WithSortExpression returns a QueryOption that sets the "sort" URL parameter.

type QueryOptions

type QueryOptions struct {
	URLValues *url.Values
}

QueryOptions are options for querying projects.

type UpdateProjectRequest

type UpdateProjectRequest struct {
	ID                 string                   `json:"id,"`
	ParentProjectId    string                   `json:"parentProjectId,omitempty"`
	Name               string                   `json:"name"`
	Description        string                   `json:"description,omitempty"`
	ContentPermissions ProjectContentPermission `json:"contentPermissions,omitempty"`
}

UpdateProjectRequest encapsulates the request for updating project.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL