opslevel

package module
v2023.12.14 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 23 Imported by: 1

README

Overall

opslevel-go

Package opslevel provides an OpsLevel API client implementation.

Installation

opslevel requires Go version 1.8 or later.

go get -u github.com/opslevel/opslevel-go

Usage

Construct a client, specifying the API token. Then, you can use it to make GraphQL queries and mutations.

client := opslevel.NewClient("XXX_API_TOKEN_XXX")
// Use client...

You can validate the client can successfully talk to the OpsLevel API.

client := opslevel.NewClient("XXX_API_TOKEN_XXX")
if err := client.Validate(); err != nil {
	panic(err)
}

Every resource (IE: service, lifecycle, tier, etc) in OpsLevel API has a corresponding data structure in go as well as the graphql query & mutation inputs. Additionally there is also some helper functions that use native go types like string and []string to make it easier to work with. The following are a handful of examples:

Find a service given an alias and print the owning team name:

foundService, foundServiceErr := client.GetServiceWithAlias("MyCoolService")
if foundServiceErr != nil {

	panic(foundServiceErr)
}
fmt.Println(foundService.Owner.Name)

Create a new service in OpsLevel and print the ID:

serviceCreateInput := opslevel.ServiceCreateInput{
	Name:        "MyCoolService",
	Product:     "MyProduct",
	Description: "The Coolest Service",
	Language:    "go",
}
newService, newServiceErr := client.CreateService(serviceCreateInput)
if newServiceErr != nil {
	panic(newServiceErr)
}
fmt.Println(newService.Id)

Assign the tag {"hello": "world"} to our newly created service and print all the tags currently on it:

allTagsOnThisService, err := client.AssignTagForId(newService.Id, "Hello", "World")
for tagKey, tagValue := range allTagsOnThisService {
	fmt.Printf("Tag '{%s : %s}'", tagKey, tagValue)
}

List all the tags for a service:

tags, tagsErr := client.GetTagsForServiceWithAlias("MyCoolService")
for _, tag := range tags {
	fmt.Printf("Tag '{%s : %s}'\n", tag.Key, tag.Value)
}
// OR
service, serviceErr := client.GetServiceWithAlias("MyCoolService")
tags, tagsErr := client.GetTagsForService(service.Id)
for _, tag := range tags {
	fmt.Printf("Tag '{%s : %s}'\n", tag.Key, tag.Value)
}

Build a lookup table of teams:

func GetTeams(client *opslevel.Client) (map[string]opslevel.Team, error) {
	teams := make(map[string]opslevel.Team)
	data, dataErr := client.ListTeams()
	if dataErr != nil {
		return teams, dataErr
	}
	for _, team := range data {
		teams[string(team.Alias)] = team
	}
	return teams, nil
}

Advanced Usage

The client also exposes functions Query and Mutate for doing custom query or mutations. We are running ontop of this go graphql library so you can read up on how to define go structures that represent a query or mutation there but examples of each can be found here.

Documentation

Overview

Package opslevel provides an OpsLevel API client implementation.

see README for more details.

Index

Constants

This section is empty.

Variables

View Source
var (
	TagKeyRegex    = regexp.MustCompile(`\A[a-z][0-9a-z_\.\/\\-]*\z`)
	TagKeyErrorMsg = "tag key name '%s' must start with a letter and be only lowercase alphanumerics, underscores, hyphens, periods, and slashes"
)

All AlertSourceStatusTypeEnum as []string

All AlertSourceTypeEnum as []string

All AliasOwnerTypeEnum as []string

All ApiDocumentSourceEnum as []string

All BasicTypeEnum as []string

All CampaignFilterEnum as []string

All CampaignReminderTypeEnum as []string

All CampaignServiceStatusEnum as []string

All CampaignSortEnum as []string

All CampaignStatusEnum as []string

All CheckStatus as []string

All CheckType as []string

All ConnectiveEnum as []string

All ContactType as []string

All CustomActionsEntityTypeEnum as []string

All CustomActionsHttpMethodEnum as []string

All CustomActionsTriggerDefinitionAccessControlEnum as []string

All CustomActionsTriggerEventStatusEnum as []string

All FrequencyTimeScale as []string

View Source
var AllHasDocumentationSubtypeEnum = []string{
	string(HasDocumentationSubtypeEnumOpenapi),
}

All HasDocumentationSubtypeEnum as []string

All HasDocumentationTypeEnum as []string

All PayloadSortEnum as []string

All PredicateKeyEnum as []string

All PredicateTypeEnum as []string

All RelatedResourceRelationshipTypeEnum as []string

All RelationshipTypeEnum as []string

All RepositoryVisibilityEnum as []string

All ResourceDocumentStatusTypeEnum as []string

All ScorecardSortEnum as []string

All ServicePropertyTypeEnum as []string

All ServiceSortEnum as []string

All TaggableResource as []string

All ToolCategory as []string

All UserRole as []string

All UsersFilterEnum as []string

All VaultSecretsSortEnum as []string

View Source
var Cache = &Cacher{
	mutex:        sync.Mutex{},
	Tiers:        make(map[string]Tier),
	Lifecycles:   make(map[string]Lifecycle),
	Teams:        make(map[string]Team),
	Categories:   make(map[string]Category),
	Levels:       make(map[string]Level),
	Filters:      make(map[string]Filter),
	Integrations: make(map[string]Integration),
	Repositories: make(map[string]Repository),
	InfraSchemas: make(map[string]InfrastructureResourceSchema),
}
View Source
var CheckCreateConstructors = map[CheckType]CheckInputConstructor{
	CheckTypeAlertSourceUsage:    func() any { return &CheckAlertSourceUsageCreateInput{} },
	CheckTypeCustom:              func() any { return &CheckCreateInput{} },
	CheckTypeGeneric:             func() any { return &CheckCustomEventCreateInput{} },
	CheckTypeGitBranchProtection: func() any { return &CheckGitBranchProtectionCreateInput{} },
	CheckTypeHasDocumentation:    func() any { return &CheckHasDocumentationCreateInput{} },
	CheckTypeHasOwner:            func() any { return &CheckServiceOwnershipCreateInput{} },
	CheckTypeHasRecentDeploy:     func() any { return &CheckHasRecentDeployCreateInput{} },
	CheckTypeHasRepository:       func() any { return &CheckRepositoryIntegratedCreateInput{} },
	CheckTypeHasServiceConfig:    func() any { return &CheckServiceConfigurationCreateInput{} },
	CheckTypeManual:              func() any { return &CheckManualCreateInput{} },
	CheckTypePayload:             func() any { return &CheckCreateInput{} },
	CheckTypeRepoFile:            func() any { return &CheckRepositoryFileCreateInput{} },
	CheckTypeRepoGrep:            func() any { return &CheckRepositoryGrepCreateInput{} },
	CheckTypeRepoSearch:          func() any { return &CheckRepositorySearchCreateInput{} },
	CheckTypeServiceDependency:   func() any { return &CheckServiceDependencyCreateInput{} },
	CheckTypeServiceProperty:     func() any { return &CheckServicePropertyCreateInput{} },
	CheckTypeTagDefined:          func() any { return &CheckTagDefinedCreateInput{} },
	CheckTypeToolUsage:           func() any { return &CheckToolUsageCreateInput{} },
}
View Source
var CheckUpdateConstructors = map[CheckType]CheckInputConstructor{
	CheckTypeAlertSourceUsage:    func() any { return &CheckAlertSourceUsageUpdateInput{} },
	CheckTypeCustom:              func() any { return &CheckUpdateInput{} },
	CheckTypeGeneric:             func() any { return &CheckCustomEventUpdateInput{} },
	CheckTypeGitBranchProtection: func() any { return &CheckGitBranchProtectionUpdateInput{} },
	CheckTypeHasDocumentation:    func() any { return &CheckHasDocumentationUpdateInput{} },
	CheckTypeHasOwner:            func() any { return &CheckServiceOwnershipUpdateInput{} },
	CheckTypeHasRecentDeploy:     func() any { return &CheckHasRecentDeployUpdateInput{} },
	CheckTypeHasRepository:       func() any { return &CheckRepositoryIntegratedUpdateInput{} },
	CheckTypeHasServiceConfig:    func() any { return &CheckServiceConfigurationUpdateInput{} },
	CheckTypeManual:              func() any { return &CheckManualUpdateInput{} },
	CheckTypePayload:             func() any { return &CheckUpdateInput{} },
	CheckTypeRepoFile:            func() any { return &CheckRepositoryFileUpdateInput{} },
	CheckTypeRepoGrep:            func() any { return &CheckRepositoryGrepUpdateInput{} },
	CheckTypeRepoSearch:          func() any { return &CheckRepositorySearchUpdateInput{} },
	CheckTypeServiceDependency:   func() any { return &CheckServiceDependencyUpdateInput{} },
	CheckTypeServiceProperty:     func() any { return &CheckServicePropertyUpdateInput{} },
	CheckTypeTagDefined:          func() any { return &CheckTagDefinedUpdateInput{} },
	CheckTypeToolUsage:           func() any { return &CheckToolUsageUpdateInput{} },
}

Functions

func AllRunnerJobOutcomeEnum

func AllRunnerJobOutcomeEnum() []string

All RunnerJobOutcomeEnum as []string

func AllRunnerJobStatusEnum

func AllRunnerJobStatusEnum() []string

All RunnerJobStatusEnum as []string

func AllRunnerStatusTypeEnum

func AllRunnerStatusTypeEnum() []string

All RunnerStatusTypeEnum as []string

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func FormatErrors

func FormatErrors(errs []OpsLevelErrors) error

func HandleErrors

func HandleErrors(err error, errs []OpsLevelErrors) error

func IsID

func IsID(value string) bool

func IsResourceValid added in v2023.12.14

func IsResourceValid[T any](opslevelResource T) error

Validates resource's `validate:""` struct tags

func JsonOf added in v2023.12.14

func JsonOf[T any](opslevelResource T) string

Get JSON formatted string of an OpsLevel resource - also sets defaults

func JsonStringAs added in v2023.12.14

func JsonStringAs[T any](data JSONString) (T, error)

func NewExampleOf added in v2023.12.14

func NewExampleOf[T any]() T

Make new OpsLevel resource with defaults set

func NewISO8601Date

func NewISO8601Date(datetime string) iso8601.Time

func NewISO8601DateNow

func NewISO8601DateNow() iso8601.Time

func NewInt

func NewInt(i int) *int

func NewRestClient

func NewRestClient(options ...Option) *resty.Client

func NewString

func NewString(value string) *string

func NullString

func NullString() *string

func SetDefaultsFor added in v2023.12.14

func SetDefaultsFor[T any](opslevelResource *T)

Apply resource's `default:""` struct tags

func UnmarshalCheckCreateInput added in v2023.8.14

func UnmarshalCheckCreateInput(checkType CheckType, data []byte) (any, error)

func UnmarshalCheckUpdateInput added in v2023.8.14

func UnmarshalCheckUpdateInput(checkType CheckType, data []byte) (any, error)

func ValidateTagKey added in v2023.10.8

func ValidateTagKey(key string) error

func WithName added in v2023.3.14

func WithName(name string) graphql.Option

func YamlOf added in v2023.12.14

func YamlOf[T any](opslevelResource T) string

Generate yaml formatted string of an OpsLevel resource - also sets defaults

Types

type AWSIntegrationFragment added in v2023.5.5

type AWSIntegrationFragment struct {
	IAMRole              string   `graphql:"iamRole"`
	ExternalID           string   `graphql:"externalId"`
	OwnershipTagOverride bool     `graphql:"awsTagsOverrideOwnership"`
	OwnershipTagKeys     []string `graphql:"ownershipTagKeys"`
}

type AWSIntegrationInput added in v2023.5.5

type AWSIntegrationInput struct {
	Name                 *string  `json:"name,omitempty"`
	IAMRole              *string  `json:"iamRole,omitempty"`
	ExternalID           *string  `json:"externalId,omitempty"`
	OwnershipTagOverride *bool    `json:"awsTagsOverrideOwnership,omitempty"`
	OwnershipTagKeys     []string `json:"ownershipTagKeys"`
}

func (AWSIntegrationInput) GetGraphQLType added in v2023.5.5

func (s AWSIntegrationInput) GetGraphQLType() string

type AlertSource

type AlertSource struct {
	Name        string              `graphql:"name"`
	Description string              `graphql:"description"`
	Id          ID                  `graphql:"id"`
	Type        AlertSourceTypeEnum `graphql:"type"`
	ExternalId  string              `graphql:"externalId"`
	Integration IntegrationId       `graphql:"integration"`
	Url         string              `graphql:"url"`
}

type AlertSourceDeleteInput added in v2023.3.14

type AlertSourceDeleteInput struct {
	Id ID `json:"id"`
}

type AlertSourceExternalIdentifier

type AlertSourceExternalIdentifier struct {
	Type       AlertSourceTypeEnum `json:"type"`
	ExternalId string              `json:"externalId"`
}

func NewAlertSource added in v2023.3.14

type AlertSourceService added in v2023.3.14

type AlertSourceService struct {
	AlertSource AlertSource               `graphql:"alertSource"`
	Id          ID                        `graphql:"id"`
	Service     ServiceId                 `graphql:"service"`
	Status      AlertSourceStatusTypeEnum `graphql:"status"`
}

type AlertSourceServiceCreateInput added in v2023.3.14

type AlertSourceServiceCreateInput struct {
	Service    IdentifierInput                `json:"service"`
	Id         ID                             `json:"alertSourceId,omitempty"`
	ExternalID *AlertSourceExternalIdentifier `json:"alertSourceExternalIdentifier,omitempty"`
}

type AlertSourceStatusTypeEnum added in v2023.3.14

type AlertSourceStatusTypeEnum string

AlertSourceStatusTypeEnum represents the monitor status level.

const (
	AlertSourceStatusTypeEnumAlert        AlertSourceStatusTypeEnum = "alert"         // Monitor is reporting an alert.
	AlertSourceStatusTypeEnumWarn         AlertSourceStatusTypeEnum = "warn"          // Monitor is reporting a warning.
	AlertSourceStatusTypeEnumOk           AlertSourceStatusTypeEnum = "ok"            // Monitor is not reporting any warnings or alerts.
	AlertSourceStatusTypeEnumNoData       AlertSourceStatusTypeEnum = "no_data"       // No data received yet. Ensure your monitors are configured correctly.
	AlertSourceStatusTypeEnumFetchingData AlertSourceStatusTypeEnum = "fetching_data" // Monitor currently being updated.
)

type AlertSourceTypeEnum

type AlertSourceTypeEnum string

AlertSourceTypeEnum represents the type of the alert source.

const (
	AlertSourceTypeEnumPagerduty AlertSourceTypeEnum = "pagerduty" // A PagerDuty alert source (aka service).
	AlertSourceTypeEnumDatadog   AlertSourceTypeEnum = "datadog"   // A Datadog alert source (aka monitor).
	AlertSourceTypeEnumOpsgenie  AlertSourceTypeEnum = "opsgenie"  // An Opsgenie alert source (aka service).
	AlertSourceTypeEnumNewRelic  AlertSourceTypeEnum = "new_relic" // A New Relic alert source (aka service).
)

type AlertSourceUsageCheckFragment

type AlertSourceUsageCheckFragment struct {
	AlertSourceNamePredicate Predicate           `graphql:"alertSourceNamePredicate"`
	AlertSourceType          AlertSourceTypeEnum `graphql:"alertSourceType"`
}

type AliasCreateInput

type AliasCreateInput struct {
	Alias   string `json:"alias"`
	OwnerId ID     `json:"ownerId"`
}

type AliasDeleteInput

type AliasDeleteInput struct {
	Alias     string             `json:"alias"`
	OwnerType AliasOwnerTypeEnum `json:"ownerType"`
}

type AliasOwnerTypeEnum

type AliasOwnerTypeEnum string

AliasOwnerTypeEnum represents the owner type an alias is assigned to.

const (
	AliasOwnerTypeEnumService                AliasOwnerTypeEnum = "service"                 // Aliases that are assigned to services.
	AliasOwnerTypeEnumTeam                   AliasOwnerTypeEnum = "team"                    // Aliases that are assigned to teams.
	AliasOwnerTypeEnumGroup                  AliasOwnerTypeEnum = "group"                   // Aliases that are assigned to groups.
	AliasOwnerTypeEnumSystem                 AliasOwnerTypeEnum = "system"                  // Aliases that are assigned to systems.
	AliasOwnerTypeEnumDomain                 AliasOwnerTypeEnum = "domain"                  // Aliases that are assigned to domains.
	AliasOwnerTypeEnumInfrastructureResource AliasOwnerTypeEnum = "infrastructure_resource" // Aliases that are assigned to infrastructure resources.
	AliasOwnerTypeEnumScorecard              AliasOwnerTypeEnum = "scorecard"               // Aliases that are assigned to scorecards.
)

type ApiDocumentSourceEnum

type ApiDocumentSourceEnum string

ApiDocumentSourceEnum represents the source used to determine the preferred API document.

const (
	ApiDocumentSourceEnumPush ApiDocumentSourceEnum = "PUSH" // Use the document that was pushed to OpsLevel via an API Docs integration.
	ApiDocumentSourceEnumPull ApiDocumentSourceEnum = "PULL" // Use the document that was pulled by OpsLevel via a repo.
)

type BasicTypeEnum added in v2023.3.14

type BasicTypeEnum string

BasicTypeEnum represents operations that can be used on filters.

const (
	BasicTypeEnumEquals       BasicTypeEnum = "equals"         // Equals a specific value.
	BasicTypeEnumDoesNotEqual BasicTypeEnum = "does_not_equal" // Does not equal a specific value.
)

type Cacher

type Cacher struct {
	Tiers        map[string]Tier
	Lifecycles   map[string]Lifecycle
	Teams        map[string]Team
	Categories   map[string]Category
	Levels       map[string]Level
	Filters      map[string]Filter
	Integrations map[string]Integration
	Repositories map[string]Repository
	InfraSchemas map[string]InfrastructureResourceSchema
	// contains filtered or unexported fields
}

func (*Cacher) CacheAll

func (c *Cacher) CacheAll(client *Client)

func (*Cacher) CacheCategories

func (c *Cacher) CacheCategories(client *Client)

func (*Cacher) CacheFilters

func (c *Cacher) CacheFilters(client *Client)

func (*Cacher) CacheInfraSchemas added in v2023.7.17

func (c *Cacher) CacheInfraSchemas(client *Client)

func (*Cacher) CacheIntegrations

func (c *Cacher) CacheIntegrations(client *Client)

func (*Cacher) CacheLevels

func (c *Cacher) CacheLevels(client *Client)

func (*Cacher) CacheLifecycles

func (c *Cacher) CacheLifecycles(client *Client)

func (*Cacher) CacheRepositories

func (c *Cacher) CacheRepositories(client *Client)

func (*Cacher) CacheTeams

func (c *Cacher) CacheTeams(client *Client)

func (*Cacher) CacheTiers

func (c *Cacher) CacheTiers(client *Client)

func (*Cacher) TryGetCategory

func (c *Cacher) TryGetCategory(alias string) (*Category, bool)

func (*Cacher) TryGetFilter

func (c *Cacher) TryGetFilter(alias string) (*Filter, bool)

func (*Cacher) TryGetInfrastructureSchema added in v2023.7.17

func (c *Cacher) TryGetInfrastructureSchema(alias string) (*InfrastructureResourceSchema, bool)

func (*Cacher) TryGetIntegration

func (c *Cacher) TryGetIntegration(alias string) (*Integration, bool)

func (*Cacher) TryGetLevel

func (c *Cacher) TryGetLevel(alias string) (*Level, bool)

func (*Cacher) TryGetLifecycle

func (c *Cacher) TryGetLifecycle(alias string) (*Lifecycle, bool)

func (*Cacher) TryGetRepository

func (c *Cacher) TryGetRepository(alias string) (*Repository, bool)

func (*Cacher) TryGetTeam

func (c *Cacher) TryGetTeam(alias string) (*Team, bool)

func (*Cacher) TryGetTier

func (c *Cacher) TryGetTier(alias string) (*Tier, bool)

type CampaignFilterEnum added in v2023.3.14

type CampaignFilterEnum string

CampaignFilterEnum represents fields that can be used as part of filter for campaigns.

const (
	CampaignFilterEnumID     CampaignFilterEnum = "id"     // Filter by `id` of campaign.
	CampaignFilterEnumOwner  CampaignFilterEnum = "owner"  // Filter by campaign owner.
	CampaignFilterEnumStatus CampaignFilterEnum = "status" // Filter by campaign status.
)

type CampaignReminderTypeEnum added in v2023.3.14

type CampaignReminderTypeEnum string

CampaignReminderTypeEnum represents type/Format of the notification.

const (
	CampaignReminderTypeEnumEmail CampaignReminderTypeEnum = "email" // Notification will be sent via email.
	CampaignReminderTypeEnumSlack CampaignReminderTypeEnum = "slack" // Notification will be sent by slack.
)

type CampaignServiceStatusEnum added in v2023.3.14

type CampaignServiceStatusEnum string

CampaignServiceStatusEnum represents status of whether a service is passing all checks for a campaign or not.

const (
	CampaignServiceStatusEnumPassing CampaignServiceStatusEnum = "passing" // Service is passing all the checks in the campaign.
	CampaignServiceStatusEnumFailing CampaignServiceStatusEnum = "failing" // Service is failing one or more checks in the campaign.
)

type CampaignSortEnum added in v2023.3.14

type CampaignSortEnum string

CampaignSortEnum represents sort possibilities for campaigns.

const (
	CampaignSortEnumNameAsc              CampaignSortEnum = "name_ASC"               // Sort by `name` ascending.
	CampaignSortEnumNameDesc             CampaignSortEnum = "name_DESC"              // Sort by `name` descending.
	CampaignSortEnumOwnerAsc             CampaignSortEnum = "owner_ASC"              // Sort by `owner` ascending.
	CampaignSortEnumOwnerDesc            CampaignSortEnum = "owner_DESC"             // Sort by `owner` descending.
	CampaignSortEnumFilterAsc            CampaignSortEnum = "filter_ASC"             // Sort by `filter` ascending.
	CampaignSortEnumFilterDesc           CampaignSortEnum = "filter_DESC"            // Sort by `filter` descending.
	CampaignSortEnumStartDateAsc         CampaignSortEnum = "start_date_ASC"         // Sort by `startDate` ascending.
	CampaignSortEnumStartDateDesc        CampaignSortEnum = "start_date_DESC"        // Sort by `startDate` descending.
	CampaignSortEnumTargetDateAsc        CampaignSortEnum = "target_date_ASC"        // Sort by `targetDate` ascending.
	CampaignSortEnumTargetDateDesc       CampaignSortEnum = "target_date_DESC"       // Sort by `targetDate` descending.
	CampaignSortEnumEndedDateAsc         CampaignSortEnum = "ended_date_ASC"         // Sort by `endedDate` ascending.
	CampaignSortEnumEndedDateDesc        CampaignSortEnum = "ended_date_DESC"        // Sort by `endedDate` descending.
	CampaignSortEnumStatusAsc            CampaignSortEnum = "status_ASC"             // Sort by `status` ascending.
	CampaignSortEnumStatusDesc           CampaignSortEnum = "status_DESC"            // Sort by `status` descending.
	CampaignSortEnumServicesCompleteAsc  CampaignSortEnum = "services_complete_ASC"  // Sort by number of `services complete` ascending.
	CampaignSortEnumServicesCompleteDesc CampaignSortEnum = "services_complete_DESC" // Sort by number of `services complete` descending.
	CampaignSortEnumChecksPassingAsc     CampaignSortEnum = "checks_passing_ASC"     // Sort by number of `checks passing` ascending.
	CampaignSortEnumChecksPassingDesc    CampaignSortEnum = "checks_passing_DESC"    // Sort by number of `checks passing` descending.
)

type CampaignStatusEnum added in v2023.3.14

type CampaignStatusEnum string

CampaignStatusEnum represents the campaign status.

const (
	CampaignStatusEnumDraft      CampaignStatusEnum = "draft"       // Campaign has been created but is not yet active.
	CampaignStatusEnumScheduled  CampaignStatusEnum = "scheduled"   // Campaign has been scheduled to begin in the future.
	CampaignStatusEnumInProgress CampaignStatusEnum = "in_progress" // Campaign is in progress.
	CampaignStatusEnumDelayed    CampaignStatusEnum = "delayed"     // Campaign is delayed.
	CampaignStatusEnumEnded      CampaignStatusEnum = "ended"       // Campaign ended.
)

type Category

type Category struct {
	Id   ID `json:"id"`
	Name string
}

func (*Category) Alias

func (self *Category) Alias() string

type CategoryBreakdown

type CategoryBreakdown struct {
	Category Category
	Level    Level
}

type CategoryConnection

type CategoryConnection struct {
	Nodes      []Category
	PageInfo   PageInfo
	TotalCount int
}

type CategoryCreateInput

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

type CategoryDeleteInput

type CategoryDeleteInput struct {
	Id ID `json:"id"`
}

type CategoryUpdateInput

type CategoryUpdateInput struct {
	Id   ID     `json:"id"`
	Name string `json:"name"`
}

type Check

type Check struct {
	Category    Category     `graphql:"category"`
	Description string       `graphql:"description"`
	Enabled     bool         `graphql:"enabled"`
	EnableOn    iso8601.Time `graphql:"enableOn"`
	Filter      Filter       `graphql:"filter"`
	Id          ID           `graphql:"id"`
	Level       Level        `graphql:"level"`
	Name        string       `graphql:"name"`
	Notes       string       `graphql:"notes: rawNotes"`
	Owner       CheckOwner   `graphql:"owner"`
	Type        CheckType    `graphql:"type"`

	// TODO: resort these alphabetically - It will require fixing all the test fixtures
	AlertSourceUsageCheckFragment `graphql:"... on AlertSourceUsageCheck"`
	CustomEventCheckFragment      `graphql:"... on CustomEventCheck"`
	HasRecentDeployCheckFragment  `graphql:"... on HasRecentDeployCheck"`
	ManualCheckFragment           `graphql:"... on ManualCheck"`
	RepositoryFileCheckFragment   `graphql:"... on RepositoryFileCheck"`
	RepositoryGrepCheckFragment   `graphql:"... on RepositoryGrepCheck"`
	RepositorySearchCheckFragment `graphql:"... on RepositorySearchCheck"`
	ServiceOwnershipCheckFragment `graphql:"... on ServiceOwnershipCheck"`
	ServicePropertyCheckFragment  `graphql:"... on ServicePropertyCheck"`
	TagDefinedCheckFragment       `graphql:"... on TagDefinedCheck"`
	ToolUsageCheckFragment        `graphql:"... on ToolUsageCheck"`
	HasDocumentationCheckFragment `graphql:"... on HasDocumentationCheck"`
}

type CheckAlertSourceUsageCreateInput

type CheckAlertSourceUsageCreateInput struct {
	CheckCreateInput

	AlertSourceType          AlertSourceTypeEnum `json:"alertSourceType,omitempty"`
	AlertSourceNamePredicate *PredicateInput     `json:"alertSourceNamePredicate,omitempty"`
}

type CheckAlertSourceUsageUpdateInput

type CheckAlertSourceUsageUpdateInput struct {
	CheckUpdateInput

	AlertSourceType          AlertSourceTypeEnum   `json:"alertSourceType,omitempty"`
	AlertSourceNamePredicate *PredicateUpdateInput `json:"alertSourceNamePredicate,omitempty"`
}

type CheckConnection

type CheckConnection struct {
	Nodes      []Check
	PageInfo   PageInfo
	TotalCount int
}

type CheckCreateInput

type CheckCreateInput struct {
	Name     string        `json:"name"`
	Enabled  bool          `json:"enabled"`
	EnableOn *iso8601.Time `json:"enableOn,omitempty"`
	Category ID            `json:"categoryId"`
	Level    ID            `json:"levelId"`
	Owner    *ID           `json:"ownerId,omitempty"`
	Filter   *ID           `json:"filterId,omitempty"`
	Notes    string        `json:"notes"`
}

func (*CheckCreateInput) GetCheckCreateInput

func (c *CheckCreateInput) GetCheckCreateInput() *CheckCreateInput

type CheckCreateInputProvider

type CheckCreateInputProvider interface {
	GetCheckCreateInput() *CheckCreateInput
}

type CheckCustomEventCreateInput

type CheckCustomEventCreateInput struct {
	CheckCreateInput

	Integration      ID     `json:"integrationId"`
	ServiceSelector  string `json:"serviceSelector"`
	SuccessCondition string `json:"successCondition"`
	Message          string `json:"resultMessage,omitempty"`
	PassPending      *bool  `json:"passPending,omitempty"`
}

type CheckCustomEventUpdateInput

type CheckCustomEventUpdateInput struct {
	CheckUpdateInput

	ServiceSelector  string  `json:"serviceSelector,omitempty"`
	SuccessCondition string  `json:"successCondition,omitempty"`
	Message          *string `json:"resultMessage,omitempty"`
	PassPending      *bool   `json:"passPending,omitempty"`
	Integration      *ID     `json:"integrationId,omitempty"`
}

type CheckDeleteInput

type CheckDeleteInput struct {
	Id ID `json:"id"`
}

type CheckGitBranchProtectionCreateInput

type CheckGitBranchProtectionCreateInput struct {
	CheckCreateInput
}

type CheckGitBranchProtectionUpdateInput

type CheckGitBranchProtectionUpdateInput struct {
	CheckUpdateInput
}

type CheckHasDocumentationCreateInput

type CheckHasDocumentationCreateInput struct {
	CheckCreateInput

	DocumentType    HasDocumentationTypeEnum    `json:"documentType"`
	DocumentSubtype HasDocumentationSubtypeEnum `json:"documentSubtype"`
}

type CheckHasDocumentationUpdateInput

type CheckHasDocumentationUpdateInput struct {
	CheckUpdateInput

	DocumentType    HasDocumentationTypeEnum    `json:"documentType"`
	DocumentSubtype HasDocumentationSubtypeEnum `json:"documentSubtype"`
}

type CheckHasRecentDeployCreateInput

type CheckHasRecentDeployCreateInput struct {
	CheckCreateInput

	Days int `json:"days"`
}

type CheckHasRecentDeployUpdateInput

type CheckHasRecentDeployUpdateInput struct {
	CheckUpdateInput

	Days *int `json:"days,omitempty"`
}

type CheckInputConstructor added in v2023.8.14

type CheckInputConstructor func() any

type CheckManualCreateInput

type CheckManualCreateInput struct {
	CheckCreateInput

	UpdateFrequency       *ManualCheckFrequencyInput `json:"updateFrequency,omitempty"`
	UpdateRequiresComment bool                       `json:"updateRequiresComment"`
}

type CheckManualUpdateInput

type CheckManualUpdateInput struct {
	CheckUpdateInput

	UpdateFrequency       *ManualCheckFrequencyInput `json:"updateFrequency,omitempty"`
	UpdateRequiresComment bool                       `json:"updateRequiresComment,omitempty"`
}

type CheckOwner

type CheckOwner struct {
	Team TeamId `graphql:"... on Team"`
}

type CheckRepositoryFileCreateInput

type CheckRepositoryFileCreateInput struct {
	CheckCreateInput

	DirectorySearch       bool            `json:"directorySearch"`
	Filepaths             []string        `json:"filePaths"`
	FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
	UseAbsoluteRoot       bool            `json:"useAbsoluteRoot"`
}

type CheckRepositoryFileUpdateInput

type CheckRepositoryFileUpdateInput struct {
	CheckUpdateInput

	DirectorySearch       bool            `json:"directorySearch"`
	Filepaths             []string        `json:"filePaths,omitempty"`
	FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
	UseAbsoluteRoot       bool            `json:"useAbsoluteRoot"`
}

type CheckRepositoryGrepCreateInput

type CheckRepositoryGrepCreateInput struct {
	CheckCreateInput

	DirectorySearch       bool            `json:"directorySearch"`
	Filepaths             []string        `json:"filePaths"`
	FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
}

type CheckRepositoryGrepUpdateInput

type CheckRepositoryGrepUpdateInput struct {
	CheckUpdateInput

	DirectorySearch       bool            `json:"directorySearch"`
	Filepaths             []string        `json:"filePaths,omitempty"`
	FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
}

type CheckRepositoryIntegratedCreateInput

type CheckRepositoryIntegratedCreateInput struct {
	CheckCreateInput
}

type CheckRepositoryIntegratedUpdateInput

type CheckRepositoryIntegratedUpdateInput struct {
	CheckUpdateInput
}

type CheckRepositorySearchCreateInput

type CheckRepositorySearchCreateInput struct {
	CheckCreateInput

	FileExtensions        []string       `json:"fileExtensions,omitempty"`
	FileContentsPredicate PredicateInput `json:"fileContentsPredicate"`
}

type CheckRepositorySearchUpdateInput

type CheckRepositorySearchUpdateInput struct {
	CheckUpdateInput

	FileExtensions        []string        `json:"fileExtensions,omitempty"`
	FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
}

type CheckResponsePayload

type CheckResponsePayload struct {
	Check  Check
	Errors []OpsLevelErrors
}

Encompass CheckCreatePayload and CheckUpdatePayload into 1 struct

type CheckServiceConfigurationCreateInput

type CheckServiceConfigurationCreateInput struct {
	CheckCreateInput
}

type CheckServiceConfigurationUpdateInput

type CheckServiceConfigurationUpdateInput struct {
	CheckUpdateInput
}

type CheckServiceDependencyCreateInput

type CheckServiceDependencyCreateInput struct {
	CheckCreateInput
}

type CheckServiceDependencyUpdateInput

type CheckServiceDependencyUpdateInput struct {
	CheckUpdateInput
}

type CheckServiceOwnershipCreateInput

type CheckServiceOwnershipCreateInput struct {
	CheckCreateInput

	RequireContactMethod *bool           `json:"requireContactMethod,omitempty"`
	ContactMethod        *ContactType    `json:"contactMethod,omitempty"`
	TeamTagKey           string          `json:"tagKey,omitempty"`
	TeamTagPredicate     *PredicateInput `json:"tagPredicate,omitempty"`
}

type CheckServiceOwnershipUpdateInput

type CheckServiceOwnershipUpdateInput struct {
	CheckUpdateInput

	RequireContactMethod *bool                 `json:"requireContactMethod,omitempty"`
	ContactMethod        *ContactType          `json:"contactMethod,omitempty"`
	TeamTagKey           string                `json:"tagKey,omitempty"`
	TeamTagPredicate     *PredicateUpdateInput `json:"tagPredicate,omitempty"`
}

type CheckServicePropertyCreateInput

type CheckServicePropertyCreateInput struct {
	CheckCreateInput

	Property  ServicePropertyTypeEnum `json:"serviceProperty"`
	Predicate *PredicateInput         `json:"propertyValuePredicate,omitempty"`
}

type CheckServicePropertyUpdateInput

type CheckServicePropertyUpdateInput struct {
	CheckUpdateInput

	Property  ServicePropertyTypeEnum `json:"serviceProperty,omitempty"`
	Predicate *PredicateInput         `json:"propertyValuePredicate,omitempty"`
}

type CheckStatus

type CheckStatus string

CheckStatus represents the evaluation status of the check.

const (
	CheckStatusPassed  CheckStatus = "passed"  // The check evaluated to a truthy value based on some conditions.
	CheckStatusFailed  CheckStatus = "failed"  // The check evaluated to a falsy value based on some conditions.
	CheckStatusPending CheckStatus = "pending" // The check has not been evaluated yet..
)

type CheckTagDefinedCreateInput

type CheckTagDefinedCreateInput struct {
	CheckCreateInput

	TagKey       string          `json:"tagKey"`
	TagPredicate *PredicateInput `json:"tagPredicate,omitempty"`
}

type CheckTagDefinedUpdateInput

type CheckTagDefinedUpdateInput struct {
	CheckUpdateInput

	TagKey       string          `json:"tagKey,omitempty"`
	TagPredicate *PredicateInput `json:"tagPredicate,omitempty"`
}

type CheckToolUsageCreateInput

type CheckToolUsageCreateInput struct {
	CheckCreateInput

	ToolCategory         ToolCategory    `json:"toolCategory"`
	ToolNamePredicate    *PredicateInput `json:"toolNamePredicate,omitempty"`
	ToolUrlPredicate     *PredicateInput `json:"toolUrlPredicate,omitempty"`
	EnvironmentPredicate *PredicateInput `json:"environmentPredicate,omitempty"`
}

type CheckToolUsageUpdateInput

type CheckToolUsageUpdateInput struct {
	CheckUpdateInput

	ToolCategory         ToolCategory    `json:"toolCategory,omitempty"`
	ToolNamePredicate    *PredicateInput `json:"toolNamePredicate,omitempty"`
	ToolUrlPredicate     *PredicateInput `json:"toolUrlPredicate,omitempty"`
	EnvironmentPredicate *PredicateInput `json:"environmentPredicate,omitempty"`
}

type CheckType

type CheckType string

CheckType represents the type of check.

const (
	CheckTypeHasOwner            CheckType = "has_owner"             // Verifies that the service has an owner defined.
	CheckTypeHasRecentDeploy     CheckType = "has_recent_deploy"     // Verified that the services has received a deploy within a specified number of days.
	CheckTypeServiceProperty     CheckType = "service_property"      // Verifies that a service property is set or matches a specified format.
	CheckTypeHasServiceConfig    CheckType = "has_service_config"    // Verifies that the service is maintained though the use of an opslevel.yml service config.
	CheckTypeHasDocumentation    CheckType = "has_documentation"     // Verifies that the service has visible documentation of a particular type and subtype.
	CheckTypeHasRepository       CheckType = "has_repository"        // Verifies that the service has a repository integrated.
	CheckTypeToolUsage           CheckType = "tool_usage"            // Verifies that the service is using a tool of a particular category or name.
	CheckTypeTagDefined          CheckType = "tag_defined"           // Verifies that the service has the specified tag defined.
	CheckTypeRepoFile            CheckType = "repo_file"             // Quickly scan the service’s repository for the existence or contents of a specific file.
	CheckTypeRepoSearch          CheckType = "repo_search"           // Quickly search the service’s repository for specific contents in any file.
	CheckTypeCustom              CheckType = "custom"                // Allows for the creation of programmatic checks that use an API to mark the status as passing or failing.
	CheckTypePayload             CheckType = "payload"               // Requires a payload integration api call to complete a check for the service.
	CheckTypeManual              CheckType = "manual"                // Requires a service owner to manually complete a check for the service.
	CheckTypeGeneric             CheckType = "generic"               // Requires a generic integration api call to complete a series of checks for multiple services.
	CheckTypeAlertSourceUsage    CheckType = "alert_source_usage"    // Verifies that the service has an alert source of a particular type or name.
	CheckTypeGitBranchProtection CheckType = "git_branch_protection" // Verifies that all the repositories on the service have branch protection enabled.
	CheckTypeServiceDependency   CheckType = "service_dependency"    // Verifies that the service has either a dependent or dependency.
	CheckTypeRepoGrep            CheckType = "repo_grep"             // Run a comprehensive search across the service's repository using advanced search parameters.
)

type CheckUpdateInput

type CheckUpdateInput struct {
	Id       ID            `json:"id"`
	Name     string        `json:"name,omitempty"`
	Enabled  *bool         `json:"enabled,omitempty"`
	EnableOn *iso8601.Time `json:"enableOn,omitempty"`
	Category ID            `json:"categoryId,omitempty"`
	Level    ID            `json:"levelId,omitempty"`
	Owner    *ID           `json:"ownerId,omitempty"`
	Filter   *ID           `json:"filterId,omitempty"`
	Notes    *string       `json:"notes,omitempty"`
}

func (*CheckUpdateInput) GetCheckUpdateInput

func (c *CheckUpdateInput) GetCheckUpdateInput() *CheckUpdateInput

type CheckUpdateInputProvider

type CheckUpdateInputProvider interface {
	GetCheckUpdateInput() *CheckUpdateInput
}

type Client

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

func NewClient deprecated

func NewClient(apiToken string, options ...Option) *Client

Deprecated: Use NewGQLClient instead

func NewGQLClient

func NewGQLClient(options ...Option) *Client

func (*Client) AddContact

func (client *Client) AddContact(team string, contact ContactInput) (*Contact, error)

func (*Client) AddMember deprecated

func (client *Client) AddMember(team *TeamId, email string) ([]TeamMembership, error)

Deprecated: use AddMemberships instead

func (*Client) AddMembers deprecated

func (client *Client) AddMembers(team *TeamId, emails []string) ([]TeamMembership, error)

Deprecated: use AddMemberships instead

func (*Client) AddMemberships added in v2023.11.16

func (client *Client) AddMemberships(team *TeamId, memberships ...TeamMembershipUserInput) ([]TeamMembership, error)

func (*Client) AssignTag added in v2023.3.14

func (client *Client) AssignTag(input TagAssignInput) ([]Tag, error)

func (*Client) AssignTagForAlias deprecated

func (client *Client) AssignTagForAlias(alias string, key string, value string) ([]Tag, error)

Deprecated: Use AssignTagFor instead

func (*Client) AssignTagForId deprecated

func (client *Client) AssignTagForId(id ID, key string, value string) ([]Tag, error)

Deprecated: Use AssignTagFor instead

func (*Client) AssignTags

func (client *Client) AssignTags(identifier string, tags map[string]string) ([]Tag, error)

func (*Client) AssignTagsForAlias deprecated

func (client *Client) AssignTagsForAlias(alias string, tags map[string]string) ([]Tag, error)

Deprecated: Use AssignTagsFor instead

func (*Client) AssignTagsForId deprecated

func (client *Client) AssignTagsForId(id ID, tags map[string]string) ([]Tag, error)

Deprecated: Use AssignTagsFor instead

func (*Client) ConnectServiceRepository

func (client *Client) ConnectServiceRepository(service *ServiceId, repository *Repository) (*ServiceRepository, error)

func (*Client) CreateAlertSourceService added in v2023.3.14

func (client *Client) CreateAlertSourceService(input AlertSourceServiceCreateInput) (*AlertSourceService, error)

func (*Client) CreateAlias

func (client *Client) CreateAlias(input AliasCreateInput) ([]string, error)

func (*Client) CreateAliases

func (client *Client) CreateAliases(ownerId ID, aliases []string) ([]string, error)

#region Create TODO: make sure duplicate aliases throw an error that we can catch

func (*Client) CreateCategory

func (client *Client) CreateCategory(input CategoryCreateInput) (*Category, error)

func (*Client) CreateCheck added in v2023.8.14

func (client *Client) CreateCheck(input any) (*Check, error)

func (*Client) CreateCheckAlertSourceUsage

func (client *Client) CreateCheckAlertSourceUsage(input CheckAlertSourceUsageCreateInput) (*Check, error)

func (*Client) CreateCheckCustomEvent

func (client *Client) CreateCheckCustomEvent(input CheckCustomEventCreateInput) (*Check, error)

func (*Client) CreateCheckGitBranchProtection

func (client *Client) CreateCheckGitBranchProtection(input CheckGitBranchProtectionCreateInput) (*Check, error)

func (*Client) CreateCheckHasDocumentation

func (client *Client) CreateCheckHasDocumentation(input CheckHasDocumentationCreateInput) (*Check, error)

func (*Client) CreateCheckHasRecentDeploy

func (client *Client) CreateCheckHasRecentDeploy(input CheckHasRecentDeployCreateInput) (*Check, error)

func (*Client) CreateCheckManual

func (client *Client) CreateCheckManual(input CheckManualCreateInput) (*Check, error)

func (*Client) CreateCheckRepositoryFile

func (client *Client) CreateCheckRepositoryFile(input CheckRepositoryFileCreateInput) (*Check, error)

func (*Client) CreateCheckRepositoryGrep

func (client *Client) CreateCheckRepositoryGrep(input CheckRepositoryGrepCreateInput) (*Check, error)

func (*Client) CreateCheckRepositoryIntegrated

func (client *Client) CreateCheckRepositoryIntegrated(input CheckRepositoryIntegratedCreateInput) (*Check, error)

func (*Client) CreateCheckRepositorySearch

func (client *Client) CreateCheckRepositorySearch(input CheckRepositorySearchCreateInput) (*Check, error)

func (*Client) CreateCheckServiceConfiguration

func (client *Client) CreateCheckServiceConfiguration(input CheckServiceConfigurationCreateInput) (*Check, error)

func (*Client) CreateCheckServiceDependency

func (client *Client) CreateCheckServiceDependency(input CheckServiceDependencyCreateInput) (*Check, error)

func (*Client) CreateCheckServiceOwnership

func (client *Client) CreateCheckServiceOwnership(input CheckServiceOwnershipCreateInput) (*Check, error)

func (*Client) CreateCheckServiceProperty

func (client *Client) CreateCheckServiceProperty(input CheckServicePropertyCreateInput) (*Check, error)

func (*Client) CreateCheckTagDefined

func (client *Client) CreateCheckTagDefined(input CheckTagDefinedCreateInput) (*Check, error)

func (*Client) CreateCheckToolUsage

func (client *Client) CreateCheckToolUsage(input CheckToolUsageCreateInput) (*Check, error)

func (*Client) CreateDomain added in v2023.4.11

func (c *Client) CreateDomain(input DomainInput) (*Domain, error)

func (*Client) CreateFilter

func (client *Client) CreateFilter(input FilterCreateInput) (*Filter, error)

func (*Client) CreateInfrastructure added in v2023.7.17

func (client *Client) CreateInfrastructure(input InfraInput) (*InfrastructureResource, error)

func (*Client) CreateIntegrationAWS added in v2023.5.5

func (client *Client) CreateIntegrationAWS(input AWSIntegrationInput) (*Integration, error)

func (*Client) CreateIntegrationNewRelic added in v2023.7.17

func (client *Client) CreateIntegrationNewRelic(input NewRelicIntegrationInput) (*Integration, error)

func (*Client) CreateLevel

func (client *Client) CreateLevel(input LevelCreateInput) (*Level, error)

func (*Client) CreatePropertyDefinition added in v2023.12.14

func (client *Client) CreatePropertyDefinition(input PropertyDefinitionInput) (*PropertyDefinition, error)

func (*Client) CreateScorecard added in v2023.8.28

func (client *Client) CreateScorecard(input ScorecardInput) (*Scorecard, error)

func (*Client) CreateSecret added in v2023.8.28

func (client *Client) CreateSecret(alias string, input SecretInput) (*Secret, error)

func (*Client) CreateService

func (client *Client) CreateService(input ServiceCreateInput) (*Service, error)

func (*Client) CreateServiceDependency added in v2023.5.5

func (client *Client) CreateServiceDependency(input ServiceDependencyCreateInput) (*ServiceDependency, error)

func (*Client) CreateServiceRepository

func (client *Client) CreateServiceRepository(input ServiceRepositoryCreateInput) (*ServiceRepository, error)

func (*Client) CreateSystem added in v2023.4.11

func (c *Client) CreateSystem(input SystemInput) (*System, error)

func (*Client) CreateTag

func (client *Client) CreateTag(input TagCreateInput) (*Tag, error)

func (*Client) CreateTags

func (client *Client) CreateTags(identifier string, tags map[string]string) ([]Tag, error)

func (*Client) CreateTagsForId deprecated

func (client *Client) CreateTagsForId(id ID, tags map[string]string) ([]Tag, error)

Deprecated: Use CreateTags instead

func (*Client) CreateTeam

func (client *Client) CreateTeam(input TeamCreateInput) (*Team, error)

func (*Client) CreateTool

func (client *Client) CreateTool(input ToolCreateInput) (*Tool, error)

func (*Client) CreateTriggerDefinition

func (client *Client) CreateTriggerDefinition(input CustomActionsTriggerDefinitionCreateInput) (*CustomActionsTriggerDefinition, error)

func (*Client) CreateWebhookAction

func (client *Client) CreateWebhookAction(input CustomActionsWebhookActionCreateInput) (*CustomActionsExternalAction, error)

func (*Client) DeleteAlertSourceService added in v2023.3.14

func (client *Client) DeleteAlertSourceService(id ID) error

func (*Client) DeleteAlias

func (client *Client) DeleteAlias(input AliasDeleteInput) error

func (*Client) DeleteCategory

func (client *Client) DeleteCategory(id ID) error

func (*Client) DeleteCheck

func (client *Client) DeleteCheck(id ID) error

func (*Client) DeleteDomain added in v2023.4.11

func (c *Client) DeleteDomain(identifier string) error

func (*Client) DeleteFilter

func (client *Client) DeleteFilter(id ID) error

func (*Client) DeleteGroup

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

func (*Client) DeleteGroupWithAlias deprecated

func (client *Client) DeleteGroupWithAlias(alias string) error

Deprecated: Please use DeleteGroup instead

func (*Client) DeleteInfraAlias added in v2023.11.16

func (client *Client) DeleteInfraAlias(alias string) error

func (*Client) DeleteInfrastructure added in v2023.7.17

func (client *Client) DeleteInfrastructure(identifier string) error

func (*Client) DeleteIntegration added in v2023.5.5

func (client *Client) DeleteIntegration(identifier string) error

func (*Client) DeleteLevel

func (client *Client) DeleteLevel(id ID) error

func (*Client) DeletePropertyDefinition added in v2023.12.14

func (client *Client) DeletePropertyDefinition(input string) error

func (*Client) DeleteScorecard added in v2023.8.28

func (client *Client) DeleteScorecard(identifier string) (ID, error)

func (*Client) DeleteSecret added in v2023.8.28

func (client *Client) DeleteSecret(identifier string) error

func (*Client) DeleteService

func (client *Client) DeleteService(input ServiceDeleteInput) error

TODO: we should have a method that takes and ID and that follows the convention of other delete functions

func (*Client) DeleteServiceAlias

func (client *Client) DeleteServiceAlias(alias string) error

func (*Client) DeleteServiceDependency added in v2023.5.5

func (client *Client) DeleteServiceDependency(id ID) error

func (*Client) DeleteServiceRepository

func (client *Client) DeleteServiceRepository(id ID) error

func (*Client) DeleteServiceWithAlias

func (client *Client) DeleteServiceWithAlias(alias string) error

func (*Client) DeleteSystem added in v2023.4.11

func (c *Client) DeleteSystem(identifier string) error

func (*Client) DeleteTag

func (client *Client) DeleteTag(id ID) error

func (*Client) DeleteTeam

func (client *Client) DeleteTeam(id ID) error

func (*Client) DeleteTeamAlias

func (client *Client) DeleteTeamAlias(alias string) error

func (*Client) DeleteTeamWithAlias

func (client *Client) DeleteTeamWithAlias(alias string) error

func (*Client) DeleteTeamWithId deprecated

func (client *Client) DeleteTeamWithId(id ID) error

Deprecated: use DeleteTeam instead

func (*Client) DeleteTool

func (client *Client) DeleteTool(id ID) error

func (*Client) DeleteTriggerDefinition

func (client *Client) DeleteTriggerDefinition(input IdentifierInput) error

func (*Client) DeleteUser

func (client *Client) DeleteUser(user string) error

func (*Client) DeleteWebhookAction

func (client *Client) DeleteWebhookAction(input IdentifierInput) error

func (*Client) ExecRaw added in v2023.3.14

func (client *Client) ExecRaw(q string, variables map[string]interface{}, options ...graphql.Option) ([]byte, error)

func (*Client) ExecRawCTX added in v2023.3.14

func (client *Client) ExecRawCTX(ctx context.Context, q string, variables map[string]interface{}, options ...graphql.Option) ([]byte, error)

func (*Client) GetAlertSource

func (client *Client) GetAlertSource(id ID) (*AlertSource, error)

func (*Client) GetAlertSourceWithExternalIdentifier

func (client *Client) GetAlertSourceWithExternalIdentifier(input AlertSourceExternalIdentifier) (*AlertSource, error)

func (*Client) GetCategory

func (client *Client) GetCategory(id ID) (*Category, error)

func (*Client) GetCheck

func (client *Client) GetCheck(id ID) (*Check, error)

func (*Client) GetCustomAction

func (client *Client) GetCustomAction(input IdentifierInput) (*CustomActionsExternalAction, error)

func (*Client) GetDomain added in v2023.4.11

func (c *Client) GetDomain(identifier string) (*Domain, error)

func (*Client) GetFilter

func (client *Client) GetFilter(id ID) (*Filter, error)

func (*Client) GetGroup

func (client *Client) GetGroup(id ID) (*Group, error)

func (*Client) GetGroupWithAlias

func (client *Client) GetGroupWithAlias(alias string) (*Group, error)

func (*Client) GetInfrastructure added in v2023.7.17

func (client *Client) GetInfrastructure(identifier string) (*InfrastructureResource, error)

func (*Client) GetIntegration

func (client *Client) GetIntegration(id ID) (*Integration, error)

func (*Client) GetLevel

func (client *Client) GetLevel(id ID) (*Level, error)

func (*Client) GetPropertyDefinition added in v2023.12.14

func (client *Client) GetPropertyDefinition(input string) (*PropertyDefinition, error)

func (*Client) GetRepository

func (client *Client) GetRepository(id ID) (*Repository, error)

func (*Client) GetRepositoryWithAlias

func (client *Client) GetRepositoryWithAlias(alias string) (*Repository, error)

func (*Client) GetScorecard added in v2023.8.28

func (client *Client) GetScorecard(identifier string) (*Scorecard, error)

func (*Client) GetSecret added in v2023.8.28

func (client *Client) GetSecret(identifier string) (*Secret, error)

func (*Client) GetService

func (client *Client) GetService(id ID) (*Service, error)

func (*Client) GetServiceCount

func (client *Client) GetServiceCount() (int, error)

func (*Client) GetServiceIdWithAlias

func (client *Client) GetServiceIdWithAlias(alias string) (*ServiceId, error)

This is a lightweight api call to lookup a service id by and alias - it does not return a full Service object

func (*Client) GetServiceMaturityWithAlias

func (c *Client) GetServiceMaturityWithAlias(alias string) (*ServiceMaturity, error)

func (*Client) GetServiceWithAlias

func (client *Client) GetServiceWithAlias(alias string) (*Service, error)

func (*Client) GetServiceWithId deprecated

func (client *Client) GetServiceWithId(id ID) (*Service, error)

Deprecated: Use GetService instead

func (*Client) GetSystem added in v2023.4.11

func (c *Client) GetSystem(identifier string) (*System, error)

func (*Client) GetTagCount deprecated

func (client *Client) GetTagCount(id ID) (int, error)

Deprecated: use client.GetService(id).Tags.TotalCount instead

func (*Client) GetTaggableResource added in v2023.10.8

func (client *Client) GetTaggableResource(resourceType TaggableResource, identifier string) (TaggableResourceInterface, error)

func (*Client) GetTagsForService deprecated

func (client *Client) GetTagsForService(id ID) ([]Tag, error)

Deprecated: use client.GetService(id).Tags instead

func (*Client) GetTagsForServiceWithAlias deprecated

func (client *Client) GetTagsForServiceWithAlias(alias string) ([]Tag, error)

Deprecated: use client.GetServiceWithAlias(alias).Tags instead

func (*Client) GetTagsForServiceWithId deprecated

func (client *Client) GetTagsForServiceWithId(id ID) ([]Tag, error)

Deprecated: use client.GetService(id).Tags instead

func (*Client) GetTeam

func (client *Client) GetTeam(id ID) (*Team, error)

func (*Client) GetTeamCount

func (client *Client) GetTeamCount() (int, error)

func (*Client) GetTeamWithAlias

func (client *Client) GetTeamWithAlias(alias string) (*Team, error)

func (*Client) GetTeamWithId deprecated

func (client *Client) GetTeamWithId(id ID) (*Team, error)

Deprecated: use GetTeam instead

func (*Client) GetToolCount deprecated

func (client *Client) GetToolCount(id ID) (int, error)

Deprecated: Use client.GetService(id).Tools.TotalCount instead

func (*Client) GetToolsForService deprecated

func (client *Client) GetToolsForService(id ID, variables *PayloadVariables) ([]Tool, error)

Deprecated: Use client.GetService(id).Tools instead

func (*Client) GetToolsForServiceWithAlias deprecated

func (client *Client) GetToolsForServiceWithAlias(alias string) ([]Tool, error)

Deprecated: Use client.GetServiceWithAlias(alias).Tools instead

func (*Client) GetToolsForServiceWithId deprecated

func (client *Client) GetToolsForServiceWithId(id ID) ([]Tool, error)

Deprecated: Use GetToolsForService instead

func (*Client) GetTriggerDefinition

func (client *Client) GetTriggerDefinition(input IdentifierInput) (*CustomActionsTriggerDefinition, error)

func (*Client) GetUser

func (client *Client) GetUser(value string) (*User, error)

func (*Client) InitialPageVariables

func (client *Client) InitialPageVariables() PayloadVariables

func (*Client) InitialPageVariablesPointer

func (client *Client) InitialPageVariablesPointer() *PayloadVariables

func (*Client) InviteUser

func (client *Client) InviteUser(email string, input UserInput) (*User, error)

func (*Client) ListCategories

func (client *Client) ListCategories(variables *PayloadVariables) (*CategoryConnection, error)

func (*Client) ListChecks

func (client *Client) ListChecks(variables *PayloadVariables) (CheckConnection, error)

func (*Client) ListCustomActions

func (client *Client) ListCustomActions(variables *PayloadVariables) (CustomActionsExternalActionsConnection, error)

func (*Client) ListDomains added in v2023.4.11

func (c *Client) ListDomains(variables *PayloadVariables) (*DomainConnection, error)

func (*Client) ListFilters

func (client *Client) ListFilters(variables *PayloadVariables) (FilterConnection, error)

func (*Client) ListGroups

func (client *Client) ListGroups(variables *PayloadVariables) (GroupConnection, error)

func (*Client) ListInfrastructure added in v2023.7.17

func (client *Client) ListInfrastructure(variables *PayloadVariables) (InfrastructureResourceConnection, error)

func (*Client) ListInfrastructureSchemas added in v2023.7.17

func (client *Client) ListInfrastructureSchemas(variables *PayloadVariables) (InfrastructureResourceSchemaConnection, error)

func (*Client) ListIntegrations

func (client *Client) ListIntegrations(variables *PayloadVariables) (IntegrationConnection, error)

func (*Client) ListLevels

func (client *Client) ListLevels() ([]Level, error)

func (*Client) ListLifecycles

func (client *Client) ListLifecycles() ([]Lifecycle, error)

func (*Client) ListPropertyDefinitions added in v2023.12.14

func (client *Client) ListPropertyDefinitions(variables *PayloadVariables) (PropertyDefinitionConnection, error)

func (*Client) ListRepositories

func (client *Client) ListRepositories(variables *PayloadVariables) (*RepositoryConnection, error)

func (*Client) ListRepositoriesWithTier

func (client *Client) ListRepositoriesWithTier(tier string, variables *PayloadVariables) (*RepositoryConnection, error)

func (*Client) ListScorecards added in v2023.8.28

func (client *Client) ListScorecards(variables *PayloadVariables) (ScorecardConnection, error)

func (*Client) ListSecretsVaultsSecret added in v2023.8.28

func (client *Client) ListSecretsVaultsSecret(variables *PayloadVariables) (SecretsVaultsSecretConnection, error)

List all Secrets for your account.

func (*Client) ListServices

func (client *Client) ListServices(variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesMaturity

func (c *Client) ListServicesMaturity() ([]ServiceMaturity, error)

func (*Client) ListServicesWithFramework

func (client *Client) ListServicesWithFramework(framework string, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesWithLanguage

func (client *Client) ListServicesWithLanguage(language string, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesWithLifecycle

func (client *Client) ListServicesWithLifecycle(lifecycle string, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesWithOwner

func (client *Client) ListServicesWithOwner(owner string, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesWithProduct

func (client *Client) ListServicesWithProduct(product string, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesWithTag

func (client *Client) ListServicesWithTag(tag TagArgs, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListServicesWithTier

func (client *Client) ListServicesWithTier(tier string, variables *PayloadVariables) (ServiceConnection, error)

func (*Client) ListSystems added in v2023.4.11

func (c *Client) ListSystems(variables *PayloadVariables) (*SystemConnection, error)

func (*Client) ListTeams

func (client *Client) ListTeams(variables *PayloadVariables) (*TeamConnection, error)

func (*Client) ListTeamsWithManager

func (client *Client) ListTeamsWithManager(email string, variables *PayloadVariables) (*TeamConnection, error)

func (*Client) ListTiers

func (client *Client) ListTiers() ([]Tier, error)

func (*Client) ListTriggerDefinitions

func (client *Client) ListTriggerDefinitions(variables *PayloadVariables) (CustomActionsTriggerDefinitionsConnection, error)

func (*Client) ListUsers

func (client *Client) ListUsers(variables *PayloadVariables) (UserConnection, error)

func (*Client) Mutate

func (client *Client) Mutate(m interface{}, variables map[string]interface{}, options ...graphql.Option) error

func (*Client) MutateCTX

func (client *Client) MutateCTX(ctx context.Context, m interface{}, variables map[string]interface{}, options ...graphql.Option) error

func (*Client) Query

func (client *Client) Query(q interface{}, variables map[string]interface{}, options ...graphql.Option) error

func (*Client) QueryCTX

func (client *Client) QueryCTX(ctx context.Context, q interface{}, variables map[string]interface{}, options ...graphql.Option) error

func (*Client) RemoveContact

func (client *Client) RemoveContact(contact ID) error

func (*Client) RemoveMember deprecated

func (client *Client) RemoveMember(team *TeamId, membership TeamMembershipUserInput) ([]User, error)

Deprecated: use RemoveMembers instead

func (*Client) RemoveMembers deprecated

func (client *Client) RemoveMembers(team *TeamId, emails []string) ([]User, error)

Deprecated: use RemoveMembers instead

func (*Client) RemoveMemberships added in v2023.11.16

func (client *Client) RemoveMemberships(team *TeamId, memberships ...TeamMembershipUserInput) ([]User, error)

func (*Client) RunnerAppendJobLog

func (c *Client) RunnerAppendJobLog(input RunnerAppendJobLogInput) error

func (*Client) RunnerGetPendingJob

func (c *Client) RunnerGetPendingJob(runnerId ID, lastUpdateToken ID) (*RunnerJob, ID, error)

func (*Client) RunnerRegister

func (c *Client) RunnerRegister() (*Runner, error)

func (*Client) RunnerReportJobOutcome

func (c *Client) RunnerReportJobOutcome(input RunnerReportJobOutcomeInput) error

func (*Client) RunnerScale

func (c *Client) RunnerScale(runnerId ID, currentReplicaCount, jobConcurrency int) (*RunnerScale, error)

func (*Client) RunnerUnregister

func (c *Client) RunnerUnregister(runnerId ID) error

func (*Client) ServiceApiDocSettingsUpdate

func (c *Client) ServiceApiDocSettingsUpdate(service string, docPath string, docSource *ApiDocumentSourceEnum) (*Service, error)

func (*Client) UpdateCategory

func (client *Client) UpdateCategory(input CategoryUpdateInput) (*Category, error)

func (*Client) UpdateCheck added in v2023.8.14

func (client *Client) UpdateCheck(input any) (*Check, error)

func (*Client) UpdateCheckAlertSourceUsage

func (client *Client) UpdateCheckAlertSourceUsage(input CheckAlertSourceUsageUpdateInput) (*Check, error)

func (*Client) UpdateCheckCustomEvent

func (client *Client) UpdateCheckCustomEvent(input CheckCustomEventUpdateInput) (*Check, error)

func (*Client) UpdateCheckGitBranchProtection

func (client *Client) UpdateCheckGitBranchProtection(input CheckGitBranchProtectionUpdateInput) (*Check, error)

func (*Client) UpdateCheckHasDocumentation

func (client *Client) UpdateCheckHasDocumentation(input CheckHasDocumentationUpdateInput) (*Check, error)

func (*Client) UpdateCheckHasRecentDeploy

func (client *Client) UpdateCheckHasRecentDeploy(input CheckHasRecentDeployUpdateInput) (*Check, error)

func (*Client) UpdateCheckManual

func (client *Client) UpdateCheckManual(input CheckManualUpdateInput) (*Check, error)

func (*Client) UpdateCheckRepositoryFile

func (client *Client) UpdateCheckRepositoryFile(input CheckRepositoryFileUpdateInput) (*Check, error)

func (*Client) UpdateCheckRepositoryGrep

func (client *Client) UpdateCheckRepositoryGrep(input CheckRepositoryGrepUpdateInput) (*Check, error)

func (*Client) UpdateCheckRepositoryIntegrated

func (client *Client) UpdateCheckRepositoryIntegrated(input CheckRepositoryIntegratedUpdateInput) (*Check, error)

func (*Client) UpdateCheckRepositorySearch

func (client *Client) UpdateCheckRepositorySearch(input CheckRepositorySearchUpdateInput) (*Check, error)

func (*Client) UpdateCheckServiceConfiguration

func (client *Client) UpdateCheckServiceConfiguration(input CheckServiceConfigurationUpdateInput) (*Check, error)

func (*Client) UpdateCheckServiceDependency

func (client *Client) UpdateCheckServiceDependency(input CheckServiceDependencyUpdateInput) (*Check, error)

func (*Client) UpdateCheckServiceOwnership

func (client *Client) UpdateCheckServiceOwnership(input CheckServiceOwnershipUpdateInput) (*Check, error)

func (*Client) UpdateCheckServiceProperty

func (client *Client) UpdateCheckServiceProperty(input CheckServicePropertyUpdateInput) (*Check, error)

func (*Client) UpdateCheckTagDefined

func (client *Client) UpdateCheckTagDefined(input CheckTagDefinedUpdateInput) (*Check, error)

func (*Client) UpdateCheckToolUsage

func (client *Client) UpdateCheckToolUsage(input CheckToolUsageUpdateInput) (*Check, error)

func (*Client) UpdateContact

func (client *Client) UpdateContact(id ID, contact ContactInput) (*Contact, error)

func (*Client) UpdateDomain added in v2023.4.11

func (c *Client) UpdateDomain(identifier string, input DomainInput) (*Domain, error)

func (*Client) UpdateFilter

func (client *Client) UpdateFilter(input FilterUpdateInput) (*Filter, error)

func (*Client) UpdateInfrastructure added in v2023.7.17

func (client *Client) UpdateInfrastructure(identifier string, input InfraInput) (*InfrastructureResource, error)

func (*Client) UpdateIntegrationAWS added in v2023.5.5

func (client *Client) UpdateIntegrationAWS(identifier string, input AWSIntegrationInput) (*Integration, error)

func (*Client) UpdateIntegrationNewRelic added in v2023.7.17

func (client *Client) UpdateIntegrationNewRelic(identifier string, input NewRelicIntegrationInput) (*Integration, error)

func (*Client) UpdateLevel

func (client *Client) UpdateLevel(input LevelUpdateInput) (*Level, error)

func (*Client) UpdateRepository added in v2023.5.18

func (client *Client) UpdateRepository(input RepositoryUpdateInput) (*Repository, error)

func (*Client) UpdateScorecard added in v2023.8.28

func (client *Client) UpdateScorecard(identifier string, input ScorecardInput) (*Scorecard, error)

func (*Client) UpdateSecret added in v2023.8.28

func (client *Client) UpdateSecret(identifier string, secretInput SecretInput) (*Secret, error)

func (*Client) UpdateService

func (client *Client) UpdateService(input ServiceUpdateInput) (*Service, error)

func (*Client) UpdateServiceRepository

func (client *Client) UpdateServiceRepository(input ServiceRepositoryUpdateInput) (*ServiceRepository, error)

func (*Client) UpdateSystem added in v2023.4.11

func (c *Client) UpdateSystem(identifier string, input SystemInput) (*System, error)

func (*Client) UpdateTag

func (client *Client) UpdateTag(input TagUpdateInput) (*Tag, error)

func (*Client) UpdateTeam

func (client *Client) UpdateTeam(input TeamUpdateInput) (*Team, error)

func (*Client) UpdateTool

func (client *Client) UpdateTool(input ToolUpdateInput) (*Tool, error)

func (*Client) UpdateTriggerDefinition

func (client *Client) UpdateTriggerDefinition(input CustomActionsTriggerDefinitionUpdateInput) (*CustomActionsTriggerDefinition, error)

func (*Client) UpdateUser

func (client *Client) UpdateUser(user string, input UserInput) (*User, error)

func (*Client) UpdateWebhookAction

func (client *Client) UpdateWebhookAction(input CustomActionsWebhookActionUpdateInput) (*CustomActionsExternalAction, error)

func (*Client) Validate

func (client *Client) Validate() error

type ClientSettings

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

type ConnectiveEnum

type ConnectiveEnum string

ConnectiveEnum represents the logical operator to be used in conjunction with multiple filters (requires filters to be supplied).

const (
	ConnectiveEnumAnd ConnectiveEnum = "and" // Used to ensure **all** filters match for a given resource.
	ConnectiveEnumOr  ConnectiveEnum = "or"  // Used to ensure **any** filters match for a given resource.
)

type Contact

type Contact struct {
	Address     string
	DisplayName string
	Id          ID
	Type        ContactType
}

type ContactCreateInput

type ContactCreateInput struct {
	Type        ContactType `json:"type"`
	DisplayName string      `json:"displayName,omitempty"`
	Address     string      `json:"address"`
	TeamId      *ID         `json:"teamId,omitempty"`
	TeamAlias   string      `json:"teamAlias,omitempty"`
}

type ContactDeleteInput

type ContactDeleteInput struct {
	Id ID `json:"id"`
}

type ContactInput

type ContactInput struct {
	Type        ContactType `json:"type"`
	DisplayName *string     `json:"displayName,omitempty"`
	Address     string      `json:"address"`
}

func CreateContactEmail

func CreateContactEmail(email string, name *string) ContactInput

func CreateContactSlack

func CreateContactSlack(channel string, name *string) ContactInput

func CreateContactSlackHandle added in v2023.7.17

func CreateContactSlackHandle(channel string, name *string) ContactInput

func CreateContactWeb

func CreateContactWeb(address string, name *string) ContactInput

type ContactType

type ContactType string

ContactType represents the method of contact.

const (
	ContactTypeSlack       ContactType = "slack"        // A Slack channel contact method.
	ContactTypeSlackHandle ContactType = "slack_handle" // A Slack handle contact method.
	ContactTypeEmail       ContactType = "email"        // An email contact method.
	ContactTypeWeb         ContactType = "web"          // A website contact method.
	ContactTypeGitHub      ContactType = "github"       // A GitHub handle.
)

type ContactUpdateInput

type ContactUpdateInput struct {
	Id          ID           `json:"id"`
	Type        *ContactType `json:"type,omitempty"`
	DisplayName string       `json:"displayName,omitempty"`
	Address     string       `json:"address,omitempty"`
}

type CustomActionsEntityTypeEnum added in v2023.3.14

type CustomActionsEntityTypeEnum string

CustomActionsEntityTypeEnum represents the entity types a custom action can be associated with.

const (
	CustomActionsEntityTypeEnumService CustomActionsEntityTypeEnum = "SERVICE" // A custom action associated with services.
	CustomActionsEntityTypeEnumGlobal  CustomActionsEntityTypeEnum = "GLOBAL"  // A custom action associated with the global scope (no particular entity type).
)

type CustomActionsExternalAction

type CustomActionsExternalAction struct {
	CustomActionsId

	Description    string `graphql:"description"`
	LiquidTemplate string `graphql:"liquidTemplate"`
	Name           string `graphql:"name"`

	CustomActionsWebhookAction `graphql:"... on CustomActionsWebhookAction"`
}

type CustomActionsExternalActionsConnection

type CustomActionsExternalActionsConnection struct {
	Nodes      []CustomActionsExternalAction
	PageInfo   PageInfo
	TotalCount int
}

type CustomActionsHttpMethodEnum

type CustomActionsHttpMethodEnum string

CustomActionsHttpMethodEnum represents an HTTP request method.

const (
	CustomActionsHttpMethodEnumGet    CustomActionsHttpMethodEnum = "GET"    // An HTTP GET request.
	CustomActionsHttpMethodEnumPatch  CustomActionsHttpMethodEnum = "PATCH"  // An HTTP PATCH request.
	CustomActionsHttpMethodEnumPost   CustomActionsHttpMethodEnum = "POST"   // An HTTP POST request.
	CustomActionsHttpMethodEnumPut    CustomActionsHttpMethodEnum = "PUT"    // An HTTP PUT request.
	CustomActionsHttpMethodEnumDelete CustomActionsHttpMethodEnum = "DELETE" // An HTTP DELETE request.
)

type CustomActionsId

type CustomActionsId struct {
	Aliases []string `graphql:"aliases"`
	Id      ID       `graphql:"id"`
}

type CustomActionsTriggerDefinition

type CustomActionsTriggerDefinition struct {
	Action                 CustomActionsId                                 `graphql:"action"`
	Aliases                []string                                        `graphql:"aliases"`
	Description            string                                          `graphql:"description"`
	Filter                 FilterId                                        `graphql:"filter"`
	Id                     ID                                              `graphql:"id"`
	ManualInputsDefinition string                                          `graphql:"manualInputsDefinition"`
	Name                   string                                          `graphql:"name"`
	Owner                  TeamId                                          `graphql:"owner"`
	Published              bool                                            `graphql:"published"`
	Timestamps             Timestamps                                      `graphql:"timestamps"`
	AccessControl          CustomActionsTriggerDefinitionAccessControlEnum `graphql:"accessControl"`
	ResponseTemplate       string                                          `graphql:"responseTemplate"`
	EntityType             CustomActionsEntityTypeEnum                     `graphql:"entityType"`
}

func (*CustomActionsTriggerDefinition) ExtendedTeamAccess added in v2023.9.12

func (c *CustomActionsTriggerDefinition) ExtendedTeamAccess(client *Client, variables *PayloadVariables) (*TeamConnection, error)

type CustomActionsTriggerDefinitionAccessControlEnum

type CustomActionsTriggerDefinitionAccessControlEnum string

CustomActionsTriggerDefinitionAccessControlEnum represents who can see and use the trigger definition.

const (
	CustomActionsTriggerDefinitionAccessControlEnumEveryone      CustomActionsTriggerDefinitionAccessControlEnum = "everyone"       // All users of OpsLevel.
	CustomActionsTriggerDefinitionAccessControlEnumAdmins        CustomActionsTriggerDefinitionAccessControlEnum = "admins"         // Admin users.
	CustomActionsTriggerDefinitionAccessControlEnumServiceOwners CustomActionsTriggerDefinitionAccessControlEnum = "service_owners" // The owners of a service.
)

type CustomActionsTriggerDefinitionCreateInput

type CustomActionsTriggerDefinitionCreateInput struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	Owner       ID      `json:"ownerId"`
	// In the API actionID is `ID!` but that's because of the CustomActionsWebhookActionCreateInput
	// But we are not implementing that because it is used for the UI, so we need to enforce an actionId is given
	Action ID  `json:"actionId"`
	Filter *ID `json:"filterId,omitempty"`
	// This is being explicitly left out to reduce the complexity of the implementation
	// action *CustomActionsWebhookActionCreateInput
	ManualInputsDefinition string                                          `json:"manualInputsDefinition"`
	Published              *bool                                           `json:"published,omitempty"`
	AccessControl          CustomActionsTriggerDefinitionAccessControlEnum `json:"accessControl"`
	ResponseTemplate       string                                          `json:"responseTemplate"`
	EntityType             CustomActionsEntityTypeEnum                     `json:"entityType"`
	ExtendedTeamAccess     *[]IdentifierInput                              `json:"extendedTeamAccess,omitempty"`
}

type CustomActionsTriggerDefinitionUpdateInput

type CustomActionsTriggerDefinitionUpdateInput struct {
	Id          ID      `json:"id"`
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	Owner       *ID     `json:"ownerId,omitempty"`
	Action      *ID     `json:"actionId,omitempty"`
	Filter      *ID     `json:"filterId,omitempty"`
	// This is being explicitly left out to reduce the complexity of the implementation
	// action *CustomActionsWebhookActionCreateInput
	ManualInputsDefinition *string                                         `json:"manualInputsDefinition,omitempty"`
	Published              *bool                                           `json:"published,omitempty"`
	AccessControl          CustomActionsTriggerDefinitionAccessControlEnum `json:"accessControl,omitempty"`
	ResponseTemplate       *string                                         `json:"responseTemplate,omitempty"`
	EntityType             CustomActionsEntityTypeEnum                     `json:"entityType,omitempty"`
	ExtendedTeamAccess     *[]IdentifierInput                              `json:"extendedTeamAccess,omitempty"`
}

type CustomActionsTriggerDefinitionsConnection

type CustomActionsTriggerDefinitionsConnection struct {
	Nodes      []CustomActionsTriggerDefinition
	PageInfo   PageInfo
	TotalCount int
}

type CustomActionsTriggerEventStatusEnum added in v2023.3.14

type CustomActionsTriggerEventStatusEnum string

CustomActionsTriggerEventStatusEnum represents the status of the custom action trigger event.

const (
	CustomActionsTriggerEventStatusEnumPending CustomActionsTriggerEventStatusEnum = "PENDING" // A result has not been determined.
	CustomActionsTriggerEventStatusEnumSuccess CustomActionsTriggerEventStatusEnum = "SUCCESS" // The action completed succesfully.
	CustomActionsTriggerEventStatusEnumFailure CustomActionsTriggerEventStatusEnum = "FAILURE" // The action failed to complete.
)

type CustomActionsWebhookAction

type CustomActionsWebhookAction struct {
	Headers    JSON                        `graphql:"headers" scalar:"true"`
	HTTPMethod CustomActionsHttpMethodEnum `graphql:"httpMethod"`
	WebhookURL string                      `graphql:"webhookUrl"`
}

type CustomActionsWebhookActionCreateInput

type CustomActionsWebhookActionCreateInput struct {
	Name           string                      `json:"name"`
	Description    *string                     `json:"description,omitempty"`
	LiquidTemplate string                      `json:"liquidTemplate"`
	WebhookURL     string                      `json:"webhookUrl"`
	HTTPMethod     CustomActionsHttpMethodEnum `json:"httpMethod"`
	Headers        JSON                        `json:"headers"`
}

type CustomActionsWebhookActionUpdateInput

type CustomActionsWebhookActionUpdateInput struct {
	Id             ID                          `json:"id"`
	Name           *string                     `json:"name,omitempty"`
	Description    *string                     `json:"description,omitempty"`
	LiquidTemplate *string                     `json:"liquidTemplate,omitempty"`
	WebhookURL     *string                     `json:"webhookUrl,omitempty"`
	HTTPMethod     CustomActionsHttpMethodEnum `json:"httpMethod,omitempty"`
	Headers        *JSON                       `json:"headers,omitempty"`
}

type CustomEventCheckFragment

type CustomEventCheckFragment struct {
	Integration      IntegrationId `graphql:"integration"`
	PassPending      bool          `graphql:"passPending"`
	ResultMessage    string        `graphql:"resultMessage"`
	ServiceSelector  string        `graphql:"serviceSelector"`
	SuccessCondition string        `graphql:"successCondition"`
}

type DeleteInput

type DeleteInput struct {
	Id ID `json:"id"`
}

type Domain added in v2023.4.11

type Domain struct {
	DomainId
	Name        string      `graphql:"name"`
	Description string      `graphql:"description"`
	HTMLUrl     string      `graphql:"htmlUrl"`
	Owner       EntityOwner `graphql:"owner"`
	Note        string      `graphql:"note"`
}

type DomainConnection added in v2023.4.11

type DomainConnection struct {
	Nodes      []Domain `json:"nodes"`
	PageInfo   PageInfo `json:"pageInfo"`
	TotalCount int      `json:"totalCount" graphql:"-"`
}

type DomainId added in v2023.4.11

type DomainId Identifier

func (*DomainId) AssignSystem added in v2023.4.11

func (s *DomainId) AssignSystem(client *Client, systems ...string) error

func (*DomainId) ChildSystems added in v2023.4.11

func (d *DomainId) ChildSystems(client *Client, variables *PayloadVariables) (*SystemConnection, error)

func (*DomainId) GetTags added in v2023.10.8

func (d *DomainId) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

func (*DomainId) ResourceId added in v2023.10.8

func (d *DomainId) ResourceId() ID

func (*DomainId) ResourceType added in v2023.10.8

func (d *DomainId) ResourceType() TaggableResource

func (*DomainId) Tags deprecated added in v2023.4.11

func (s *DomainId) Tags(client *Client, variables *PayloadVariables) (*TagConnection, error)

Deprecated: Please use GetTags instead

type DomainInput added in v2023.4.11

type DomainInput struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	Owner       *ID     `json:"ownerId,omitempty"`
	Note        *string `json:"note,omitempty"`
}

type EntityOwner added in v2023.4.11

type EntityOwner struct {
	OnTeam EntityOwnerTeam `graphql:"... on Team"`
}

func (*EntityOwner) Alias added in v2023.7.17

func (s *EntityOwner) Alias() string

func (*EntityOwner) Id added in v2023.4.11

func (s *EntityOwner) Id() ID

type EntityOwnerTeam added in v2023.7.17

type EntityOwnerTeam struct {
	Alias string `json:"alias,omitempty" graphql:"teamAlias:alias"`
	Id    ID     `json:"id"`
}

func (*EntityOwnerTeam) AsTeam added in v2023.7.17

func (s *EntityOwnerTeam) AsTeam() TeamId

type Filter

type Filter struct {
	Connective ConnectiveEnum
	HtmlURL    string
	FilterId
	Predicates []FilterPredicate
}

func (*Filter) Alias

func (self *Filter) Alias() string

type FilterConnection

type FilterConnection struct {
	Nodes      []Filter
	PageInfo   PageInfo
	TotalCount int
}

type FilterCreateInput

type FilterCreateInput struct {
	Name       string            `json:"name"`
	Predicates []FilterPredicate `json:"predicates"`
	Connective ConnectiveEnum    `json:"connective,omitempty"`
}

type FilterId

type FilterId struct {
	Id   ID
	Name string
}

type FilterPredicate

type FilterPredicate struct {
	Key           PredicateKeyEnum  `json:"key"`
	KeyData       string            `json:"keyData,omitempty"`
	Type          PredicateTypeEnum `json:"type"`
	Value         string            `json:"value,omitempty"`
	CaseSensitive *bool             `json:"caseSensitive,omitempty"`
}

type FilterUpdateInput

type FilterUpdateInput struct {
	Id         ID                `json:"id"`
	Name       string            `json:"name,omitempty"`
	Predicates []FilterPredicate `json:"predicates"` // The list of predicates used to select which services apply to the filter. All existing predicates will be replaced by these predicates.
	Connective ConnectiveEnum    `json:"connective,omitempty"`
}

type FrequencyTimeScale

type FrequencyTimeScale string

FrequencyTimeScale represents the time scale type for the frequency.

const (
	FrequencyTimeScaleDay   FrequencyTimeScale = "day"   // Consider the time scale of days.
	FrequencyTimeScaleWeek  FrequencyTimeScale = "week"  // Consider the time scale of weeks.
	FrequencyTimeScaleMonth FrequencyTimeScale = "month" // Consider the time scale of months.
	FrequencyTimeScaleYear  FrequencyTimeScale = "year"  // Consider the time scale of years.
)

type GitBranchProtectionCheckFragment

type GitBranchProtectionCheckFragment struct{}

type Group

type Group struct {
	GroupId
	Description string  `json:"description,omitempty"`
	HtmlURL     string  `json:"htmlUrl,omitempty"`
	Name        string  `json:"name,omitempty"`
	Parent      GroupId `json:"parent,omitempty"`
}

func (*Group) ChildTeams

func (g *Group) ChildTeams(client *Client, variables *PayloadVariables) (*TeamConnection, error)

func (*Group) DescendantRepositories

func (g *Group) DescendantRepositories(client *Client, variables *PayloadVariables) (*RepositoryConnection, error)

func (*Group) DescendantServices

func (g *Group) DescendantServices(client *Client, variables *PayloadVariables) (*ServiceConnection, error)

func (*Group) DescendantSubgroups

func (g *Group) DescendantSubgroups(client *Client, variables *PayloadVariables) (*GroupConnection, error)

func (*Group) DescendantTeams

func (g *Group) DescendantTeams(client *Client, variables *PayloadVariables) (*TeamConnection, error)

func (*Group) Members

func (g *Group) Members(client *Client, variables *PayloadVariables) (*UserConnection, error)

type GroupConnection

type GroupConnection struct {
	Nodes      []Group
	PageInfo   PageInfo
	TotalCount int
}

type GroupId

type GroupId struct {
	Alias string `json:"alias,omitempty"`
	Id    ID     `json:"id"`
}

type HasDocumentationCheckFragment

type HasDocumentationCheckFragment struct {
	DocumentType    HasDocumentationTypeEnum    `graphql:"documentType"`
	DocumentSubtype HasDocumentationSubtypeEnum `graphql:"documentSubtype"`
}

type HasDocumentationSubtypeEnum

type HasDocumentationSubtypeEnum string

HasDocumentationSubtypeEnum represents the subtype of the document.

const (
	HasDocumentationSubtypeEnumOpenapi HasDocumentationSubtypeEnum = "openapi" // Document is an OpenAPI document.
)

type HasDocumentationTypeEnum

type HasDocumentationTypeEnum string

HasDocumentationTypeEnum represents the type of the document.

const (
	HasDocumentationTypeEnumTech HasDocumentationTypeEnum = "tech" // Document is an Tech document.
	HasDocumentationTypeEnumAPI  HasDocumentationTypeEnum = "api"  // Document is an API document.
)

type HasRecentDeployCheckFragment

type HasRecentDeployCheckFragment struct {
	Days int `graphql:"days"`
}

type ID

type ID string

func NewID

func NewID(id ...string) *ID

func (ID) GetGraphQLType

func (s ID) GetGraphQLType() string

func (*ID) MarshalJSON

func (s *ID) MarshalJSON() ([]byte, error)

type Identifier added in v2023.3.14

type Identifier struct {
	Id      ID       `graphql:"id"`
	Aliases []string `graphql:"aliases"`
}

type IdentifierInput

type IdentifierInput struct {
	Id    *ID     `graphql:"id" json:"id,omitempty"`
	Alias *string `graphql:"alias" json:"alias,omitempty"`
}

func NewIdentifier

func NewIdentifier(value string) *IdentifierInput

func NewIdentifierArray added in v2023.4.11

func NewIdentifierArray(values []string) []IdentifierInput

type InfraInput added in v2023.7.17

type InfraInput struct {
	Schema   string              `json:"schema" yaml:"schema"`
	Owner    *ID                 `json:"owner" yaml:"owner"`
	Provider *InfraProviderInput `json:"provider" yaml:"provider"`
	Data     map[string]any      `json:"data" yaml:"data"`
}

type InfraProviderInput added in v2023.7.17

type InfraProviderInput struct {
	Account string `json:"account" yaml:"account"`
	Name    string `json:"name" yaml:"name"`
	Type    string `json:"type" yaml:"type"`
	URL     string `json:"url" yaml:"url"`
}

type InfrastructureResource added in v2023.7.17

type InfrastructureResource struct {
	Id           string                             `json:"id"`
	Aliases      []string                           `json:"aliases"`
	Name         string                             `json:"name"`
	Schema       string                             `json:"type" graphql:"type @include(if: $all)"`
	ProviderType string                             `json:"providerResourceType" graphql:"providerResourceType @include(if: $all)"`
	ProviderData InfrastructureResourceProviderData `json:"providerData" graphql:"providerData @include(if: $all)"`
	Owner        EntityOwner                        `json:"owner" graphql:"owner @include(if: $all)"`
	OwnerLocked  bool                               `json:"ownerLocked" graphql:"ownerLocked @include(if: $all)"`
	ParsedData   JSON                               `json:"data" scalar:"true" graphql:"data @include(if: $all)"`
	Data         JSON                               `json:"rawData" scalar:"true" graphql:"rawData @include(if: $all)"`
}

func (*InfrastructureResource) GetTags added in v2023.10.8

func (i *InfrastructureResource) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

func (*InfrastructureResource) ResourceId added in v2023.10.8

func (i *InfrastructureResource) ResourceId() ID

func (*InfrastructureResource) ResourceType added in v2023.10.8

func (i *InfrastructureResource) ResourceType() TaggableResource

type InfrastructureResourceConnection added in v2023.7.17

type InfrastructureResourceConnection struct {
	Nodes      []InfrastructureResource
	PageInfo   PageInfo
	TotalCount int `graphql:"-"`
}

type InfrastructureResourceInput added in v2023.7.17

type InfrastructureResourceInput struct {
	Schema       *InfrastructureResourceSchemaInput   `json:"schema,omitempty"`
	ProviderType *string                              `json:"providerResourceType,omitempty" yaml:"providerResourceType"`
	ProviderData *InfrastructureResourceProviderInput `json:"providerData,omitempty" yaml:"providerData"`
	Owner        *ID                                  `json:"ownerId,omitempty" yaml:"owner"`
	Data         JSON                                 `json:"data,omitempty" yaml:"data" scalar:"true"`
}

type InfrastructureResourceProviderData added in v2023.7.17

type InfrastructureResourceProviderData struct {
	AccountName  string `json:"accountName" graphql:"accountName"`
	ExternalURL  string `json:"externalUrl" graphql:"externalUrl"`
	ProviderName string `json:"providerName" graphql:"providerName"`
}

type InfrastructureResourceProviderInput added in v2023.7.17

type InfrastructureResourceProviderInput struct {
	AccountName  string `json:"accountName" yaml:"accountName"`
	ExternalURL  string `json:"externalUrl" yaml:"externalUrl"`
	ProviderName string `json:"providerName" yaml:"providerName"`
}

type InfrastructureResourceSchema added in v2023.7.17

type InfrastructureResourceSchema struct {
	Type   string `json:"type"`
	Schema JSON   `json:"schema" scalar:"true"`
}

type InfrastructureResourceSchemaConnection added in v2023.7.17

type InfrastructureResourceSchemaConnection struct {
	Nodes      []InfrastructureResourceSchema
	PageInfo   PageInfo
	TotalCount int `graphql:"-"`
}

type InfrastructureResourceSchemaInput added in v2023.7.17

type InfrastructureResourceSchemaInput struct {
	Type string `json:"type" yaml:"type"`
}

type Integration

type Integration struct {
	IntegrationId

	CreatedAt   iso8601.Time `graphql:"createdAt"`
	InstalledAt iso8601.Time `graphql:"installedAt"`

	AWSIntegrationFragment      `graphql:"... on AwsIntegration"`
	NewRelicIntegrationFragment `graphql:"... on NewRelicIntegration"`
}

type IntegrationConnection

type IntegrationConnection struct {
	Nodes      []Integration
	PageInfo   PageInfo
	TotalCount int
}

type IntegrationId added in v2023.5.5

type IntegrationId struct {
	Id   ID     `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

func (*IntegrationId) Alias added in v2023.5.5

func (self *IntegrationId) Alias() string

type JSON

type JSON map[string]any

JSON is a specialized map[string]string to support proper graphql serialization

func NewJSON added in v2023.7.17

func NewJSON(data string) JSON

func (JSON) GetGraphQLType

func (s JSON) GetGraphQLType() string

func (JSON) MarshalJSON

func (s JSON) MarshalJSON() ([]byte, error)

func (JSON) ToJSON added in v2023.7.17

func (s JSON) ToJSON() string

type JSONString added in v2023.12.14

type JSONString string

JSONString is a specialized input type to support serialization to JSON for input to graphql

func NewJSONInput added in v2023.12.14

func NewJSONInput(data any) JSONString

func (JSONString) AsArray added in v2023.12.14

func (s JSONString) AsArray() []any

func (JSONString) AsBool added in v2023.12.14

func (s JSONString) AsBool() bool

func (JSONString) AsFloat64 added in v2023.12.14

func (s JSONString) AsFloat64() float64

func (JSONString) AsInt added in v2023.12.14

func (s JSONString) AsInt() int

func (JSONString) AsMap added in v2023.12.14

func (s JSONString) AsMap() map[string]any

func (JSONString) AsString added in v2023.12.14

func (s JSONString) AsString() string

func (JSONString) GetGraphQLType added in v2023.12.14

func (s JSONString) GetGraphQLType() string

type Language

type Language struct {
	Name  string
	Usage float32
}

type Level

type Level struct {
	Alias       string
	Description string `json:"description,omitempty"`
	Id          ID     `json:"id"`
	Index       int
	Name        string
}

type LevelConnection

type LevelConnection struct {
	Nodes      []Level
	PageInfo   PageInfo
	TotalCount graphql.Int
}

func (*LevelConnection) Hydrate

func (conn *LevelConnection) Hydrate(client *Client) error

type LevelCreateInput

type LevelCreateInput struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Index       *int   `json:"index,omitempty"`
}

type LevelDeleteInput

type LevelDeleteInput struct {
	Id ID `json:"id"`
}

type LevelUpdateInput

type LevelUpdateInput struct {
	Id          ID      `json:"id"`
	Name        string  `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

type Lifecycle

type Lifecycle struct {
	Alias       string
	Description string
	Id          ID
	Index       int
	Name        string
}

type ManualCheckFragment

type ManualCheckFragment struct {
	UpdateFrequency       *ManualCheckFrequency `graphql:"updateFrequency"`
	UpdateRequiresComment bool                  `graphql:"updateRequiresComment"`
}

type ManualCheckFrequency

type ManualCheckFrequency struct {
	StartingDate       iso8601.Time       `graphql:"startingDate"`
	FrequencyTimeScale FrequencyTimeScale `graphql:"frequencyTimeScale"`
	FrequencyValue     int                `graphql:"frequencyValue"`
}

type ManualCheckFrequencyInput

type ManualCheckFrequencyInput struct {
	StartingDate       iso8601.Time       `json:"startingDate"`
	FrequencyTimeScale FrequencyTimeScale `json:"frequencyTimeScale"`
	FrequencyValue     int                `json:"frequencyValue"`
}

func NewManualCheckFrequencyInput

func NewManualCheckFrequencyInput(startingDate string, timeScale FrequencyTimeScale, value int) *ManualCheckFrequencyInput

type MaturityReport

type MaturityReport struct {
	CategoryBreakdown []CategoryBreakdown
	OverallLevel      Level
}

func (*MaturityReport) Get

func (s *MaturityReport) Get(category string) *Level

Get Given a 'category' name returns the 'Level'

type MemberInput

type MemberInput struct {
	Email string `json:"email" default:"john.doe@example.com"`
}

type NewRelicIntegrationFragment added in v2023.7.17

type NewRelicIntegrationFragment struct {
	BaseUrl    string `graphql:"baseUrl"`
	AccountKey string `graphql:"accountKey"`
}

type NewRelicIntegrationInput added in v2023.7.17

type NewRelicIntegrationInput struct {
	ApiKey     *string `json:"apiKey,omitempty"`
	BaseUrl    *string `json:"baseUrl,omitempty"`
	AccountKey *string `json:"accountKey,omitempty"`
}

func (NewRelicIntegrationInput) GetGraphQLType added in v2023.7.17

func (s NewRelicIntegrationInput) GetGraphQLType() string

type OpsLevelErrors

type OpsLevelErrors struct {
	Message string
	Path    []string
}

type OpsLevelWarnings added in v2023.7.17

type OpsLevelWarnings struct {
	Message string
}

type Option

type Option func(*ClientSettings)

func SetAPIToken

func SetAPIToken(apiToken string) Option

func SetAPIVisibility

func SetAPIVisibility(visibility string) Option

func SetHeader added in v2023.3.14

func SetHeader(key string, value string) Option

func SetHeaders added in v2023.3.14

func SetHeaders(headers map[string]string) Option

func SetMaxRetries

func SetMaxRetries(amount int) Option

func SetPageSize

func SetPageSize(size int) Option

func SetTimeout

func SetTimeout(amount time.Duration) Option

func SetURL

func SetURL(url string) Option

func SetUserAgentExtra

func SetUserAgentExtra(extra string) Option

type PageInfo

type PageInfo struct {
	HasNextPage     bool   `graphql:"hasNextPage"`
	HasPreviousPage bool   `graphql:"hasPreviousPage"`
	Start           string `graphql:"startCursor"`
	End             string `graphql:"endCursor"`
}

type PayloadSortEnum added in v2023.3.14

type PayloadSortEnum string

PayloadSortEnum represents sort possibilities for payloads.

const (
	PayloadSortEnumCreatedAtAsc    PayloadSortEnum = "created_at_ASC"    // Order by `created_at` ascending.
	PayloadSortEnumCreatedAtDesc   PayloadSortEnum = "created_at_DESC"   // Order by `created_at` descending.
	PayloadSortEnumProcessedAtAsc  PayloadSortEnum = "processed_at_ASC"  // Order by `processed_at` ascending.
	PayloadSortEnumProcessedAtDesc PayloadSortEnum = "processed_at_DESC" // Order by `processed_at` descending.
)

type PayloadVariables

type PayloadVariables map[string]interface{}

type Predicate

type Predicate struct {
	Type  PredicateTypeEnum `graphql:"type"`
	Value string            `graphql:"value"`
}

type PredicateInput

type PredicateInput struct {
	Type  PredicateTypeEnum `json:"type"`
	Value string            `json:"value,omitempty"`
}

type PredicateKeyEnum

type PredicateKeyEnum string

PredicateKeyEnum represents fields that can be used as part of filter for services.

const (
	PredicateKeyEnumTierIndex      PredicateKeyEnum = "tier_index"      // Filter by `tier` field.
	PredicateKeyEnumLifecycleIndex PredicateKeyEnum = "lifecycle_index" // Filter by `lifecycle` field.
	PredicateKeyEnumLanguage       PredicateKeyEnum = "language"        // Filter by `language` field.
	PredicateKeyEnumFramework      PredicateKeyEnum = "framework"       // Filter by `framework` field.
	PredicateKeyEnumProduct        PredicateKeyEnum = "product"         // Filter by `product` field.
	PredicateKeyEnumName           PredicateKeyEnum = "name"            // Filter by `name` field.
	PredicateKeyEnumTags           PredicateKeyEnum = "tags"            // Filter by `tags` field.
	PredicateKeyEnumOwnerID        PredicateKeyEnum = "owner_id"        // Filter by `owner` field.
	PredicateKeyEnumGroupIDs       PredicateKeyEnum = "group_ids"       // Filter by group hierarchy. Will return resources who's owner is in the group ancestry chain.
	PredicateKeyEnumOwnerIDs       PredicateKeyEnum = "owner_ids"       // Filter by `owner` hierarchy. Will return resources who's owner is in the team ancestry chain.
	PredicateKeyEnumCreationSource PredicateKeyEnum = "creation_source" // Filter by the creation source.
	PredicateKeyEnumRepositoryIDs  PredicateKeyEnum = "repository_ids"  // Filter by Repository that this service is attached to, if any.
	PredicateKeyEnumFilterID       PredicateKeyEnum = "filter_id"       // Filter by another filter.
	PredicateKeyEnumAliases        PredicateKeyEnum = "aliases"         // Filter by Alias attached to this service, if any.
	PredicateKeyEnumDomainID       PredicateKeyEnum = "domain_id"       // Filter by Domain that includes the System this service is assigned to, if any.
	PredicateKeyEnumSystemID       PredicateKeyEnum = "system_id"       // Filter by System that this service is assigned to, if any.
)

type PredicateTypeEnum

type PredicateTypeEnum string

PredicateTypeEnum represents operations that can be used on predicates.

const (
	PredicateTypeEnumContains                   PredicateTypeEnum = "contains"                     // Contains a specific value.
	PredicateTypeEnumDoesNotContain             PredicateTypeEnum = "does_not_contain"             // Does not contain a specific value.
	PredicateTypeEnumDoesNotEqual               PredicateTypeEnum = "does_not_equal"               // Does not equal a specific value.
	PredicateTypeEnumDoesNotExist               PredicateTypeEnum = "does_not_exist"               // Specific attribute does not exist.
	PredicateTypeEnumEndsWith                   PredicateTypeEnum = "ends_with"                    // Ends with a specific value.
	PredicateTypeEnumEquals                     PredicateTypeEnum = "equals"                       // Equals a specific value.
	PredicateTypeEnumExists                     PredicateTypeEnum = "exists"                       // Specific attribute exists.
	PredicateTypeEnumGreaterThanOrEqualTo       PredicateTypeEnum = "greater_than_or_equal_to"     // Greater than or equal to a specific value (numeric only).
	PredicateTypeEnumLessThanOrEqualTo          PredicateTypeEnum = "less_than_or_equal_to"        // Less than or equal to a specific value (numeric only).
	PredicateTypeEnumStartsWith                 PredicateTypeEnum = "starts_with"                  // Starts with a specific value.
	PredicateTypeEnumSatisfiesVersionConstraint PredicateTypeEnum = "satisfies_version_constraint" // Satisfies version constraint (tag value only).
	PredicateTypeEnumMatchesRegex               PredicateTypeEnum = "matches_regex"                // Matches a value using a regular expression.
	PredicateTypeEnumDoesNotMatchRegex          PredicateTypeEnum = "does_not_match_regex"         // Does not match a value using a regular expression.
	PredicateTypeEnumBelongsTo                  PredicateTypeEnum = "belongs_to"                   // Belongs to a group's hierarchy.
	PredicateTypeEnumMatches                    PredicateTypeEnum = "matches"                      // A certain filter is matched.
	PredicateTypeEnumDoesNotMatch               PredicateTypeEnum = "does_not_match"               // A certain filter is not matched.
	PredicateTypeEnumSatisfiesJqExpression      PredicateTypeEnum = "satisfies_jq_expression"      // Satisfies an expression defined in jq.
)

type PredicateUpdateInput

type PredicateUpdateInput struct {
	Type  PredicateTypeEnum `json:"type,omitempty"`
	Value string            `json:"value,omitempty"`
}

type PropertyDefinition added in v2023.12.14

type PropertyDefinition struct {
	Aliases []string `graphql:"aliases" json:"aliases"`
	Id      ID       `graphql:"id" json:"id"`
	Name    string   `graphql:"name" json:"name"`
	Schema  JSON     `json:"schema" scalar:"true"`
}

type PropertyDefinitionConnection added in v2023.12.14

type PropertyDefinitionConnection struct {
	Nodes      []PropertyDefinition
	PageInfo   PageInfo
	TotalCount int `graphql:"-"`
}

type PropertyDefinitionInput added in v2023.12.14

type PropertyDefinitionInput struct {
	Name   string     `json:"name" default:"John Doe"`
	Schema JSONString `` /* 431-byte string literal not displayed */
}

type RelatedResourceRelationshipTypeEnum added in v2023.10.8

type RelatedResourceRelationshipTypeEnum string

RelatedResourceRelationshipTypeEnum represents the type of the relationship between two resources.

const (
	RelatedResourceRelationshipTypeEnumBelongsTo    RelatedResourceRelationshipTypeEnum = "belongs_to"    // The resource belongs to the node on the edge.
	RelatedResourceRelationshipTypeEnumContains     RelatedResourceRelationshipTypeEnum = "contains"      // The resource contains the node on the edge.
	RelatedResourceRelationshipTypeEnumDependsOn    RelatedResourceRelationshipTypeEnum = "depends_on"    // The resource depends on the node on the edge.
	RelatedResourceRelationshipTypeEnumDependencyOf RelatedResourceRelationshipTypeEnum = "dependency_of" // The resource is a dependency of the node on the edge.
)

type RelationshipTypeEnum added in v2023.10.8

type RelationshipTypeEnum string

RelationshipTypeEnum represents the type of relationship between two resources.

const (
	RelationshipTypeEnumBelongsTo RelationshipTypeEnum = "belongs_to" // The source resource belongs to the target resource.
	RelationshipTypeEnumDependsOn RelationshipTypeEnum = "depends_on" // The source resource depends on the target resource.
)

type Repository

type Repository struct {
	ArchivedAt         iso8601.Time
	CreatedOn          iso8601.Time
	DefaultAlias       string
	DefaultBranch      string
	Description        string
	Forked             bool
	HtmlUrl            string
	Id                 ID
	Languages          []Language
	LastOwnerChangedAt iso8601.Time
	Name               string
	Organization       string
	Owner              TeamId
	Private            bool
	RepoKey            string
	Services           *RepositoryServiceConnection
	Tags               *TagConnection
	Tier               Tier
	Type               string
	Url                string
	Visible            bool
}

func (*Repository) GetService

func (r *Repository) GetService(service ID, directory string) *ServiceRepository

func (*Repository) GetServices added in v2023.3.14

func (r *Repository) GetServices(client *Client, variables *PayloadVariables) (*RepositoryServiceConnection, error)

func (*Repository) GetTags added in v2023.3.14

func (r *Repository) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

func (*Repository) Hydrate

func (r *Repository) Hydrate(client *Client) error

func (*Repository) ResourceId added in v2023.10.8

func (r *Repository) ResourceId() ID

func (*Repository) ResourceType added in v2023.10.8

func (r *Repository) ResourceType() TaggableResource

type RepositoryConnection

type RepositoryConnection struct {
	HiddenCount       int
	Nodes             []Repository
	OrganizationCount int
	OwnedCount        int
	PageInfo          PageInfo
	TotalCount        int
	VisibleCount      int
}

type RepositoryFileCheckFragment

type RepositoryFileCheckFragment struct {
	DirectorySearch       bool       `graphql:"directorySearch"`
	Filepaths             []string   `graphql:"filePaths"`
	FileContentsPredicate *Predicate `graphql:"fileContentsPredicate"`
	UseAbsoluteRoot       bool       `graphql:"useAbsoluteRoot"`
}

type RepositoryGrepCheckFragment

type RepositoryGrepCheckFragment struct {
	DirectorySearch       bool       `graphql:"directorySearch"`
	Filepaths             []string   `graphql:"filePaths"`
	FileContentsPredicate *Predicate `graphql:"fileContentsPredicate"`
}

type RepositoryId

type RepositoryId struct {
	Id           ID
	DefaultAlias string
}

Lightweight Repository struct used to make some API calls return less data

type RepositoryPath

type RepositoryPath struct {
	Href string
	Path string
}

type RepositorySearchCheckFragment

type RepositorySearchCheckFragment struct {
	FileExtensions        []string  `graphql:"fileExtensions"`
	FileContentsPredicate Predicate `graphql:"fileContentsPredicate"`
}

type RepositoryServiceConnection

type RepositoryServiceConnection struct {
	Edges      []RepositoryServiceEdge
	PageInfo   PageInfo
	TotalCount int
}

type RepositoryServiceEdge

type RepositoryServiceEdge struct {
	AtRoot              bool
	Node                ServiceId
	Paths               []RepositoryPath
	ServiceRepositories []ServiceRepository
}

type RepositoryUpdateInput added in v2023.5.18

type RepositoryUpdateInput struct {
	Id    ID  `json:"id"`
	Owner *ID `json:"ownerId,omitempty"`
}

type RepositoryVisibilityEnum added in v2023.3.14

type RepositoryVisibilityEnum string

RepositoryVisibilityEnum represents possible visibility levels for repositories.

const (
	RepositoryVisibilityEnumPrivate  RepositoryVisibilityEnum = "PRIVATE"  // Repositories that are private to the user.
	RepositoryVisibilityEnumInternal RepositoryVisibilityEnum = "INTERNAL" // Repositories that are only accessible to organization users.
	RepositoryVisibilityEnumPublic   RepositoryVisibilityEnum = "PUBLIC"   // Repositories that are publically accessible.
)

type ResourceDocumentStatusTypeEnum added in v2023.3.14

type ResourceDocumentStatusTypeEnum string

ResourceDocumentStatusTypeEnum represents status of a document on a resource.

const (
	ResourceDocumentStatusTypeEnumPinned  ResourceDocumentStatusTypeEnum = "pinned"  // Document is pinned.
	ResourceDocumentStatusTypeEnumVisible ResourceDocumentStatusTypeEnum = "visible" // Document is visible.
	ResourceDocumentStatusTypeEnumHidden  ResourceDocumentStatusTypeEnum = "hidden"  // Document is hidden.
)

type RestResponse

type RestResponse struct {
	Result  string `json:"result"`
	Message string `json:"message"`
}

type Runner

type Runner struct {
	Id     ID                   `json:"id"`
	Status RunnerStatusTypeEnum `json:"status"`
}

type RunnerAppendJobLogInput

type RunnerAppendJobLogInput struct {
	RunnerId    ID           `json:"runnerId"`
	RunnerJobId ID           `json:"runnerJobId"`
	SentAt      iso8601.Time `json:"sentAt"`
	Logs        []string     `json:"logChunk"`
}

type RunnerJob

type RunnerJob struct {
	Commands  []string             `json:"commands"`
	Id        ID                   `json:"id"`
	Image     string               `json:"image"`
	Outcome   RunnerJobOutcomeEnum `json:"outcome"`
	Status    RunnerJobStatusEnum  `json:"status"`
	Variables []RunnerJobVariable  `json:"variables"`
	Files     []RunnerJobFile      `json:"files"`
}

func (*RunnerJob) Number

func (j *RunnerJob) Number() string

type RunnerJobFile

type RunnerJobFile struct {
	Name     string `json:"name"`
	Contents string `json:"contents"`
}

type RunnerJobOutcomeEnum

type RunnerJobOutcomeEnum string

RunnerJobOutcomeEnum represents the runner job outcome.

const (
	RunnerJobOutcomeEnumUnstarted        RunnerJobOutcomeEnum = "unstarted"         // translation missing: en.graphql.types.runner_job_outcome_enum.unstarted.
	RunnerJobOutcomeEnumCanceled         RunnerJobOutcomeEnum = "canceled"          // Job was canceled.
	RunnerJobOutcomeEnumFailed           RunnerJobOutcomeEnum = "failed"            // Job failed during execution.
	RunnerJobOutcomeEnumSuccess          RunnerJobOutcomeEnum = "success"           // Job succeded the execution.
	RunnerJobOutcomeEnumQueueTimeout     RunnerJobOutcomeEnum = "queue_timeout"     // Job was not assigned to a runner for too long.
	RunnerJobOutcomeEnumExecutionTimeout RunnerJobOutcomeEnum = "execution_timeout" // Job run took too long to complete, and was marked as failed.
	RunnerJobOutcomeEnumPodTimeout       RunnerJobOutcomeEnum = "pod_timeout"       // A pod could not be scheduled for the job in time.
)

type RunnerJobOutcomeVariable

type RunnerJobOutcomeVariable struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type RunnerJobStatusEnum

type RunnerJobStatusEnum string

RunnerJobStatusEnum represents the runner job status.

const (
	RunnerJobStatusEnumCreated  RunnerJobStatusEnum = "created"  // A created runner job, but not yet ready to be run.
	RunnerJobStatusEnumPending  RunnerJobStatusEnum = "pending"  // A runner job ready to be run.
	RunnerJobStatusEnumRunning  RunnerJobStatusEnum = "running"  // A runner job being run by a runner.
	RunnerJobStatusEnumComplete RunnerJobStatusEnum = "complete" // A finished runner job.
)
const (
	RunnerStatusTypeEnumInactive   RunnerJobStatusEnum = "inactive"   // The runner will not actively take jobs.
	RunnerStatusTypeEnumRegistered RunnerJobStatusEnum = "registered" // The runner will process jobs.
)

type RunnerJobVariable

type RunnerJobVariable struct {
	Key       string `json:"key"`
	Sensitive bool   `json:"sensitive"`
	Value     string `json:"value"`
}

type RunnerReportJobOutcomeInput

type RunnerReportJobOutcomeInput struct {
	RunnerId         ID                         `json:"runnerId"`
	RunnerJobId      ID                         `json:"runnerJobId"`
	Outcome          RunnerJobOutcomeEnum       `json:"outcome"`
	OutcomeVariables []RunnerJobOutcomeVariable `json:"outcomeVariables,omitempty"`
}

type RunnerScale

type RunnerScale struct {
	RecommendedReplicaCount int `json:"recommendedReplicaCount"`
}

type RunnerStatusTypeEnum

type RunnerStatusTypeEnum string

RunnerStatusTypeEnum represents The status of an OpsLevel runner.

type Scorecard added in v2023.8.28

type Scorecard struct {
	ScorecardId

	AffectsOverallServiceLevels bool        `graphql:"affectsOverallServiceLevels"`
	Description                 string      `graphql:"description"` // optional
	Filter                      Filter      `graphql:"filter"`      // optional
	Name                        string      `graphql:"name"`
	Owner                       EntityOwner `graphql:"owner"`
	PassingChecks               int         `graphql:"passingChecks"`
	ServiceCount                int         `graphql:"serviceCount"`
	ChecksCount                 int         `graphql:"totalChecks"`
}

type ScorecardConnection added in v2023.8.28

type ScorecardConnection struct {
	Nodes      []Scorecard `graphql:"nodes"`
	PageInfo   PageInfo    `graphql:"pageInfo"`
	TotalCount int         `graphql:"totalCount"`
}

type ScorecardId added in v2023.8.28

type ScorecardId struct {
	Aliases []string `graphql:"aliases"`
	Id      ID       `graphql:"id"`
}

type ScorecardInput added in v2023.8.28

type ScorecardInput struct {
	AffectsOverallServiceLevels *bool   `graphql:"affectsOverallServiceLevels" json:"affectsOverallServiceLevels,omitempty"`
	Name                        string  `graphql:"name" json:"name"`
	Description                 *string `graphql:"description" json:"description,omitempty"`
	OwnerId                     ID      `graphql:"ownerId" json:"ownerId"`
	FilterId                    *ID     `graphql:"filterId" json:"filterId,omitempty"`
}

type ScorecardSortEnum added in v2023.8.28

type ScorecardSortEnum string

ScorecardSortEnum represents the possible options to sort the resulting list of scorecards.

const (
	ScorecardSortEnumNameAsc                         ScorecardSortEnum = "name_ASC"                         // Order by the scorecard's name, in ascending order.
	ScorecardSortEnumNameDesc                        ScorecardSortEnum = "name_DESC"                        // Order by the scorecard's name, in descending order.
	ScorecardSortEnumOwnerAsc                        ScorecardSortEnum = "owner_ASC"                        // Order by the scorecard owner's name, in ascending order.
	ScorecardSortEnumOwnerDesc                       ScorecardSortEnum = "owner_DESC"                       // Order by the scorecard owner's name, in descending order.
	ScorecardSortEnumFilterAsc                       ScorecardSortEnum = "filter_ASC"                       // Order by the associated filter's name, in ascending order.
	ScorecardSortEnumFilterDesc                      ScorecardSortEnum = "filter_DESC"                      // Order by the associated filter's name, in descending order.
	ScorecardSortEnumServicecountAsc                 ScorecardSortEnum = "serviceCount_ASC"                 // Order by the number of services covered by the scorecard, in ascending order.
	ScorecardSortEnumServicecountDesc                ScorecardSortEnum = "serviceCount_DESC"                // Order by the number of services covered by the scorecard, in descending order.
	ScorecardSortEnumPassingcheckfractionAsc         ScorecardSortEnum = "passingCheckFraction_ASC"         // Order by the fraction of passing checks on the scorecard, in ascending order.
	ScorecardSortEnumPassingcheckfractionDesc        ScorecardSortEnum = "passingCheckFraction_DESC"        // Order by the fraction of passing checks on the scorecard, in descending order.
	ScorecardSortEnumAffectsoverallservicelevelsAsc  ScorecardSortEnum = "affectsOverallServiceLevels_ASC"  // Order by whether or not the checks on the scorecard affect the overall maturity, in ascending order.
	ScorecardSortEnumAffectsoverallservicelevelsDesc ScorecardSortEnum = "affectsOverallServiceLevels_DESC" // Order by whether or not the checks on the scorecard affect the overall maturity, in descending order.
)

type Secret added in v2023.8.28

type Secret struct {
	Alias      string     `json:"alias"`
	ID         ID         `json:"id"`
	Owner      TeamId     `json:"team"`
	Timestamps Timestamps `json:"timestamps"`
}

type SecretInput added in v2023.8.28

type SecretInput struct {
	Owner IdentifierInput `json:"owner" yaml:"owner"`
	Value string          `json:"value" yaml:"value"`
}

type SecretsVaultsSecretConnection added in v2023.8.28

type SecretsVaultsSecretConnection struct {
	Nodes      []Secret
	PageInfo   PageInfo
	TotalCount int `graphql:"-"`
}

type Service

type Service struct {
	ApiDocumentPath string `json:"apiDocumentPath,omitempty"`
	Description     string `json:"description,omitempty"`
	Framework       string `json:"framework,omitempty"`
	HtmlURL         string `json:"htmlUrl"`
	ServiceId
	Language                   string                       `json:"language,omitempty"`
	Lifecycle                  Lifecycle                    `json:"lifecycle,omitempty"`
	ManagedAliases             []string                     `json:"managedAliases,omitempty"`
	Name                       string                       `json:"name,omitempty"`
	Owner                      TeamId                       `json:"owner,omitempty"`
	PreferredApiDocument       *ServiceDocument             `json:"preferredApiDocument,omitempty"`
	PreferredApiDocumentSource *ApiDocumentSourceEnum       `json:"preferredApiDocumentSource,omitempty"`
	Product                    string                       `json:"product,omitempty"`
	Repositories               *ServiceRepositoryConnection `json:"repos,omitempty" graphql:"repos"`
	Tags                       *TagConnection               `json:"tags,omitempty"`
	Tier                       Tier                         `json:"tier,omitempty"`
	Timestamps                 Timestamps                   `json:"timestamps"`
	Tools                      *ToolConnection              `json:"tools,omitempty"`

	Dependencies *ServiceDependenciesConnection `graphql:"-"`
	Dependents   *ServiceDependentsConnection   `graphql:"-"`
}

func (*Service) Documents

func (s *Service) Documents(client *Client) ([]ServiceDocument, error)

Deprecated use GetDocuments(client) instead

func (*Service) GetDependencies added in v2023.5.5

func (s *Service) GetDependencies(client *Client, variables *PayloadVariables) (*ServiceDependenciesConnection, error)

func (*Service) GetDependents added in v2023.5.5

func (s *Service) GetDependents(client *Client, variables *PayloadVariables) (*ServiceDependentsConnection, error)

func (*Service) GetDocuments added in v2023.3.14

func (s *Service) GetDocuments(client *Client, variables *PayloadVariables) (*ServiceDocumentsConnection, error)

func (*Service) GetRepositories added in v2023.3.14

func (s *Service) GetRepositories(client *Client, variables *PayloadVariables) (*ServiceRepositoryConnection, error)

func (*Service) GetTags added in v2023.3.14

func (s *Service) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

func (*Service) GetTools added in v2023.3.14

func (s *Service) GetTools(client *Client, variables *PayloadVariables) (*ToolConnection, error)

func (*Service) HasAlias

func (s *Service) HasAlias(alias string) bool

func (*Service) HasTag

func (s *Service) HasTag(key string, value string) bool

func (*Service) HasTool

func (s *Service) HasTool(category ToolCategory, name string, environment string) bool

func (*Service) Hydrate

func (s *Service) Hydrate(client *Client) error

func (*Service) ResourceId added in v2023.10.8

func (s *Service) ResourceId() ID

func (*Service) ResourceType added in v2023.10.8

func (s *Service) ResourceType() TaggableResource

type ServiceConnection

type ServiceConnection struct {
	Nodes      []Service
	PageInfo   PageInfo
	TotalCount int
}

type ServiceCreateInput

type ServiceCreateInput struct {
	Name        string           `json:"name"`
	Product     string           `json:"product,omitempty"`
	Description string           `json:"description,omitempty"`
	Language    string           `json:"language,omitempty"`
	Framework   string           `json:"framework,omitempty"`
	Tier        string           `json:"tierAlias,omitempty"`
	Owner       *IdentifierInput `json:"ownerInput,omitempty"`
	Lifecycle   string           `json:"lifecycleAlias,omitempty"`
	Parent      *IdentifierInput `json:"parent,omitempty"`
}

type ServiceDeleteInput

type ServiceDeleteInput struct {
	Id    ID     `json:"id,omitempty"`
	Alias string `json:"alias,omitempty"`
}

type ServiceDependenciesConnection added in v2023.5.5

type ServiceDependenciesConnection struct {
	Edges    []ServiceDependenciesEdge `graphql:"edges"`
	PageInfo PageInfo
}

type ServiceDependenciesEdge added in v2023.5.5

type ServiceDependenciesEdge struct {
	Id     ID         `graphql:"id"`
	Locked bool       `graphql:"locked"`
	Node   *ServiceId `graphql:"node"`
	Notes  string     `graphql:"notes"`
}

type ServiceDependency added in v2023.5.5

type ServiceDependency struct {
	Id        ID        `graphql:"id"`
	Service   ServiceId `graphql:"sourceService"`
	DependsOn ServiceId `graphql:"destinationService"`
	Notes     string    `graphql:"notes"`
}

type ServiceDependencyCreateInput added in v2023.5.5

type ServiceDependencyCreateInput struct {
	Key   ServiceDependencyKey `json:"dependencyKey"`
	Notes string               `json:"notes,omitempty"`
}

type ServiceDependencyKey added in v2023.5.5

type ServiceDependencyKey struct {
	Service   IdentifierInput `json:"sourceIdentifier"`
	DependsOn IdentifierInput `json:"destinationIdentifier"`
}

type ServiceDependentsConnection added in v2023.5.5

type ServiceDependentsConnection struct {
	Edges    []ServiceDependentsEdge `graphql:"edges"`
	PageInfo PageInfo
}

type ServiceDependentsEdge added in v2023.5.5

type ServiceDependentsEdge struct {
	Id     ID         `graphql:"id"`
	Locked bool       `graphql:"locked"`
	Node   *ServiceId `graphql:"node"`
	Notes  string     `graphql:"notes"`
}

type ServiceDocument

type ServiceDocument struct {
	Id         ID                    `graphql:"id" json:"id"`
	HtmlURL    string                `graphql:"htmlUrl" json:"htmUrl,omitempty"`
	Source     ServiceDocumentSource `graphql:"source" json:"source"`
	Timestamps Timestamps            `graphql:"timestamps" json:"timestamps"`
}

type ServiceDocumentContent

type ServiceDocumentContent struct {
	ServiceDocument
	Content string `graphql:"content" json:"content,omitempty"`
}

type ServiceDocumentSource

type ServiceDocumentSource struct {
	IntegrationId     `graphql:"... on ApiDocIntegration"`
	ServiceRepository `graphql:"... on ServiceRepository"`
}

type ServiceDocumentsConnection added in v2023.3.14

type ServiceDocumentsConnection struct {
	Nodes      []ServiceDocument
	PageInfo   PageInfo
	TotalCount int
}

type ServiceId

type ServiceId struct {
	Id      ID       `json:"id"`
	Aliases []string `json:"aliases,omitempty"`
}

type ServiceMaturity

type ServiceMaturity struct {
	Name           string
	MaturityReport MaturityReport
}

type ServiceOwnershipCheckFragment

type ServiceOwnershipCheckFragment struct {
	RequireContactMethod *bool        `graphql:"requireContactMethod"`
	ContactMethod        *ContactType `graphql:"contactMethod"`
	TeamTagKey           string       `graphql:"tagKey"`
	TeamTagPredicate     *Predicate   `graphql:"tagPredicate"`
}

type ServicePropertyCheckFragment

type ServicePropertyCheckFragment struct {
	Property  ServicePropertyTypeEnum `graphql:"serviceProperty"`
	Predicate *Predicate              `graphql:"propertyValuePredicate"`
}

type ServicePropertyTypeEnum

type ServicePropertyTypeEnum string

ServicePropertyTypeEnum represents properties of services that can be validated.

const (
	ServicePropertyTypeEnumDescription    ServicePropertyTypeEnum = "description"     // The description of a service.
	ServicePropertyTypeEnumName           ServicePropertyTypeEnum = "name"            // The name of a service.
	ServicePropertyTypeEnumLanguage       ServicePropertyTypeEnum = "language"        // The primary programming language of a service.
	ServicePropertyTypeEnumFramework      ServicePropertyTypeEnum = "framework"       // The primary software development framework of a service.
	ServicePropertyTypeEnumProduct        ServicePropertyTypeEnum = "product"         // The product that is associated with a service.
	ServicePropertyTypeEnumLifecycleIndex ServicePropertyTypeEnum = "lifecycle_index" // The index of the lifecycle a service belongs to.
	ServicePropertyTypeEnumTierIndex      ServicePropertyTypeEnum = "tier_index"      // The index of the tier a service belongs to.
	ServicePropertyTypeEnumNote           ServicePropertyTypeEnum = "note"            // Additional information about the service.
	ServicePropertyTypeEnumSystem         ServicePropertyTypeEnum = "system"          // The system that the service belongs to.
)

type ServiceRepository

type ServiceRepository struct {
	BaseDirectory string
	DisplayName   string
	Id            ID
	Repository    RepositoryId
	Service       ServiceId
}

type ServiceRepositoryConnection

type ServiceRepositoryConnection struct {
	Edges      []ServiceRepositoryEdge
	PageInfo   PageInfo
	TotalCount int
}

type ServiceRepositoryCreateInput

type ServiceRepositoryCreateInput struct {
	Service       IdentifierInput `json:"service"`
	Repository    IdentifierInput `json:"repository"`
	BaseDirectory string          `json:"baseDirectory"`
	DisplayName   string          `json:"displayName,omitempty"`
}

type ServiceRepositoryEdge

type ServiceRepositoryEdge struct {
	Node                RepositoryId
	ServiceRepositories []ServiceRepository
}

type ServiceRepositoryUpdateInput

type ServiceRepositoryUpdateInput struct {
	Id            ID     `json:"id"`
	BaseDirectory string `json:"baseDirectory,omitempty"`
	DisplayName   string `json:"displayName,omitempty"`
}

type ServiceSortEnum added in v2023.3.14

type ServiceSortEnum string

ServiceSortEnum represents sort possibilities for services.

const (
	ServiceSortEnumNameAsc           ServiceSortEnum = "name_ASC"            // Sort by `name` ascending.
	ServiceSortEnumNameDesc          ServiceSortEnum = "name_DESC"           // Sort by `name` descending.
	ServiceSortEnumProductAsc        ServiceSortEnum = "product_ASC"         // Sort by `product` ascending.
	ServiceSortEnumProductDesc       ServiceSortEnum = "product_DESC"        // Sort by `product` descending.
	ServiceSortEnumTierAsc           ServiceSortEnum = "tier_ASC"            // Sort by `tier` ascending.
	ServiceSortEnumTierDesc          ServiceSortEnum = "tier_DESC"           // Sort by `tier` descending.
	ServiceSortEnumLifecycleAsc      ServiceSortEnum = "lifecycle_ASC"       // Sort by lifecycle ascending.
	ServiceSortEnumLifecycleDesc     ServiceSortEnum = "lifecycle_DESC"      // Sort by lifecycle descending.
	ServiceSortEnumLevelIndexAsc     ServiceSortEnum = "level_index_ASC"     // Sort by level ascending.
	ServiceSortEnumLevelIndexDesc    ServiceSortEnum = "level_index_DESC"    // Sort by level descending.
	ServiceSortEnumOwnerAsc          ServiceSortEnum = "owner_ASC"           // Sort by `owner` ascending.
	ServiceSortEnumOwnerDesc         ServiceSortEnum = "owner_DESC"          // Sort by `owner` descending.
	ServiceSortEnumChecksPassingAsc  ServiceSortEnum = "checks_passing_ASC"  // Sort by `checks_passing` ascending.
	ServiceSortEnumChecksPassingDesc ServiceSortEnum = "checks_passing_DESC" // Sort by `checks_passing` descending.
	ServiceSortEnumServiceStatAsc    ServiceSortEnum = "service_stat_ASC"    // Alias to sort by `checks_passing` ascending.
	ServiceSortEnumServiceStatDesc   ServiceSortEnum = "service_stat_DESC"   // Alias to sort by `checks_passing` descending.
	ServiceSortEnumLastDeployAsc     ServiceSortEnum = "last_deploy_ASC"     // Sort by last deploy time ascending.
	ServiceSortEnumLastDeployDesc    ServiceSortEnum = "last_deploy_DESC"    // Sort by last deploy time descending.
	ServiceSortEnumAlertStatusAsc    ServiceSortEnum = "alert_status_ASC"    // Sort by alert status ascending.
	ServiceSortEnumAlertStatusDesc   ServiceSortEnum = "alert_status_DESC"   // Sort by alert status descending.
)

type ServiceUpdateInput

type ServiceUpdateInput struct {
	Id          ID               `json:"id,omitempty"`
	Alias       string           `json:"alias,omitempty"`
	Name        string           `json:"name,omitempty"`
	Product     string           `json:"product,omitempty"`
	Description string           `json:"description,omitempty"`
	Language    string           `json:"language,omitempty"`
	Framework   string           `json:"framework,omitempty"`
	Tier        string           `json:"tierAlias,omitempty"`
	Owner       *IdentifierInput `json:"ownerInput,omitempty"`
	Lifecycle   string           `json:"lifecycleAlias,omitempty"`
	Parent      *IdentifierInput `json:"parent,omitempty"`
}

type System added in v2023.4.11

type System struct {
	SystemId
	Name        string      `graphql:"name"`
	Description string      `graphql:"description"`
	HTMLUrl     string      `graphql:"htmlUrl"`
	Owner       EntityOwner `graphql:"owner"`
	Parent      Domain      `graphql:"parent"`
	Note        string      `graphql:"note"`
}

type SystemConnection added in v2023.4.11

type SystemConnection struct {
	Nodes      []System `json:"nodes"`
	PageInfo   PageInfo `json:"pageInfo"`
	TotalCount int      `json:"totalCount" graphql:"-"`
}

type SystemId added in v2023.4.11

type SystemId Identifier

func (*SystemId) AssignService added in v2023.4.11

func (s *SystemId) AssignService(client *Client, services ...string) error

func (*SystemId) ChildServices added in v2023.4.11

func (s *SystemId) ChildServices(client *Client, variables *PayloadVariables) (*ServiceConnection, error)

func (*SystemId) GetTags added in v2023.10.8

func (s *SystemId) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

func (*SystemId) ResourceId added in v2023.10.8

func (s *SystemId) ResourceId() ID

func (*SystemId) ResourceType added in v2023.10.8

func (s *SystemId) ResourceType() TaggableResource

func (*SystemId) Tags deprecated added in v2023.4.11

func (s *SystemId) Tags(client *Client, variables *PayloadVariables) (*TagConnection, error)

Deprecated: Please use GetTags instead

type SystemInput added in v2023.4.11

type SystemInput struct {
	Name        *string          `json:"name,omitempty"`
	Description *string          `json:"description,omitempty"`
	Owner       *ID              `json:"ownerId,omitempty"`
	Parent      *IdentifierInput `json:"parent,omitempty"`
	Note        *string          `json:"note,omitempty"`
}

type Tag

type Tag struct {
	Id    ID     `json:"id"`
	Key   string `json:"key"`
	Value string `json:"value"`
}

type TagArgs

type TagArgs struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

func NewTagArgs

func NewTagArgs(tag string) TagArgs

type TagAssignInput

type TagAssignInput struct {
	Id    ID               `json:"id,omitempty"`
	Alias string           `json:"alias,omitempty"`
	Type  TaggableResource `json:"type,omitempty"`
	Tags  []TagInput       `json:"tags"`
}

type TagConnection

type TagConnection struct {
	Nodes      []Tag
	PageInfo   PageInfo
	TotalCount int
}

func (*TagConnection) GetTagById added in v2023.10.8

func (t *TagConnection) GetTagById(tagId ID) (*Tag, error)

type TagCreateInput

type TagCreateInput struct {
	Id    ID               `json:"id,omitempty"`
	Alias string           `json:"alias,omitempty"`
	Type  TaggableResource `json:"type,omitempty"`
	Key   string           `json:"key"`
	Value string           `json:"value"`
}

type TagDefinedCheckFragment

type TagDefinedCheckFragment struct {
	TagKey       string     `graphql:"tagKey"`
	TagPredicate *Predicate `graphql:"tagPredicate"`
}

type TagDeleteInput

type TagDeleteInput struct {
	Id ID `json:"id"`
}

type TagInput

type TagInput struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type TagOwner

type TagOwner string
const (
	TagOwnerService    TagOwner = "Service"
	TagOwnerRepository TagOwner = "Repository"
)

type TagUpdateInput

type TagUpdateInput struct {
	Id    ID     `json:"id"`
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type TaggableResource

type TaggableResource string

TaggableResource represents possible types to apply tags to.

const (
	TaggableResourceService                TaggableResource = "Service"                // Used to identify a Service.
	TaggableResourceRepository             TaggableResource = "Repository"             // Used to identify a Repository.
	TaggableResourceTeam                   TaggableResource = "Team"                   // Used to identify a Team.
	TaggableResourceUser                   TaggableResource = "User"                   // Used to identify a User.
	TaggableResourceDomain                 TaggableResource = "Domain"                 // Used to identify a Domain.
	TaggableResourceSystem                 TaggableResource = "System"                 // Used to identify a System.
	TaggableResourceInfrastructureresource TaggableResource = "InfrastructureResource" // Used to identify an Infrastructure Resource.
)

type TaggableResourceInterface added in v2023.10.8

type TaggableResourceInterface interface {
	GetTags(*Client, *PayloadVariables) (*TagConnection, error)
	ResourceId() ID
	ResourceType() TaggableResource
}

type Team

type Team struct {
	TeamId

	Aliases  []string
	Contacts []Contact

	Group            GroupId // Deprecated: Group field will be removed in a future release
	HTMLUrl          string
	Manager          User
	Members          *UserConnection // Deprecated: Members field will be removed in a future release
	Memberships      *TeamMembershipConnection
	Name             string
	ParentTeam       TeamId
	Responsibilities string
	Tags             *TagConnection
}

func (*Team) GetMembers deprecated added in v2023.3.14

func (t *Team) GetMembers(client *Client, variables *PayloadVariables) (*UserConnection, error)

Deprecated: use GetMemberships instead

func (*Team) GetMemberships added in v2023.11.16

func (t *Team) GetMemberships(client *Client, variables *PayloadVariables) (*TeamMembershipConnection, error)

func (*Team) GetTags added in v2023.3.14

func (t *Team) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

func (*Team) HasTag

func (s *Team) HasTag(key string, value string) bool

func (*Team) Hydrate

func (self *Team) Hydrate(client *Client) error

func (*Team) ResourceId added in v2023.10.8

func (t *Team) ResourceId() ID

func (*Team) ResourceType added in v2023.10.8

func (t *Team) ResourceType() TaggableResource

type TeamConnection

type TeamConnection struct {
	Nodes      []Team
	PageInfo   PageInfo
	TotalCount int
}

type TeamCreateInput

type TeamCreateInput struct {
	Name             string           `json:"name"`
	ManagerEmail     string           `json:"managerEmail,omitempty"`
	Responsibilities string           `json:"responsibilities,omitempty"`
	Contacts         *[]ContactInput  `json:"contacts,omitempty"`
	ParentTeam       *IdentifierInput `json:"parentTeam"`
}

type TeamDeleteInput

type TeamDeleteInput struct {
	Id    ID     `json:"id,omitempty"`
	Alias string `json:"alias,omitempty"`
}

type TeamId

type TeamId struct {
	Alias string
	Id    ID
}

Has no json struct tags as this is nested in returned data structs

type TeamIdConnection added in v2023.3.14

type TeamIdConnection struct {
	Nodes      []TeamId
	PageInfo   PageInfo
	TotalCount int
}

Had to create this to prevent circular references on User because Team has UserConnection

type TeamMembership added in v2023.10.20

type TeamMembership struct {
	Team TeamId `graphql:"team"`
	Role string `graphql:"role"`
	User UserId `graphql:"user"`
}

type TeamMembershipConnection added in v2023.11.16

type TeamMembershipConnection struct {
	Nodes      []TeamMembership
	PageInfo   PageInfo
	TotalCount int
}

type TeamMembershipCreateInput

type TeamMembershipCreateInput struct {
	TeamId  ID                        `json:"teamId"`
	Members []TeamMembershipUserInput `json:"members"`
}

type TeamMembershipDeleteInput

type TeamMembershipDeleteInput struct {
	TeamId  ID                        `json:"teamId"`
	Members []TeamMembershipUserInput `json:"members"`
}

type TeamMembershipUserInput

type TeamMembershipUserInput struct {
	User UserIdentifierInput `json:"user"`
	Role string              `json:"role"`
}

type TeamUpdateInput

type TeamUpdateInput struct {
	Id               ID               `json:"id"`
	Alias            string           `json:"alias,omitempty"`
	Name             string           `json:"name,omitempty"`
	ManagerEmail     string           `json:"managerEmail,omitempty"`
	Responsibilities string           `json:"responsibilities,omitempty"`
	ParentTeam       *IdentifierInput `json:"parentTeam"`
}

type Tier

type Tier struct {
	Alias       string
	Description string
	Id          ID
	Index       int
	Name        string
}

type Timestamps

type Timestamps struct {
	CreatedAt iso8601.Time `json:"createdAt"`
	UpdatedAt iso8601.Time `json:"updatedAt"`
}

type Tool

type Tool struct {
	Category      ToolCategory
	CategoryAlias string `json:",omitempty"`
	DisplayName   string
	Environment   string `json:",omitempty"`
	Id            ID     `json:",omitempty"`
	Url           string
	Service       ServiceId
}

type ToolCategory

type ToolCategory string

ToolCategory represents the specific categories that a tool can belong to.

const (
	ToolCategoryAdmin                 ToolCategory = "admin"                  // Tools used for administrative purposes.
	ToolCategoryAPIDocumentation      ToolCategory = "api_documentation"      // Tools used as API documentation for this service.
	ToolCategoryArchitectureDiagram   ToolCategory = "architecture_diagram"   // Tools used for diagramming architecture.
	ToolCategoryBacklog               ToolCategory = "backlog"                // Tools used for tracking issues.
	ToolCategoryCode                  ToolCategory = "code"                   // Tools used for source code.
	ToolCategoryContinuousIntegration ToolCategory = "continuous_integration" // Tools used for building/unit testing a service.
	ToolCategoryDeployment            ToolCategory = "deployment"             // Tools used for deploying changes to a service.
	ToolCategoryDesignDocumentation   ToolCategory = "design_documentation"   // Tools used for documenting design.
	ToolCategoryErrors                ToolCategory = "errors"                 // Tools used for tracking/reporting errors.
	ToolCategoryFeatureFlag           ToolCategory = "feature_flag"           // Tools used for managing feature flags.
	ToolCategoryHealthChecks          ToolCategory = "health_checks"          // Tools used for tracking/reporting the health of a service.
	ToolCategoryIncidents             ToolCategory = "incidents"              // Tools used to surface incidents on a service.
	ToolCategoryIssueTracking         ToolCategory = "issue_tracking"         // Tools used for tracking issues.
	ToolCategoryLogs                  ToolCategory = "logs"                   // Tools used for displaying logs from services.
	ToolCategoryMetrics               ToolCategory = "metrics"                // Tools used for tracking/reporting service metrics.
	ToolCategoryObservability         ToolCategory = "observability"          // Tools used for observability.
	ToolCategoryOrchestrator          ToolCategory = "orchestrator"           // Tools used for orchestrating a service.
	ToolCategoryOther                 ToolCategory = "other"                  // Tools that do not fit into the available categories.
	ToolCategoryResiliency            ToolCategory = "resiliency"             // Tools used for testing the resiliency of a service.
	ToolCategoryRunbooks              ToolCategory = "runbooks"               // Tools used for managing runbooks for a service.
	ToolCategorySecurityScans         ToolCategory = "security_scans"         // Tools used for performing security scans.
	ToolCategoryStatusPage            ToolCategory = "status_page"            // Tools used for reporting the status of a service.
	ToolCategoryWiki                  ToolCategory = "wiki"                   // Tools used as a wiki for this service.
)

type ToolConnection

type ToolConnection struct {
	Nodes      []Tool
	PageInfo   PageInfo
	TotalCount int
}

type ToolCreateInput

type ToolCreateInput struct {
	Category     ToolCategory `json:"category" validate:"required" default:"logs"`
	DisplayName  string       `json:"displayName" yaml:"displayName" default:"John Doe"`
	Url          string       `json:"url" default:"john.doe@example.com"`
	Environment  string       `json:"environment,omitempty" yaml:"environment,omitempty"`
	ServiceId    ID           `json:"serviceId,omitempty" yaml:"serviceId,omitempty"`
	ServiceAlias string       `json:"serviceAlias,omitempty" yaml:"serviceId,omitempty"`
}

type ToolDeleteInput

type ToolDeleteInput struct {
	Id ID `json:"id"`
}

type ToolUpdateInput

type ToolUpdateInput struct {
	Id          ID           `json:"id" default:"Z2lkOi8vMTIzNDU2Nzg5MTAK"`
	Category    ToolCategory `json:"category,omitempty"`
	DisplayName string       `json:"displayName,omitempty" yaml:"displayName,omitempty" default:"John Doe"`
	Url         string       `json:"url,omitempty" yaml:"url,omitempty" default:"john.doe@example.com"`
	Environment string       `json:"environment,omitempty" yaml:"environment,omitempty"`
}

type ToolUsageCheckFragment

type ToolUsageCheckFragment struct {
	ToolCategory         ToolCategory `graphql:"toolCategory"`
	ToolNamePredicate    *Predicate   `graphql:"toolNamePredicate"`
	ToolUrlPredicate     *Predicate   `graphql:"toolUrlPredicate"`
	EnvironmentPredicate *Predicate   `graphql:"environmentPredicate"`
}

type User

type User struct {
	UserId
	HTMLUrl string
	Name    string
	Role    UserRole
}

func (*User) ResourceId added in v2023.10.8

func (u *User) ResourceId() ID

func (*User) ResourceType added in v2023.10.8

func (u *User) ResourceType() TaggableResource

func (*User) Teams

func (u *User) Teams(client *Client, variables *PayloadVariables) (*TeamIdConnection, error)

type UserConnection

type UserConnection struct {
	Nodes      []User
	PageInfo   PageInfo
	TotalCount int
}

type UserId

type UserId struct {
	Id    ID
	Email string
}

func (*UserId) GetTags added in v2023.10.8

func (u *UserId) GetTags(client *Client, variables *PayloadVariables) (*TagConnection, error)

type UserIdentifierInput

type UserIdentifierInput struct {
	Id    *ID     `graphql:"id" json:"id,omitempty"`
	Email *string `graphql:"email" json:"email,omitempty"`
}

func NewUserIdentifier

func NewUserIdentifier(value string) UserIdentifierInput

type UserInput

type UserInput struct {
	Name             string   `json:"name,omitempty"`
	Role             UserRole `json:"role,omitempty"`
	SkipWelcomeEmail bool     `json:"skipWelcomeEmail" yaml:"skipWelcomeEmail"`
}

type UserRole

type UserRole string

UserRole represents a role that can be assigned to a user.

const (
	UserRoleUser      UserRole = "user"       // A regular user on the account.
	UserRoleAdmin     UserRole = "admin"      // An administrator on the account.
	UserRoleBasicUser UserRole = "basic_user" // A basic user on the account with limited access.
)

type UsersFilterEnum added in v2023.10.8

type UsersFilterEnum string

UsersFilterEnum represents fields that can be used as part of filter for users.

const (
	UsersFilterEnumName          UsersFilterEnum = "name"            // Filter by `name` field.
	UsersFilterEnumEmail         UsersFilterEnum = "email"           // Filter by `email` field.
	UsersFilterEnumRole          UsersFilterEnum = "role"            // Filter by `role` field. (user or admin).
	UsersFilterEnumTag           UsersFilterEnum = "tag"             // Filter by `tags` belonging to user.
	UsersFilterEnumDeactivatedAt UsersFilterEnum = "deactivated_at"  // Filter by the `deactivated_at` field.
	UsersFilterEnumLastSignInAt  UsersFilterEnum = "last_sign_in_at" // Filter by the `last_sign_in_at` field.
)

type VaultSecretsSortEnum added in v2023.10.8

type VaultSecretsSortEnum string

VaultSecretsSortEnum represents sort possibilities for secrets.

const (
	VaultSecretsSortEnumSlugAsc       VaultSecretsSortEnum = "slug_ASC"        // Sort by slug ascending.
	VaultSecretsSortEnumSlugDesc      VaultSecretsSortEnum = "slug_DESC"       // Sort by slug descending.
	VaultSecretsSortEnumUpdatedAtAsc  VaultSecretsSortEnum = "updated_at_ASC"  // Sort by updated_at ascending.
	VaultSecretsSortEnumUpdatedAtDesc VaultSecretsSortEnum = "updated_at_DESC" // Sort by updated_at descending.
)

Directories

Path Synopsis
Wrapping the client can be useful when you want to override default behavior, such as always setting context or disallowing (to the best of Go's ability) access to specific receiver functions on `opslevel.Client`.
Wrapping the client can be useful when you want to override default behavior, such as always setting context or disallowing (to the best of Go's ability) access to specific receiver functions on `opslevel.Client`.

Jump to

Keyboard shortcuts

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