// SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and Greenhouse contributors
// SPDX-License-Identifier: Apache-2.0

// Code generated by github.com/Khan/genqlient, DO NOT EDIT.

package client

import (
	"context"

	"github.com/Khan/genqlient/graphql"
)

// CreateIssueRepositoryResponse is returned by CreateIssueRepository on success.
type CreateIssueRepositoryResponse struct {
	CreateIssueRepository *IssueRepository `json:"createIssueRepository"`
}

// GetCreateIssueRepository returns CreateIssueRepositoryResponse.CreateIssueRepository, and is useful for accessing the field via an interface.
func (v *CreateIssueRepositoryResponse) GetCreateIssueRepository() *IssueRepository {
	return v.CreateIssueRepository
}

// CreateIssueResponse is returned by CreateIssue on success.
type CreateIssueResponse struct {
	CreateIssue *Issue `json:"createIssue"`
}

// GetCreateIssue returns CreateIssueResponse.CreateIssue, and is useful for accessing the field via an interface.
func (v *CreateIssueResponse) GetCreateIssue() *Issue { return v.CreateIssue }

// CreateIssueVariantResponse is returned by CreateIssueVariant on success.
type CreateIssueVariantResponse struct {
	CreateIssueVariant *IssueVariant `json:"createIssueVariant"`
}

// GetCreateIssueVariant returns CreateIssueVariantResponse.CreateIssueVariant, and is useful for accessing the field via an interface.
func (v *CreateIssueVariantResponse) GetCreateIssueVariant() *IssueVariant {
	return v.CreateIssueVariant
}

// GetIssueRepositoriesResponse is returned by GetIssueRepositories on success.
type GetIssueRepositoriesResponse struct {
	IssueRepositories *IssueRepositoryConnection `json:"IssueRepositories"`
}

// GetIssueRepositories returns GetIssueRepositoriesResponse.IssueRepositories, and is useful for accessing the field via an interface.
func (v *GetIssueRepositoriesResponse) GetIssueRepositories() *IssueRepositoryConnection {
	return v.IssueRepositories
}

// GetIssuesResponse is returned by GetIssues on success.
type GetIssuesResponse struct {
	Issues *IssueConnection `json:"Issues"`
}

// GetIssues returns GetIssuesResponse.Issues, and is useful for accessing the field via an interface.
func (v *GetIssuesResponse) GetIssues() *IssueConnection { return v.Issues }

// Issue includes the requested fields of the GraphQL type Issue.
type Issue struct {
	Id          string     `json:"id"`
	PrimaryName string     `json:"primaryName"`
	Description string     `json:"description"`
	Type        IssueTypes `json:"type"`
}

// GetId returns Issue.Id, and is useful for accessing the field via an interface.
func (v *Issue) GetId() string { return v.Id }

// GetPrimaryName returns Issue.PrimaryName, and is useful for accessing the field via an interface.
func (v *Issue) GetPrimaryName() string { return v.PrimaryName }

// GetDescription returns Issue.Description, and is useful for accessing the field via an interface.
func (v *Issue) GetDescription() string { return v.Description }

// GetType returns Issue.Type, and is useful for accessing the field via an interface.
func (v *Issue) GetType() IssueTypes { return v.Type }

// IssueConnection includes the requested fields of the GraphQL type IssueConnection.
type IssueConnection struct {
	TotalCount int                              `json:"totalCount"`
	Edges      []*IssueConnectionEdgesIssueEdge `json:"edges"`
}

// GetTotalCount returns IssueConnection.TotalCount, and is useful for accessing the field via an interface.
func (v *IssueConnection) GetTotalCount() int { return v.TotalCount }

// GetEdges returns IssueConnection.Edges, and is useful for accessing the field via an interface.
func (v *IssueConnection) GetEdges() []*IssueConnectionEdgesIssueEdge { return v.Edges }

// IssueConnectionEdgesIssueEdge includes the requested fields of the GraphQL type IssueEdge.
type IssueConnectionEdgesIssueEdge struct {
	Node *Issue `json:"node"`
}

// GetNode returns IssueConnectionEdgesIssueEdge.Node, and is useful for accessing the field via an interface.
func (v *IssueConnectionEdgesIssueEdge) GetNode() *Issue { return v.Node }

type IssueFilter struct {
	ServiceCcrn        []string                 `json:"serviceCcrn"`
	SupportGroupCcrn   []string                 `json:"supportGroupCcrn"`
	PrimaryName        []string                 `json:"primaryName"`
	IssueMatchStatus   []IssueMatchStatusValues `json:"issueMatchStatus"`
	IssueType          []IssueTypes             `json:"issueType"`
	State              []StateFilter            `json:"state"`
	IssueRepositoryId  []string                 `json:"issueRepositoryId"`
	ComponentVersionId []string                 `json:"componentVersionId"`
	Search             []string                 `json:"search"`
	AllServices        bool                     `json:"allServices"`
}

// GetServiceCcrn returns IssueFilter.ServiceCcrn, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetServiceCcrn() []string { return v.ServiceCcrn }

// GetSupportGroupCcrn returns IssueFilter.SupportGroupCcrn, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetSupportGroupCcrn() []string { return v.SupportGroupCcrn }

// GetPrimaryName returns IssueFilter.PrimaryName, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetPrimaryName() []string { return v.PrimaryName }

// GetIssueMatchStatus returns IssueFilter.IssueMatchStatus, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetIssueMatchStatus() []IssueMatchStatusValues { return v.IssueMatchStatus }

// GetIssueType returns IssueFilter.IssueType, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetIssueType() []IssueTypes { return v.IssueType }

// GetState returns IssueFilter.State, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetState() []StateFilter { return v.State }

// GetIssueRepositoryId returns IssueFilter.IssueRepositoryId, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetIssueRepositoryId() []string { return v.IssueRepositoryId }

// GetComponentVersionId returns IssueFilter.ComponentVersionId, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetComponentVersionId() []string { return v.ComponentVersionId }

// GetSearch returns IssueFilter.Search, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetSearch() []string { return v.Search }

// GetAllServices returns IssueFilter.AllServices, and is useful for accessing the field via an interface.
func (v *IssueFilter) GetAllServices() bool { return v.AllServices }

type IssueInput struct {
	PrimaryName string     `json:"primaryName"`
	Description string     `json:"description"`
	Uuid        string     `json:"uuid"`
	Type        IssueTypes `json:"type"`
}

// GetPrimaryName returns IssueInput.PrimaryName, and is useful for accessing the field via an interface.
func (v *IssueInput) GetPrimaryName() string { return v.PrimaryName }

// GetDescription returns IssueInput.Description, and is useful for accessing the field via an interface.
func (v *IssueInput) GetDescription() string { return v.Description }

// GetUuid returns IssueInput.Uuid, and is useful for accessing the field via an interface.
func (v *IssueInput) GetUuid() string { return v.Uuid }

// GetType returns IssueInput.Type, and is useful for accessing the field via an interface.
func (v *IssueInput) GetType() IssueTypes { return v.Type }

type IssueMatchStatusValues string

const (
	IssueMatchStatusValuesNew           IssueMatchStatusValues = "new"
	IssueMatchStatusValuesRiskAccepted  IssueMatchStatusValues = "risk_accepted"
	IssueMatchStatusValuesFalsePositive IssueMatchStatusValues = "false_positive"
	IssueMatchStatusValuesMitigated     IssueMatchStatusValues = "mitigated"
)

var AllIssueMatchStatusValues = []IssueMatchStatusValues{
	IssueMatchStatusValuesNew,
	IssueMatchStatusValuesRiskAccepted,
	IssueMatchStatusValuesFalsePositive,
	IssueMatchStatusValuesMitigated,
}

// IssueRepository includes the requested fields of the GraphQL type IssueRepository.
type IssueRepository struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Url  string `json:"url"`
}

// GetId returns IssueRepository.Id, and is useful for accessing the field via an interface.
func (v *IssueRepository) GetId() string { return v.Id }

// GetName returns IssueRepository.Name, and is useful for accessing the field via an interface.
func (v *IssueRepository) GetName() string { return v.Name }

// GetUrl returns IssueRepository.Url, and is useful for accessing the field via an interface.
func (v *IssueRepository) GetUrl() string { return v.Url }

// IssueRepositoryConnection includes the requested fields of the GraphQL type IssueRepositoryConnection.
type IssueRepositoryConnection struct {
	TotalCount int                                                  `json:"totalCount"`
	Edges      []*IssueRepositoryConnectionEdgesIssueRepositoryEdge `json:"edges"`
}

// GetTotalCount returns IssueRepositoryConnection.TotalCount, and is useful for accessing the field via an interface.
func (v *IssueRepositoryConnection) GetTotalCount() int { return v.TotalCount }

// GetEdges returns IssueRepositoryConnection.Edges, and is useful for accessing the field via an interface.
func (v *IssueRepositoryConnection) GetEdges() []*IssueRepositoryConnectionEdgesIssueRepositoryEdge {
	return v.Edges
}

// IssueRepositoryConnectionEdgesIssueRepositoryEdge includes the requested fields of the GraphQL type IssueRepositoryEdge.
type IssueRepositoryConnectionEdgesIssueRepositoryEdge struct {
	Node *IssueRepository `json:"node"`
}

// GetNode returns IssueRepositoryConnectionEdgesIssueRepositoryEdge.Node, and is useful for accessing the field via an interface.
func (v *IssueRepositoryConnectionEdgesIssueRepositoryEdge) GetNode() *IssueRepository { return v.Node }

type IssueRepositoryFilter struct {
	ServiceCcrn []string      `json:"serviceCcrn"`
	ServiceId   []string      `json:"serviceId"`
	Name        []string      `json:"name"`
	State       []StateFilter `json:"state"`
}

// GetServiceCcrn returns IssueRepositoryFilter.ServiceCcrn, and is useful for accessing the field via an interface.
func (v *IssueRepositoryFilter) GetServiceCcrn() []string { return v.ServiceCcrn }

// GetServiceId returns IssueRepositoryFilter.ServiceId, and is useful for accessing the field via an interface.
func (v *IssueRepositoryFilter) GetServiceId() []string { return v.ServiceId }

// GetName returns IssueRepositoryFilter.Name, and is useful for accessing the field via an interface.
func (v *IssueRepositoryFilter) GetName() []string { return v.Name }

// GetState returns IssueRepositoryFilter.State, and is useful for accessing the field via an interface.
func (v *IssueRepositoryFilter) GetState() []StateFilter { return v.State }

type IssueRepositoryInput struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

// GetName returns IssueRepositoryInput.Name, and is useful for accessing the field via an interface.
func (v *IssueRepositoryInput) GetName() string { return v.Name }

// GetUrl returns IssueRepositoryInput.Url, and is useful for accessing the field via an interface.
func (v *IssueRepositoryInput) GetUrl() string { return v.Url }

type IssueTypes string

const (
	IssueTypesVulnerability   IssueTypes = "Vulnerability"
	IssueTypesPolicyviolation IssueTypes = "PolicyViolation"
	IssueTypesSecurityevent   IssueTypes = "SecurityEvent"
)

var AllIssueTypes = []IssueTypes{
	IssueTypesVulnerability,
	IssueTypesPolicyviolation,
	IssueTypesSecurityevent,
}

// IssueVariant includes the requested fields of the GraphQL type IssueVariant.
type IssueVariant struct {
	Id            string `json:"id"`
	SecondaryName string `json:"secondaryName"`
	IssueId       string `json:"issueId"`
}

// GetId returns IssueVariant.Id, and is useful for accessing the field via an interface.
func (v *IssueVariant) GetId() string { return v.Id }

// GetSecondaryName returns IssueVariant.SecondaryName, and is useful for accessing the field via an interface.
func (v *IssueVariant) GetSecondaryName() string { return v.SecondaryName }

// GetIssueId returns IssueVariant.IssueId, and is useful for accessing the field via an interface.
func (v *IssueVariant) GetIssueId() string { return v.IssueId }

type IssueVariantInput struct {
	SecondaryName     string         `json:"secondaryName"`
	Description       string         `json:"description"`
	IssueRepositoryId string         `json:"issueRepositoryId"`
	ExternalUrl       string         `json:"externalUrl"`
	IssueId           string         `json:"issueId"`
	Severity          *SeverityInput `json:"severity,omitempty"`
}

// GetSecondaryName returns IssueVariantInput.SecondaryName, and is useful for accessing the field via an interface.
func (v *IssueVariantInput) GetSecondaryName() string { return v.SecondaryName }

// GetDescription returns IssueVariantInput.Description, and is useful for accessing the field via an interface.
func (v *IssueVariantInput) GetDescription() string { return v.Description }

// GetIssueRepositoryId returns IssueVariantInput.IssueRepositoryId, and is useful for accessing the field via an interface.
func (v *IssueVariantInput) GetIssueRepositoryId() string { return v.IssueRepositoryId }

// GetExternalUrl returns IssueVariantInput.ExternalUrl, and is useful for accessing the field via an interface.
func (v *IssueVariantInput) GetExternalUrl() string { return v.ExternalUrl }

// GetIssueId returns IssueVariantInput.IssueId, and is useful for accessing the field via an interface.
func (v *IssueVariantInput) GetIssueId() string { return v.IssueId }

// GetSeverity returns IssueVariantInput.Severity, and is useful for accessing the field via an interface.
func (v *IssueVariantInput) GetSeverity() *SeverityInput { return v.Severity }

type SeverityInput struct {
	Vector string         `json:"vector"`
	Rating SeverityValues `json:"rating"`
}

// GetVector returns SeverityInput.Vector, and is useful for accessing the field via an interface.
func (v *SeverityInput) GetVector() string { return v.Vector }

// GetRating returns SeverityInput.Rating, and is useful for accessing the field via an interface.
func (v *SeverityInput) GetRating() SeverityValues { return v.Rating }

type SeverityValues string

const (
	SeverityValuesNone     SeverityValues = "None"
	SeverityValuesLow      SeverityValues = "Low"
	SeverityValuesMedium   SeverityValues = "Medium"
	SeverityValuesHigh     SeverityValues = "High"
	SeverityValuesCritical SeverityValues = "Critical"
)

var AllSeverityValues = []SeverityValues{
	SeverityValuesNone,
	SeverityValuesLow,
	SeverityValuesMedium,
	SeverityValuesHigh,
	SeverityValuesCritical,
}

type StateFilter string

const (
	StateFilterActive  StateFilter = "Active"
	StateFilterDeleted StateFilter = "Deleted"
)

var AllStateFilter = []StateFilter{
	StateFilterActive,
	StateFilterDeleted,
}

// __CreateIssueInput is used internally by genqlient
type __CreateIssueInput struct {
	Input *IssueInput `json:"input,omitempty"`
}

// GetInput returns __CreateIssueInput.Input, and is useful for accessing the field via an interface.
func (v *__CreateIssueInput) GetInput() *IssueInput { return v.Input }

// __CreateIssueRepositoryInput is used internally by genqlient
type __CreateIssueRepositoryInput struct {
	Input *IssueRepositoryInput `json:"input,omitempty"`
}

// GetInput returns __CreateIssueRepositoryInput.Input, and is useful for accessing the field via an interface.
func (v *__CreateIssueRepositoryInput) GetInput() *IssueRepositoryInput { return v.Input }

// __CreateIssueVariantInput is used internally by genqlient
type __CreateIssueVariantInput struct {
	Input *IssueVariantInput `json:"input,omitempty"`
}

// GetInput returns __CreateIssueVariantInput.Input, and is useful for accessing the field via an interface.
func (v *__CreateIssueVariantInput) GetInput() *IssueVariantInput { return v.Input }

// __GetIssueRepositoriesInput is used internally by genqlient
type __GetIssueRepositoriesInput struct {
	Filter *IssueRepositoryFilter `json:"filter,omitempty"`
}

// GetFilter returns __GetIssueRepositoriesInput.Filter, and is useful for accessing the field via an interface.
func (v *__GetIssueRepositoriesInput) GetFilter() *IssueRepositoryFilter { return v.Filter }

// __GetIssuesInput is used internally by genqlient
type __GetIssuesInput struct {
	Filter *IssueFilter `json:"filter,omitempty"`
}

// GetFilter returns __GetIssuesInput.Filter, and is useful for accessing the field via an interface.
func (v *__GetIssuesInput) GetFilter() *IssueFilter { return v.Filter }

// The mutation executed by CreateIssue.
const CreateIssue_Operation = `
mutation CreateIssue ($input: IssueInput!) {
	createIssue(input: $input) {
		id
		primaryName
		description
		type
	}
}
`

func CreateIssue(
	ctx_ context.Context,
	client_ graphql.Client,
	input *IssueInput,
) (data_ *CreateIssueResponse, err_ error) {
	req_ := &graphql.Request{
		OpName: "CreateIssue",
		Query:  CreateIssue_Operation,
		Variables: &__CreateIssueInput{
			Input: input,
		},
	}

	data_ = &CreateIssueResponse{}
	resp_ := &graphql.Response{Data: data_}

	err_ = client_.MakeRequest(
		ctx_,
		req_,
		resp_,
	)

	return data_, err_
}

// The mutation executed by CreateIssueRepository.
const CreateIssueRepository_Operation = `
mutation CreateIssueRepository ($input: IssueRepositoryInput!) {
	createIssueRepository(input: $input) {
		id
		name
		url
	}
}
`

func CreateIssueRepository(
	ctx_ context.Context,
	client_ graphql.Client,
	input *IssueRepositoryInput,
) (data_ *CreateIssueRepositoryResponse, err_ error) {
	req_ := &graphql.Request{
		OpName: "CreateIssueRepository",
		Query:  CreateIssueRepository_Operation,
		Variables: &__CreateIssueRepositoryInput{
			Input: input,
		},
	}

	data_ = &CreateIssueRepositoryResponse{}
	resp_ := &graphql.Response{Data: data_}

	err_ = client_.MakeRequest(
		ctx_,
		req_,
		resp_,
	)

	return data_, err_
}

// The mutation executed by CreateIssueVariant.
const CreateIssueVariant_Operation = `
mutation CreateIssueVariant ($input: IssueVariantInput!) {
	createIssueVariant(input: $input) {
		id
		secondaryName
		issueId
	}
}
`

func CreateIssueVariant(
	ctx_ context.Context,
	client_ graphql.Client,
	input *IssueVariantInput,
) (data_ *CreateIssueVariantResponse, err_ error) {
	req_ := &graphql.Request{
		OpName: "CreateIssueVariant",
		Query:  CreateIssueVariant_Operation,
		Variables: &__CreateIssueVariantInput{
			Input: input,
		},
	}

	data_ = &CreateIssueVariantResponse{}
	resp_ := &graphql.Response{Data: data_}

	err_ = client_.MakeRequest(
		ctx_,
		req_,
		resp_,
	)

	return data_, err_
}

// The query executed by GetIssueRepositories.
const GetIssueRepositories_Operation = `
query GetIssueRepositories ($filter: IssueRepositoryFilter) {
	IssueRepositories(filter: $filter) {
		totalCount
		edges {
			node {
				id
				name
				url
			}
		}
	}
}
`

func GetIssueRepositories(
	ctx_ context.Context,
	client_ graphql.Client,
	filter *IssueRepositoryFilter,
) (data_ *GetIssueRepositoriesResponse, err_ error) {
	req_ := &graphql.Request{
		OpName: "GetIssueRepositories",
		Query:  GetIssueRepositories_Operation,
		Variables: &__GetIssueRepositoriesInput{
			Filter: filter,
		},
	}

	data_ = &GetIssueRepositoriesResponse{}
	resp_ := &graphql.Response{Data: data_}

	err_ = client_.MakeRequest(
		ctx_,
		req_,
		resp_,
	)

	return data_, err_
}

// The query executed by GetIssues.
const GetIssues_Operation = `
query GetIssues ($filter: IssueFilter) {
	Issues(filter: $filter) {
		totalCount
		edges {
			node {
				id
				primaryName
				description
				type
			}
		}
	}
}
`

func GetIssues(
	ctx_ context.Context,
	client_ graphql.Client,
	filter *IssueFilter,
) (data_ *GetIssuesResponse, err_ error) {
	req_ := &graphql.Request{
		OpName: "GetIssues",
		Query:  GetIssues_Operation,
		Variables: &__GetIssuesInput{
			Filter: filter,
		},
	}

	data_ = &GetIssuesResponse{}
	resp_ := &graphql.Response{Data: data_}

	err_ = client_.MakeRequest(
		ctx_,
		req_,
		resp_,
	)

	return data_, err_
}
