gqlclient

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("Resource was not found")

Functions

This section is empty.

Types

type AuthenticatedTransport

type AuthenticatedTransport struct {
	T      http.RoundTripper
	ApiKey string
	UA     string
}

func (*AuthenticatedTransport) RoundTrip

func (transport *AuthenticatedTransport) RoundTrip(req *http.Request) (*http.Response, error)

type BlamelessInputType added in v0.4.2

type BlamelessInputType struct {
	BlamelessProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type BlamelessProviderData added in v0.4.2

type BlamelessProviderData struct {
	RemoteTypes             []string `json:"remoteTypes"`
	RemoteSeverityThreshold string   `json:"remoteSeverityThreshold"`
}

type BranchMapping

type BranchMapping struct {
	EnvironmentSlug string `json:"environmentSlug" tfsdk:"environment_slug"`
	Branch          string `json:"branch" tfsdk:"branch"`
}

type BuildMapping added in v0.3.4

type BuildMapping struct {
	EnvironmentSlug          string `json:"environmentSlug"`
	Provider                 string `json:"provider"`
	BuildName                string `json:"buildName"`
	JobName                  string `json:"jobName,omitempty"`
	BuildProjectKey          string `json:"buildProjectKey,omitempty"`
	IntegrationSlug          string `json:"integrationSlug"`
	BuildBranch              string `json:"buildBranch"`
	MatchBranchToEnvironment bool   `json:"matchBranchToEnvironment,omitempty"`
}

This represents a build mapping for creation or mutation

type CLTStartStates added in v0.4.6

type CLTStartStates struct {
	ID string `json:"id,omitempty"`
}

type Client

type Client struct {
	Baseurl    string
	HTTPClient *http.Client
	GQLClient  *graphql.Client
	ApiKey     string
	OrgSlug    string
}

Client -

func NewClient

func NewClient(baseurl, apiKey *string, ua string) (*Client, error)

NewClient -

func (*Client) CreateCodeChangeSource

func (c *Client) CreateCodeChangeSource(input CreateCodeChangeSourceMutationInput) (*CodeChangeSource, error)

func (*Client) CreateEnvironment

func (c *Client) CreateEnvironment(input CreateEnvironmentMutationInput) (*Environment, error)

CreateEnvironment - Creates a environment

func (*Client) CreateErrorImpactSource

func (c *Client) CreateErrorImpactSource(input CreateErrorImpactSourceMutationInput) (*ErrorImpactSource, error)

CreateErrorImpactSource - Creates a environment

func (*Client) CreateIncidentImpactSource added in v0.4.0

func (c *Client) CreateIncidentImpactSource(ctx context.Context, input IncidentImpactSourceInputType) (*IncidentImpactSource, error)

func (*Client) CreateMetricImpactSource

func (c *Client) CreateMetricImpactSource(input CreateMetricImpactSourceMutationInput) (*MetricImpactSource, error)

CreateMetricImpactSource - Creates a environment

func (*Client) CreateProject

func (c *Client) CreateProject(input CreateProjectMutationInput) (*Project, error)

CreateProject - Creates a project

func (*Client) DeleteChangeSource

func (c *Client) DeleteChangeSource(projectSlug *string, slug *string) error

DeleteChangeSource - Deletes a change source

func (*Client) DeleteEnvironment

func (c *Client) DeleteEnvironment(ctx context.Context, projectSlug *string, slug *string) error

DeleteEnvironment - Deletes a environment

func (*Client) DeleteImpactSource

func (c *Client) DeleteImpactSource(projectSlug *string, slug *string) error

DeleteImpactSource - Deletes a impact source

func (*Client) DeleteIncidentImpactSource added in v0.4.0

func (c *Client) DeleteIncidentImpactSource(ctx context.Context, input IncidentImpactSourceDeleteInputType) (bool, error)

func (*Client) DeleteProject

func (c *Client) DeleteProject(slug *string) error

DeleteProject - Deletes a project

func (*Client) GetCodeChangeSource

func (c *Client) GetCodeChangeSource(ctx context.Context, projectSlug *string, slug *string) (*CodeChangeSource, error)

func (*Client) GetEnvironment

func (c *Client) GetEnvironment(projectSlug *string, slug *string) (*Environment, error)

GetEnvironment - Returns environment

func (*Client) GetEnvironmentByName

func (c *Client) GetEnvironmentByName(projectSlug *string, name *string) (*Environment, error)

func (*Client) GetErrorImpactSource

func (c *Client) GetErrorImpactSource(projectSlug *string, slug *string) (*ErrorImpactSource, error)

GetErrorImpactSource - Returns error impact source

func (*Client) GetIncidentImpactSource added in v0.4.0

func (c *Client) GetIncidentImpactSource(ctx context.Context, projectSlug, slug string) (*IncidentImpactSource, error)

GetIncidentImpactSource returns incident impact source

func (*Client) GetMetricImpactSource

func (c *Client) GetMetricImpactSource(projectSlug *string, slug *string) (*MetricImpactSource, error)

GetMetricImpactSource - Returns error impact source

func (*Client) GetProject

func (c *Client) GetProject(slug *string) (*Project, error)

GetProject - Returns project

func (*Client) UpdateCodeChangeSource

func (c *Client) UpdateCodeChangeSource(input UpdateCodeChangeSourceMutationInput) (*CodeChangeSource, error)

func (*Client) UpdateEnvironment

func (c *Client) UpdateEnvironment(input UpdateEnvironmentMutationInput) (*Environment, error)

UpdateEnvironment - Updates a environment

func (*Client) UpdateErrorImpactSource

func (c *Client) UpdateErrorImpactSource(input UpdateErrorImpactSourceMutationInput) (*ErrorImpactSource, error)

UpdateErrorImpactSource - Updates a environment

func (*Client) UpdateIncidentImpactSource added in v0.4.0

func (c *Client) UpdateIncidentImpactSource(ctx context.Context, input IncidentImpactSourceInputUpdateType) (*IncidentImpactSource, error)

func (*Client) UpdateMetricImpactSource

func (c *Client) UpdateMetricImpactSource(input UpdateMetricImpactSourceMutationInput) (*MetricImpactSource, error)

UpdateMetricImpactSource - Updates a environment

func (*Client) UpdateProject

func (c *Client) UpdateProject(slug *string, input UpdateProjectMutationInput) (*Project, error)

UpdateProject - Updates a project

type ClubhouseInputType added in v0.4.6

type ClubhouseInputType struct {
	ClubhouseProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type ClubhouseProviderData added in v0.4.6

type ClubhouseProviderData struct {
	RemoteQuery string `json:"remoteQuery"`
}

type CodeChangeSource

type CodeChangeSource struct {
	Slug                        string                       `json:"slug"`
	Name                        string                       `json:"name"`
	Repository                  Repository                   `json:"repository"`
	DeployTrackingType          string                       `json:"deployTrackingType"`
	CollectImpact               bool                         `json:"collectImpact"`
	PathPrefix                  string                       `json:"pathPrefix"`
	NotifyInSlack               bool                         `json:"notifyInSlack"`
	IncludeInDashboard          bool                         `json:"includeInDashboard"`
	AutoTrackingDelay           int                          `json:"autoTrackingDelay"`
	EnvironmentMappings         []BranchMapping              `json:"environmentMappings"`
	DeployTrackingBuildMappings []DeployTrackingBuildMapping `json:"deployTrackingBuildMappings"`
}

type CreateCodeChangeSourceMutationInput

type CreateCodeChangeSourceMutationInput struct {
	ProjectSlug       string `json:"projectSlug"`
	InitializeChanges bool   `json:"initializeChanges"`
	*MutableCodeChangeSource
}

type CreateEnvironmentMutationInput

type CreateEnvironmentMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	*MutableEnvironment
}

type CreateErrorImpactSourceMutationInput

type CreateErrorImpactSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	*MutableErrorImpactSource
}

type CreateMetricImpactSourceMutationInput

type CreateMetricImpactSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	*MutableMetricImpactSource
}

type CreateProjectMutationInput

type CreateProjectMutationInput struct {
	*MutableProject
}

type DataDogInputType added in v0.4.0

type DataDogInputType struct {
	DataDogProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type DataDogProviderData added in v0.4.0

type DataDogProviderData struct {
	Query                   string `json:"query"`
	RemotePriorityThreshold string `json:"remotePriorityThreshold"`
}

type DeleteChangeSourceMutationInput

type DeleteChangeSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
}

type DeleteEnvironmentMutationInput

type DeleteEnvironmentMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
}

type DeleteImpactSourceMutationInput

type DeleteImpactSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
}

type DeleteProjectMutationInput

type DeleteProjectMutationInput struct {
	Slug string `json:"slug"`
}

type DeployTrackingBuildMapping added in v0.3.4

type DeployTrackingBuildMapping struct {
	Environment              Environment `json:"environment"`
	Provider                 string      `json:"provider"`
	IntegrationSlug          string      `json:"integrationSlug"`
	BuildName                string      `json:"buildName"`
	JobName                  string      `json:"jobName,omitempty"`
	BuildProjectKey          string      `json:"buildProjectKey"`
	MatchBranchToEnvironment bool        `json:"matchBranchToEnvironment"`
}

This represents the build mapping as retrieved from a query

type Environment

type Environment struct {
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Color       string `json:"color,omitempty"`
}

type ErrorImpactSource

type ErrorImpactSource struct {
	Slug                       string      `json:"slug"`
	Environment                Environment `json:"environment"`
	Name                       string      `json:"name"`
	Provider                   string      `json:"provider"`
	ErrorOrgKey                string      `json:"errorOrgKey"`
	ErrorProjectKey            string      `json:"errorProjectKey"`
	ErrorEnvironment           string      `json:"errorEnvironment"`
	ManuallySetHealthThreshold *float64    `json:"manuallySetHealthThreshold,omitempty"`
	IntegrationAuthSlug        string      `json:"integrationAuthSlug,omitempty"`
}

type ErrorsType

type ErrorsType []struct {
	Field    string   `json:"field"`
	Messages []string `json:"messages"`
}

type FireHydrantInputType added in v0.4.3

type FireHydrantInputType struct {
	FireHydrantProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type FireHydrantProviderData added in v0.4.3

type FireHydrantProviderData struct {
	RemoteEnvironments       string `json:"remoteEnvironments"`
	RemoteServices           string `json:"remoteServices"`
	RemoteMitigatedIsHealthy bool   `json:"remoteMitigatedIsHealthy"`
}

type IncidentImpactSource added in v0.4.0

type IncidentImpactSource struct {
	Slug                string       `json:"slug"`
	Environment         Environment  `json:"environment"`
	Name                string       `json:"name"`
	Provider            string       `json:"provider"`
	ProviderData        ProviderData `json:"providerData"`
	IntegrationAuthSlug string       `json:"integrationAuthSlug"`
	RegisterImpactLink  string       `json:"registerImpactLink"`
}

type IncidentImpactSourceDeleteInputType added in v0.4.0

type IncidentImpactSourceDeleteInputType struct {
	Slug        string `json:"slug"`
	ProjectSlug string `json:"projectSlug"`
}

type IncidentImpactSourceInputType added in v0.4.0

type IncidentImpactSourceInputType struct {
	ProjectSlug          string                `json:"projectSlug"`
	EnvironmentName      string                `json:"environmentName"`
	Name                 string                `json:"name"`
	Provider             string                `json:"provider"`
	PagerDutyInputType   *PagerDutyInputType   `json:"pagerDutyInput"`
	DataDogInputType     *DataDogInputType     `json:"datadogInput"`
	JiraInputType        *JiraInputType        `json:"jiraInput"`
	BlamelessInputType   *BlamelessInputType   `json:"blamelessInput"`
	StatuspageInputType  *StatuspageInputType  `json:"statuspageInput"`
	OpsGenieInputType    *OpsGenieInputType    `json:"opsgenieInput"`
	FireHydrantInputType *FireHydrantInputType `json:"firehydrantInput"`
	ClubhouseInputType   *ClubhouseInputType   `json:"clubhouseInput"`
	RootlyInputType      *RootlyInputType      `json:"rootlyInput"`
}

type IncidentImpactSourceInputUpdateType added in v0.4.0

type IncidentImpactSourceInputUpdateType struct {
	IncidentImpactSourceInputType
	Slug string `json:"slug"`
}

type IntegrationAuth added in v0.4.6

type IntegrationAuth struct {
	Slug string `json:"slug"`
}

type JiraInputType added in v0.4.1

type JiraInputType struct {
	JiraProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type JiraProviderData added in v0.4.1

type JiraProviderData struct {
	RemoteJql string `json:"remoteJql"`
}

type MetricImpactSource

type MetricImpactSource struct {
	Slug                       string      `json:"slug"`
	Environment                Environment `json:"environment"`
	Name                       string      `json:"name"`
	Provider                   string      `json:"provider,omitempty"`
	Query                      string      `json:"query,omitempty"`
	IntegrationAuthSlug        string      `json:"integrationAuthSlug,omitempty"`
	LessIsBetter               bool        `json:"lessIsBetter,omitempty"`
	ManuallySetHealthThreshold *float64    `json:"manuallySetHealthThreshold,omitempty"`
}

type MutableCodeChangeSource

type MutableCodeChangeSource struct {
	Name                string            `json:"name"`
	Repository          MutableRepository `json:"repository"`
	DeployTrackingType  string            `json:"deployTrackingType"`
	CollectImpact       bool              `json:"collectImpact"`
	PathPrefix          string            `json:"pathPrefix"`
	NotifyInSlack       bool              `json:"notifyInSlack"`
	IncludeInDashboard  bool              `json:"includeInDashboard"`
	AutoTrackingDelay   int               `json:"autoTrackingDelay"`
	EnvironmentMappings []BranchMapping   `json:"environmentMappings"`
	BuildMappings       []BuildMapping    `json:"buildMappings"`
}

type MutableEnvironment

type MutableEnvironment struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Color       string `json:"color,omitempty"`
}

type MutableErrorImpactSource

type MutableErrorImpactSource struct {
	EnvironmentSlug            string  `json:"environment"`
	Name                       string  `json:"name"`
	Provider                   string  `json:"provider"`
	ErrorOrgKey                string  `json:"errorOrgKey"`
	ErrorProjectKey            string  `json:"errorProjectKey"`
	ErrorEnvironment           string  `json:"errorEnvironment"`
	ManuallySetHealthThreshold float64 `json:"manuallySetHealthThreshold,omitempty"`
	IntegrationSlug            string  `json:"auth,omitempty"`
}

type MutableMetricImpactSource

type MutableMetricImpactSource struct {
	EnvironmentSlug            string  `json:"environment"`
	Name                       string  `json:"name"`
	Provider                   string  `json:"provider"`
	Query                      string  `json:"query,omitempty"`
	IntegrationSlug            string  `json:"auth,omitempty"`
	LessIsBetter               bool    `json:"lessIsBetter,omitempty"`
	ManuallySetHealthThreshold float64 `json:"manuallySetHealthThreshold,omitempty"`
}

type MutableProject

type MutableProject struct {
	Name                      string   `json:"name"`
	Description               string   `json:"description,omitempty"`
	IssueTrackerProvider      string   `json:"issueTrackerProvider,omitempty"`
	BuildProvider             string   `json:"buildProvider,omitempty"`
	ChangeFailureRateBoundary string   `json:"changeFailureRateBoundary,omitempty"`
	ImpactSensitivity         string   `json:"impactSensitivity,omitempty"`
	FailureSensitivity        int      `json:"failureSensitivity,omitempty"`
	CltStartDefinition        string   `json:"cltStartDefinition,omitempty"`
	CltStartStates            []int    `json:"cltStartStates,omitempty"`
	StrictIssueMatching       bool     `json:"strictIssueMatching,omitempty"`
	Labels                    []string `json:"labels"`
}

type MutableRepository added in v0.3.10

type MutableRepository struct {
	RepositoryBase
	IntegrationSlug string `json:"integrationSlug,omitempty"`
}

type OpsGenieInputType added in v0.4.3

type OpsGenieInputType struct {
	OpsGenieProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type OpsGenieProviderData added in v0.4.3

type OpsGenieProviderData struct {
	RemoteAlertTags         string `json:"remoteAlertTags,omitempty"`
	RemoteIncidentTags      string `json:"remoteIncidentTags,omitempty"`
	RemotePriorityThreshold string `json:"remotePriorityThreshold"`
	RemoteService           string `json:"remoteService,omitempty"`
	RemoteUseAlerts         bool   `json:"remoteUseAlerts"`
}

type PagerDutyInputType added in v0.4.0

type PagerDutyInputType struct {
	RemoteServices string `json:"remoteServices"`
	RemoteUrgency  string `json:"remoteUrgency"`
}

type PagerDutyProviderData added in v0.4.0

type PagerDutyProviderData struct {
	RemoteServices string `json:"remoteServices"`
	RemoteUrgency  string `json:"remoteUrgency"`
}

type Project

type Project struct {
	Slug                      string           `json:"slug"`
	Name                      string           `json:"name"`
	Description               string           `json:"description,omitempty"`
	IssueTrackerProvider      string           `json:"issueTrackerProvider,omitempty"`
	BuildProvider             string           `json:"buildProvider,omitempty"`
	ChangeFailureRateBoundary string           `json:"changeFailureRateBoundary,omitempty"`
	ImpactSensitivity         string           `json:"impactSensitivity,omitempty"`
	FailureSensitivity        int              `json:"failureSensitivity,omitempty"`
	CltStartDefinition        string           `json:"cltStartDefinition,omitempty"`
	CltStartStates            []CLTStartStates `json:"cltStartStates,omitempty"`
	StrictIssueMatching       bool             `json:"strictIssueMatching,omitempty"`
	LabelNames                []string         `json:"labelNames"`
}

type ProviderData added in v0.4.0

type ProviderData struct {
	PagerDutyProviderData   PagerDutyProviderData   `json:"pagerDutyProviderData" graphql:"... on PagerDutyProviderData"`
	DataDogProviderData     DataDogProviderData     `json:"dataDogProviderData" graphql:"... on DataDogProviderData"`
	JiraProviderData        JiraProviderData        `json:"jiraProviderData" graphql:"... on JiraProviderData"`
	BlamelessProviderData   BlamelessProviderData   `json:"blamelessProviderData" graphql:"... on BlamelessProviderData"`
	StatuspageProviderData  StatuspageProviderData  `json:"statuspageProviderData" graphql:"... on StatuspageProviderData"`
	OpsGenieProviderData    OpsGenieProviderData    `json:"opsgenieProviderData" graphql:"... on OpsgenieProviderData"`
	FireHydrantProviderData FireHydrantProviderData `json:"firehydrantProviderData" graphql:"... on FireHydrantProviderData"`
	ClubhouseProviderData   ClubhouseProviderData   `json:"ClubhouseProviderData" graphql:"... on ClubhouseProviderData"`
	RootlyProviderData      RootlyProviderData      `json:"RootlyProviderData" graphql:"... on RootlyProviderData"`
}

type Repository

type Repository struct {
	RepositoryBase
	IntegrationAuth *IntegrationAuth `json:"integrationAuth,omitempty"`
}

type RepositoryBase added in v0.5.0

type RepositoryBase struct {
	Owner      string `json:"owner"`
	Name       string `json:"name"`
	Provider   string `json:"provider"`
	Url        string `json:"url,omitempty"`
	ProjectUID string `json:"projectUid,omitempty"`
	RepoUID    string `json:"repoUid,omitempty"`
}

type RootlyInputType added in v0.6.2

type RootlyInputType struct {
	RootlyProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type RootlyProviderData added in v0.6.2

type RootlyProviderData struct {
	RemoteSeverity     string `json:"remoteSeverity"`
	RemoteIncidentType string `json:"remoteIncidentType"`
	RemoteEnvironment  string `json:"remoteEnvironment"`
	RemoteService      string `json:"remoteService"`
	RemoteTeam         string `json:"remoteTeam"`
}

type StatuspageInputType added in v0.4.3

type StatuspageInputType struct {
	StatuspageProviderData
	IntegrationSlug string `json:"integrationSlug"`
}

type StatuspageProviderData added in v0.4.3

type StatuspageProviderData struct {
	RemotePage                 string `json:"remotePage"`
	RemoteComponent            string `json:"remoteComponent"`
	RemoteImpact               string `json:"remoteImpact"`
	IgnoreMaintenanceIncidents bool   `json:"ignoreMaintenanceIncidents"`
}

type UpdateCodeChangeSourceMutationInput

type UpdateCodeChangeSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
	*MutableCodeChangeSource
}

type UpdateEnvironmentMutationInput

type UpdateEnvironmentMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
	*MutableEnvironment
}

type UpdateErrorImpactSourceMutationInput

type UpdateErrorImpactSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
	*MutableErrorImpactSource
}

type UpdateMetricImpactSourceMutationInput

type UpdateMetricImpactSourceMutationInput struct {
	ProjectSlug string `json:"projectSlug"`
	Slug        string `json:"slug"`
	*MutableMetricImpactSource
}

type UpdateProjectMutationInput

type UpdateProjectMutationInput struct {
	Slug string `json:"slug"`
	*MutableProject
}

Jump to

Keyboard shortcuts

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