import { EntityApi , EntityBase } from '../entity-base' ; import { ODataUri } from '../uri-conversion' ; import { Link } from '../selectable' ; import { DeSerializers } from '../de-serializers' ; import { ODataRequestConfig } from './odata-request-config' ; typeparam internal export class ODataCreateRequestConfig < EntityT extends EntityBase , DeSerializersT extends DeSerializers > extends ODataRequestConfig { /**
     * Keys of the parent of the entity to create. Defined only when attempting to create child entities.
     */ parentKeys : Record < string , any > ; /**
     * Field that links the parent entity class to the child entity class.
     */ childField : Link < EntityBase , DeSerializersT , EntityT > ; param entityApi param oDataUri constructor ( readonly entityApi , private oDataUri ) { super ( 'post' , entityApi . entityConstructor . _defaultServicePath ) ; } resourcePath ( ) { return this . parentKeys === undefined ? this . entityApi . entityConstructor . _entityName : this . resourcePathAsChild ( ) ; } queryParameters ( ) { return this . prependDollarToQueryParameters ( { } ) ; } protected resourcePathAsChild ( ) { return ( this . oDataUri . getResourcePathForKeys ( this . parentKeys , this . childField . _entityApi ) + '/' + this . childField . _fieldName ) ; } }