httpclient

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessControlTargetRole    = "role"
	AccessControlTargetMember  = "member"
	AccessControlTargetDefault = "default"
)

Access control target types used in composite IDs.

Variables

This section is empty.

Functions

func BuildProjectMemberCompositeID added in v1.0.4

func BuildProjectMemberCompositeID(projectID, role, organizationMember string) string

BuildProjectMemberCompositeID constructs a unique identifier for project member access. Format: project_id/role/<role_id> or project_id/member/<member_id>

Types

type AccessControl added in v1.0.4

type AccessControl struct {
	AccessLevel        *string `json:"access_level"`
	Resource           string  `json:"resource"`
	ResourceID         *string `json:"resource_id,omitempty"`
	OrganizationMember *string `json:"organization_member,omitempty"`
	Role               *string `json:"role,omitempty"`
	CreatedBy          *string `json:"created_by,omitempty"`
	CreatedAt          *string `json:"created_at,omitempty"`
	UpdatedAt          *string `json:"updated_at,omitempty"`
}

func (AccessControl) BuildCompositeID added in v1.0.4

func (ac AccessControl) BuildCompositeID(projectID string) string

BuildCompositeID constructs a unique identifier for this access control. Formats:

  • Role-specific: project_id/resource[/resource_id]/role/role_id
  • Member-specific: project_id/resource[/resource_id]/member/member_id
  • Project default: project_id/resource[/resource_id]/default

type AccessControlListResponse added in v1.0.4

type AccessControlListResponse struct {
	AccessControls        []AccessControl `json:"access_controls"`
	AvailableAccessLevels []string        `json:"available_access_levels"`
	DefaultAccessLevel    string          `json:"default_access_level"`
}

type AccessControlRequest added in v1.0.4

type AccessControlRequest struct {
	AccessLevel        *string `json:"access_level"`
	Resource           string  `json:"resource"`
	ResourceID         *string `json:"resource_id,omitempty"`
	OrganizationMember *string `json:"organization_member,omitempty"`
	Role               *string `json:"role,omitempty"`
}

type Action added in v1.0.5

type Action struct {
	ID                 int64                    `json:"id"`
	Name               *string                  `json:"name,omitempty"`
	Description        *string                  `json:"description,omitempty"`
	Tags               []string                 `json:"tags,omitempty"`
	PostToSlack        *bool                    `json:"post_to_slack,omitempty"`
	SlackMessageFormat *string                  `json:"slack_message_format,omitempty"`
	Steps              []map[string]interface{} `json:"steps,omitempty"`
	CreatedAt          *string                  `json:"created_at,omitempty"`
	Deleted            *bool                    `json:"deleted,omitempty"`
}

type ActionRequest added in v1.0.5

type ActionRequest struct {
	Name               *string                   `json:"name,omitempty"`
	Description        *string                   `json:"description,omitempty"`
	Tags               *[]string                 `json:"tags,omitempty"`
	PostToSlack        *bool                     `json:"post_to_slack,omitempty"`
	SlackMessageFormat *string                   `json:"slack_message_format,omitempty"`
	Steps              *[]map[string]interface{} `json:"steps,omitempty"`
	Deleted            *bool                     `json:"deleted,omitempty"`
}

type Alert

type Alert struct {
	ID                  string             `json:"id"`
	Name                *string            `json:"name,omitempty"`
	Insight             AlertInsight       `json:"insight"`
	Enabled             *bool              `json:"enabled,omitempty"`
	SubscribedUsers     []AlertUser        `json:"subscribed_users,omitempty"`
	Threshold           *AlertThreshold    `json:"threshold,omitempty"`
	Condition           *AlertCondition    `json:"condition,omitempty"`
	Config              *TrendsAlertConfig `json:"config,omitempty"`
	CalculationInterval *string            `json:"calculation_interval,omitempty"`
	SnoozedUntil        *string            `json:"snoozed_until,omitempty"`
	SkipWeekend         *bool              `json:"skip_weekend,omitempty"`
	State               *string            `json:"state,omitempty"`
	CreatedAt           *string            `json:"created_at,omitempty"`
	CreatedBy           map[string]any     `json:"created_by,omitempty"`
	LastNotifiedAt      *string            `json:"last_notified_at,omitempty"`
	LastCheckedAt       *string            `json:"last_checked_at,omitempty"`
	NextCheckAt         *string            `json:"next_check_at,omitempty"`
	Checks              []AlertCheck       `json:"checks,omitempty"`
}

type AlertCheck

type AlertCheck struct {
	ID              string   `json:"id"`
	CreatedAt       string   `json:"created_at"`
	CalculatedValue *float64 `json:"calculated_value,omitempty"`
	State           string   `json:"state"`
	TargetsNotified bool     `json:"targets_notified"`
}

type AlertCondition

type AlertCondition struct {
	Type string `json:"type"` // "absolute_value", "relative_increase", "relative_decrease"
}

type AlertInsight

type AlertInsight struct {
	ID int64 `json:"id"`
}

type AlertRequest

type AlertRequest struct {
	Name                *string            `json:"name,omitempty"`
	Insight             int64              `json:"insight"`
	Enabled             *bool              `json:"enabled,omitempty"`
	SubscribedUsers     []int64            `json:"subscribed_users"`
	Threshold           *AlertThreshold    `json:"threshold,omitempty"`
	Condition           *AlertCondition    `json:"condition,omitempty"`
	Config              *TrendsAlertConfig `json:"config,omitempty"`
	CalculationInterval *string            `json:"calculation_interval,omitempty"`
	SnoozedUntil        *string            `json:"snoozed_until,omitempty"`
	SkipWeekend         *bool              `json:"skip_weekend,omitempty"`
}

type AlertThreshold

type AlertThreshold struct {
	Configuration ThresholdConfiguration `json:"configuration"`
}

type AlertUser

type AlertUser struct {
	ID int64 `json:"id"`
}

type ClientOption

type ClientOption func(*http.Client)

ClientOption is a functional option for configuring the client.

func WithNoRetry

func WithNoRetry() ClientOption

WithNoRetry disables retry logic.

func WithRetryConfig

func WithRetryConfig(config middleware.RetryConfig) ClientOption

WithRetryConfig sets a custom retry configuration.

type Dashboard

type Dashboard struct {
	ID          int64    `json:"id"`
	Name        *string  `json:"name,omitempty"`
	Description *string  `json:"description,omitempty"`
	Pinned      *bool    `json:"pinned,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Deleted     *bool    `json:"deleted,omitempty"`
}

type DashboardLayoutPatchRequest added in v1.0.6

type DashboardLayoutPatchRequest struct {
	Tiles []DashboardTilePatchItem `json:"tiles"`
}

type DashboardLayoutResponse added in v1.0.6

type DashboardLayoutResponse struct {
	ID    int64           `json:"id"`
	Tiles []DashboardTile `json:"tiles"`
}

type DashboardRequest

type DashboardRequest struct {
	Name        *string  `json:"name,omitempty"`
	Description *string  `json:"description,omitempty"`
	Pinned      *bool    `json:"pinned,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Deleted     *bool    `json:"deleted,omitempty"`
}

type DashboardTile added in v1.0.6

type DashboardTile struct {
	ID      int64                  `json:"id"`
	Insight *DashboardTileInsight  `json:"insight,omitempty"`
	Text    *DashboardTileText     `json:"text,omitempty"`
	Layouts map[string]interface{} `json:"layouts"`
	Color   *string                `json:"color,omitempty"`
	Deleted *bool                  `json:"deleted,omitempty"`
}

type DashboardTileInsight added in v1.0.6

type DashboardTileInsight struct {
	ID int64 `json:"id"`
}

type DashboardTilePatchItem added in v1.0.6

type DashboardTilePatchItem struct {
	ID      int64                   `json:"id,omitempty"`
	Deleted *bool                   `json:"deleted,omitempty"`
	Color   *string                 `json:"color,omitempty"`
	Layouts *map[string]interface{} `json:"layouts,omitempty"`
	Text    *DashboardTileTextPatch `json:"text,omitempty"`
}

type DashboardTileText added in v1.0.6

type DashboardTileText struct {
	ID   int64  `json:"id"`
	Body string `json:"body"`
}

type DashboardTileTextPatch added in v1.0.6

type DashboardTileTextPatch struct {
	Body string `json:"body"`
}

type FeatureFlag

type FeatureFlag struct {
	ID                int64                  `json:"id"`
	Key               string                 `json:"key"`
	Name              *string                `json:"name,omitempty"`
	Active            *bool                  `json:"active,omitempty"`
	Filters           map[string]interface{} `json:"filters,omitempty"`
	RolloutPercentage *int32                 `json:"rollout_percentage,omitempty"`
	Tags              []string               `json:"tags,omitempty"`
	Deleted           *bool                  `json:"deleted,omitempty"`
}

type FeatureFlagRequest

type FeatureFlagRequest struct {
	Key     string                 `json:"key"`
	Name    *string                `json:"name,omitempty"`
	Active  *bool                  `json:"active,omitempty"`
	Filters map[string]interface{} `json:"filters,omitempty"`
	Tags    []string               `json:"tags,omitempty"`
	Deleted *bool                  `json:"deleted,omitempty"`
}

type HTTPStatusCode

type HTTPStatusCode int

type HogFunction

type HogFunction struct {
	ID             string                   `json:"id"`
	Type           *string                  `json:"type,omitempty"`
	Name           *string                  `json:"name,omitempty"`
	Description    *string                  `json:"description,omitempty"`
	Enabled        *bool                    `json:"enabled,omitempty"`
	Hog            *string                  `json:"hog,omitempty"`
	InputsSchema   []map[string]interface{} `json:"inputs_schema,omitempty"`
	Inputs         map[string]interface{}   `json:"inputs,omitempty"`
	Filters        map[string]interface{}   `json:"filters,omitempty"`
	Masking        map[string]interface{}   `json:"masking,omitempty"`
	Mappings       []map[string]interface{} `json:"mappings,omitempty"`
	IconURL        *string                  `json:"icon_url,omitempty"`
	Template       *HogFunctionTemplate     `json:"template,omitempty"`
	ExecutionOrder *int                     `json:"execution_order,omitempty"`
	CreatedAt      *string                  `json:"created_at,omitempty"`
	CreatedBy      map[string]interface{}   `json:"created_by,omitempty"`
	UpdatedAt      *string                  `json:"updated_at,omitempty"`
	Status         *HogFunctionStatus       `json:"status,omitempty"`
}

type HogFunctionRequest

type HogFunctionRequest struct {
	Type           *string                  `json:"type,omitempty"`
	Name           *string                  `json:"name,omitempty"`
	Description    *string                  `json:"description,omitempty"`
	Enabled        *bool                    `json:"enabled,omitempty"`
	Hog            *string                  `json:"hog,omitempty"`
	InputsSchema   []map[string]interface{} `json:"inputs_schema,omitempty"`
	Inputs         map[string]interface{}   `json:"inputs,omitempty"`
	Filters        map[string]interface{}   `json:"filters,omitempty"`
	Masking        map[string]interface{}   `json:"masking,omitempty"`
	Mappings       []map[string]interface{} `json:"mappings,omitempty"`
	IconURL        *string                  `json:"icon_url,omitempty"`
	TemplateID     *string                  `json:"template_id,omitempty"`
	ExecutionOrder *int                     `json:"execution_order,omitempty"`
	Deleted        *bool                    `json:"deleted,omitempty"`
}

type HogFunctionStatus

type HogFunctionStatus struct {
	State  int `json:"state"`
	Tokens int `json:"tokens"`
}

type HogFunctionTemplate

type HogFunctionTemplate struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	Type        string  `json:"type"`
	Status      *string `json:"status,omitempty"`
	IconURL     *string `json:"icon_url,omitempty"`
}

type Insight

type Insight struct {
	ID             int64                  `json:"id"`
	Name           *string                `json:"name,omitempty"`
	DerivedName    *string                `json:"derived_name,omitempty"`
	Description    *string                `json:"description,omitempty"`
	Query          map[string]interface{} `json:"query,omitempty"`
	Tags           []string               `json:"tags,omitempty"`
	Dashboards     []int32                `json:"dashboards,omitempty"`
	CreateInFolder *string                `json:"_create_in_folder,omitempty"`
	Deleted        *bool                  `json:"deleted,omitempty"`
}

type InsightRequest

type InsightRequest struct {
	Name           *string                `json:"name,omitempty"`
	DerivedName    *string                `json:"derived_name,omitempty"`
	Description    *string                `json:"description,omitempty"`
	Query          map[string]interface{} `json:"query,omitempty"`
	Tags           []string               `json:"tags,omitempty"`
	Dashboards     []int32                `json:"dashboards,omitempty"`
	CreateInFolder *string                `json:"_create_in_folder,omitempty"`
	Deleted        *bool                  `json:"deleted,omitempty"`
}

type OrganizationMember added in v1.0.4

type OrganizationMember struct {
	ID           string                  `json:"id"`
	User         *OrganizationMemberUser `json:"user,omitempty"`
	Level        *int                    `json:"level,omitempty"`
	JoinedAt     *string                 `json:"joined_at,omitempty"`
	Is2FAEnabled *bool                   `json:"is_2fa_enabled,omitempty"`
}

type OrganizationMemberRequest added in v1.0.4

type OrganizationMemberRequest struct {
	Level *int `json:"level,omitempty"`
}

type OrganizationMemberUser added in v1.0.4

type OrganizationMemberUser struct {
	UUID            string  `json:"uuid"`
	Email           *string `json:"email,omitempty"`
	FirstName       *string `json:"first_name,omitempty"`
	LastName        *string `json:"last_name,omitempty"`
	IsEmailVerified *bool   `json:"is_email_verified,omitempty"`
}

type PaginatedResponse added in v1.0.8

type PaginatedResponse[T any] struct {
	Results []T     `json:"results"`
	Next    *string `json:"next,omitempty"`
}

PaginatedResponse is the standard envelope for paginated PostHog API list endpoints.

type PosthogClient

type PosthogClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(client *http.Client, host, apiKey, version string, opts ...ClientOption) PosthogClient

func NewDefaultClient

func NewDefaultClient(host, apiKey, version string, opts ...ClientOption) PosthogClient

func (*PosthogClient) CreateAction added in v1.0.5

func (c *PosthogClient) CreateAction(ctx context.Context, projectID string, input ActionRequest) (Action, error)

func (*PosthogClient) CreateAlert

func (c *PosthogClient) CreateAlert(ctx context.Context, projectID string, input AlertRequest) (Alert, error)

func (*PosthogClient) CreateDashboard

func (c *PosthogClient) CreateDashboard(ctx context.Context, projectID string, input DashboardRequest) (Dashboard, error)

func (*PosthogClient) CreateFeatureFlag

func (c *PosthogClient) CreateFeatureFlag(ctx context.Context, projectID string, input FeatureFlagRequest) (FeatureFlag, error)

func (*PosthogClient) CreateHogFunction

func (c *PosthogClient) CreateHogFunction(ctx context.Context, projectID string, input HogFunctionRequest) (HogFunction, error)

func (*PosthogClient) CreateInsight

func (c *PosthogClient) CreateInsight(ctx context.Context, projectID string, input InsightRequest) (Insight, error)

func (*PosthogClient) CreateProject added in v1.0.1

func (c *PosthogClient) CreateProject(ctx context.Context, organizationID string, input ProjectRequest) (Project, error)

func (*PosthogClient) CreateRole added in v1.0.4

func (c *PosthogClient) CreateRole(ctx context.Context, organizationID string, input RoleRequest) (Role, error)

func (*PosthogClient) CreateRoleMembership added in v1.0.4

func (c *PosthogClient) CreateRoleMembership(ctx context.Context, organizationID, roleID string, input RoleMembershipRequest) (RoleMembership, error)

func (*PosthogClient) DeleteAccessControl added in v1.0.4

func (c *PosthogClient) DeleteAccessControl(ctx context.Context, projectID string, input AccessControlRequest) (HTTPStatusCode, error)

func (*PosthogClient) DeleteAction added in v1.0.5

func (c *PosthogClient) DeleteAction(ctx context.Context, projectID, id string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteAlert

func (c *PosthogClient) DeleteAlert(ctx context.Context, projectID, id string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteDashboard

func (c *PosthogClient) DeleteDashboard(ctx context.Context, projectID, id string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteFeatureFlag

func (c *PosthogClient) DeleteFeatureFlag(ctx context.Context, projectID, id string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteHogFunction

func (c *PosthogClient) DeleteHogFunction(ctx context.Context, projectID, id string) (HTTPStatusCode, error)

DeleteHogFunction performs a soft delete by setting deleted=true via PATCH. The HogFunction API does not support hard deletes

func (*PosthogClient) DeleteInsight

func (c *PosthogClient) DeleteInsight(ctx context.Context, projectID, id string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteOrganizationMember added in v1.0.4

func (c *PosthogClient) DeleteOrganizationMember(ctx context.Context, organizationID, userUUID string) (HTTPStatusCode, error)

DeleteOrganizationMember removes a member from the organization.

func (*PosthogClient) DeleteProject added in v1.0.1

func (c *PosthogClient) DeleteProject(ctx context.Context, organizationID, projectID string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteProjectAccessControl added in v1.0.4

func (c *PosthogClient) DeleteProjectAccessControl(ctx context.Context, projectID string, input ProjectAccessControlRequest) (HTTPStatusCode, error)

DeleteProjectAccessControl removes a project-level access control by setting access_level to nil.

func (*PosthogClient) DeleteRole added in v1.0.4

func (c *PosthogClient) DeleteRole(ctx context.Context, organizationID, roleID string) (HTTPStatusCode, error)

func (*PosthogClient) DeleteRoleMembership added in v1.0.4

func (c *PosthogClient) DeleteRoleMembership(ctx context.Context, organizationID, roleID, membershipID string) (HTTPStatusCode, error)

func (*PosthogClient) GetAccessControls added in v1.0.4

func (c *PosthogClient) GetAccessControls(ctx context.Context, projectID, resourceType string, resourceID *string) (AccessControlListResponse, HTTPStatusCode, error)

GetAccessControls returns access controls for a project. If resourceID is provided, returns controls for that specific resource. Otherwise, returns resource-type level controls.

func (*PosthogClient) GetAction added in v1.0.5

func (c *PosthogClient) GetAction(ctx context.Context, projectID, id string) (Action, HTTPStatusCode, error)

func (*PosthogClient) GetAlert

func (c *PosthogClient) GetAlert(ctx context.Context, projectID, id string) (Alert, HTTPStatusCode, error)

func (*PosthogClient) GetDashboard

func (c *PosthogClient) GetDashboard(ctx context.Context, projectID, id string) (Dashboard, HTTPStatusCode, error)

func (*PosthogClient) GetDashboardLayout added in v1.0.6

func (c *PosthogClient) GetDashboardLayout(ctx context.Context, projectID, dashboardID string) (DashboardLayoutResponse, HTTPStatusCode, error)

GetDashboardLayout fetches the tile layout for a specific dashboard.

func (*PosthogClient) GetFeatureFlag

func (c *PosthogClient) GetFeatureFlag(ctx context.Context, projectID, id string) (FeatureFlag, HTTPStatusCode, error)

func (*PosthogClient) GetHogFunction

func (c *PosthogClient) GetHogFunction(ctx context.Context, projectID, id string) (HogFunction, HTTPStatusCode, error)

func (*PosthogClient) GetInsight

func (c *PosthogClient) GetInsight(ctx context.Context, projectID, id string) (Insight, HTTPStatusCode, error)

func (*PosthogClient) GetOrganizationMember added in v1.0.4

func (c *PosthogClient) GetOrganizationMember(ctx context.Context, organizationID, userUUID string) (OrganizationMember, HTTPStatusCode, error)

GetOrganizationMember retrieves a specific member by user UUID. Since there's no direct GET endpoint, we list all members and filter.

func (*PosthogClient) GetProject added in v1.0.1

func (c *PosthogClient) GetProject(ctx context.Context, organizationID, projectID string) (Project, HTTPStatusCode, error)

func (*PosthogClient) GetProjectAccessControls added in v1.0.4

func (c *PosthogClient) GetProjectAccessControls(ctx context.Context, projectID string) (ProjectAccessControlListResponse, HTTPStatusCode, error)

func (*PosthogClient) GetRole added in v1.0.4

func (c *PosthogClient) GetRole(ctx context.Context, organizationID, roleID string) (Role, HTTPStatusCode, error)

func (*PosthogClient) GetRoleMembership added in v1.0.4

func (c *PosthogClient) GetRoleMembership(ctx context.Context, organizationID, roleID, membershipID string) (RoleMembership, HTTPStatusCode, error)

func (*PosthogClient) ListOrganizationMembers added in v1.0.4

func (c *PosthogClient) ListOrganizationMembers(ctx context.Context, organizationID string) ([]OrganizationMember, error)

func (*PosthogClient) ListRoles added in v1.0.8

func (c *PosthogClient) ListRoles(ctx context.Context, organizationID string) ([]Role, error)

func (*PosthogClient) UpdateAction added in v1.0.5

func (c *PosthogClient) UpdateAction(ctx context.Context, projectID, id string, input ActionRequest) (Action, HTTPStatusCode, error)

func (*PosthogClient) UpdateAlert

func (c *PosthogClient) UpdateAlert(ctx context.Context, projectID, id string, input AlertRequest) (Alert, HTTPStatusCode, error)

func (*PosthogClient) UpdateDashboard

func (c *PosthogClient) UpdateDashboard(ctx context.Context, projectID, id string, input DashboardRequest) (Dashboard, HTTPStatusCode, error)

func (*PosthogClient) UpdateDashboardLayout added in v1.0.6

func (c *PosthogClient) UpdateDashboardLayout(ctx context.Context, projectID, dashboardID string, input DashboardLayoutPatchRequest) (DashboardLayoutResponse, HTTPStatusCode, error)

UpdateDashboardLayout applies a partial update to the tile layout of a specific dashboard. Only the tiles listed in the request are modified; unmanaged tiles are left untouched.

func (*PosthogClient) UpdateFeatureFlag

func (c *PosthogClient) UpdateFeatureFlag(ctx context.Context, projectID, id string, input FeatureFlagRequest) (FeatureFlag, HTTPStatusCode, error)

func (*PosthogClient) UpdateHogFunction

func (c *PosthogClient) UpdateHogFunction(ctx context.Context, projectID, id string, input HogFunctionRequest) (HogFunction, HTTPStatusCode, error)

func (*PosthogClient) UpdateInsight

func (c *PosthogClient) UpdateInsight(ctx context.Context, projectID, id string, input InsightRequest) (Insight, HTTPStatusCode, error)

func (*PosthogClient) UpdateOrganizationMember added in v1.0.4

func (c *PosthogClient) UpdateOrganizationMember(ctx context.Context, organizationID, userUUID string, input OrganizationMemberRequest) (OrganizationMember, HTTPStatusCode, error)

UpdateOrganizationMember updates a member's level.

func (*PosthogClient) UpdateProject added in v1.0.1

func (c *PosthogClient) UpdateProject(ctx context.Context, organizationID, projectID string, input ProjectRequest) (Project, HTTPStatusCode, error)

func (*PosthogClient) UpdateRole added in v1.0.4

func (c *PosthogClient) UpdateRole(ctx context.Context, organizationID, roleID string, input RoleRequest) (Role, HTTPStatusCode, error)

func (*PosthogClient) UpsertAccessControl added in v1.0.4

func (c *PosthogClient) UpsertAccessControl(ctx context.Context, projectID string, input AccessControlRequest) (AccessControl, error)

UpsertAccessControl creates or updates an access control. If resourceID is provided, it sets permissions for that specific resource instance. Otherwise, it sets permissions at the resource-type level (all resources of that type).

func (*PosthogClient) UpsertProjectAccessControl added in v1.0.4

func (c *PosthogClient) UpsertProjectAccessControl(ctx context.Context, projectID string, input ProjectAccessControlRequest) (ProjectAccessControl, HTTPStatusCode, error)

UpsertProjectAccessControl creates or updates a project-level access control. This can set: - Default access level (when role and organization_member are nil) - Role access (when role is set) - Member access (when organization_member is set)

type Project added in v1.0.1

type Project struct {
	ID             int64   `json:"id"`
	Name           *string `json:"name,omitempty"`
	OrganizationID *string `json:"organization,omitempty"`
	APIToken       *string `json:"api_token,omitempty"`
	Timezone       *string `json:"timezone,omitempty"`
}

type ProjectAccessControl added in v1.0.4

type ProjectAccessControl struct {
	AccessLevel        *string `json:"access_level"`
	Resource           string  `json:"resource"`
	ResourceID         *string `json:"resource_id,omitempty"`
	OrganizationMember *string `json:"organization_member,omitempty"`
	Role               *string `json:"role,omitempty"`
	CreatedBy          *string `json:"created_by,omitempty"`
	CreatedAt          *string `json:"created_at,omitempty"`
	UpdatedAt          *string `json:"updated_at,omitempty"`
}

func (ProjectAccessControl) BuildCompositeID added in v1.0.4

func (ac ProjectAccessControl) BuildCompositeID(projectID string) string

BuildCompositeID constructs a unique identifier for this project access control.

type ProjectAccessControlListResponse added in v1.0.4

type ProjectAccessControlListResponse struct {
	AccessControls          []ProjectAccessControl `json:"access_controls"`
	AvailableAccessLevels   []string               `json:"available_access_levels"`
	DefaultAccessLevel      string                 `json:"default_access_level"`
	UserAccessLevel         string                 `json:"user_access_level"`
	UserCanEditAccessLevels bool                   `json:"user_can_edit_access_levels"`
}

type ProjectAccessControlRequest added in v1.0.4

type ProjectAccessControlRequest struct {
	AccessLevel        *string `json:"access_level"`
	OrganizationMember *string `json:"organization_member,omitempty"`
	Role               *string `json:"role,omitempty"`
}

type ProjectRequest added in v1.0.1

type ProjectRequest struct {
	Name     *string `json:"name,omitempty"`
	Timezone *string `json:"timezone,omitempty"`
}

type Role added in v1.0.4

type Role struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	CreatedAt *string `json:"created_at,omitempty"`
	CreatedBy *string `json:"created_by,omitempty"`
}

type RoleMembership added in v1.0.4

type RoleMembership struct {
	ID       string              `json:"id"`
	RoleID   string              `json:"role_id"`
	User     *RoleMembershipUser `json:"user,omitempty"`
	JoinedAt *string             `json:"joined_at,omitempty"`
}

type RoleMembershipRequest added in v1.0.4

type RoleMembershipRequest struct {
	UserUUID string `json:"user_uuid"`
}

type RoleMembershipUser added in v1.0.4

type RoleMembershipUser struct {
	UUID  string  `json:"uuid"`
	Email *string `json:"email,omitempty"`
}

type RoleRequest added in v1.0.4

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

type ThresholdBounds

type ThresholdBounds struct {
	Lower *float64 `json:"lower,omitempty"`
	Upper *float64 `json:"upper,omitempty"`
}

type ThresholdConfiguration

type ThresholdConfiguration struct {
	Type   string           `json:"type"` // "absolute" or "percentage"
	Bounds *ThresholdBounds `json:"bounds,omitempty"`
}

type TrendsAlertConfig

type TrendsAlertConfig struct {
	Type                 string `json:"type"` // "TrendsAlertConfig"
	SeriesIndex          *int   `json:"series_index,omitempty"`
	CheckOngoingInterval *bool  `json:"check_ongoing_interval,omitempty"`
}

Directories

Path Synopsis
Package middleware provides HTTP middleware components.
Package middleware provides HTTP middleware components.

Jump to

Keyboard shortcuts

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