package resolver

// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen

import (
	"context"

	"github.com/cloudoperators/heureka/internal/api/graphql/graph"
	"github.com/cloudoperators/heureka/internal/api/graphql/graph/baseResolver"
	"github.com/cloudoperators/heureka/internal/api/graphql/graph/model"
)

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

func (r *serviceResolver) Owners(ctx context.Context, obj *model.Service, filter *model.UserFilter, first *int, after *string) (*model.UserConnection, error) {
	return baseResolver.UserBaseResolver(r.App, ctx, filter, first, after,
		&model.NodeParent{
			Parent:     obj,
			ParentName: model.ServiceNodeName,
		})
}

func (r *serviceResolver) SupportGroups(ctx context.Context, obj *model.Service, filter *model.SupportGroupFilter, first *int, after *string, orderBy []*model.SupportGroupOrderBy) (*model.SupportGroupConnection, error) {
	return baseResolver.SupportGroupBaseResolver(r.App, ctx, filter, first, after, orderBy,
		&model.NodeParent{
			Parent:     obj,
			ParentName: model.ServiceNodeName,
		})
}

func (r *serviceResolver) Activities(ctx context.Context, obj *model.Service, filter *model.ActivityFilter, first *int, after *string) (*model.ActivityConnection, error) {
	return baseResolver.ActivityBaseResolver(r.App, ctx, filter, first, after,
		&model.NodeParent{
			Parent:     obj,
			ParentName: model.ServiceNodeName,
		})
}

func (r *serviceResolver) IssueRepositories(ctx context.Context, obj *model.Service, filter *model.IssueRepositoryFilter, first *int, after *string) (*model.IssueRepositoryConnection, error) {
	return baseResolver.IssueRepositoryBaseResolver(r.App, ctx, filter, first, after,
		&model.NodeParent{
			Parent:     obj,
			ParentName: model.ServiceNodeName,
		})
}

func (r *serviceResolver) ComponentInstances(ctx context.Context, obj *model.Service, filter *model.ComponentInstanceFilter, first *int, after *string, orderBy []*model.ComponentInstanceOrderBy) (*model.ComponentInstanceConnection, error) {
	return baseResolver.ComponentInstanceBaseResolver(r.App, ctx, filter, first, after, orderBy,
		&model.NodeParent{
			Parent:     obj,
			ParentName: model.ServiceNodeName,
		})
}

func (r *serviceResolver) IssueMatches(ctx context.Context, obj *model.Service, filter *model.IssueMatchFilter, first *int, after *string, orderBy []*model.IssueMatchOrderBy) (*model.IssueMatchConnection, error) {
	return baseResolver.IssueMatchBaseResolver(r.App, ctx, filter, first, after, orderBy, &model.NodeParent{
		Parent:     obj,
		ParentName: model.ServiceNodeName,
	})
}

func (r *serviceResolver) IssueCounts(ctx context.Context, obj *model.Service, filter *model.IssueFilter) (*model.SeverityCounts, error) {
	return baseResolver.IssueCountsBaseResolver(r.App, ctx, filter, &model.NodeParent{
		Parent:     obj,
		ParentName: model.ServiceNodeName,
	})
}

func (r *Resolver) Service() graph.ServiceResolver { return &serviceResolver{r} }

type serviceResolver struct{ *Resolver }
