package com.l7tech.external.assertions.gatewaygraphql.server.resolver.mutation;

import com.l7tech.external.assertions.gatewaygraphql.EntityTypeInfo;
import com.l7tech.external.assertions.gatewaygraphql.server.data.InternalWebApiServiceDTO;
import com.l7tech.external.assertions.gatewaygraphql.server.data.WebApiServiceDTO;
import graphql.schema.DataFetchingEnvironment;
import java.util.List;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import lombok.Generated;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.transaction.PlatformTransactionManager;

@Deprecated
public class InternalWebApiServiceMutationResolver extends BasicGraphQLMutationResolver {
   @Generated
   private static final Logger b = Logger.getLogger(InternalWebApiServiceMutationResolver.class.getName());
   private final WebApiServiceMutationResolver c;

   public InternalWebApiServiceMutationResolver(PlatformTransactionManager var1, BeanFactory var2) {
      super(EntityTypeInfo.INTERNAL_WEB_API_SERVICE, var1);
      this.c = new b(this, EntityTypeInfo.INTERNAL_WEB_API_SERVICE, var1, var2);
   }

   @Override
   protected Logger getLogger() {
      return b;
   }

   public InternalWebApiServiceDTO.InternalWebApiServicesPayload setInternalWebApiServices(
      List<WebApiServiceDTO.WebApiServiceInput> var1, DataFetchingEnvironment var2
   ) {
      return this.a(this.c.setWebApiServices(var1, var2));
   }

   public InternalWebApiServiceDTO.InternalWebApiServicesPayload deleteInternalWebApiServices(List<String> var1, DataFetchingEnvironment var2) {
      return this.a(this.c.deleteWebApiServices(var1, var2));
   }

   private InternalWebApiServiceDTO.InternalWebApiServicesPayload a(WebApiServiceDTO.WebApiServicesPayload var1) {
      InternalWebApiServiceDTO.InternalWebApiServicesPayload var2 = new InternalWebApiServiceDTO.InternalWebApiServicesPayload();
      var2.addAll(var1.getDetailedStatus(), var1.getItems().stream().map(InternalWebApiServiceDTO.class::cast).collect(Collectors.toList()));
      return var2;
   }
}
