ibm-cloud-sdk-core
Version:
Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.
88 lines (41 loc) • 1.48 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) > [constructServiceUrl](./ibm-cloud-sdk-core.constructserviceurl.md)
## constructServiceUrl() function
Constructs a service URL by formatting a parameterized URL.
**Signature:**
```typescript
export declare function constructServiceUrl(parameterizedUrl: string, defaultUrlVariables: Map<string, string>, providedUrlVariables: Map<string, string> | null): string;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
parameterizedUrl
</td><td>
string
</td><td>
a URL that contains variable placeholders, e.g. '<!-- -->{<!-- -->scheme<!-- -->}<!-- -->://ibm.com'.
</td></tr>
<tr><td>
defaultUrlVariables
</td><td>
Map<string, string>
</td><td>
a Map of variable names to default values. Each variable in the parameterized URL must have a default value specified in this map.
</td></tr>
<tr><td>
providedUrlVariables
</td><td>
Map<string, string> \| null
</td><td>
a Map of variable names to desired values. If a variable is not provided in this map, the default variable value will be used instead.
</td></tr>
</tbody></table>
**Returns:**
string
the formatted URL with all variable placeholders replaced by values.