github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/root_resolver.go (about)

     1  package domain
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"net/http"
     7  	"net/url"
     8  
     9  	"github.com/kyma-incubator/compass/components/director/internal/domain/destination"
    10  	"github.com/kyma-incubator/compass/components/director/internal/domain/destination/destinationcreator"
    11  	"github.com/kyma-incubator/compass/components/director/internal/domain/formationconstraint/operators"
    12  
    13  	"github.com/kyma-incubator/compass/components/director/internal/domain/tenantbusinesstype"
    14  
    15  	"github.com/kyma-incubator/compass/components/director/internal/domain/certsubjectmapping"
    16  	"github.com/kyma-incubator/compass/components/director/internal/domain/formationconstraint"
    17  	"github.com/kyma-incubator/compass/components/director/internal/domain/formationtemplateconstraintreferences"
    18  
    19  	databuilder "github.com/kyma-incubator/compass/components/director/internal/domain/webhook/datainputbuilder"
    20  
    21  	"github.com/kyma-incubator/compass/components/director/internal/domain/formationassignment"
    22  
    23  	"github.com/kyma-incubator/compass/components/director/pkg/retry"
    24  	webhookclient "github.com/kyma-incubator/compass/components/director/pkg/webhook_client"
    25  
    26  	"github.com/kyma-incubator/compass/components/director/internal/domain/formationtemplate"
    27  	"github.com/kyma-incubator/compass/components/director/internal/domain/subscription"
    28  
    29  	"github.com/kyma-incubator/compass/components/director/internal/selfregmanager"
    30  
    31  	pkgadapters "github.com/kyma-incubator/compass/components/director/pkg/adapters"
    32  
    33  	"github.com/kyma-incubator/compass/components/director/pkg/model"
    34  
    35  	httptransport "github.com/go-openapi/runtime/client"
    36  	dataloader "github.com/kyma-incubator/compass/components/director/internal/dataloaders"
    37  	"github.com/kyma-incubator/compass/components/director/internal/domain/api"
    38  	"github.com/kyma-incubator/compass/components/director/internal/domain/application"
    39  	"github.com/kyma-incubator/compass/components/director/internal/domain/apptemplate"
    40  	"github.com/kyma-incubator/compass/components/director/internal/domain/auth"
    41  	bundleutil "github.com/kyma-incubator/compass/components/director/internal/domain/bundle"
    42  	"github.com/kyma-incubator/compass/components/director/internal/domain/bundleinstanceauth"
    43  	"github.com/kyma-incubator/compass/components/director/internal/domain/bundlereferences"
    44  	"github.com/kyma-incubator/compass/components/director/internal/domain/document"
    45  	"github.com/kyma-incubator/compass/components/director/internal/domain/eventdef"
    46  	"github.com/kyma-incubator/compass/components/director/internal/domain/eventing"
    47  	"github.com/kyma-incubator/compass/components/director/internal/domain/fetchrequest"
    48  	"github.com/kyma-incubator/compass/components/director/internal/domain/formation"
    49  	"github.com/kyma-incubator/compass/components/director/internal/domain/healthcheck"
    50  	"github.com/kyma-incubator/compass/components/director/internal/domain/integrationsystem"
    51  	"github.com/kyma-incubator/compass/components/director/internal/domain/label"
    52  	"github.com/kyma-incubator/compass/components/director/internal/domain/labeldef"
    53  	"github.com/kyma-incubator/compass/components/director/internal/domain/oauth20"
    54  	"github.com/kyma-incubator/compass/components/director/internal/domain/onetimetoken"
    55  	"github.com/kyma-incubator/compass/components/director/internal/domain/runtime"
    56  	runtimectx "github.com/kyma-incubator/compass/components/director/internal/domain/runtime_context"
    57  	"github.com/kyma-incubator/compass/components/director/internal/domain/scenarioassignment"
    58  	"github.com/kyma-incubator/compass/components/director/internal/domain/spec"
    59  	"github.com/kyma-incubator/compass/components/director/internal/domain/systemauth"
    60  	"github.com/kyma-incubator/compass/components/director/internal/domain/tenant"
    61  	"github.com/kyma-incubator/compass/components/director/internal/domain/version"
    62  	"github.com/kyma-incubator/compass/components/director/internal/domain/viewer"
    63  	"github.com/kyma-incubator/compass/components/director/internal/domain/webhook"
    64  	"github.com/kyma-incubator/compass/components/director/internal/features"
    65  	"github.com/kyma-incubator/compass/components/director/internal/metrics"
    66  	"github.com/kyma-incubator/compass/components/director/internal/uid"
    67  	"github.com/kyma-incubator/compass/components/director/pkg/accessstrategy"
    68  	"github.com/kyma-incubator/compass/components/director/pkg/config"
    69  	"github.com/kyma-incubator/compass/components/director/pkg/consumer"
    70  	"github.com/kyma-incubator/compass/components/director/pkg/graphql"
    71  	httputil "github.com/kyma-incubator/compass/components/director/pkg/http"
    72  	"github.com/kyma-incubator/compass/components/director/pkg/log"
    73  	"github.com/kyma-incubator/compass/components/director/pkg/normalizer"
    74  	"github.com/kyma-incubator/compass/components/director/pkg/persistence"
    75  	"github.com/kyma-incubator/compass/components/director/pkg/time"
    76  	hydraClient "github.com/ory/hydra-client-go/client"
    77  )
    78  
    79  var _ graphql.ResolverRoot = &RootResolver{}
    80  
    81  // RootResolver missing godoc
    82  type RootResolver struct {
    83  	appNameNormalizer   normalizer.Normalizator
    84  	app                 *application.Resolver
    85  	appTemplate         *apptemplate.Resolver
    86  	api                 *api.Resolver
    87  	eventAPI            *eventdef.Resolver
    88  	eventing            *eventing.Resolver
    89  	doc                 *document.Resolver
    90  	formation           *formation.Resolver
    91  	runtime             *runtime.Resolver
    92  	runtimeContext      *runtimectx.Resolver
    93  	healthCheck         *healthcheck.Resolver
    94  	webhook             *webhook.Resolver
    95  	labelDef            *labeldef.Resolver
    96  	token               *onetimetoken.Resolver
    97  	systemAuth          *systemauth.Resolver
    98  	oAuth20             *oauth20.Resolver
    99  	intSys              *integrationsystem.Resolver
   100  	viewer              *viewer.Resolver
   101  	tenant              *tenant.Resolver
   102  	mpBundle            *bundleutil.Resolver
   103  	bundleInstanceAuth  *bundleinstanceauth.Resolver
   104  	scenarioAssignment  *scenarioassignment.Resolver
   105  	subscription        *subscription.Resolver
   106  	formationTemplate   *formationtemplate.Resolver
   107  	formationConstraint *formationconstraint.Resolver
   108  	constraintReference *formationtemplateconstraintreferences.Resolver
   109  	certSubjectMapping  *certsubjectmapping.Resolver
   110  }
   111  
   112  // NewRootResolver missing godoc
   113  func NewRootResolver(
   114  	appNameNormalizer normalizer.Normalizator,
   115  	transact persistence.Transactioner,
   116  	cfgProvider *config.Provider,
   117  	oneTimeTokenCfg onetimetoken.Config,
   118  	oAuth20Cfg oauth20.Config,
   119  	pairingAdapters *pkgadapters.Adapters,
   120  	featuresConfig features.Config,
   121  	metricsCollector *metrics.Collector,
   122  	retryHTTPExecutor *retry.HTTPExecutor,
   123  	httpClient, internalFQDNHTTPClient, internalGatewayHTTPClient, securedHTTPClient, mtlsHTTPClient, extSvcMtlsClient *http.Client,
   124  	selfRegConfig config.SelfRegConfig,
   125  	tokenLength int,
   126  	hydraURL *url.URL,
   127  	accessStrategyExecutorProvider *accessstrategy.Provider,
   128  	subscriptionConfig subscription.Config,
   129  	tenantOnDemandAPIConfig tenant.FetchOnDemandAPIConfig,
   130  	ordWebhookMappings []application.ORDWebhookMapping,
   131  	tenantMappingConfig map[string]interface{},
   132  	callbackURL string,
   133  	appTemplateProductLabel string,
   134  	destinationCreatorConfig *destinationcreator.Config,
   135  ) (*RootResolver, error) {
   136  	timeService := time.NewService()
   137  
   138  	oAuth20HTTPClient := &http.Client{
   139  		Timeout:   oAuth20Cfg.HTTPClientTimeout,
   140  		Transport: httputil.NewCorrelationIDTransport(httputil.NewServiceAccountTokenTransport(httputil.NewHTTPTransportWrapper(http.DefaultTransport.(*http.Transport)))),
   141  	}
   142  
   143  	transport := httptransport.NewWithClient(hydraURL.Host, hydraURL.Path, []string{hydraURL.Scheme}, oAuth20HTTPClient)
   144  	hydra := hydraClient.New(transport, nil)
   145  
   146  	metricsCollector.InstrumentOAuth20HTTPClient(oAuth20HTTPClient)
   147  
   148  	tokenConverter := onetimetoken.NewConverter(oneTimeTokenCfg.LegacyConnectorURL)
   149  	authConverter := auth.NewConverterWithOTT(tokenConverter)
   150  	runtimeContextConverter := runtimectx.NewConverter()
   151  	frConverter := fetchrequest.NewConverter(authConverter)
   152  	versionConverter := version.NewConverter()
   153  	docConverter := document.NewConverter(frConverter)
   154  	webhookConverter := webhook.NewConverter(authConverter)
   155  	specConverter := spec.NewConverter(frConverter)
   156  	apiConverter := api.NewConverter(versionConverter, specConverter)
   157  	eventAPIConverter := eventdef.NewConverter(versionConverter, specConverter)
   158  	labelDefConverter := labeldef.NewConverter()
   159  	labelConverter := label.NewConverter()
   160  	systemAuthConverter := systemauth.NewConverter(authConverter)
   161  	intSysConverter := integrationsystem.NewConverter()
   162  	tenantConverter := tenant.NewConverter()
   163  	bundleConverter := bundleutil.NewConverter(authConverter, apiConverter, eventAPIConverter, docConverter)
   164  	appConverter := application.NewConverter(webhookConverter, bundleConverter)
   165  	appTemplateConverter := apptemplate.NewConverter(appConverter, webhookConverter)
   166  	tenantBusinessTypeConverter := tenantbusinesstype.NewConverter()
   167  	bundleInstanceAuthConv := bundleinstanceauth.NewConverter(authConverter)
   168  	assignmentConv := scenarioassignment.NewConverter()
   169  	bundleReferenceConv := bundlereferences.NewConverter()
   170  	formationConv := formation.NewConverter()
   171  	runtimeConverter := runtime.NewConverter(webhookConverter)
   172  	formationTemplateConverter := formationtemplate.NewConverter(webhookConverter)
   173  	formationAssignmentConv := formationassignment.NewConverter()
   174  	formationConstraintConverter := formationconstraint.NewConverter()
   175  	appTemplateConv := apptemplate.NewConverter(appConverter, webhookConverter)
   176  	constraintReferencesConverter := formationtemplateconstraintreferences.NewConverter()
   177  	certSubjectMappingConv := certsubjectmapping.NewConverter()
   178  	destinationConv := destination.NewConverter()
   179  
   180  	healthcheckRepo := healthcheck.NewRepository()
   181  	runtimeRepo := runtime.NewRepository(runtimeConverter)
   182  	runtimeContextRepo := runtimectx.NewRepository(runtimectx.NewConverter())
   183  	applicationRepo := application.NewRepository(appConverter)
   184  	appTemplateRepo := apptemplate.NewRepository(appTemplateConverter)
   185  	tenantBusinessTypeRepo := tenantbusinesstype.NewRepository(tenantBusinessTypeConverter)
   186  	labelRepo := label.NewRepository(labelConverter)
   187  	labelDefRepo := labeldef.NewRepository(labelDefConverter)
   188  	webhookRepo := webhook.NewRepository(webhookConverter)
   189  	apiRepo := api.NewRepository(apiConverter)
   190  	eventAPIRepo := eventdef.NewRepository(eventAPIConverter)
   191  	specRepo := spec.NewRepository(specConverter)
   192  	docRepo := document.NewRepository(docConverter)
   193  	fetchRequestRepo := fetchrequest.NewRepository(frConverter)
   194  	systemAuthRepo := systemauth.NewRepository(systemAuthConverter)
   195  	intSysRepo := integrationsystem.NewRepository(intSysConverter)
   196  	tenantRepo := tenant.NewRepository(tenantConverter)
   197  	bundleRepo := bundleutil.NewRepository(bundleConverter)
   198  	bundleInstanceAuthRepo := bundleinstanceauth.NewRepository(bundleInstanceAuthConv)
   199  	scenarioAssignmentRepo := scenarioassignment.NewRepository(assignmentConv)
   200  	bundleReferenceRepo := bundlereferences.NewRepository(bundleReferenceConv)
   201  	formationTemplateRepo := formationtemplate.NewRepository(formationTemplateConverter)
   202  	formationRepo := formation.NewRepository(formationConv)
   203  	formationAssignmentRepo := formationassignment.NewRepository(formationAssignmentConv)
   204  	formationConstraintRepo := formationconstraint.NewRepository(formationConstraintConverter)
   205  	constraintReferencesRepo := formationtemplateconstraintreferences.NewRepository(constraintReferencesConverter)
   206  	certSubjectMappingRepo := certsubjectmapping.NewRepository(certSubjectMappingConv)
   207  	destinationRepo := destination.NewRepository(destinationConv)
   208  
   209  	uidSvc := uid.NewService()
   210  	labelSvc := label.NewLabelService(labelRepo, labelDefRepo, uidSvc)
   211  	appTemplateSvc := apptemplate.NewService(appTemplateRepo, webhookRepo, uidSvc, labelSvc, labelRepo, applicationRepo)
   212  	tenantBusinessTypeSvc := tenantbusinesstype.NewService(tenantBusinessTypeRepo, uidSvc)
   213  	labelDefSvc := labeldef.NewService(labelDefRepo, labelRepo, scenarioAssignmentRepo, tenantRepo, uidSvc)
   214  	fetchRequestSvc := fetchrequest.NewServiceWithRetry(fetchRequestRepo, httpClient, accessStrategyExecutorProvider, retryHTTPExecutor)
   215  	specSvc := spec.NewService(specRepo, fetchRequestRepo, uidSvc, fetchRequestSvc)
   216  	bundleReferenceSvc := bundlereferences.NewService(bundleReferenceRepo, uidSvc)
   217  	apiSvc := api.NewService(apiRepo, uidSvc, specSvc, bundleReferenceSvc)
   218  	eventAPISvc := eventdef.NewService(eventAPIRepo, uidSvc, specSvc, bundleReferenceSvc)
   219  	tenantSvc := tenant.NewServiceWithLabels(tenantRepo, uidSvc, labelRepo, labelSvc, tenantConverter)
   220  	webhookSvc := webhook.NewService(webhookRepo, applicationRepo, uidSvc, tenantSvc, tenantMappingConfig, callbackURL)
   221  	docSvc := document.NewService(docRepo, fetchRequestRepo, uidSvc)
   222  	scenarioAssignmentSvc := scenarioassignment.NewService(scenarioAssignmentRepo, labelDefSvc)
   223  	healthCheckSvc := healthcheck.NewService(healthcheckRepo)
   224  	systemAuthSvc := systemauth.NewService(systemAuthRepo, uidSvc)
   225  	oAuth20Svc := oauth20.NewService(cfgProvider, uidSvc, oAuth20Cfg.PublicAccessTokenEndpoint, hydra.Admin)
   226  	intSysSvc := integrationsystem.NewService(intSysRepo, uidSvc)
   227  	eventingSvc := eventing.NewService(appNameNormalizer, runtimeRepo, labelRepo)
   228  	bundleSvc := bundleutil.NewService(bundleRepo, apiSvc, eventAPISvc, docSvc, uidSvc)
   229  	bundleInstanceAuthSvc := bundleinstanceauth.NewService(bundleInstanceAuthRepo, uidSvc)
   230  	webhookClient := webhookclient.NewClient(securedHTTPClient, mtlsHTTPClient, extSvcMtlsClient)
   231  	webhookDataInputBuilder := databuilder.NewWebhookDataInputBuilder(applicationRepo, appTemplateRepo, runtimeRepo, runtimeContextRepo, labelRepo)
   232  	formationConstraintSvc := formationconstraint.NewService(formationConstraintRepo, constraintReferencesRepo, uidSvc, formationConstraintConverter)
   233  	destinationSvc := destination.NewService(mtlsHTTPClient, destinationCreatorConfig, transact, applicationRepo, runtimeRepo, runtimeContextRepo, labelRepo, destinationRepo, tenantRepo, uidSvc)
   234  	constraintEngine := operators.NewConstraintEngine(transact, formationConstraintSvc, tenantSvc, scenarioAssignmentSvc, destinationSvc, formationRepo, labelRepo, labelSvc, applicationRepo, runtimeContextRepo, formationTemplateRepo, formationAssignmentRepo, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
   235  	notificationsBuilder := formation.NewNotificationsBuilder(webhookConverter, constraintEngine, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
   236  	notificationsGenerator := formation.NewNotificationsGenerator(applicationRepo, appTemplateRepo, runtimeRepo, runtimeContextRepo, labelRepo, webhookRepo, webhookDataInputBuilder, notificationsBuilder)
   237  	notificationSvc := formation.NewNotificationService(tenantRepo, webhookClient, notificationsGenerator, constraintEngine, webhookConverter, formationTemplateRepo)
   238  	faNotificationSvc := formationassignment.NewFormationAssignmentNotificationService(formationAssignmentRepo, webhookConverter, webhookRepo, tenantRepo, webhookDataInputBuilder, formationRepo, notificationsBuilder, runtimeContextRepo, labelSvc, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
   239  	formationAssignmentStatusSvc := formationassignment.NewFormationAssignmentStatusService(formationAssignmentRepo, constraintEngine, faNotificationSvc)
   240  	formationAssignmentSvc := formationassignment.NewService(formationAssignmentRepo, uidSvc, applicationRepo, runtimeRepo, runtimeContextRepo, notificationSvc, faNotificationSvc, labelSvc, formationRepo, formationAssignmentStatusSvc, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
   241  	formationStatusSvc := formation.NewFormationStatusService(formationRepo, labelDefRepo, labelDefSvc, notificationSvc, constraintEngine)
   242  	formationSvc := formation.NewService(transact, applicationRepo, labelDefRepo, labelRepo, formationRepo, formationTemplateRepo, labelSvc, uidSvc, labelDefSvc, scenarioAssignmentRepo, scenarioAssignmentSvc, tenantSvc, runtimeRepo, runtimeContextRepo, formationAssignmentSvc, faNotificationSvc, notificationSvc, constraintEngine, webhookRepo, formationStatusSvc, featuresConfig.RuntimeTypeLabelKey, featuresConfig.ApplicationTypeLabelKey)
   243  	appSvc := application.NewService(appNameNormalizer, cfgProvider, applicationRepo, webhookRepo, runtimeRepo, labelRepo, intSysRepo, labelSvc, bundleSvc, uidSvc, formationSvc, selfRegConfig.SelfRegisterDistinguishLabelKey, ordWebhookMappings)
   244  	runtimeContextSvc := runtimectx.NewService(runtimeContextRepo, labelRepo, runtimeRepo, labelSvc, formationSvc, tenantSvc, uidSvc)
   245  	runtimeSvc := runtime.NewService(runtimeRepo, labelRepo, labelSvc, uidSvc, formationSvc, tenantSvc, webhookSvc, runtimeContextSvc, featuresConfig.ProtectedLabelPattern, featuresConfig.ImmutableLabelPattern, featuresConfig.RuntimeTypeLabelKey, featuresConfig.KymaRuntimeTypeLabelValue, featuresConfig.KymaApplicationNamespaceValue)
   246  	tokenSvc := onetimetoken.NewTokenService(systemAuthSvc, appSvc, appConverter, tenantSvc, internalFQDNHTTPClient, onetimetoken.NewTokenGenerator(tokenLength), oneTimeTokenCfg, pairingAdapters, timeService)
   247  	subscriptionSvc := subscription.NewService(runtimeSvc, runtimeContextSvc, tenantSvc, labelSvc, appTemplateSvc, appConverter, appTemplateConv, appSvc, uidSvc, subscriptionConfig.ConsumerSubaccountLabelKey, subscriptionConfig.SubscriptionLabelKey, subscriptionConfig.RuntimeTypeLabelKey, subscriptionConfig.ProviderLabelKey)
   248  	tenantOnDemandSvc := tenant.NewFetchOnDemandService(internalGatewayHTTPClient, tenantOnDemandAPIConfig)
   249  	formationTemplateSvc := formationtemplate.NewService(formationTemplateRepo, uidSvc, formationTemplateConverter, tenantSvc, webhookRepo, webhookSvc)
   250  	constraintReferenceSvc := formationtemplateconstraintreferences.NewService(constraintReferencesRepo, constraintReferencesConverter)
   251  	certSubjectMappingSvc := certsubjectmapping.NewService(certSubjectMappingRepo)
   252  
   253  	selfRegisterManager, err := selfregmanager.NewSelfRegisterManager(selfRegConfig, &selfregmanager.CallerProvider{})
   254  	if err != nil {
   255  		return nil, err
   256  	}
   257  
   258  	return &RootResolver{
   259  		appNameNormalizer:   appNameNormalizer,
   260  		app:                 application.NewResolver(transact, appSvc, webhookSvc, oAuth20Svc, systemAuthSvc, appConverter, webhookConverter, systemAuthConverter, eventingSvc, bundleSvc, bundleConverter, appTemplateSvc, appTemplateConverter, tenantBusinessTypeSvc, tenantBusinessTypeConverter, selfRegConfig.SelfRegisterDistinguishLabelKey, featuresConfig.TokenPrefix),
   261  		appTemplate:         apptemplate.NewResolver(transact, appSvc, appConverter, appTemplateSvc, appTemplateConverter, webhookSvc, webhookConverter, selfRegisterManager, uidSvc, appTemplateProductLabel),
   262  		api:                 api.NewResolver(transact, apiSvc, runtimeSvc, bundleSvc, bundleReferenceSvc, apiConverter, frConverter, specSvc, specConverter, appSvc),
   263  		eventAPI:            eventdef.NewResolver(transact, eventAPISvc, bundleSvc, bundleReferenceSvc, eventAPIConverter, frConverter, specSvc, specConverter),
   264  		eventing:            eventing.NewResolver(transact, eventingSvc, appSvc),
   265  		doc:                 document.NewResolver(transact, docSvc, appSvc, bundleSvc, frConverter),
   266  		formation:           formation.NewResolver(transact, formationSvc, formationConv, formationAssignmentSvc, formationAssignmentConv, tenantOnDemandSvc),
   267  		runtime:             runtime.NewResolver(transact, runtimeSvc, scenarioAssignmentSvc, systemAuthSvc, oAuth20Svc, runtimeConverter, systemAuthConverter, eventingSvc, bundleInstanceAuthSvc, selfRegisterManager, uidSvc, subscriptionSvc, runtimeContextSvc, runtimeContextConverter, webhookSvc, webhookConverter, tenantOnDemandSvc, formationSvc),
   268  		runtimeContext:      runtimectx.NewResolver(transact, runtimeContextSvc, runtimeContextConverter),
   269  		healthCheck:         healthcheck.NewResolver(healthCheckSvc),
   270  		webhook:             webhook.NewResolver(transact, webhookSvc, appSvc, appTemplateSvc, runtimeSvc, formationTemplateSvc, webhookConverter),
   271  		labelDef:            labeldef.NewResolver(transact, labelDefSvc, formationSvc, labelDefConverter),
   272  		token:               onetimetoken.NewTokenResolver(transact, tokenSvc, tokenConverter, oneTimeTokenCfg.SuggestTokenHeaderKey),
   273  		systemAuth:          systemauth.NewResolver(transact, systemAuthSvc, oAuth20Svc, tokenSvc, systemAuthConverter, authConverter),
   274  		oAuth20:             oauth20.NewResolver(transact, oAuth20Svc, appSvc, runtimeSvc, intSysSvc, systemAuthSvc, systemAuthConverter),
   275  		intSys:              integrationsystem.NewResolver(transact, intSysSvc, systemAuthSvc, oAuth20Svc, intSysConverter, systemAuthConverter),
   276  		viewer:              viewer.NewViewerResolver(),
   277  		tenant:              tenant.NewResolver(transact, tenantSvc, tenantConverter, tenantOnDemandSvc),
   278  		mpBundle:            bundleutil.NewResolver(transact, bundleSvc, bundleInstanceAuthSvc, bundleReferenceSvc, apiSvc, eventAPISvc, docSvc, bundleConverter, bundleInstanceAuthConv, apiConverter, eventAPIConverter, docConverter, specSvc, appSvc),
   279  		bundleInstanceAuth:  bundleinstanceauth.NewResolver(transact, bundleInstanceAuthSvc, bundleSvc, bundleInstanceAuthConv, bundleConverter),
   280  		scenarioAssignment:  scenarioassignment.NewResolver(transact, scenarioAssignmentSvc, assignmentConv, tenantSvc),
   281  		subscription:        subscription.NewResolver(transact, subscriptionSvc),
   282  		formationTemplate:   formationtemplate.NewResolver(transact, formationTemplateConverter, formationTemplateSvc, webhookConverter, formationConstraintSvc, formationConstraintConverter),
   283  		formationConstraint: formationconstraint.NewResolver(transact, formationConstraintConverter, formationConstraintSvc),
   284  		constraintReference: formationtemplateconstraintreferences.NewResolver(transact, constraintReferencesConverter, constraintReferenceSvc),
   285  		certSubjectMapping:  certsubjectmapping.NewResolver(transact, certSubjectMappingConv, certSubjectMappingSvc, uidSvc),
   286  	}, nil
   287  }
   288  
   289  // BundlesDataloader missing godoc
   290  func (r *RootResolver) BundlesDataloader(ids []dataloader.ParamBundle) ([]*graphql.BundlePage, []error) {
   291  	return r.app.BundlesDataLoader(ids)
   292  }
   293  
   294  // APIDefinitionsDataloader missing godoc
   295  func (r *RootResolver) APIDefinitionsDataloader(ids []dataloader.ParamAPIDef) ([]*graphql.APIDefinitionPage, []error) {
   296  	return r.mpBundle.APIDefinitionsDataLoader(ids)
   297  }
   298  
   299  // EventDefinitionsDataloader missing godoc
   300  func (r *RootResolver) EventDefinitionsDataloader(ids []dataloader.ParamEventDef) ([]*graphql.EventDefinitionPage, []error) {
   301  	return r.mpBundle.EventDefinitionsDataLoader(ids)
   302  }
   303  
   304  // DocumentsDataloader missing godoc
   305  func (r *RootResolver) DocumentsDataloader(ids []dataloader.ParamDocument) ([]*graphql.DocumentPage, []error) {
   306  	return r.mpBundle.DocumentsDataLoader(ids)
   307  }
   308  
   309  // FetchRequestAPIDefDataloader missing godoc
   310  func (r *RootResolver) FetchRequestAPIDefDataloader(ids []dataloader.ParamFetchRequestAPIDef) ([]*graphql.FetchRequest, []error) {
   311  	return r.api.FetchRequestAPIDefDataLoader(ids)
   312  }
   313  
   314  // FetchRequestEventDefDataloader missing godoc
   315  func (r *RootResolver) FetchRequestEventDefDataloader(ids []dataloader.ParamFetchRequestEventDef) ([]*graphql.FetchRequest, []error) {
   316  	return r.eventAPI.FetchRequestEventDefDataLoader(ids)
   317  }
   318  
   319  // FetchRequestDocumentDataloader missing godoc
   320  func (r *RootResolver) FetchRequestDocumentDataloader(ids []dataloader.ParamFetchRequestDocument) ([]*graphql.FetchRequest, []error) {
   321  	return r.doc.FetchRequestDocumentDataLoader(ids)
   322  }
   323  
   324  // RuntimeContextsDataloader missing godoc
   325  func (r *RootResolver) RuntimeContextsDataloader(ids []dataloader.ParamRuntimeContext) ([]*graphql.RuntimeContextPage, []error) {
   326  	return r.runtime.RuntimeContextsDataLoader(ids)
   327  }
   328  
   329  // FormationAssignmentsDataLoader missing godoc
   330  func (r *RootResolver) FormationAssignmentsDataLoader(ids []dataloader.ParamFormationAssignment) ([]*graphql.FormationAssignmentPage, []error) {
   331  	return r.formation.FormationAssignmentsDataLoader(ids)
   332  }
   333  
   334  // StatusDataLoader is the FormationStatus dataloader used in the graphql API router
   335  func (r *RootResolver) StatusDataLoader(ids []dataloader.ParamFormationStatus) ([]*graphql.FormationStatus, []error) {
   336  	return r.formation.StatusDataLoader(ids)
   337  }
   338  
   339  // FormationConstraintsDataLoader is the FormationConstraint dataloader used in the graphql API router
   340  func (r *RootResolver) FormationConstraintsDataLoader(ids []dataloader.ParamFormationConstraint) ([][]*graphql.FormationConstraint, []error) {
   341  	return r.formationTemplate.FormationConstraintsDataLoader(ids)
   342  }
   343  
   344  // Mutation missing godoc
   345  func (r *RootResolver) Mutation() graphql.MutationResolver {
   346  	return &mutationResolver{r}
   347  }
   348  
   349  // Query missing godoc
   350  func (r *RootResolver) Query() graphql.QueryResolver {
   351  	return &queryResolver{r}
   352  }
   353  
   354  // Application missing godoc
   355  func (r *RootResolver) Application() graphql.ApplicationResolver {
   356  	return &applicationResolver{r}
   357  }
   358  
   359  // ApplicationTemplate missing godoc
   360  func (r *RootResolver) ApplicationTemplate() graphql.ApplicationTemplateResolver {
   361  	return &applicationTemplateResolver{r}
   362  }
   363  
   364  // Runtime missing godoc
   365  func (r *RootResolver) Runtime() graphql.RuntimeResolver {
   366  	return &runtimeResolver{r}
   367  }
   368  
   369  // RuntimeContext missing godoc
   370  func (r *RootResolver) RuntimeContext() graphql.RuntimeContextResolver {
   371  	return &runtimeContextResolver{r}
   372  }
   373  
   374  // Formation missing godoc
   375  func (r *RootResolver) Formation() graphql.FormationResolver {
   376  	return &formationResolver{r}
   377  }
   378  
   379  // APISpec missing godoc
   380  func (r *RootResolver) APISpec() graphql.APISpecResolver {
   381  	return &apiSpecResolver{r}
   382  }
   383  
   384  // Document missing godoc
   385  func (r *RootResolver) Document() graphql.DocumentResolver {
   386  	return &documentResolver{r}
   387  }
   388  
   389  // EventSpec missing godoc
   390  func (r *RootResolver) EventSpec() graphql.EventSpecResolver {
   391  	return &eventSpecResolver{r}
   392  }
   393  
   394  // Bundle missing godoc
   395  func (r *RootResolver) Bundle() graphql.BundleResolver {
   396  	return &BundleResolver{r}
   397  }
   398  
   399  // IntegrationSystem missing godoc
   400  func (r *RootResolver) IntegrationSystem() graphql.IntegrationSystemResolver {
   401  	return &integrationSystemResolver{r}
   402  }
   403  
   404  // OneTimeTokenForApplication missing godoc
   405  func (r *RootResolver) OneTimeTokenForApplication() graphql.OneTimeTokenForApplicationResolver {
   406  	return &oneTimeTokenForApplicationResolver{r}
   407  }
   408  
   409  // OneTimeTokenForRuntime missing godoc
   410  func (r *RootResolver) OneTimeTokenForRuntime() graphql.OneTimeTokenForRuntimeResolver {
   411  	return &oneTimeTokenForRuntimeResolver{r}
   412  }
   413  
   414  // Tenant missing godoc
   415  func (r *RootResolver) Tenant() graphql.TenantResolver {
   416  	return &tenantResolver{r}
   417  }
   418  
   419  type queryResolver struct {
   420  	*RootResolver
   421  }
   422  
   423  func (r *queryResolver) FormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error) {
   424  	return r.formationConstraint.FormationConstraint(ctx, id)
   425  }
   426  
   427  func (r *queryResolver) FormationConstraints(ctx context.Context) ([]*graphql.FormationConstraint, error) {
   428  	return r.formationConstraint.FormationConstraints(ctx)
   429  }
   430  
   431  func (r *queryResolver) FormationConstraintsByFormationType(ctx context.Context, formationTemplateID string) ([]*graphql.FormationConstraint, error) {
   432  	return r.formationConstraint.FormationConstraintsByFormationType(ctx, formationTemplateID)
   433  }
   434  
   435  func (r *queryResolver) Formation(ctx context.Context, id string) (*graphql.Formation, error) {
   436  	return r.formation.Formation(ctx, id)
   437  }
   438  
   439  // FormationByName returns a formation retrieved by name
   440  func (r *queryResolver) FormationByName(ctx context.Context, name string) (*graphql.Formation, error) {
   441  	return r.formation.FormationByName(ctx, name)
   442  }
   443  
   444  func (r *queryResolver) Formations(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.FormationPage, error) {
   445  	return r.formation.Formations(ctx, first, after)
   446  }
   447  
   448  func (r *queryResolver) FormationTemplate(ctx context.Context, id string) (*graphql.FormationTemplate, error) {
   449  	return r.formationTemplate.FormationTemplate(ctx, id)
   450  }
   451  
   452  func (r *queryResolver) FormationTemplates(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.FormationTemplatePage, error) {
   453  	return r.formationTemplate.FormationTemplates(ctx, first, after)
   454  }
   455  
   456  // Viewer missing godoc
   457  func (r *queryResolver) Viewer(ctx context.Context) (*graphql.Viewer, error) {
   458  	return r.viewer.Viewer(ctx)
   459  }
   460  
   461  // ApisForApplication resolves to APIDefinition page for a given application ID
   462  func (r *queryResolver) ApisForApplication(ctx context.Context, appID string, first *int, after *graphql.PageCursor) (*graphql.APIDefinitionPage, error) {
   463  	return r.api.APIDefinitionsForApplication(ctx, appID, first, after)
   464  }
   465  
   466  // EventsForApplication resolves to EventDefinition page for a given application ID
   467  func (r *queryResolver) EventsForApplication(ctx context.Context, appID string, first *int, after *graphql.PageCursor) (*graphql.EventDefinitionPage, error) {
   468  	return r.eventAPI.EventDefinitionsForApplication(ctx, appID, first, after)
   469  }
   470  
   471  // Applications missing godoc
   472  func (r *queryResolver) Applications(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationPage, error) {
   473  	consumerInfo, err := consumer.LoadFromContext(ctx)
   474  	if err != nil {
   475  		return nil, err
   476  	}
   477  
   478  	if consumerInfo.ConsumerType == consumer.Runtime {
   479  		log.C(ctx).Debugf("Consumer type is of type %v. Filtering response based on scenarios...", consumer.Runtime)
   480  		return r.app.ApplicationsForRuntime(ctx, consumerInfo.ConsumerID, first, after)
   481  	}
   482  
   483  	return r.app.Applications(ctx, filter, first, after)
   484  }
   485  
   486  // Application missing godoc
   487  func (r *queryResolver) Application(ctx context.Context, id string) (*graphql.Application, error) {
   488  	return r.app.Application(ctx, id)
   489  }
   490  
   491  // ApplicationBySystemNumber returns an application retrieved by systemNumber
   492  func (r *queryResolver) ApplicationBySystemNumber(ctx context.Context, systemNumber string) (*graphql.Application, error) {
   493  	return r.app.ApplicationBySystemNumber(ctx, systemNumber)
   494  }
   495  
   496  // ApplicationTemplates missing godoc
   497  func (r *queryResolver) ApplicationTemplates(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationTemplatePage, error) {
   498  	return r.appTemplate.ApplicationTemplates(ctx, filter, first, after)
   499  }
   500  
   501  // ApplicationTemplate missing godoc
   502  func (r *queryResolver) ApplicationTemplate(ctx context.Context, id string) (*graphql.ApplicationTemplate, error) {
   503  	return r.appTemplate.ApplicationTemplate(ctx, id)
   504  }
   505  
   506  // ApplicationsForRuntime missing godoc
   507  func (r *queryResolver) ApplicationsForRuntime(ctx context.Context, runtimeID string, first *int, after *graphql.PageCursor) (*graphql.ApplicationPage, error) {
   508  	apps, err := r.app.ApplicationsForRuntime(ctx, runtimeID, first, after)
   509  	if err != nil {
   510  		return nil, err
   511  	}
   512  
   513  	labels, err := r.runtime.GetLabel(ctx, runtimeID, runtime.IsNormalizedLabel)
   514  	if err != nil {
   515  		return nil, err
   516  	}
   517  
   518  	shouldNormalize := true
   519  	if labels != nil {
   520  		labelsMap := (map[string]interface{})(*labels)
   521  		shouldNormalize = labelsMap[runtime.IsNormalizedLabel] == nil || labelsMap[runtime.IsNormalizedLabel] == "true"
   522  	}
   523  
   524  	if shouldNormalize {
   525  		for i := range apps.Data {
   526  			apps.Data[i].Name = r.appNameNormalizer.Normalize(apps.Data[i].Name)
   527  		}
   528  	}
   529  	for i := range apps.Data {
   530  		if apps.Data[i].SystemNumber != nil {
   531  			apps.Data[i].Name = fmt.Sprintf("%s-%s", apps.Data[i].Name, *apps.Data[i].SystemNumber)
   532  		}
   533  	}
   534  
   535  	return apps, nil
   536  }
   537  
   538  // Runtimes missing godoc
   539  func (r *queryResolver) Runtimes(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.RuntimePage, error) {
   540  	return r.runtime.Runtimes(ctx, filter, first, after)
   541  }
   542  
   543  // Runtime missing godoc
   544  func (r *queryResolver) Runtime(ctx context.Context, id string) (*graphql.Runtime, error) {
   545  	return r.runtime.Runtime(ctx, id)
   546  }
   547  
   548  // RuntimeByTokenIssuer missing godoc
   549  func (r *queryResolver) RuntimeByTokenIssuer(ctx context.Context, issuer string) (*graphql.Runtime, error) {
   550  	return r.runtime.RuntimeByTokenIssuer(ctx, issuer)
   551  }
   552  
   553  // LabelDefinitions missing godoc
   554  func (r *queryResolver) LabelDefinitions(ctx context.Context) ([]*graphql.LabelDefinition, error) {
   555  	return r.labelDef.LabelDefinitions(ctx)
   556  }
   557  
   558  // LabelDefinition missing godoc
   559  func (r *queryResolver) LabelDefinition(ctx context.Context, key string) (*graphql.LabelDefinition, error) {
   560  	return r.labelDef.LabelDefinition(ctx, key)
   561  }
   562  
   563  // BundleByInstanceAuth missing godoc
   564  func (r *queryResolver) BundleByInstanceAuth(ctx context.Context, authID string) (*graphql.Bundle, error) {
   565  	return r.bundleInstanceAuth.BundleByInstanceAuth(ctx, authID)
   566  }
   567  
   568  // BundleInstanceAuth missing godoc
   569  func (r *queryResolver) BundleInstanceAuth(ctx context.Context, id string) (*graphql.BundleInstanceAuth, error) {
   570  	return r.bundleInstanceAuth.BundleInstanceAuth(ctx, id)
   571  }
   572  
   573  // HealthChecks missing godoc
   574  func (r *queryResolver) HealthChecks(ctx context.Context, types []graphql.HealthCheckType, origin *string, first *int, after *graphql.PageCursor) (*graphql.HealthCheckPage, error) {
   575  	return r.healthCheck.HealthChecks(ctx, types, origin, first, after)
   576  }
   577  
   578  // IntegrationSystems missing godoc
   579  func (r *queryResolver) IntegrationSystems(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.IntegrationSystemPage, error) {
   580  	return r.intSys.IntegrationSystems(ctx, first, after)
   581  }
   582  
   583  // IntegrationSystem missing godoc
   584  func (r *queryResolver) IntegrationSystem(ctx context.Context, id string) (*graphql.IntegrationSystem, error) {
   585  	return r.intSys.IntegrationSystem(ctx, id)
   586  }
   587  
   588  // Tenants fetches tenants by page and search term
   589  func (r *queryResolver) Tenants(ctx context.Context, first *int, after *graphql.PageCursor, searchTerm *string) (*graphql.TenantPage, error) {
   590  	return r.tenant.Tenants(ctx, first, after, searchTerm)
   591  }
   592  
   593  // AutomaticScenarioAssignmentForScenario missing godoc
   594  func (r *queryResolver) AutomaticScenarioAssignmentForScenario(ctx context.Context, scenarioName string) (*graphql.AutomaticScenarioAssignment, error) {
   595  	return r.scenarioAssignment.GetAutomaticScenarioAssignmentForScenarioName(ctx, scenarioName)
   596  }
   597  
   598  // AutomaticScenarioAssignmentsForSelector missing godoc
   599  func (r *queryResolver) AutomaticScenarioAssignmentsForSelector(ctx context.Context, selector graphql.LabelSelectorInput) ([]*graphql.AutomaticScenarioAssignment, error) {
   600  	return r.scenarioAssignment.AutomaticScenarioAssignmentsForSelector(ctx, selector)
   601  }
   602  
   603  // AutomaticScenarioAssignments missing godoc
   604  func (r *queryResolver) AutomaticScenarioAssignments(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.AutomaticScenarioAssignmentPage, error) {
   605  	return r.scenarioAssignment.AutomaticScenarioAssignments(ctx, first, after)
   606  }
   607  
   608  // SystemAuth missing godoc
   609  func (r *queryResolver) SystemAuth(ctx context.Context, id string) (graphql.SystemAuth, error) {
   610  	return r.systemAuth.SystemAuth(ctx, id)
   611  }
   612  
   613  // SystemAuthByToken missing godoc
   614  func (r *queryResolver) SystemAuthByToken(ctx context.Context, id string) (graphql.SystemAuth, error) {
   615  	return r.systemAuth.SystemAuthByToken(ctx, id)
   616  }
   617  
   618  func (r *queryResolver) CertificateSubjectMapping(ctx context.Context, id string) (*graphql.CertificateSubjectMapping, error) {
   619  	return r.certSubjectMapping.CertificateSubjectMapping(ctx, id)
   620  }
   621  
   622  func (r *queryResolver) CertificateSubjectMappings(ctx context.Context, first *int, after *graphql.PageCursor) (*graphql.CertificateSubjectMappingPage, error) {
   623  	return r.certSubjectMapping.CertificateSubjectMappings(ctx, first, after)
   624  }
   625  
   626  type mutationResolver struct {
   627  	*RootResolver
   628  }
   629  
   630  func (r *mutationResolver) AddTenantAccess(ctx context.Context, in graphql.TenantAccessInput) (*graphql.TenantAccess, error) {
   631  	return r.tenant.AddTenantAccess(ctx, in)
   632  }
   633  
   634  func (r *mutationResolver) RemoveTenantAccess(ctx context.Context, tenantID string, resourceID string, resourceType graphql.TenantAccessObjectType) (*graphql.TenantAccess, error) {
   635  	return r.tenant.RemoveTenantAccess(ctx, tenantID, resourceID, resourceType)
   636  }
   637  
   638  func (r *mutationResolver) UpdateFormationConstraint(ctx context.Context, id string, in graphql.FormationConstraintUpdateInput) (*graphql.FormationConstraint, error) {
   639  	return r.formationConstraint.UpdateFormationConstraint(ctx, id, in)
   640  }
   641  
   642  func (r *mutationResolver) ResynchronizeFormationNotifications(ctx context.Context, formationID string) (*graphql.Formation, error) {
   643  	return r.formation.ResynchronizeFormationNotifications(ctx, formationID)
   644  }
   645  
   646  func (r *mutationResolver) AttachConstraintToFormationTemplate(ctx context.Context, constraintID string, formationTemplateID string) (*graphql.ConstraintReference, error) {
   647  	return r.constraintReference.AttachConstraintToFormationTemplate(ctx, constraintID, formationTemplateID)
   648  }
   649  
   650  func (r *mutationResolver) DetachConstraintFromFormationTemplate(ctx context.Context, constraintID string, formationTemplateID string) (*graphql.ConstraintReference, error) {
   651  	return r.constraintReference.DetachConstraintFromFormationTemplate(ctx, constraintID, formationTemplateID)
   652  }
   653  
   654  func (r *mutationResolver) CreateFormationConstraint(ctx context.Context, formationConstraint graphql.FormationConstraintInput) (*graphql.FormationConstraint, error) {
   655  	return r.formationConstraint.CreateFormationConstraint(ctx, formationConstraint)
   656  }
   657  
   658  func (r *mutationResolver) DeleteFormationConstraint(ctx context.Context, id string) (*graphql.FormationConstraint, error) {
   659  	return r.formationConstraint.DeleteFormationConstraint(ctx, id)
   660  }
   661  
   662  func (r *mutationResolver) CreateFormationTemplate(ctx context.Context, in graphql.FormationTemplateInput) (*graphql.FormationTemplate, error) {
   663  	return r.formationTemplate.CreateFormationTemplate(ctx, in)
   664  }
   665  
   666  func (r *mutationResolver) DeleteFormationTemplate(ctx context.Context, id string) (*graphql.FormationTemplate, error) {
   667  	return r.formationTemplate.DeleteFormationTemplate(ctx, id)
   668  }
   669  
   670  func (r *mutationResolver) UpdateFormationTemplate(ctx context.Context, id string, in graphql.FormationTemplateInput) (*graphql.FormationTemplate, error) {
   671  	return r.formationTemplate.UpdateFormationTemplate(ctx, id, in)
   672  }
   673  
   674  func (r *mutationResolver) AssignFormation(ctx context.Context, objectID string, objectType graphql.FormationObjectType, formation graphql.FormationInput) (*graphql.Formation, error) {
   675  	return r.formation.AssignFormation(ctx, objectID, objectType, formation)
   676  }
   677  
   678  func (r *mutationResolver) UnassignFormation(ctx context.Context, objectID string, objectType graphql.FormationObjectType, formation graphql.FormationInput) (*graphql.Formation, error) {
   679  	return r.formation.UnassignFormation(ctx, objectID, objectType, formation)
   680  }
   681  
   682  func (r *mutationResolver) CreateFormation(ctx context.Context, formationInput graphql.FormationInput) (*graphql.Formation, error) {
   683  	return r.formation.CreateFormation(ctx, formationInput)
   684  }
   685  
   686  func (r *mutationResolver) DeleteFormation(ctx context.Context, formation graphql.FormationInput) (*graphql.Formation, error) {
   687  	return r.formation.DeleteFormation(ctx, formation)
   688  }
   689  
   690  // RegisterApplication missing godoc
   691  func (r *mutationResolver) RegisterApplication(ctx context.Context, in graphql.ApplicationRegisterInput, _ *graphql.OperationMode) (*graphql.Application, error) {
   692  	return r.app.RegisterApplication(ctx, in)
   693  }
   694  
   695  // UpdateApplication missing godoc
   696  func (r *mutationResolver) UpdateApplication(ctx context.Context, id string, in graphql.ApplicationUpdateInput) (*graphql.Application, error) {
   697  	return r.app.UpdateApplication(ctx, id, in)
   698  }
   699  
   700  // UnregisterApplication missing godoc
   701  func (r *mutationResolver) UnregisterApplication(ctx context.Context, id string, _ *graphql.OperationMode) (*graphql.Application, error) {
   702  	return r.app.UnregisterApplication(ctx, id)
   703  }
   704  
   705  // UnpairApplication removes system auths, hydra client credentials and performs the "unpair" flow in the database
   706  func (r *mutationResolver) UnpairApplication(ctx context.Context, id string, _ *graphql.OperationMode) (*graphql.Application, error) {
   707  	return r.app.UnpairApplication(ctx, id)
   708  }
   709  
   710  // MergeApplications Merges properties from Source Application into Destination Application, provided that the Destination's
   711  // Application does not have a value set for a given property. Then the Source Application is being deleted.
   712  func (r *mutationResolver) MergeApplications(ctx context.Context, destID, srcID string) (*graphql.Application, error) {
   713  	return r.app.MergeApplications(ctx, destID, srcID)
   714  }
   715  
   716  // CreateApplicationTemplate missing godoc
   717  func (r *mutationResolver) CreateApplicationTemplate(ctx context.Context, in graphql.ApplicationTemplateInput) (*graphql.ApplicationTemplate, error) {
   718  	return r.appTemplate.CreateApplicationTemplate(ctx, in)
   719  }
   720  
   721  // RegisterApplicationFromTemplate missing godoc
   722  func (r *mutationResolver) RegisterApplicationFromTemplate(ctx context.Context, in graphql.ApplicationFromTemplateInput) (*graphql.Application, error) {
   723  	return r.appTemplate.RegisterApplicationFromTemplate(ctx, in)
   724  }
   725  
   726  // UpdateApplicationTemplate missing godoc
   727  func (r *mutationResolver) UpdateApplicationTemplate(ctx context.Context, id string, in graphql.ApplicationTemplateUpdateInput) (*graphql.ApplicationTemplate, error) {
   728  	return r.appTemplate.UpdateApplicationTemplate(ctx, id, in)
   729  }
   730  
   731  // DeleteApplicationTemplate missing godoc
   732  func (r *mutationResolver) DeleteApplicationTemplate(ctx context.Context, id string) (*graphql.ApplicationTemplate, error) {
   733  	return r.appTemplate.DeleteApplicationTemplate(ctx, id)
   734  }
   735  
   736  // AddWebhook missing godoc
   737  func (r *mutationResolver) AddWebhook(ctx context.Context, applicationID *string, applicationTemplateID *string, runtimeID *string, formationTemplateID *string, in graphql.WebhookInput) (*graphql.Webhook, error) {
   738  	return r.webhook.AddWebhook(ctx, applicationID, applicationTemplateID, runtimeID, formationTemplateID, in)
   739  }
   740  
   741  // UpdateWebhook missing godoc
   742  func (r *mutationResolver) UpdateWebhook(ctx context.Context, webhookID string, in graphql.WebhookInput) (*graphql.Webhook, error) {
   743  	return r.webhook.UpdateWebhook(ctx, webhookID, in)
   744  }
   745  
   746  // DeleteWebhook missing godoc
   747  func (r *mutationResolver) DeleteWebhook(ctx context.Context, webhookID string) (*graphql.Webhook, error) {
   748  	return r.webhook.DeleteWebhook(ctx, webhookID)
   749  }
   750  
   751  // UpdateAPIDefinition missing godoc
   752  func (r *mutationResolver) UpdateAPIDefinition(ctx context.Context, id string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error) {
   753  	return r.api.UpdateAPIDefinition(ctx, id, in)
   754  }
   755  
   756  // UpdateAPIDefinitionForApplication updates an API Definition for a given application ID
   757  func (r *mutationResolver) UpdateAPIDefinitionForApplication(ctx context.Context, id string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error) {
   758  	return r.api.UpdateAPIDefinitionForApplication(ctx, id, in)
   759  }
   760  
   761  // DeleteAPIDefinition missing godoc
   762  func (r *mutationResolver) DeleteAPIDefinition(ctx context.Context, id string) (*graphql.APIDefinition, error) {
   763  	return r.api.DeleteAPIDefinition(ctx, id)
   764  }
   765  
   766  // RefetchAPISpec missing godoc
   767  func (r *mutationResolver) RefetchAPISpec(ctx context.Context, apiID string) (*graphql.APISpec, error) {
   768  	return r.api.RefetchAPISpec(ctx, apiID)
   769  }
   770  
   771  // UpdateEventDefinition missing godoc
   772  func (r *mutationResolver) UpdateEventDefinition(ctx context.Context, id string, in graphql.EventDefinitionInput) (*graphql.EventDefinition, error) {
   773  	return r.eventAPI.UpdateEventDefinition(ctx, id, in)
   774  }
   775  
   776  // UpdateEventDefinitionForApplication updates an Event Definition for a given application ID
   777  func (r *mutationResolver) UpdateEventDefinitionForApplication(ctx context.Context, id string, in graphql.EventDefinitionInput) (*graphql.EventDefinition, error) {
   778  	return r.eventAPI.UpdateEventDefinitionForApplication(ctx, id, in)
   779  }
   780  
   781  // DeleteEventDefinition missing godoc
   782  func (r *mutationResolver) DeleteEventDefinition(ctx context.Context, id string) (*graphql.EventDefinition, error) {
   783  	return r.eventAPI.DeleteEventDefinition(ctx, id)
   784  }
   785  
   786  // RefetchEventDefinitionSpec missing godoc
   787  func (r *mutationResolver) RefetchEventDefinitionSpec(ctx context.Context, eventID string) (*graphql.EventSpec, error) {
   788  	return r.eventAPI.RefetchEventDefinitionSpec(ctx, eventID)
   789  }
   790  
   791  // RegisterRuntime missing godoc
   792  func (r *mutationResolver) RegisterRuntime(ctx context.Context, in graphql.RuntimeRegisterInput) (*graphql.Runtime, error) {
   793  	return r.runtime.RegisterRuntime(ctx, in)
   794  }
   795  
   796  // UpdateRuntime missing godoc
   797  func (r *mutationResolver) UpdateRuntime(ctx context.Context, id string, in graphql.RuntimeUpdateInput) (*graphql.Runtime, error) {
   798  	return r.runtime.UpdateRuntime(ctx, id, in)
   799  }
   800  
   801  // UnregisterRuntime missing godoc
   802  func (r *mutationResolver) UnregisterRuntime(ctx context.Context, id string) (*graphql.Runtime, error) {
   803  	return r.runtime.DeleteRuntime(ctx, id)
   804  }
   805  
   806  // RegisterRuntimeContext missing godoc
   807  func (r *mutationResolver) RegisterRuntimeContext(ctx context.Context, runtimeID string, in graphql.RuntimeContextInput) (*graphql.RuntimeContext, error) {
   808  	return r.runtimeContext.RegisterRuntimeContext(ctx, runtimeID, in)
   809  }
   810  
   811  // UpdateRuntimeContext missing godoc
   812  func (r *mutationResolver) UpdateRuntimeContext(ctx context.Context, id string, in graphql.RuntimeContextInput) (*graphql.RuntimeContext, error) {
   813  	return r.runtimeContext.UpdateRuntimeContext(ctx, id, in)
   814  }
   815  
   816  // UnregisterRuntimeContext missing godoc
   817  func (r *mutationResolver) UnregisterRuntimeContext(ctx context.Context, id string) (*graphql.RuntimeContext, error) {
   818  	return r.runtimeContext.DeleteRuntimeContext(ctx, id)
   819  }
   820  
   821  // DeleteDocument missing godoc
   822  func (r *mutationResolver) DeleteDocument(ctx context.Context, id string) (*graphql.Document, error) {
   823  	return r.doc.DeleteDocument(ctx, id)
   824  }
   825  
   826  // CreateLabelDefinition missing godoc
   827  func (r *mutationResolver) CreateLabelDefinition(ctx context.Context, in graphql.LabelDefinitionInput) (*graphql.LabelDefinition, error) {
   828  	return r.labelDef.CreateLabelDefinition(ctx, in)
   829  }
   830  
   831  // UpdateLabelDefinition missing godoc
   832  func (r *mutationResolver) UpdateLabelDefinition(ctx context.Context, in graphql.LabelDefinitionInput) (*graphql.LabelDefinition, error) {
   833  	return r.labelDef.UpdateLabelDefinition(ctx, in)
   834  }
   835  
   836  // SetApplicationLabel missing godoc
   837  func (r *mutationResolver) SetApplicationLabel(ctx context.Context, applicationID string, key string, value interface{}) (*graphql.Label, error) {
   838  	return r.app.SetApplicationLabel(ctx, applicationID, key, value)
   839  }
   840  
   841  // DeleteApplicationLabel missing godoc
   842  func (r *mutationResolver) DeleteApplicationLabel(ctx context.Context, applicationID string, key string) (*graphql.Label, error) {
   843  	return r.app.DeleteApplicationLabel(ctx, applicationID, key)
   844  }
   845  
   846  // SetRuntimeLabel missing godoc
   847  func (r *mutationResolver) SetRuntimeLabel(ctx context.Context, runtimeID string, key string, value interface{}) (*graphql.Label, error) {
   848  	return r.runtime.SetRuntimeLabel(ctx, runtimeID, key, value)
   849  }
   850  
   851  // DeleteRuntimeLabel missing godoc
   852  func (r *mutationResolver) DeleteRuntimeLabel(ctx context.Context, runtimeID string, key string) (*graphql.Label, error) {
   853  	return r.runtime.DeleteRuntimeLabel(ctx, runtimeID, key)
   854  }
   855  
   856  // RequestOneTimeTokenForApplication missing godoc
   857  func (r *mutationResolver) RequestOneTimeTokenForApplication(ctx context.Context, id string, systemAuthID *string) (*graphql.OneTimeTokenForApplication, error) {
   858  	return r.token.RequestOneTimeTokenForApplication(ctx, id, systemAuthID)
   859  }
   860  
   861  // RequestOneTimeTokenForRuntime missing godoc
   862  func (r *mutationResolver) RequestOneTimeTokenForRuntime(ctx context.Context, id string, systemAuthID *string) (*graphql.OneTimeTokenForRuntime, error) {
   863  	return r.token.RequestOneTimeTokenForRuntime(ctx, id, systemAuthID)
   864  }
   865  
   866  // RequestClientCredentialsForRuntime missing godoc
   867  func (r *mutationResolver) RequestClientCredentialsForRuntime(ctx context.Context, id string) (graphql.SystemAuth, error) {
   868  	return r.oAuth20.RequestClientCredentialsForRuntime(ctx, id)
   869  }
   870  
   871  // RequestClientCredentialsForApplication missing godoc
   872  func (r *mutationResolver) RequestClientCredentialsForApplication(ctx context.Context, id string) (graphql.SystemAuth, error) {
   873  	return r.oAuth20.RequestClientCredentialsForApplication(ctx, id)
   874  }
   875  
   876  // RequestClientCredentialsForIntegrationSystem missing godoc
   877  func (r *mutationResolver) RequestClientCredentialsForIntegrationSystem(ctx context.Context, id string) (graphql.SystemAuth, error) {
   878  	return r.oAuth20.RequestClientCredentialsForIntegrationSystem(ctx, id)
   879  }
   880  
   881  // DeleteSystemAuthForRuntime missing godoc
   882  func (r *mutationResolver) DeleteSystemAuthForRuntime(ctx context.Context, authID string) (graphql.SystemAuth, error) {
   883  	fn := r.systemAuth.GenericDeleteSystemAuth(model.RuntimeReference)
   884  	return fn(ctx, authID)
   885  }
   886  
   887  // DeleteSystemAuthForApplication missing godoc
   888  func (r *mutationResolver) DeleteSystemAuthForApplication(ctx context.Context, authID string) (graphql.SystemAuth, error) {
   889  	fn := r.systemAuth.GenericDeleteSystemAuth(model.ApplicationReference)
   890  	return fn(ctx, authID)
   891  }
   892  
   893  // DeleteSystemAuthForIntegrationSystem missing godoc
   894  func (r *mutationResolver) DeleteSystemAuthForIntegrationSystem(ctx context.Context, authID string) (graphql.SystemAuth, error) {
   895  	fn := r.systemAuth.GenericDeleteSystemAuth(model.IntegrationSystemReference)
   896  	return fn(ctx, authID)
   897  }
   898  
   899  // UpdateSystemAuth missing godoc
   900  func (r *mutationResolver) UpdateSystemAuth(ctx context.Context, authID string, in graphql.AuthInput) (graphql.SystemAuth, error) {
   901  	return r.systemAuth.UpdateSystemAuth(ctx, authID, in)
   902  }
   903  
   904  // InvalidateSystemAuthOneTimeToken missing godoc
   905  func (r *mutationResolver) InvalidateSystemAuthOneTimeToken(ctx context.Context, authID string) (graphql.SystemAuth, error) {
   906  	return r.systemAuth.InvalidateSystemAuthOneTimeToken(ctx, authID)
   907  }
   908  
   909  // RegisterIntegrationSystem missing godoc
   910  func (r *mutationResolver) RegisterIntegrationSystem(ctx context.Context, in graphql.IntegrationSystemInput) (*graphql.IntegrationSystem, error) {
   911  	return r.intSys.RegisterIntegrationSystem(ctx, in)
   912  }
   913  
   914  // UpdateIntegrationSystem missing godoc
   915  func (r *mutationResolver) UpdateIntegrationSystem(ctx context.Context, id string, in graphql.IntegrationSystemInput) (*graphql.IntegrationSystem, error) {
   916  	return r.intSys.UpdateIntegrationSystem(ctx, id, in)
   917  }
   918  
   919  // UnregisterIntegrationSystem missing godoc
   920  func (r *mutationResolver) UnregisterIntegrationSystem(ctx context.Context, id string) (*graphql.IntegrationSystem, error) {
   921  	return r.intSys.UnregisterIntegrationSystem(ctx, id)
   922  }
   923  
   924  // SetDefaultEventingForApplication missing godoc
   925  func (r *mutationResolver) SetDefaultEventingForApplication(ctx context.Context, appID string, runtimeID string) (*graphql.ApplicationEventingConfiguration, error) {
   926  	return r.eventing.SetEventingForApplication(ctx, appID, runtimeID)
   927  }
   928  
   929  // DeleteDefaultEventingForApplication missing godoc
   930  func (r *mutationResolver) DeleteDefaultEventingForApplication(ctx context.Context, appID string) (*graphql.ApplicationEventingConfiguration, error) {
   931  	return r.eventing.UnsetEventingForApplication(ctx, appID)
   932  }
   933  
   934  // AddAPIDefinitionToBundle missing godoc
   935  func (r *mutationResolver) AddAPIDefinitionToBundle(ctx context.Context, bundleID string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error) {
   936  	return r.api.AddAPIDefinitionToBundle(ctx, bundleID, in)
   937  }
   938  
   939  // AddAPIDefinitionToApplication adds an API Definition to a given application ID
   940  func (r *mutationResolver) AddAPIDefinitionToApplication(ctx context.Context, appID string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error) {
   941  	return r.api.AddAPIDefinitionToApplication(ctx, appID, in)
   942  }
   943  
   944  // AddEventDefinitionToBundle missing godoc
   945  func (r *mutationResolver) AddEventDefinitionToBundle(ctx context.Context, bundleID string, in graphql.EventDefinitionInput) (*graphql.EventDefinition, error) {
   946  	return r.eventAPI.AddEventDefinitionToBundle(ctx, bundleID, in)
   947  }
   948  
   949  // AddEventDefinitionToApplication adds an Event Definition to a given application ID
   950  func (r *mutationResolver) AddEventDefinitionToApplication(ctx context.Context, appID string, in graphql.EventDefinitionInput) (*graphql.EventDefinition, error) {
   951  	return r.eventAPI.AddEventDefinitionToApplication(ctx, appID, in)
   952  }
   953  
   954  // AddDocumentToBundle missing godoc
   955  func (r *mutationResolver) AddDocumentToBundle(ctx context.Context, bundleID string, in graphql.DocumentInput) (*graphql.Document, error) {
   956  	return r.doc.AddDocumentToBundle(ctx, bundleID, in)
   957  }
   958  
   959  // SetBundleInstanceAuth missing godoc
   960  func (r *mutationResolver) SetBundleInstanceAuth(ctx context.Context, authID string, in graphql.BundleInstanceAuthSetInput) (*graphql.BundleInstanceAuth, error) {
   961  	return r.bundleInstanceAuth.SetBundleInstanceAuth(ctx, authID, in)
   962  }
   963  
   964  // DeleteBundleInstanceAuth missing godoc
   965  func (r *mutationResolver) DeleteBundleInstanceAuth(ctx context.Context, authID string) (*graphql.BundleInstanceAuth, error) {
   966  	return r.bundleInstanceAuth.DeleteBundleInstanceAuth(ctx, authID)
   967  }
   968  
   969  // RequestBundleInstanceAuthCreation missing godoc
   970  func (r *mutationResolver) RequestBundleInstanceAuthCreation(ctx context.Context, bundleID string, in graphql.BundleInstanceAuthRequestInput) (*graphql.BundleInstanceAuth, error) {
   971  	return r.bundleInstanceAuth.RequestBundleInstanceAuthCreation(ctx, bundleID, in)
   972  }
   973  
   974  // RequestBundleInstanceAuthDeletion missing godoc
   975  func (r *mutationResolver) RequestBundleInstanceAuthDeletion(ctx context.Context, authID string) (*graphql.BundleInstanceAuth, error) {
   976  	return r.bundleInstanceAuth.RequestBundleInstanceAuthDeletion(ctx, authID)
   977  }
   978  
   979  // CreateBundleInstanceAuth creates graphql.BundleInstanceAuth from a given input for a bundle with id - bundleID
   980  func (r *mutationResolver) CreateBundleInstanceAuth(ctx context.Context, bundleID string, in graphql.BundleInstanceAuthCreateInput) (*graphql.BundleInstanceAuth, error) {
   981  	return r.bundleInstanceAuth.CreateBundleInstanceAuth(ctx, bundleID, in)
   982  }
   983  
   984  // UpdateBundleInstanceAuth updates graphql.BundleInstanceAuth with id from a given input for a bundle with id - bundleID
   985  func (r *mutationResolver) UpdateBundleInstanceAuth(ctx context.Context, id string, bundleID string, in graphql.BundleInstanceAuthUpdateInput) (*graphql.BundleInstanceAuth, error) {
   986  	return r.bundleInstanceAuth.UpdateBundleInstanceAuth(ctx, id, bundleID, in)
   987  }
   988  
   989  // AddBundle missing godoc
   990  func (r *mutationResolver) AddBundle(ctx context.Context, applicationID string, in graphql.BundleCreateInput) (*graphql.Bundle, error) {
   991  	return r.mpBundle.AddBundle(ctx, applicationID, in)
   992  }
   993  
   994  // UpdateBundle missing godoc
   995  func (r *mutationResolver) UpdateBundle(ctx context.Context, id string, in graphql.BundleUpdateInput) (*graphql.Bundle, error) {
   996  	return r.mpBundle.UpdateBundle(ctx, id, in)
   997  }
   998  
   999  // DeleteBundle missing godoc
  1000  func (r *mutationResolver) DeleteBundle(ctx context.Context, id string) (*graphql.Bundle, error) {
  1001  	return r.mpBundle.DeleteBundle(ctx, id)
  1002  }
  1003  
  1004  // WriteTenants creates tenants of type customer, account, subaccount, organization, folder, or resource-group
  1005  func (r *mutationResolver) WriteTenants(ctx context.Context, in []*graphql.BusinessTenantMappingInput) ([]string, error) {
  1006  	return r.tenant.Write(ctx, in)
  1007  }
  1008  
  1009  // WriteTenant creates tenant of type customer, account, subaccount, organization, folder, or resource-group
  1010  func (r *mutationResolver) WriteTenant(ctx context.Context, in graphql.BusinessTenantMappingInput) (string, error) {
  1011  	return r.tenant.WriteSingle(ctx, in)
  1012  }
  1013  
  1014  // DeleteTenants deletes multiple tenants by external tenant id
  1015  func (r *mutationResolver) DeleteTenants(ctx context.Context, in []string) (int, error) {
  1016  	return r.tenant.Delete(ctx, in)
  1017  }
  1018  
  1019  // SubscribeTenant subscribes given tenant
  1020  func (r *mutationResolver) SubscribeTenant(ctx context.Context, providerID, subaccountID, providerSubaccountID, consumerTenantID, region, subscriptionAppName string, subscriptionPayload string) (bool, error) {
  1021  	return r.subscription.SubscribeTenant(ctx, providerID, subaccountID, providerSubaccountID, consumerTenantID, region, subscriptionAppName, subscriptionPayload)
  1022  }
  1023  
  1024  // UnsubscribeTenant unsubscribes given tenant
  1025  func (r *mutationResolver) UnsubscribeTenant(ctx context.Context, providerID, subaccountID, providerSubaccountID, consumerTenantID, region string) (bool, error) {
  1026  	return r.subscription.UnsubscribeTenant(ctx, providerID, subaccountID, providerSubaccountID, consumerTenantID, region)
  1027  }
  1028  
  1029  func (r *mutationResolver) UpdateTenant(ctx context.Context, id string, in graphql.BusinessTenantMappingInput) (*graphql.Tenant, error) {
  1030  	return r.tenant.Update(ctx, id, in)
  1031  }
  1032  
  1033  func (r *mutationResolver) CreateCertificateSubjectMapping(ctx context.Context, in graphql.CertificateSubjectMappingInput) (*graphql.CertificateSubjectMapping, error) {
  1034  	return r.certSubjectMapping.CreateCertificateSubjectMapping(ctx, in)
  1035  }
  1036  
  1037  func (r *mutationResolver) UpdateCertificateSubjectMapping(ctx context.Context, id string, in graphql.CertificateSubjectMappingInput) (*graphql.CertificateSubjectMapping, error) {
  1038  	return r.certSubjectMapping.UpdateCertificateSubjectMapping(ctx, id, in)
  1039  }
  1040  
  1041  func (r *mutationResolver) DeleteCertificateSubjectMapping(ctx context.Context, id string) (*graphql.CertificateSubjectMapping, error) {
  1042  	return r.certSubjectMapping.DeleteCertificateSubjectMapping(ctx, id)
  1043  }
  1044  
  1045  type applicationResolver struct {
  1046  	*RootResolver
  1047  }
  1048  
  1049  // Auths missing godoc
  1050  func (r *applicationResolver) Auths(ctx context.Context, obj *graphql.Application) ([]*graphql.AppSystemAuth, error) {
  1051  	return r.app.Auths(ctx, obj)
  1052  }
  1053  
  1054  // Labels missing godoc
  1055  func (r *applicationResolver) Labels(ctx context.Context, obj *graphql.Application, key *string) (graphql.Labels, error) {
  1056  	return r.app.Labels(ctx, obj, key)
  1057  }
  1058  
  1059  // Webhooks missing godoc
  1060  func (r *applicationResolver) Webhooks(ctx context.Context, obj *graphql.Application) ([]*graphql.Webhook, error) {
  1061  	return r.app.Webhooks(ctx, obj)
  1062  }
  1063  
  1064  // EventingConfiguration missing godoc
  1065  func (r *applicationResolver) EventingConfiguration(ctx context.Context, obj *graphql.Application) (*graphql.ApplicationEventingConfiguration, error) {
  1066  	return r.app.EventingConfiguration(ctx, obj)
  1067  }
  1068  
  1069  // Bundles missing godoc
  1070  func (r *applicationResolver) Bundles(ctx context.Context, obj *graphql.Application, first *int, after *graphql.PageCursor) (*graphql.BundlePage, error) {
  1071  	return r.app.Bundles(ctx, obj, first, after)
  1072  }
  1073  
  1074  // Bundle missing godoc
  1075  func (r *applicationResolver) Bundle(ctx context.Context, obj *graphql.Application, id string) (*graphql.Bundle, error) {
  1076  	return r.app.Bundle(ctx, obj, id)
  1077  }
  1078  
  1079  // ApplicationTemplate resolves application template for application object
  1080  func (r *applicationResolver) ApplicationTemplate(ctx context.Context, obj *graphql.Application) (*graphql.ApplicationTemplate, error) {
  1081  	return r.app.ApplicationTemplate(ctx, obj)
  1082  }
  1083  
  1084  // TenantBusinessType resolves tenant business type for application object
  1085  func (r *applicationResolver) TenantBusinessType(ctx context.Context, obj *graphql.Application) (*graphql.TenantBusinessType, error) {
  1086  	return r.app.TenantBusinessType(ctx, obj)
  1087  }
  1088  
  1089  type applicationTemplateResolver struct {
  1090  	*RootResolver
  1091  }
  1092  
  1093  // Webhooks missing godoc
  1094  func (r applicationTemplateResolver) Webhooks(ctx context.Context, obj *graphql.ApplicationTemplate) ([]*graphql.Webhook, error) {
  1095  	return r.appTemplate.Webhooks(ctx, obj)
  1096  }
  1097  
  1098  // Labels missing godoc
  1099  func (r applicationTemplateResolver) Labels(ctx context.Context, obj *graphql.ApplicationTemplate, key *string) (graphql.Labels, error) {
  1100  	return r.appTemplate.Labels(ctx, obj, key)
  1101  }
  1102  
  1103  type formationTemplateResolver struct {
  1104  	*RootResolver
  1105  }
  1106  
  1107  // FormationTemplate represents the resolver for Formation Template
  1108  func (r *RootResolver) FormationTemplate() graphql.FormationTemplateResolver {
  1109  	return &formationTemplateResolver{r}
  1110  }
  1111  
  1112  // Webhooks missing godoc
  1113  func (r *formationTemplateResolver) Webhooks(ctx context.Context, obj *graphql.FormationTemplate) ([]*graphql.Webhook, error) {
  1114  	return r.formationTemplate.Webhooks(ctx, obj)
  1115  }
  1116  
  1117  // FormationConstraints missing godoc
  1118  func (r *formationTemplateResolver) FormationConstraints(ctx context.Context, obj *graphql.FormationTemplate) ([]*graphql.FormationConstraint, error) {
  1119  	return r.formationTemplate.FormationConstraint(ctx, obj)
  1120  }
  1121  
  1122  type runtimeResolver struct {
  1123  	*RootResolver
  1124  }
  1125  
  1126  func (r *runtimeResolver) Webhooks(ctx context.Context, obj *graphql.Runtime) ([]*graphql.Webhook, error) {
  1127  	return r.runtime.Webhooks(ctx, obj)
  1128  }
  1129  
  1130  // Labels missing godoc
  1131  func (r *runtimeResolver) Labels(ctx context.Context, obj *graphql.Runtime, key *string) (graphql.Labels, error) {
  1132  	return r.runtime.Labels(ctx, obj, key)
  1133  }
  1134  
  1135  // Auths missing godoc
  1136  func (r *runtimeResolver) Auths(ctx context.Context, obj *graphql.Runtime) ([]*graphql.RuntimeSystemAuth, error) {
  1137  	return r.runtime.Auths(ctx, obj)
  1138  }
  1139  
  1140  // EventingConfiguration missing godoc
  1141  func (r *runtimeResolver) EventingConfiguration(ctx context.Context, obj *graphql.Runtime) (*graphql.RuntimeEventingConfiguration, error) {
  1142  	return r.runtime.EventingConfiguration(ctx, obj)
  1143  }
  1144  
  1145  // RuntimeContexts missing godoc
  1146  func (r *runtimeResolver) RuntimeContexts(ctx context.Context, obj *graphql.Runtime, first *int, after *graphql.PageCursor) (*graphql.RuntimeContextPage, error) {
  1147  	return r.runtime.RuntimeContexts(ctx, obj, first, after)
  1148  }
  1149  
  1150  // RuntimeContext missing godoc
  1151  func (r *runtimeResolver) RuntimeContext(ctx context.Context, obj *graphql.Runtime, id string) (*graphql.RuntimeContext, error) {
  1152  	return r.runtime.RuntimeContext(ctx, obj, id)
  1153  }
  1154  
  1155  type apiSpecResolver struct{ *RootResolver }
  1156  
  1157  // FetchRequest missing godoc
  1158  func (r *apiSpecResolver) FetchRequest(ctx context.Context, obj *graphql.APISpec) (*graphql.FetchRequest, error) {
  1159  	return r.api.FetchRequest(ctx, obj)
  1160  }
  1161  
  1162  type documentResolver struct{ *RootResolver }
  1163  
  1164  // FetchRequest missing godoc
  1165  func (r *documentResolver) FetchRequest(ctx context.Context, obj *graphql.Document) (*graphql.FetchRequest, error) {
  1166  	return r.doc.FetchRequest(ctx, obj)
  1167  }
  1168  
  1169  type eventSpecResolver struct{ *RootResolver }
  1170  
  1171  // FetchRequest missing godoc
  1172  func (r *eventSpecResolver) FetchRequest(ctx context.Context, obj *graphql.EventSpec) (*graphql.FetchRequest, error) {
  1173  	return r.eventAPI.FetchRequest(ctx, obj)
  1174  }
  1175  
  1176  type integrationSystemResolver struct{ *RootResolver }
  1177  
  1178  // Auths missing godoc
  1179  func (r *integrationSystemResolver) Auths(ctx context.Context, obj *graphql.IntegrationSystem) ([]*graphql.IntSysSystemAuth, error) {
  1180  	return r.intSys.Auths(ctx, obj)
  1181  }
  1182  
  1183  type oneTimeTokenForApplicationResolver struct{ *RootResolver }
  1184  
  1185  // RawEncoded missing godoc
  1186  func (r *oneTimeTokenForApplicationResolver) RawEncoded(ctx context.Context, obj *graphql.OneTimeTokenForApplication) (*string, error) {
  1187  	return r.token.RawEncoded(ctx, &obj.TokenWithURL)
  1188  }
  1189  
  1190  // Raw missing godoc
  1191  func (r *oneTimeTokenForApplicationResolver) Raw(ctx context.Context, obj *graphql.OneTimeTokenForApplication) (*string, error) {
  1192  	return r.token.Raw(ctx, &obj.TokenWithURL)
  1193  }
  1194  
  1195  type oneTimeTokenForRuntimeResolver struct{ *RootResolver }
  1196  
  1197  // RawEncoded missing godoc
  1198  func (r *oneTimeTokenForRuntimeResolver) RawEncoded(ctx context.Context, obj *graphql.OneTimeTokenForRuntime) (*string, error) {
  1199  	return r.token.RawEncoded(ctx, &obj.TokenWithURL)
  1200  }
  1201  
  1202  // Raw missing godoc
  1203  func (r *oneTimeTokenForRuntimeResolver) Raw(ctx context.Context, obj *graphql.OneTimeTokenForRuntime) (*string, error) {
  1204  	return r.token.Raw(ctx, &obj.TokenWithURL)
  1205  }
  1206  
  1207  type runtimeContextResolver struct {
  1208  	*RootResolver
  1209  }
  1210  
  1211  // Labels missing godoc
  1212  func (r *runtimeContextResolver) Labels(ctx context.Context, obj *graphql.RuntimeContext, key *string) (graphql.Labels, error) {
  1213  	return r.runtimeContext.Labels(ctx, obj, key)
  1214  }
  1215  
  1216  type formationResolver struct {
  1217  	*RootResolver
  1218  }
  1219  
  1220  // FormationAssignment missing godoc
  1221  func (r *formationResolver) FormationAssignment(ctx context.Context, obj *graphql.Formation, id string) (*graphql.FormationAssignment, error) {
  1222  	return r.formation.FormationAssignment(ctx, obj, id)
  1223  }
  1224  
  1225  // FormationAssignments missing godoc
  1226  func (r *formationResolver) FormationAssignments(ctx context.Context, obj *graphql.Formation, first *int, after *graphql.PageCursor) (*graphql.FormationAssignmentPage, error) {
  1227  	return r.formation.FormationAssignments(ctx, obj, first, after)
  1228  }
  1229  
  1230  // Status missing godoc
  1231  func (r *formationResolver) Status(ctx context.Context, obj *graphql.Formation) (*graphql.FormationStatus, error) {
  1232  	return r.formation.Status(ctx, obj)
  1233  }
  1234  
  1235  // BundleResolver missing godoc
  1236  type BundleResolver struct{ *RootResolver }
  1237  
  1238  // CorrelationIDs missing godoc
  1239  func (r *BundleResolver) CorrelationIDs(_ context.Context, obj *graphql.Bundle) ([]string, error) {
  1240  	return obj.CorrelationIDs, nil
  1241  }
  1242  
  1243  // InstanceAuth missing godoc
  1244  func (r *BundleResolver) InstanceAuth(ctx context.Context, obj *graphql.Bundle, id string) (*graphql.BundleInstanceAuth, error) {
  1245  	return r.mpBundle.InstanceAuth(ctx, obj, id)
  1246  }
  1247  
  1248  // InstanceAuths missing godoc
  1249  func (r *BundleResolver) InstanceAuths(ctx context.Context, obj *graphql.Bundle) ([]*graphql.BundleInstanceAuth, error) {
  1250  	return r.mpBundle.InstanceAuths(ctx, obj)
  1251  }
  1252  
  1253  // APIDefinitions missing godoc
  1254  func (r *BundleResolver) APIDefinitions(ctx context.Context, obj *graphql.Bundle, group *string, first *int, after *graphql.PageCursor) (*graphql.APIDefinitionPage, error) {
  1255  	return r.mpBundle.APIDefinitions(ctx, obj, group, first, after)
  1256  }
  1257  
  1258  // EventDefinitions missing godoc
  1259  func (r *BundleResolver) EventDefinitions(ctx context.Context, obj *graphql.Bundle, group *string, first *int, after *graphql.PageCursor) (*graphql.EventDefinitionPage, error) {
  1260  	return r.mpBundle.EventDefinitions(ctx, obj, group, first, after)
  1261  }
  1262  
  1263  // Documents missing godoc
  1264  func (r *BundleResolver) Documents(ctx context.Context, obj *graphql.Bundle, first *int, after *graphql.PageCursor) (*graphql.DocumentPage, error) {
  1265  	return r.mpBundle.Documents(ctx, obj, first, after)
  1266  }
  1267  
  1268  // APIDefinition missing godoc
  1269  func (r *BundleResolver) APIDefinition(ctx context.Context, obj *graphql.Bundle, id string) (*graphql.APIDefinition, error) {
  1270  	return r.mpBundle.APIDefinition(ctx, obj, id)
  1271  }
  1272  
  1273  // EventDefinition missing godoc
  1274  func (r *BundleResolver) EventDefinition(ctx context.Context, obj *graphql.Bundle, id string) (*graphql.EventDefinition, error) {
  1275  	return r.mpBundle.EventDefinition(ctx, obj, id)
  1276  }
  1277  
  1278  // Document missing godoc
  1279  func (r *BundleResolver) Document(ctx context.Context, obj *graphql.Bundle, id string) (*graphql.Document, error) {
  1280  	return r.mpBundle.Document(ctx, obj, id)
  1281  }
  1282  
  1283  type tenantResolver struct {
  1284  	*RootResolver
  1285  }
  1286  
  1287  // Labels missing godoc
  1288  func (r *tenantResolver) Labels(ctx context.Context, obj *graphql.Tenant, key *string) (graphql.Labels, error) {
  1289  	return r.tenant.Labels(ctx, obj, key)
  1290  }
  1291  
  1292  // TenantByExternalID returns a tenant by external ID
  1293  func (r *queryResolver) TenantByExternalID(ctx context.Context, id string) (*graphql.Tenant, error) {
  1294  	return r.tenant.Tenant(ctx, id)
  1295  }
  1296  
  1297  // TenantByInternalID returns a tenant by an internal ID
  1298  func (r *queryResolver) TenantByInternalID(ctx context.Context, id string) (*graphql.Tenant, error) {
  1299  	return r.tenant.TenantByID(ctx, id)
  1300  }
  1301  
  1302  // TenantByLowestOwnerForResource returns the lowest tenant in the hierarchy that is owner of a given resource.
  1303  func (r *queryResolver) TenantByLowestOwnerForResource(ctx context.Context, resource, objectID string) (string, error) {
  1304  	return r.tenant.TenantByLowestOwnerForResource(ctx, resource, objectID)
  1305  }