import { Observable } from 'rxjs/Observable' ; import { ProjectId , ScenarioFieldConfigObjectType , ScenarioFieldConfigId , OrganizationId , TaskflowId } from 'teambition-types' ; import { SDK } from '../../SDK' ; import { SDKFetch } from '../../SDKFetch' ; import { TaskScenarioFieldConfigSchema , EventScenarioFieldConfigSchema , ScenarioFieldConfigSchema , ScenarioFieldSchema } from '../../schemas' ; interface BulkAddScenarioFieldConfigsOptions { _taskflowId ? : TaskflowId ; scenariofields ? : Partial < ScenarioFieldSchema > [ ] ; } export function bulkAddScenarioFieldConfigsFetch ( this , projectId , objectType , scenariofieldconfigIds , options ? ) ; export function bulkAddScenarioFieldConfigsFetch ( this , projectId , objectType , scenariofieldconfigIds , options ? ) ; export function bulkAddScenarioFieldConfigsFetch ( this , projectId , objectType , scenariofieldconfigIds , options ? ) ; export function bulkAddScenarioFieldConfigsFetch ( this , projectId , objectType , scenariofieldconfigIds , options = { } ) { return this . post < ScenarioFieldConfigSchema [ ] > ( `projects/${ projectId }/scenariofieldconfigs/bulk` , { objectType , scenariofieldconfigIds , _taskflowId : options . _taskflowId , scenariofields : options . scenariofields } ) ; } declare module '../../SDKFetch' { interface SDKFetch { bulkAddScenarioFieldConfigs : typeof bulkAddScenarioFieldConfigsFetch ; } } SDKFetch . prototype . bulkAddScenarioFieldConfigs = bulkAddScenarioFieldConfigsFetch ; export function bulkAddScenarioFieldConfigs ( this , projectId , objectType , scenariofieldconfigIds , options ? ) ; export function bulkAddScenarioFieldConfigs ( this , projectId , objectType , scenariofieldconfigIds , options ? ) ; export function bulkAddScenarioFieldConfigs ( this , projectId , objectType , scenariofieldconfigIds , options ? ) ; export function bulkAddScenarioFieldConfigs ( this , projectId , objectType , scenariofieldconfigIds , options ? ) { return this . lift ( { tableName : 'ScenarioFieldConfig' , method : 'create' , request : this . fetch . bulkAddScenarioFieldConfigs ( projectId , objectType , scenariofieldconfigIds , options ) } ) ; } declare module '../../SDK' { interface SDK { bulkAddScenarioFieldConfigs : typeof bulkAddScenarioFieldConfigs ; } } SDK . prototype . bulkAddScenarioFieldConfigs = bulkAddScenarioFieldConfigs ; export function createOrgScenarioFieldConfigFetch ( this , orgId , payload ) { const url = `organizations/${ orgId }/scenariofieldconfigs` ; const body = payload ; return this . post < ScenarioFieldConfigSchema > ( url , body ) ; } declare module '../../SDKFetch' { interface SDKFetch { createOrgScenarioFieldConfig : typeof createOrgScenarioFieldConfigFetch ; } } SDKFetch . prototype . createOrgScenarioFieldConfig = createOrgScenarioFieldConfigFetch ; export function createOrgScenarioFieldConfig ( this , orgId , payload ) { return this . lift ( { tableName : 'ScenarioFieldConfig' , method : 'create' , request : this . fetch . createOrgScenarioFieldConfig ( orgId , payload ) } ) ; } declare module '../../SDK' { interface SDK { createOrgScenarioFieldConfig : typeof createOrgScenarioFieldConfig ; } } SDK . prototype . createOrgScenarioFieldConfig = createOrgScenarioFieldConfig ;