...

Source file src/edge-infra.dev/pkg/edge/api/graph/resolver/log_classifications_labels_queries.resolvers.go

Documentation: edge-infra.dev/pkg/edge/api/graph/resolver

     1  package resolver
     2  
     3  // This file will be automatically regenerated based on the schema, any resolver implementations
     4  // will be copied through when generating and any unknown code will be moved to the end.
     5  // Code generated by github.com/99designs/gqlgen version v0.17.45
     6  
     7  import (
     8  	"context"
     9  	"fmt"
    10  
    11  	"edge-infra.dev/pkg/edge/api/graph/model"
    12  )
    13  
    14  // CreateLogClassificationLabel is the resolver for the createLogClassificationLabel field.
    15  func (r *mutationResolver) CreateLogClassificationLabel(ctx context.Context, logClassificationEdgeID string, labelEdgeID string) (string, error) {
    16  	created, err := r.LogClassificationLabelsService.CreateLogClassificationLabel(ctx, "", logClassificationEdgeID, labelEdgeID)
    17  	if err != nil {
    18  		return "", fmt.Errorf("Error Creating Log Classification Label: %s", err.Error())
    19  	}
    20  	return created, nil
    21  }
    22  
    23  // DeleteLogClassificationLabel is the resolver for the deleteLogClassificationLabel field.
    24  func (r *mutationResolver) DeleteLogClassificationLabel(ctx context.Context, logClassificationLabelEdgeID string, logClassificationEdgeID string, labelEdgeID string) (bool, error) {
    25  	wasDeleted, err := r.LogClassificationLabelsService.DeleteLogClassificationLabel(ctx, logClassificationLabelEdgeID, logClassificationEdgeID, labelEdgeID)
    26  	if err != nil {
    27  		return false, fmt.Errorf("Error Deleting Log Classification Label: %s", err.Error())
    28  	}
    29  
    30  	return wasDeleted, nil
    31  }
    32  
    33  // UpdateLogClassificationLabel is the resolver for the updateLogClassificationLabel field.
    34  func (r *mutationResolver) UpdateLogClassificationLabel(ctx context.Context, logClassificationEdgeID string, labelEdgeID string) (string, error) {
    35  	updated, err := r.LogClassificationLabelsService.UpdateLogClassificationLabel(ctx, logClassificationEdgeID, labelEdgeID)
    36  	if err != nil {
    37  		return "", fmt.Errorf("Error Updating Log Classification Label: %s", err.Error())
    38  	}
    39  	return updated, nil
    40  }
    41  
    42  // GetLogClassificationLabel is the resolver for the getLogClassificationLabel field.
    43  func (r *queryResolver) GetLogClassificationLabel(ctx context.Context, logClassificationLabelEdgeID string, logClassificationEdgeID string, labelEdgeID string) (*model.LogClassificationLabel, error) {
    44  	logClassificationLabel, err := r.LogClassificationLabelsService.GetLogClassificationLabel(ctx, logClassificationLabelEdgeID, logClassificationEdgeID, labelEdgeID)
    45  	if err != nil {
    46  		return nil, fmt.Errorf("Error Getting Log Classification Label: %s", err.Error())
    47  	}
    48  	return logClassificationLabel, nil
    49  }
    50  
    51  // GetLogClassificationLabelsByLabel is the resolver for the getLogClassificationLabelsByLabel field.
    52  func (r *queryResolver) GetLogClassificationLabelsByLabel(ctx context.Context, labelEdgeID string) ([]*model.LogClassificationLabel, error) {
    53  	logClassificationLabels, err := r.LogClassificationLabelsService.GetLogClassificationLabelsByLabel(ctx, labelEdgeID)
    54  	if err != nil {
    55  		return nil, fmt.Errorf("Error Getting Log Classification Label: %s", err.Error())
    56  	}
    57  	return logClassificationLabels, nil
    58  }
    59  
    60  // GetLogClassificationLabelsByBanner is the resolver for the getLogClassificationLabelsByBanner field.
    61  func (r *queryResolver) GetLogClassificationLabelsByBanner(ctx context.Context, bannerEdgeID string) ([]*model.LogClassificationLabel, error) {
    62  	logClassificationLabels, err := r.LogClassificationLabelsService.GetLogClassificationLabelsByBanner(ctx, bannerEdgeID)
    63  	if err != nil {
    64  		return nil, fmt.Errorf("Error Getting Log Classification Label: %s", err.Error())
    65  	}
    66  	return logClassificationLabels, nil
    67  }
    68  

View as plain text