import { Observable } from 'rxjs' ; import type { ODataModel } from '../models/model' ; import type { ODataEntity , ODataOptions , ODataSingletonResource , } from '../resources' ; import { ODataEntityService } from './entity' ; /**
 * OData Singleton Service
 * www.odata.org/getting-started/advanced-tutorial/#singleton
 */ export class ODataSingletonService < T > extends ODataEntityService < T > { param key public entity ( ) { return this . client . singleton ( this . name , this . apiNameOrEntityType ) ; } param model public attach < M extends ODataModel < T > > ( model ) { model . attach ( this . entity ( ) ) ; } /**
     * The schema for the singleton.
     */ get singletonSchema ( ) { return this . api . findEntitySetByName ( this . name ) ; } param attrs param etag param options public update ( attrs , options ? ) { const res = this . entity ( ) ; return res . update ( attrs , options ) ; } param attrs param etag param options public patch ( attrs , options ? ) { const res = this . entity ( ) ; return res . modify ( attrs , options ) ; } }