ibm-cloud-sdk-core
Version:
Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.
86 lines (40 loc) • 1.23 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) > [BaseService](./ibm-cloud-sdk-core.baseservice.md) > [convertModel](./ibm-cloud-sdk-core.baseservice.convertmodel.md)
## BaseService.convertModel() method
Applies a given modifier function on a model object. Since the model object can be a map, or an array, or a model, these types needs different handling. Considering whether the input object is a map happens with an explicit parameter.
**Signature:**
```typescript
static convertModel(input: any, converterFn: any, isMap?: boolean): any;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
input
</td><td>
any
</td><td>
the input model object
</td></tr>
<tr><td>
converterFn
</td><td>
any
</td><td>
the function that is applied on the input object
</td></tr>
<tr><td>
isMap
</td><td>
boolean
</td><td>
_(Optional)_ is `true` when the input object should be handled as a map
</td></tr>
</tbody></table>
**Returns:**
any