Skip to content

Commit 23dc130

Browse files
committed
Refactor parameter names for consistency and clarity
1 parent 66caca2 commit 23dc130

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

source/Private/Test-FabricApiResponse.ps1

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@ function Test-FabricApiResponse {
77
.DESCRIPTION
88
Tests the response from a Fabric API call and handles long-running operations. It checks the status code and processes the response accordingly.
99
10-
.PARAMETER statusCode
11-
The HTTP status code returned from the API call.
12-
13-
.PARAMETER response
10+
.PARAMETER Response
1411
The response body from the API call.
1512
16-
.PARAMETER responseHeader
17-
The response headers from the API call.
18-
1913
.PARAMETER Name
2014
The name of the resource being operated.
2115
22-
.PARAMETER typeName
16+
.PARAMETER TypeName
2317
The type of resource being operated (default: 'Fabric Item').
2418
2519
.PARAMETER NoWait
@@ -47,13 +41,13 @@ function Test-FabricApiResponse {
4741
[CmdletBinding()]
4842
param (
4943
[Parameter(Mandatory = $false)]
50-
$response,
44+
$Response,
5145

5246
[Parameter(Mandatory = $false)]
5347
$Name,
5448

5549
[Parameter(Mandatory = $false)]
56-
$typeName = 'Fabric Item',
50+
$TypeName = 'Fabric Item',
5751

5852
[Parameter(Mandatory = $false)]
5953
[switch] $NoWait = $false
@@ -71,16 +65,16 @@ function Test-FabricApiResponse {
7165
}
7266
201 {
7367
switch ($verb) {
74-
'New' { $msg = "$typeName '$Name' created successfully!" }
75-
'Update' { $msg = "$typeName '$Name' updated successfully!" }
76-
'Remove' { $msg = "$typeName '$Name' deleted successfully!" }
77-
default { $msg = "Received 201 status code for $verb operation on $typeName '$Name'" }
68+
'New' { $msg = "$TypeName '$Name' created successfully!" }
69+
'Update' { $msg = "$TypeName '$Name' updated successfully!" }
70+
'Remove' { $msg = "$TypeName '$Name' deleted successfully!" }
71+
default { $msg = "Received 201 status code for $verb operation on $TypeName '$Name'" }
7872
}
7973
Write-Message -Message $msg -Level Info
80-
return $response
74+
return $Response
8175
}
8276
202 {
83-
Write-Message -Message "$verb Request for $typeName '$Name' accepted. Provisioning in progress!" -Level Info
77+
Write-Message -Message "$verb Request for $TypeName '$Name' accepted. Provisioning in progress!" -Level Info
8478
[string]$operationId = $responseHeader["x-ms-operation-id"]
8579

8680
if ($NoWait) {

0 commit comments

Comments
 (0)