Documentation
¶
Index ¶
- func ActionBlueprintID(action Action) string
- func IsAutomationAction(action Action) bool
- func SelfServiceActionBlueprintID(action Action) string
- type APIError
- type Action
- type ActionRun
- type AuditLog
- type Automation
- type BatchSkillError
- type BatchUploadSkillResultItem
- type BatchUploadSkillsRequest
- type BatchUploadSkillsResponse
- type Blueprint
- type BulkEntityError
- type CatalogEntitySnapshot
- type Client
- func (c *Client) ApproveActionRun(ctx context.Context, runID string, body map[string]interface{}) (ActionRun, error)
- func (c *Client) BulkDeleteEntities(ctx context.Context, blueprintIdentifier string, entityIdentifiers []string, ...) (map[string]interface{}, error)
- func (c *Client) BulkUpsertEntities(ctx context.Context, blueprintID string, entities []Entity, upsert bool) ([]BulkEntityError, error)
- func (c *Client) Close() error
- func (c *Client) CreateAction(ctx context.Context, blueprintIdentifier string, action Action) (Action, error)
- func (c *Client) CreateAutomation(ctx context.Context, automation Automation) (Automation, error)
- func (c *Client) CreateBlueprint(ctx context.Context, blueprint Blueprint) (Blueprint, error)
- func (c *Client) CreateEntity(ctx context.Context, blueprintIdentifier string, entity Entity) (Entity, error)
- func (c *Client) CreateFolder(ctx context.Context, folder Folder) error
- func (c *Client) CreateMigration(ctx context.Context, migration MigrationRequest) (Migration, error)
- func (c *Client) CreatePage(ctx context.Context, page Page) (Page, error)
- func (c *Client) CreateScorecard(ctx context.Context, blueprintIdentifier string, scorecard Scorecard) (Scorecard, error)
- func (c *Client) CreateTeam(ctx context.Context, team Team) (Team, error)
- func (c *Client) CreateUserEntitiesBulk(ctx context.Context, entities []Entity, upsert bool) ([]BulkEntityError, error)
- func (c *Client) CreateWebhook(ctx context.Context, body map[string]interface{}) (Webhook, error)
- func (c *Client) DeleteAction(ctx context.Context, blueprintIdentifier, actionIdentifier string) error
- func (c *Client) DeleteActionByID(ctx context.Context, actionIdentifier string) error
- func (c *Client) DeleteAutomation(ctx context.Context, automationIdentifier string) error
- func (c *Client) DeleteBlueprint(ctx context.Context, identifier string) error
- func (c *Client) DeleteEntity(ctx context.Context, blueprintIdentifier, entityIdentifier string) error
- func (c *Client) DeleteFolder(ctx context.Context, folderIdentifier string) error
- func (c *Client) DeleteIntegration(ctx context.Context, integrationIdentifier string) error
- func (c *Client) DeletePage(ctx context.Context, pageIdentifier string) error
- func (c *Client) DeleteScorecard(ctx context.Context, blueprintIdentifier, scorecardIdentifier string) error
- func (c *Client) DeleteTeam(ctx context.Context, teamName string) error
- func (c *Client) DeleteWebhook(ctx context.Context, id string) error
- func (c *Client) ExecuteAction(ctx context.Context, actionID string, body map[string]interface{}) (ActionRun, error)
- func (c *Client) ForEachEntity(ctx context.Context, blueprintIdentifier string, yield func([]Entity) error) error
- func (c *Client) ForEachEntityPage(ctx context.Context, blueprintIdentifier string, body map[string]interface{}, ...) error
- func (c *Client) GetActionPermissions(ctx context.Context, actionIdentifier string) (Permissions, error)
- func (c *Client) GetActionRun(ctx context.Context, runID string) (ActionRun, error)
- func (c *Client) GetActionRuns(ctx context.Context) ([]ActionRun, error)
- func (c *Client) GetActions(ctx context.Context, blueprintIdentifier string) ([]Action, error)
- func (c *Client) GetAllActions(ctx context.Context) ([]Action, error)
- func (c *Client) GetAllScorecards(ctx context.Context) ([]Scorecard, error)
- func (c *Client) GetAuditLogs(ctx context.Context) ([]AuditLog, error)
- func (c *Client) GetBlueprint(ctx context.Context, identifier string) (Blueprint, error)
- func (c *Client) GetBlueprintPermissions(ctx context.Context, blueprintIdentifier string) (Permissions, error)
- func (c *Client) GetBlueprints(ctx context.Context) ([]Blueprint, error)
- func (c *Client) GetEntities(ctx context.Context, blueprintIdentifier string, params map[string]string) ([]Entity, error)
- func (c *Client) GetEntitiesCount(ctx context.Context, blueprintIdentifier string) (int, error)
- func (c *Client) GetEntity(ctx context.Context, blueprintIdentifier, entityIdentifier string) (Entity, error)
- func (c *Client) GetFolders(ctx context.Context) ([]Folder, error)
- func (c *Client) GetIntegrations(ctx context.Context) ([]Integration, error)
- func (c *Client) GetMigration(ctx context.Context, identifier string) (Migration, error)
- func (c *Client) GetPage(ctx context.Context, pageIdentifier string) (Page, error)
- func (c *Client) GetPagePermissions(ctx context.Context, pageIdentifier string) (Permissions, error)
- func (c *Client) GetPages(ctx context.Context) ([]Page, error)
- func (c *Client) GetScorecards(ctx context.Context, blueprintIdentifier string) ([]Scorecard, error)
- func (c *Client) GetSkill(ctx context.Context, identifier string) (*GetSkillResponse, error)
- func (c *Client) GetSkillsGrouped(ctx context.Context, query GetSkillsQuery) (*GroupedSkillsResponse, error)
- func (c *Client) GetTeams(ctx context.Context) ([]Team, error)
- func (c *Client) GetUser(ctx context.Context, userEmail string) (User, error)
- func (c *Client) GetUsers(ctx context.Context) ([]User, error)
- func (c *Client) GetWebhook(ctx context.Context, id string) (Webhook, error)
- func (c *Client) GetWebhooks(ctx context.Context) ([]Webhook, error)
- func (c *Client) PatchBlueprint(ctx context.Context, identifier string, blueprint Blueprint) (Blueprint, error)
- func (c *Client) PublishSkill(ctx context.Context, identifier string) (*SkillVersionWriteResponse, error)
- func (c *Client) Request(ctx context.Context, params RequestParams) (any, error)
- func (c *Client) SearchEntities(ctx context.Context, blueprintIdentifier string, body map[string]interface{}) ([]Entity, error)
- func (c *Client) SearchSkills(ctx context.Context, query SearchSkillsQuery) (*SkillsSummaryResponse, error)
- func (c *Client) TopSearchEntities(ctx context.Context, blueprintIdentifier string, body map[string]interface{}) ([]Entity, error)
- func (c *Client) UnpublishSkill(ctx context.Context, identifier string) (*UnpublishSkillResponse, error)
- func (c *Client) UpdateAction(ctx context.Context, blueprintIdentifier, actionIdentifier string, ...) (Action, error)
- func (c *Client) UpdateActionPermissions(ctx context.Context, actionIdentifier string, permissions Permissions) (Permissions, error)
- func (c *Client) UpdateActionRun(ctx context.Context, runID string, body map[string]interface{}) (ActionRun, error)
- func (c *Client) UpdateAutomation(ctx context.Context, automationIdentifier string, automation Automation) (Automation, error)
- func (c *Client) UpdateBlueprint(ctx context.Context, identifier string, blueprint Blueprint) (Blueprint, error)
- func (c *Client) UpdateBlueprintPermissions(ctx context.Context, blueprintIdentifier string, permissions Permissions) (Permissions, error)
- func (c *Client) UpdateEntity(ctx context.Context, blueprintIdentifier, entityIdentifier string, ...) (Entity, error)
- func (c *Client) UpdateIntegrationConfig(ctx context.Context, integrationIdentifier string, ...) (Integration, error)
- func (c *Client) UpdatePage(ctx context.Context, pageIdentifier string, page Page) (Page, error)
- func (c *Client) UpdatePagePermissions(ctx context.Context, pageIdentifier string, permissions Permissions) (Permissions, error)
- func (c *Client) UpdateScorecard(ctx context.Context, blueprintIdentifier, scorecardIdentifier string, ...) (Scorecard, error)
- func (c *Client) UpdateScorecards(ctx context.Context, blueprintIdentifier string, scorecards []Scorecard) ([]Scorecard, error)
- func (c *Client) UpdateTeam(ctx context.Context, teamName string, team Team) (Team, error)
- func (c *Client) UpdateWebhook(ctx context.Context, id string, body map[string]interface{}) (Webhook, error)
- func (c *Client) UploadSkill(ctx context.Context, body UploadSkillRequest) (*SkillVersionWriteResponse, error)
- func (c *Client) UploadSkillsBatch(ctx context.Context, body BatchUploadSkillsRequest) (*BatchUploadSkillsResponse, error)
- type ClientOpts
- type Entity
- type Folder
- type GetSkillResponse
- type GetSkillsQuery
- type GroupedSkillsResponse
- type Integration
- type Migration
- type MigrationRequest
- type Page
- type Permissions
- type RequestParams
- type Scorecard
- type SearchSkillsQuery
- type SkillAtLatestVersion
- type SkillCatalogEntry
- type SkillFile
- type SkillFileInput
- type SkillGroupAtLatestVersion
- type SkillVersionWriteResponse
- type SkillsSummaryResponse
- type Team
- type TokenManager
- type TokenResponse
- type UnpublishSkillResponse
- type UploadSkillRequest
- type User
- type VersionBump
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionBlueprintID ¶ added in v0.3.7
ActionBlueprintID extracts the blueprint identifier an action or automation references, if any. Self-service actions carry it at trigger.blueprintIdentifier; automations can carry it at trigger.event.blueprintIdentifier.
func IsAutomationAction ¶ added in v0.3.7
IsAutomationAction reports whether an action record is an automation.
func SelfServiceActionBlueprintID ¶ added in v0.3.7
SelfServiceActionBlueprintID extracts the blueprint identifier from a non-automation action. Automations are excluded even when their event references a blueprint.
Types ¶
type APIError ¶ added in v0.3.7
type APIError struct {
Method string
URL string
Status string
StatusCode int
Body string
Code string
Message string
Details map[string]interface{}
}
APIError represents a non-2xx response from the Port API.
type Action ¶
type Action map[string]interface{}
Action represents a Port action.
func ActionWithBlueprintIdentifier ¶ added in v0.3.7
ActionWithBlueprintIdentifier returns a shallow copy of action with trigger.blueprintIdentifier set.
type ActionRun ¶ added in v0.2.23
type ActionRun map[string]interface{}
ActionRun represents a Port action run.
type AuditLog ¶ added in v0.2.23
type AuditLog map[string]interface{}
AuditLog represents a Port audit log entry.
type BatchSkillError ¶ added in v0.3.1
type BatchSkillError struct {
Name string `json:"name"`
Message string `json:"message"`
StatusCode int `json:"statusCode"`
}
BatchSkillError is a per-item error in batch create.
type BatchUploadSkillResultItem ¶ added in v0.3.1
type BatchUploadSkillResultItem struct {
Identifier string `json:"identifier"`
OK bool `json:"ok"`
Result *SkillVersionWriteResponse `json:"result,omitempty"`
Error *BatchSkillError `json:"error,omitempty"`
}
BatchUploadSkillResultItem is one result in POST /skills/upload/batch.
type BatchUploadSkillsRequest ¶ added in v0.3.1
type BatchUploadSkillsRequest struct {
Skills []UploadSkillRequest `json:"skills"`
}
BatchUploadSkillsRequest is the POST /skills/upload/batch body.
type BatchUploadSkillsResponse ¶ added in v0.3.1
type BatchUploadSkillsResponse struct {
OK bool `json:"ok"`
Results []BatchUploadSkillResultItem `json:"results"`
}
BatchUploadSkillsResponse is returned by POST /skills/upload/batch.
type BulkEntityError ¶ added in v0.2.22
type BulkEntityError struct {
Identifier string `json:"identifier"`
Index float64 `json:"index"`
StatusCode float64 `json:"statusCode"`
Error string `json:"error"`
Message string `json:"message"`
}
BulkEntityError is a single per-entity failure returned by the bulk entity endpoint.
type CatalogEntitySnapshot ¶ added in v0.3.1
type CatalogEntitySnapshot struct {
Identifier string `json:"identifier"`
Title string `json:"title"`
Blueprint string `json:"blueprint"`
Properties map[string]interface{} `json:"properties"`
Relations map[string]interface{} `json:"relations,omitempty"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
CatalogEntitySnapshot is a Port entity without file payloads.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles authenticated requests to Port's API.
func (*Client) ApproveActionRun ¶ added in v0.2.23
func (c *Client) ApproveActionRun(ctx context.Context, runID string, body map[string]interface{}) (ActionRun, error)
ApproveActionRun approves or declines an action run.
func (*Client) BulkDeleteEntities ¶ added in v0.2.23
func (c *Client) BulkDeleteEntities(ctx context.Context, blueprintIdentifier string, entityIdentifiers []string, deleteDependents bool) (map[string]interface{}, error)
BulkDeleteEntities deletes multiple entities for a blueprint.
func (*Client) BulkUpsertEntities ¶ added in v0.2.23
func (c *Client) BulkUpsertEntities(ctx context.Context, blueprintID string, entities []Entity, upsert bool) ([]BulkEntityError, error)
BulkUpsertEntities upserts up to 20 entities for any blueprint in one call. Set upsert=true to overwrite existing entities; false returns 409 errors for conflicts.
func (*Client) Close ¶
Close closes the HTTP client (no-op for standard client, but implements closer pattern).
func (*Client) CreateAction ¶
func (c *Client) CreateAction(ctx context.Context, blueprintIdentifier string, action Action) (Action, error)
CreateAction creates a blueprint-level action using the organization-wide actions endpoint.
func (*Client) CreateAutomation ¶
func (c *Client) CreateAutomation(ctx context.Context, automation Automation) (Automation, error)
CreateAutomation creates a new automation (organization-wide action).
func (*Client) CreateBlueprint ¶
CreateBlueprint creates a new blueprint.
func (*Client) CreateEntity ¶
func (c *Client) CreateEntity(ctx context.Context, blueprintIdentifier string, entity Entity) (Entity, error)
CreateEntity creates a new entity.
func (*Client) CreateFolder ¶ added in v0.1.15
CreateFolder creates a sidebar folder under the catalog sidebar.
func (*Client) CreateMigration ¶ added in v0.3.7
func (c *Client) CreateMigration(ctx context.Context, migration MigrationRequest) (Migration, error)
CreateMigration starts a Port migration.
func (*Client) CreatePage ¶
CreatePage creates a new page.
func (*Client) CreateScorecard ¶
func (c *Client) CreateScorecard(ctx context.Context, blueprintIdentifier string, scorecard Scorecard) (Scorecard, error)
CreateScorecard creates a new scorecard for a blueprint.
func (*Client) CreateTeam ¶
CreateTeam creates a new team.
func (*Client) CreateUserEntitiesBulk ¶ added in v0.2.22
func (c *Client) CreateUserEntitiesBulk(ctx context.Context, entities []Entity, upsert bool) ([]BulkEntityError, error)
CreateUserEntitiesBulk creates up to 20 _user blueprint entities in one call. Set upsert=true to overwrite existing entities; false returns 409 errors for conflicts.
func (*Client) CreateWebhook ¶ added in v0.2.23
CreateWebhook creates a new webhook.
func (*Client) DeleteAction ¶
func (c *Client) DeleteAction(ctx context.Context, blueprintIdentifier, actionIdentifier string) error
DeleteAction deletes a blueprint-level action using the organization-wide actions endpoint.
func (*Client) DeleteActionByID ¶ added in v0.3.7
DeleteActionByID deletes an action using the organization-wide actions endpoint.
func (*Client) DeleteAutomation ¶
DeleteAutomation deletes an automation.
func (*Client) DeleteBlueprint ¶
DeleteBlueprint deletes a blueprint.
func (*Client) DeleteEntity ¶
func (c *Client) DeleteEntity(ctx context.Context, blueprintIdentifier, entityIdentifier string) error
DeleteEntity deletes an entity.
func (*Client) DeleteFolder ¶ added in v0.2.0
DeleteFolder deletes a sidebar folder from the catalog sidebar.
func (*Client) DeleteIntegration ¶
DeleteIntegration deletes an integration.
func (*Client) DeletePage ¶
DeletePage deletes a page.
func (*Client) DeleteScorecard ¶
func (c *Client) DeleteScorecard(ctx context.Context, blueprintIdentifier, scorecardIdentifier string) error
DeleteScorecard deletes a scorecard.
func (*Client) DeleteTeam ¶
DeleteTeam deletes a team.
func (*Client) DeleteWebhook ¶ added in v0.2.23
DeleteWebhook deletes a webhook.
func (*Client) ExecuteAction ¶ added in v0.2.23
func (c *Client) ExecuteAction(ctx context.Context, actionID string, body map[string]interface{}) (ActionRun, error)
ExecuteAction creates a new action run for the given action identifier.
func (*Client) ForEachEntity ¶ added in v0.3.2
func (c *Client) ForEachEntity(ctx context.Context, blueprintIdentifier string, yield func([]Entity) error) error
ForEachEntity retrieves all entities for a blueprint and calls yield with each returned batch. Blueprints above the threshold use the search endpoint because it supports cursor pagination; smaller blueprints use the canonical GET endpoint.
func (*Client) ForEachEntityPage ¶ added in v0.3.2
func (c *Client) ForEachEntityPage(ctx context.Context, blueprintIdentifier string, body map[string]interface{}, yield func([]Entity) error) error
ForEachEntityPage queries entities for a blueprint using Port's search endpoint and calls yield once for each returned page.
func (*Client) GetActionPermissions ¶ added in v0.1.7
func (c *Client) GetActionPermissions(ctx context.Context, actionIdentifier string) (Permissions, error)
GetActionPermissions retrieves permissions for an action.
func (*Client) GetActionRun ¶ added in v0.2.23
GetActionRun retrieves a specific action run.
func (*Client) GetActionRuns ¶ added in v0.2.23
GetActionRuns retrieves all action runs.
func (*Client) GetActions ¶
GetActions retrieves actions for a blueprint using the organization-wide actions endpoint and client-side blueprint filtering.
func (*Client) GetAllActions ¶
GetAllActions retrieves all actions and automations (organization-wide).
func (*Client) GetAllScorecards ¶
GetAllScorecards retrieves all scorecards (organization-wide).
func (*Client) GetAuditLogs ¶ added in v0.2.23
GetAuditLogs retrieves the organization audit log.
func (*Client) GetBlueprint ¶
GetBlueprint retrieves a specific blueprint.
func (*Client) GetBlueprintPermissions ¶ added in v0.1.7
func (c *Client) GetBlueprintPermissions(ctx context.Context, blueprintIdentifier string) (Permissions, error)
GetBlueprintPermissions retrieves permissions for a blueprint.
func (*Client) GetBlueprints ¶
GetBlueprints retrieves all blueprints.
func (*Client) GetEntities ¶
func (c *Client) GetEntities(ctx context.Context, blueprintIdentifier string, params map[string]string) ([]Entity, error)
GetEntities retrieves entities for a blueprint.
func (*Client) GetEntitiesCount ¶ added in v0.3.2
GetEntitiesCount retrieves the number of entities for a blueprint.
func (*Client) GetEntity ¶
func (c *Client) GetEntity(ctx context.Context, blueprintIdentifier, entityIdentifier string) (Entity, error)
GetEntity retrieves a specific entity.
func (*Client) GetFolders ¶ added in v0.1.15
GetFolders retrieves sidebar folders from the catalog sidebar.
func (*Client) GetIntegrations ¶
func (c *Client) GetIntegrations(ctx context.Context) ([]Integration, error)
GetIntegrations retrieves all integrations.
func (*Client) GetMigration ¶ added in v0.3.7
GetMigration retrieves a Port migration job.
func (*Client) GetPagePermissions ¶ added in v0.2.18
func (c *Client) GetPagePermissions(ctx context.Context, pageIdentifier string) (Permissions, error)
GetPagePermissions retrieves permissions for a page.
func (*Client) GetScorecards ¶
func (c *Client) GetScorecards(ctx context.Context, blueprintIdentifier string) ([]Scorecard, error)
GetScorecards retrieves scorecards for a blueprint.
func (*Client) GetSkillsGrouped ¶ added in v0.3.1
func (c *Client) GetSkillsGrouped(ctx context.Context, query GetSkillsQuery) (*GroupedSkillsResponse, error)
GetSkillsGrouped fetches published skills grouped by skill group.
func (*Client) GetWebhook ¶ added in v0.2.23
GetWebhook retrieves a specific webhook.
func (*Client) GetWebhooks ¶ added in v0.2.23
GetWebhooks retrieves all webhooks.
func (*Client) PatchBlueprint ¶ added in v0.2.10
func (c *Client) PatchBlueprint(ctx context.Context, identifier string, blueprint Blueprint) (Blueprint, error)
PatchBlueprint updates an existing blueprint with a partial payload (PATCH).
func (*Client) PublishSkill ¶ added in v0.3.1
func (c *Client) PublishSkill(ctx context.Context, identifier string) (*SkillVersionWriteResponse, error)
PublishSkill sets the active version to the latest semver.
func (*Client) SearchEntities ¶ added in v0.2.16
func (c *Client) SearchEntities(ctx context.Context, blueprintIdentifier string, body map[string]interface{}) ([]Entity, error)
SearchEntities queries entities for a blueprint using Port's search endpoint. Pages are fetched sequentially (each page's cursor depends on the previous response), so this cannot be parallelized client-side. For large blueprints this is still far better than GetEntities, which makes a single unbounded request that 504s above ~10k entities.
func (*Client) SearchSkills ¶ added in v0.3.1
func (c *Client) SearchSkills(ctx context.Context, query SearchSkillsQuery) (*SkillsSummaryResponse, error)
SearchSkills finds skills whose identifier or title matches the query.
func (*Client) TopSearchEntities ¶ added in v0.2.16
func (c *Client) TopSearchEntities(ctx context.Context, blueprintIdentifier string, body map[string]interface{}) ([]Entity, error)
TopSearchEntities queries entities using Port's top-search endpoint, which supports server-side sorting.
func (*Client) UnpublishSkill ¶ added in v0.3.1
func (c *Client) UnpublishSkill(ctx context.Context, identifier string) (*UnpublishSkillResponse, error)
UnpublishSkill clears the active version.
func (*Client) UpdateAction ¶
func (c *Client) UpdateAction(ctx context.Context, blueprintIdentifier, actionIdentifier string, action Action) (Action, error)
UpdateAction updates an existing blueprint-level action using the organization-wide actions endpoint.
func (*Client) UpdateActionPermissions ¶ added in v0.1.7
func (c *Client) UpdateActionPermissions(ctx context.Context, actionIdentifier string, permissions Permissions) (Permissions, error)
UpdateActionPermissions updates permissions for an action.
func (*Client) UpdateActionRun ¶ added in v0.2.23
func (c *Client) UpdateActionRun(ctx context.Context, runID string, body map[string]interface{}) (ActionRun, error)
UpdateActionRun updates an action run (set status, message, link, logs).
func (*Client) UpdateAutomation ¶
func (c *Client) UpdateAutomation(ctx context.Context, automationIdentifier string, automation Automation) (Automation, error)
UpdateAutomation updates an existing automation.
func (*Client) UpdateBlueprint ¶
func (c *Client) UpdateBlueprint(ctx context.Context, identifier string, blueprint Blueprint) (Blueprint, error)
UpdateBlueprint updates an existing blueprint.
func (*Client) UpdateBlueprintPermissions ¶ added in v0.1.7
func (c *Client) UpdateBlueprintPermissions(ctx context.Context, blueprintIdentifier string, permissions Permissions) (Permissions, error)
UpdateBlueprintPermissions updates permissions for a blueprint.
func (*Client) UpdateEntity ¶
func (c *Client) UpdateEntity(ctx context.Context, blueprintIdentifier, entityIdentifier string, entity Entity) (Entity, error)
UpdateEntity updates an existing entity.
func (*Client) UpdateIntegrationConfig ¶
func (c *Client) UpdateIntegrationConfig(ctx context.Context, integrationIdentifier string, config map[string]interface{}) (Integration, error)
UpdateIntegrationConfig updates an integration's configuration.
func (*Client) UpdatePage ¶
UpdatePage updates an existing page.
func (*Client) UpdatePagePermissions ¶ added in v0.2.18
func (c *Client) UpdatePagePermissions(ctx context.Context, pageIdentifier string, permissions Permissions) (Permissions, error)
UpdatePagePermissions updates permissions for a page.
func (*Client) UpdateScorecard ¶
func (c *Client) UpdateScorecard(ctx context.Context, blueprintIdentifier, scorecardIdentifier string, scorecard Scorecard) (Scorecard, error)
UpdateScorecard updates an existing scorecard.
func (*Client) UpdateScorecards ¶
func (c *Client) UpdateScorecards(ctx context.Context, blueprintIdentifier string, scorecards []Scorecard) ([]Scorecard, error)
UpdateScorecards updates multiple scorecards for a blueprint using bulk PUT endpoint. The API expects the array of scorecards directly (not wrapped in an object).
func (*Client) UpdateTeam ¶
UpdateTeam updates an existing team.
func (*Client) UpdateWebhook ¶ added in v0.2.23
func (c *Client) UpdateWebhook(ctx context.Context, id string, body map[string]interface{}) (Webhook, error)
UpdateWebhook updates an existing webhook.
func (*Client) UploadSkill ¶ added in v0.3.1
func (c *Client) UploadSkill(ctx context.Context, body UploadSkillRequest) (*SkillVersionWriteResponse, error)
UploadSkill creates or updates a skill via POST /skills/upload.
func (*Client) UploadSkillsBatch ¶ added in v0.3.1
func (c *Client) UploadSkillsBatch(ctx context.Context, body BatchUploadSkillsRequest) (*BatchUploadSkillsResponse, error)
UploadSkillsBatch uploads multiple skills via POST /skills/upload/batch.
type ClientOpts ¶ added in v0.1.17
type Folder ¶ added in v0.1.15
type Folder map[string]interface{}
Folder represents a Port sidebar folder.
type GetSkillResponse ¶ added in v0.3.1
type GetSkillResponse struct {
OK bool `json:"ok"`
Skill SkillAtLatestVersion `json:"skill"`
}
GetSkillResponse is returned by GET /skills/:identifier.
type GetSkillsQuery ¶ added in v0.3.1
type GetSkillsQuery struct {
SkillIdentifiers []string
IncludeGroups []string
ExcludeGroups []string
TeamsDefault *bool
Limit int
Exclude []string
IncludeUngrouped bool
IncludeUnpublished bool
}
GetSkillsQuery optional filters for GET /skills.
type GroupedSkillsResponse ¶ added in v0.3.1
type GroupedSkillsResponse struct {
OK bool `json:"ok"`
Groups []SkillGroupAtLatestVersion `json:"groups"`
UngroupedSkills []SkillAtLatestVersion `json:"ungroupedSkills"`
}
GroupedSkillsResponse is the GET /skills response body.
type Integration ¶
type Integration map[string]interface{}
Integration represents a Port integration.
type Migration ¶ added in v0.3.7
type Migration map[string]interface{}
Migration represents a Port migration job.
type MigrationRequest ¶ added in v0.3.7
type MigrationRequest struct {
SourceBlueprint string `json:"sourceBlueprint"`
Mapping map[string]interface{} `json:"mapping"`
}
MigrationRequest represents a Port migration request.
type Permissions ¶ added in v0.1.7
type Permissions map[string]interface{}
Permissions represents Port resource permissions.
type RequestParams ¶ added in v0.2.0
type SearchSkillsQuery ¶ added in v0.3.1
SearchSkillsQuery optional filters for GET /skills/search.
type SkillAtLatestVersion ¶ added in v0.3.1
type SkillAtLatestVersion struct {
Identifier string `json:"identifier"`
AgentSkillName string `json:"agentSkillName,omitempty"`
Title string `json:"title"`
Location string `json:"location"`
Description string `json:"description,omitempty"`
Version string `json:"version"`
VersionIdentifier string `json:"versionIdentifier"`
GroupIdentifiers []string `json:"groupIdentifiers,omitempty"`
Files []SkillFile `json:"files"`
}
SkillAtLatestVersion is one skill at its active version (sync catalog).
type SkillCatalogEntry ¶ added in v0.3.1
type SkillCatalogEntry struct {
Skill CatalogEntitySnapshot `json:"skill"`
Version *CatalogEntitySnapshot `json:"version"`
}
SkillCatalogEntry pairs a skill entity with its resolved version (if any).
type SkillFile ¶ added in v0.3.1
type SkillFile struct {
Identifier string `json:"identifier,omitempty"`
Title string `json:"title,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
Relations map[string]interface{} `json:"relations,omitempty"`
}
SkillFile is one file in a skill directory tree.
type SkillFileInput ¶ added in v0.3.1
type SkillFileInput struct {
Path string `json:"path"`
Content string `json:"content"`
Title string `json:"title,omitempty"`
}
SkillFileInput is one file in a create/edit skill request.
type SkillGroupAtLatestVersion ¶ added in v0.3.1
type SkillGroupAtLatestVersion struct {
Identifier string `json:"identifier"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
OwningTeamIDs []string `json:"owningTeamIds"`
MatchesUserTeams bool `json:"matchesUserTeams"`
Skills []SkillAtLatestVersion `json:"skills"`
}
SkillGroupAtLatestVersion groups skills with catalog metadata.
type SkillVersionWriteResponse ¶ added in v0.3.1
type SkillVersionWriteResponse struct {
OK bool `json:"ok"`
SkillIdentifier string `json:"skillIdentifier"`
Version string `json:"version"`
VersionIdentifier string `json:"versionIdentifier"`
ActiveVersionSet bool `json:"activeVersionSet"`
FileIdentifiers []string `json:"fileIdentifiers"`
}
SkillVersionWriteResponse is returned by create/edit skill endpoints.
type SkillsSummaryResponse ¶ added in v0.3.1
type SkillsSummaryResponse struct {
OK bool `json:"ok"`
Skills []SkillCatalogEntry `json:"skills"`
}
SkillsSummaryResponse is the GET /skills/summary response body.
type TokenManager ¶
type TokenManager struct {
ClientID string
ClientSecret string
APIURL string
// contains filtered or unexported fields
}
TokenManager manages authentication tokens with thread-safe caching.
func NewTokenManager ¶
func NewTokenManager(clientID, clientSecret, apiURL string) *TokenManager
NewTokenManager creates a new token manager.
func (*TokenManager) GetToken ¶
func (tm *TokenManager) GetToken() (string, error)
GetToken returns a valid token, refreshing if necessary. Thread-safe with read/write locks.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"accessToken"`
ExpiresIn int `json:"expiresIn"`
TokenType string `json:"tokenType"`
}
TokenResponse represents the Port API token response.
type UnpublishSkillResponse ¶ added in v0.3.1
type UnpublishSkillResponse struct {
OK bool `json:"ok"`
SkillIdentifier string `json:"skillIdentifier"`
}
UnpublishSkillResponse is returned by POST /skills/:identifier/unpublish.
type UploadSkillRequest ¶ added in v0.3.1
type UploadSkillRequest struct {
Identifier string `json:"identifier"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Location string `json:"location,omitempty"`
Publish bool `json:"publish,omitempty"`
VersionBump VersionBump `json:"versionBump,omitempty"`
GroupIDs []string `json:"groupIdentifiers,omitempty"`
FolderBaseName string `json:"folderBaseName,omitempty"`
Files []SkillFileInput `json:"files"`
}
UploadSkillRequest is the POST /skills/upload body.
type VersionBump ¶ added in v0.3.1
type VersionBump string
VersionBump is the semver increment for a new skill version.
const ( VersionBumpPatch VersionBump = "patch" VersionBumpMinor VersionBump = "minor" VersionBumpMajor VersionBump = "major" )