import { inject, Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';

import { isPresent } from 'app/core/util/operators';
import { ApplicationConfigService } from 'app/core/config/application-config.service';
import { ResilientService } from 'app/resilient/resilient-base/resilient-base.service';
import { createRequestOption } from 'app/core/request/request-util';
import { ISecurityResource, NewSecurityResource } from '../security-resource.model';

export type PartialUpdateSecurityGroup = Partial<ISecurityResource> & Pick<ISecurityResource, 'id'>;

export type EntityResponseType = HttpResponse<ISecurityResource>;
export type EntityArrayResponseType = HttpResponse<ISecurityResource[]>;

@Injectable({ providedIn: 'root' })
export class SecurityResourceService extends ResilientService<ISecurityResource, NewSecurityResource> {
  protected applicationConfigService = inject(ApplicationConfigService);

  private resourceUrl = this.applicationConfigService.getEndpointFor('api/security/resources');
  getResourceUrl(): string { return this.resourceUrl; }
  
}
