powerbiapi

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddGroupUserRequest added in v1.1.0

type AddGroupUserRequest struct {
	DisplayName          string `json:"displayName"`
	EmailAddress         string `json:"emailAddress"`
	GroupUserAccessRight string `json:"groupUserAccessRight"`
	Identifier           string `json:"identifier"`
	PrincipalType        string `json:"principalType"`
}

AddGroupUserRequest represents details when adding a group user.

type CapacityAdmins added in v1.1.0

type CapacityAdmins string

CapacityAdmins represents the list of capacity admins.

type Client

type Client struct {
	*http.Client
}

Client allows calling the Power BI service

func NewClientWithClientCredentialAuth added in v1.1.0

func NewClientWithClientCredentialAuth(tenant string, clientID string, clientSecret string) (*Client, error)

NewClientWithClientCredentialAuth creates a Power BI REST API client using client credentials with application permissions

func NewClientWithPasswordAuth added in v1.1.0

func NewClientWithPasswordAuth(tenant string, clientID string, clientSecret string, username string, password string) (*Client, error)

NewClientWithPasswordAuth creates a Power BI REST API client using password authentication with delegated permissions

func (*Client) AddGroupUser added in v1.1.0

func (client *Client) AddGroupUser(groupID string, request AddGroupUserRequest) error

AddGroupUser Grants the specified user permissions to the specified workspace.

func (*Client) CreateGroup

func (client *Client) CreateGroup(request CreateGroupRequest) (*CreateGroupResponse, error)

CreateGroup creates new workspace

func (*Client) DeleteDatasetInGroup added in v1.1.0

func (client *Client) DeleteDatasetInGroup(groupID string, datasetID string) error

DeleteDatasetInGroup deletes a dataset that exists within a group.

func (*Client) DeleteGroup

func (client *Client) DeleteGroup(groupID string) error

DeleteGroup deletes a workspace

func (*Client) DeleteReportInGroup added in v1.1.0

func (client *Client) DeleteReportInGroup(groupID string, reportID string) error

DeleteReportInGroup deletes a report that exists within a group.

func (*Client) DeleteUserInGroup added in v1.1.0

func (client *Client) DeleteUserInGroup(groupID string, userInfo string) error

DeleteUserInGroup Deletes the specified user permissions from the specified workspace.

func (*Client) GetCapacities added in v1.1.0

func (client *Client) GetCapacities() (*GetCapacitiesResponse, error)

GetCapacities Returns a list of capacities the user has access to.

func (*Client) GetDatasetInGroup added in v1.2.0

func (client *Client) GetDatasetInGroup(groupID string, datasetID string) (*GetDatasetInGroupResponse, error)

GetDatasetInGroup returns a dataset within the specified group.

func (*Client) GetDatasetsInGroup

func (client *Client) GetDatasetsInGroup(groupID string) (*GetDatasetsInGroupResponse, error)

GetDatasetsInGroup returns a list of datasets within the specified group.

func (*Client) GetDatasourcesInGroup added in v1.1.0

func (client *Client) GetDatasourcesInGroup(groupID string, datasetID string) (*GetDatasourcesInGroupResponse, error)

GetDatasourcesInGroup gets datasources in a dataset that exists within a group.

func (*Client) GetGroup

func (client *Client) GetGroup(groupID string) (*GetGroupResponse, error)

GetGroup returns a single workspace

func (*Client) GetGroupByName added in v1.2.0

func (client *Client) GetGroupByName(groupName string) (*GetGroupResponse, error)

GetGroupByName returns a single workspace

func (*Client) GetGroupUsers added in v1.1.0

func (client *Client) GetGroupUsers(groupID string) (*GetGroupUsersResponse, error)

GetGroupUsers Returns a list of users that have access to the specified workspace.

func (*Client) GetGroups

func (client *Client) GetGroups(filter string, top int, skip int) (*GetGroupsResponse, error)

GetGroups returns a list of workspaces the user has access to.

func (*Client) GetImportInGroup

func (client *Client) GetImportInGroup(groupID string, importID string) (*GetImportInGroupResponse, error)

GetImportInGroup returns the import found within a group

func (*Client) GetImportsInGroup

func (client *Client) GetImportsInGroup(groupID string) (*GetImportsInGroupResponse, error)

GetImportsInGroup returns the imports found within a group

func (*Client) GetParametersInGroup added in v1.1.0

func (client *Client) GetParametersInGroup(groupID string, datasetID string) (*GetParametersInGroupResponse, error)

GetParametersInGroup gets parameters in a dataset that exists within a group.

func (*Client) GetRefreshScheduleInGroup added in v1.1.0

func (client *Client) GetRefreshScheduleInGroup(groupID string, datasetID string) (*GetRefreshScheduleInGroupResponse, error)

GetRefreshScheduleInGroup gets a datasource's refresh schedule.

func (*Client) GetReportInGroup added in v1.4.0

func (client *Client) GetReportInGroup(groupID string, reportID string) (*GetReportInGroupResponse, error)

GetReportInGroup returns a report that exists within a group

func (*Client) GetReportsInGroup

func (client *Client) GetReportsInGroup(groupID string) (*GetReportsInGroupResponse, error)

GetReportsInGroup returns a list of reports within the specified group.

func (*Client) GetTables

func (client *Client) GetTables(datasetID string) (*GetTablesResponse, error)

GetTables gets the tables in a push dataset.

func (*Client) GroupAssignToCapacity added in v1.1.0

func (client *Client) GroupAssignToCapacity(groupID string, request GroupAssignToCapacityRequest) error

GroupAssignToCapacity assigns capcity to a workspace

func (*Client) PostDatasetInGroup

func (client *Client) PostDatasetInGroup(groupID string, defaultRetentionPolicy string, request PostDatasetInGroupRequest) (*PostDatasetInGroupResponse, error)

PostDatasetInGroup creates a dataset within the specified group.

func (*Client) PostImportInGroup

func (client *Client) PostImportInGroup(groupID string, datasetDisplayName string, nameConflict string, skipReport bool, requestData io.Reader) (*PostImportInGroupResponse, error)

PostImportInGroup creates an import within the the specified group

func (*Client) PostRowsInGroup added in v1.2.0

func (client *Client) PostRowsInGroup(groupID string, datasetID string, tableName string, request PostRowsInGroupRequest) error

PostRowsInGroup posts rows into a table in a dataset in a group.

func (*Client) PutTableInGroup added in v1.2.0

func (client *Client) PutTableInGroup(groupID string, datasetID string, tableName string, request PutTableInGroupRequest) error

PutTableInGroup updates the metadata and schema for the specified table, within the specified dataset, from the specified workspace.

func (*Client) RebindReportInGroup added in v1.4.0

func (client *Client) RebindReportInGroup(groupID string, reportID string, request RebindReportInGroupRequest) error

RebindReportInGroup rebinds the specified report from the specified group to the requested dataset.

func (*Client) RefreshUserPermissions added in v1.1.0

func (client *Client) RefreshUserPermissions() error

RefreshUserPermissions Refreshes user permissions in Power BI.

func (*Client) UpdateDatasourcesInGroup added in v1.1.0

func (client *Client) UpdateDatasourcesInGroup(groupID string, datasetID string, request UpdateDatasourcesInGroupRequest) error

UpdateDatasourcesInGroup updates datasources in a dataset that exists within a group.

func (*Client) UpdateGroupAsAdmin

func (client *Client) UpdateGroupAsAdmin(groupID string, request UpdateGroupAsAdminRequest) error

UpdateGroupAsAdmin updates a workspace

func (*Client) UpdateGroupUser added in v1.1.0

func (client *Client) UpdateGroupUser(groupID string, request UpdateGroupUserRequest) error

UpdateGroupUser Update the specified user permissions to the specified workspace.

func (*Client) UpdateParametersInGroup added in v1.1.0

func (client *Client) UpdateParametersInGroup(groupID string, datasetID string, request UpdateParametersInGroupRequest) error

UpdateParametersInGroup updates parameters in a dataset that exists within a group.

func (*Client) UpdateRefreshScheduleInGroup added in v1.1.0

func (client *Client) UpdateRefreshScheduleInGroup(groupID string, datasetID string, request UpdateRefreshScheduleInGroupRequest) error

UpdateRefreshScheduleInGroup updates a datasource's refresh schedule.

func (*Client) WaitForImportInGroupToSucceed added in v1.1.0

func (client *Client) WaitForImportInGroupToSucceed(groupID string, importID string, timeout time.Duration) (*GetImportInGroupResponse, error)

WaitForImportInGroupToSucceed waits until the specified import in group succeeds

type CreateGroupRequest

type CreateGroupRequest struct {
	Name string `json:"name"`
}

CreateGroupRequest represents the request for the CreateGroup API

type CreateGroupResponse

type CreateGroupResponse struct {
	ID                    string
	IsOnDedicatedCapacity bool
	Name                  string
	CapacityID            string
}

CreateGroupResponse represents the response from the CreateGroup API

type ErrorBody

type ErrorBody struct {
	Code    string
	Message string
}

ErrorBody represents the error returned in the body of Power BI API requests

type ErrorResponse

type ErrorResponse struct {
	Error ErrorBody
}

ErrorResponse represents the response when the Power BI API returns errors

type GetCapacitiesResponse added in v1.1.0

type GetCapacitiesResponse struct {
	Value []GetCapacitiesResponseItem
}

GetCapacitiesResponse represents the response of get capacities response API.

type GetCapacitiesResponseItem added in v1.1.0

type GetCapacitiesResponseItem struct {
	ID                      string
	DisplayName             string
	Admins                  []CapacityAdmins
	SKU                     string
	State                   string
	Region                  string
	CapacityUserAccessRight string
}

GetCapacitiesResponseItem represents the response object of each capacity of get capacities response API.

type GetDatasetInGroupResponse added in v1.2.0

type GetDatasetInGroupResponse struct {
	ID                               string `json:"id"`
	Name                             string
	AddRowsAPIEnabled                bool
	ConfiguredBy                     string
	IsRefreshable                    bool
	IsEffectiveIdentityRequired      bool
	IsEffectiveIdentityRolesRequired bool
	TargetStorageMode                string
}

GetDatasetInGroupResponse represents the details when getting a datasets in a group.

type GetDatasetsInGroupResponse

type GetDatasetsInGroupResponse struct {
	Value []GetDatasetsInGroupResponseItem
}

GetDatasetsInGroupResponse represents the details when getting a datasets in a group.

type GetDatasetsInGroupResponseItem

type GetDatasetsInGroupResponseItem struct {
	ID                               string
	Name                             string
	AddRowsAPIEnabled                bool
	ConfiguredBy                     string
	IsRefreshable                    bool
	IsEffectiveIdentityRequired      bool
	IsEffectiveIdentityRolesRequired bool
	TargetStorageMode                string
}

GetDatasetsInGroupResponseItem represents a single dataset

type GetDatasourcesInGroupResponse added in v1.1.0

type GetDatasourcesInGroupResponse struct {
	Value []GetDatasourcesInGroupResponseItem
}

GetDatasourcesInGroupResponse represents the response from get datasources

type GetDatasourcesInGroupResponseItem added in v1.1.0

type GetDatasourcesInGroupResponseItem struct {
	DatasourceID      string
	DatasourceType    string
	GatewayID         string
	Name              string
	CopnnectionString string
	ConnectionDetails GetDatasourcesInGroupResponseItemConnectionDetails
}

GetDatasourcesInGroupResponseItem represents a single datasource

type GetDatasourcesInGroupResponseItemConnectionDetails added in v1.1.0

type GetDatasourcesInGroupResponseItemConnectionDetails struct {
	Database *string
	Server   *string
	URL      *string
}

GetDatasourcesInGroupResponseItemConnectionDetails represents connection details for a single datasource

type GetGroupResponse

type GetGroupResponse struct {
	ID                    string
	IsOnDedicatedCapacity bool
	Name                  string
	CapacityID            string
}

GetGroupResponse represents the details when getting an individual group

type GetGroupUsersResponse added in v1.1.0

type GetGroupUsersResponse struct {
	Value []GetGroupUsersResponseItem
}

GetGroupUsersResponse represents list of users that have access to the specified workspace.

type GetGroupUsersResponseItem added in v1.1.0

type GetGroupUsersResponseItem struct {
	DisplayName          string
	EmailAddress         string
	GroupUserAccessRight string
	Identifier           string
	PrincipalType        string
}

GetGroupUsersResponseItem represents a single user details.

type GetGroupsResponse

type GetGroupsResponse struct {
	Value []GetGroupsResponseItem
}

GetGroupsResponse represents the response from the GetGroups API

type GetGroupsResponseItem

type GetGroupsResponseItem struct {
	ID                    string
	IsOnDedicatedCapacity bool
	Name                  string
	CapacityID            string
}

GetGroupsResponseItem represents an item returned within GetGroupsResponse

type GetImportInGroupResponse

type GetImportInGroupResponse struct {
	ID              string
	ImportState     string
	CreatedDateTime time.Time
	UpdatedDateTime time.Time
	Name            string
	ConnectionType  string
	Source          string
	Datasets        []GetImportInGroupResponseDataset
	Reports         []GetImportInGroupResponseReport
}

GetImportInGroupResponse represents the response from getting an import in a group

type GetImportInGroupResponseDataset

type GetImportInGroupResponseDataset struct {
	ID                string
	Name              string
	WebURL            string
	TargetStorageMode string
}

GetImportInGroupResponseDataset represents the dataset from the response when getting an import in a group

type GetImportInGroupResponseReport

type GetImportInGroupResponseReport struct {
	ID         string
	ReportType string
	Name       string
	WebURL     string
}

GetImportInGroupResponseReport represents the report from the response when getting an import in a group

type GetImportsInGroupResponse

type GetImportsInGroupResponse struct {
	Value []GetImportsInGroupResponseItem
}

GetImportsInGroupResponse represents the response from imports in a group

type GetImportsInGroupResponseItem

type GetImportsInGroupResponseItem struct {
	ID              string
	ImportState     string
	CreatedDateTime time.Time
	UpdatedDateTime time.Time
	Name            string
	ConnectionType  string
	Source          string
	Datasets        []GetImportsInGroupResponseItemDataset
	Reports         []GetImportsInGroupResponseItemReport
}

GetImportsInGroupResponseItem represents a single response item from getting an imports in a group

type GetImportsInGroupResponseItemDataset

type GetImportsInGroupResponseItemDataset struct {
	ID                string
	Name              string
	WebURL            string
	TargetStorageMode string
}

GetImportsInGroupResponseItemDataset represents the dataset from the response when getting a imports in a group

type GetImportsInGroupResponseItemReport

type GetImportsInGroupResponseItemReport struct {
	ID         string
	ReportType string
	Name       string
	WebURL     string
}

GetImportsInGroupResponseItemReport represents the report from the response when getting a imports in a group

type GetParametersInGroupResponse added in v1.1.0

type GetParametersInGroupResponse struct {
	Value []GetParametersInGroupResponseItem
}

GetParametersInGroupResponse represents the response from get parameters

type GetParametersInGroupResponseItem added in v1.1.0

type GetParametersInGroupResponseItem struct {
	Name         string
	Type         string
	IsRequired   bool
	CurrentValue string
}

GetParametersInGroupResponseItem represents a single parameter

type GetRefreshScheduleInGroupResponse added in v1.1.0

type GetRefreshScheduleInGroupResponse struct {
	Enabled         bool
	Days            []string
	Times           []string
	LocalTimeZoneID string
	NotifyOption    string
}

GetRefreshScheduleInGroupResponse represents the response to getting a refresh schedule

type GetReportInGroupResponse added in v1.4.0

type GetReportInGroupResponse struct {
	ID        string
	Name      string
	DatasetID string
	WebURL    string
	EmbedURL  string
}

GetReportsInGroupResponse represents the details when getting a report in a group.

type GetReportsInGroupResponse

type GetReportsInGroupResponse struct {
	Value []GetReportsInGroupResponseItem
}

GetReportsInGroupResponse represents the details when getting a report in a group.

type GetReportsInGroupResponseItem

type GetReportsInGroupResponseItem struct {
	ID        string
	Name      string
	DatasetID string
	WebURL    string
	EmbedURL  string
}

GetReportsInGroupResponseItem represents a single dataset

type GetTablesResponse

type GetTablesResponse struct {
	Value []GetTablesResponseTable
}

GetTablesResponse represents the response to a request to get tables

type GetTablesResponseTable

type GetTablesResponseTable struct {
	Name string
}

GetTablesResponseTable represents a table from the response to a request to get tables

type GroupAssignToCapacityRequest added in v1.1.0

type GroupAssignToCapacityRequest struct {
	CapacityID string `json:"capacityId"`
}

GroupAssignToCapacityRequest represents the request for Assigning capacity to group API.

type HTTPUnsuccessfulError

type HTTPUnsuccessfulError struct {
	Request      *http.Request
	Response     *http.Response
	ErrorBody    *ErrorBody
	ErrorBodyRaw []byte
}

HTTPUnsuccessfulError represents an error thrown when a non 2xx response is received

func (HTTPUnsuccessfulError) Error

func (err HTTPUnsuccessfulError) Error() string

type PostDatasetInGroupRequest added in v1.2.0

type PostDatasetInGroupRequest struct {
	Name          string                                  `json:"name,omitempty"`
	DefaultMode   string                                  `json:"defaultMode,omitempty"`
	Tables        []PostDatasetInGroupRequestTable        `json:"tables,omitempty"`
	Relationships []PostDatasetInGroupRequestRelationship `json:"relationships,omitempty"`
}

PostDatasetInGroupRequest represents the request to create a push dataset

type PostDatasetInGroupRequestRelationship added in v1.2.0

type PostDatasetInGroupRequestRelationship struct {
	Name                   string `json:"name,omitempty"`
	FromColumn             string `json:"fromColumn,omitempty"`
	FromTable              string `json:"fromTable,omitempty"`
	ToColumn               string `json:"toColumn,omitempty"`
	ToTable                string `json:"toTable,omitempty"`
	CrossFilteringBehavior string `json:"crossFilteringBehavior,omitempty"`
}

PostDatasetInGroupRequestRelationship represents a relationship in the request to create a push dataset

type PostDatasetInGroupRequestTable added in v1.2.0

type PostDatasetInGroupRequestTable struct {
	Name     string                                  `json:"name,omitempty"`
	Columns  []PostDatasetInGroupRequestTableColumn  `json:"columns,omitempty"`
	Measures []PostDatasetInGroupRequestTableMeasure `json:"measures,omitempty"`
}

PostDatasetInGroupRequestTable represents a table in the request to create a push dataset

type PostDatasetInGroupRequestTableColumn added in v1.2.0

type PostDatasetInGroupRequestTableColumn struct {
	Name         string `json:"name,omitempty"`
	DataType     string `json:"dataType,omitempty"`
	FormatString string `json:"formatString,omitempty"`
}

PostDatasetInGroupRequestTableColumn represents a table column in the request to create a push dataset

type PostDatasetInGroupRequestTableMeasure added in v1.2.0

type PostDatasetInGroupRequestTableMeasure struct {
	Name       string `json:"name,omitempty"`
	Expression string `json:"expression,omitempty"`
}

PostDatasetInGroupRequestTableMeasure represents a table measure in the request to create a push dataset

type PostDatasetInGroupResponse added in v1.2.0

type PostDatasetInGroupResponse struct {
	ID   string
	Name string
}

PostDatasetInGroupResponse represents the details when post a dataset in a group.

type PostImportInGroupResponse

type PostImportInGroupResponse struct {
	ID string
}

PostImportInGroupResponse represents the response from creating an inmport in a group

type PostRowsInGroupRequest added in v1.2.0

type PostRowsInGroupRequest struct {
	Rows []map[string]interface{}
}

PostRowsInGroupRequest represents the request to post rows into a push dataset

type PutTableInGroupRequest added in v1.2.0

type PutTableInGroupRequest struct {
	Name     string                               `json:"name,omitempty"`
	Columns  []PutTableInGroupRequestTableColumn  `json:"columns,omitempty"`
	Measures []PutTableInGroupRequestTableMeasure `json:"measures,omitempty"`
}

PutTableInGroupRequest represents the request to update a table

type PutTableInGroupRequestTableColumn added in v1.2.0

type PutTableInGroupRequestTableColumn struct {
	Name         string `json:"name,omitempty"`
	DataType     string `json:"dataType,omitempty"`
	FormatString string `json:"formatString,omitempty"`
}

PutTableInGroupRequestTableColumn represents a table column in the request to update a table

type PutTableInGroupRequestTableMeasure added in v1.2.0

type PutTableInGroupRequestTableMeasure struct {
	Name       string `json:"name,omitempty"`
	Expression string `json:"expression,omitempty"`
}

PutTableInGroupRequestTableMeasure represents a table measure in the request to update a table

type RebindReportInGroupRequest added in v1.4.0

type RebindReportInGroupRequest struct {
	DatasetID string `json:"datasetId"`
}

RebindReportInGroup represents the request for the RebindReportInGroup API

type UpdateDatasourcesInGroupRequest added in v1.1.0

type UpdateDatasourcesInGroupRequest struct {
	UpdateDetails []UpdateDatasourcesInGroupRequestItem
}

UpdateDatasourcesInGroupRequest represents the request to update datasources

type UpdateDatasourcesInGroupRequestItem added in v1.1.0

type UpdateDatasourcesInGroupRequestItem struct {
	DatasourceSelector UpdateDatasourcesInGroupRequestItemDatasourceSelector
	ConnectionDetails  UpdateDatasourcesInGroupRequestItemConnectionDetails
}

UpdateDatasourcesInGroupRequestItem represents a single datasource update

type UpdateDatasourcesInGroupRequestItemConnectionDetails added in v1.1.0

type UpdateDatasourcesInGroupRequestItemConnectionDetails struct {
	Database *string
	Server   *string
	URL      *string
}

UpdateDatasourcesInGroupRequestItemConnectionDetails represents connection details for a single datasource

type UpdateDatasourcesInGroupRequestItemDatasourceSelector added in v1.1.0

type UpdateDatasourcesInGroupRequestItemDatasourceSelector struct {
	DatasourceType    string
	ConnectionDetails UpdateDatasourcesInGroupRequestItemConnectionDetails
}

UpdateDatasourcesInGroupRequestItemDatasourceSelector represents a query to select a datasource

type UpdateGroupAsAdminRequest

type UpdateGroupAsAdminRequest struct {
	Name string `json:"name"`
}

UpdateGroupAsAdminRequest represents the request to the UpdateGroupAsAdmin API

type UpdateGroupUserRequest added in v1.1.0

type UpdateGroupUserRequest struct {
	DisplayName          string `json:"displayName"`
	EmailAddress         string `json:"emailAddress"`
	GroupUserAccessRight string `json:"groupUserAccessRight"`
	Identifier           string `json:"identifier"`
	PrincipalType        string `json:"principalType"`
}

UpdateGroupUserRequest represents details when updating a group user.

type UpdateParametersInGroupRequest added in v1.1.0

type UpdateParametersInGroupRequest struct {
	UpdateDetails []UpdateParametersInGroupRequestItem
}

UpdateParametersInGroupRequest represents the request to update parameters

type UpdateParametersInGroupRequestItem added in v1.1.0

type UpdateParametersInGroupRequestItem struct {
	Name     string
	NewValue string
}

UpdateParametersInGroupRequestItem represents a single parameter update

type UpdateRefreshScheduleInGroupRequest added in v1.1.0

type UpdateRefreshScheduleInGroupRequest struct {
	Value UpdateRefreshScheduleInGroupRequestValue `json:"value"`
}

UpdateRefreshScheduleInGroupRequest represents the request to update refresh schedules

type UpdateRefreshScheduleInGroupRequestValue added in v1.1.0

type UpdateRefreshScheduleInGroupRequestValue struct {
	Enabled         *bool     `json:"enabled,omitempty"`
	Days            *[]string `json:"days,omitempty"`
	Times           *[]string `json:"times,omitempty"`
	LocalTimeZoneID *string   `json:"localTimeZoneId,omitempty"`
	NotifyOption    *string   `json:"notifyOption,omitempty"`
}

UpdateRefreshScheduleInGroupRequestValue represents the value section in the request tot update refresh schedules

Jump to

Keyboard shortcuts

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