11function  New-ITGlueConfigurationInterfaces  {
22    Param  (
3-         [Nullable [Int ]]$conf_id  =  $null , 
3+         [Nullable [Int64 ]]$conf_id  =  $null , 
44
5-         [Parameter (Mandatory = $true )]
5+         [Parameter (Mandatory   =   $true )]
66        $data 
77    )
88
9-     $resource_uri  =  " /configuration_interfaces/" 
9+     $resource_uri  =  ' /configuration_interfaces/' 
1010
11-     if ($conf_id ) {
12-         $resource_uri  =  " /configurations/${conf_id }" 
11+     if   ($conf_id ) {
12+         $resource_uri  =  ( ' /configurations/{0 }/relationships/configuration_interfaces'   -f   $conf_id ) 
1313    }
1414
15-     $body  =  ConvertTo-Json  $data  - Depth $ITGlue_JSON_Conversion_Depth 
15+     $body  =  ConvertTo-Json  - InputObject  $data  - Depth $ITGlue_JSON_Conversion_Depth 
1616
17-     $ITGlue_Headers.Add  (" x-api-key" ,  (New-Object  System.Management.Automation.PSCredential ' N/A' ,  $ITGlue_API_Key ).GetNetworkCredential().Password)
18-     $rest_output  =  Invoke-RestMethod  - method " POST" - uri ($ITGlue_Base_URI  +  $resource_uri ) - headers $ITGlue_Headers  ` 
19-                                       - body $body  - ErrorAction Stop - ErrorVariable $web_error 
17+     $ITGlue_Headers.Add  (' x-api-key' ,  (New-Object  - TypeName  System.Management.Automation.PSCredential  - ArgumentList  ' N/A' ,  $ITGlue_API_Key ).GetNetworkCredential().Password)
18+     $rest_output  =  Invoke-RestMethod  - method ' POST' - uri ($ITGlue_Base_URI  +  $resource_uri ) - headers $ITGlue_Headers  ` 
19+         - body $body  - ErrorAction Stop - ErrorVariable $web_error 
2020    $ITGlue_Headers.Remove  (' x-api-key' > $null  #  Quietly clean up scope so the API key doesn't persist
2121
2222    $data  =  @ {}
2323    $data  =  $rest_output  
2424    return  $data 
2525}
2626
27- 
28- 
29- 
3027function  Get-ITGlueConfigurationInterfaces  {
31-     [CmdletBinding (DefaultParametersetName = " index" 
28+     [CmdletBinding (DefaultParametersetName   =   ' index' 
3229    Param  (
33-         [Parameter (ParameterSetName = " index" 
34-         [Parameter (ParameterSetName = " show" 
35-         [Nullable [Int ]]$conf_id  =  $null , 
30+         [Parameter (ParameterSetName   =   ' index' 
31+         [Parameter (ParameterSetName   =   ' show' 
32+         [Nullable [Int64 ]]$conf_id  =  $null , 
3633
37-         [Parameter (ParameterSetName = " index" 
38-         [Nullable [Int ]]$page_number  =  $null , 
34+         [Parameter (ParameterSetName   =   ' index' 
35+         [Nullable [Int64 ]]$page_number  =  $null , 
3936
40-         [Parameter (ParameterSetName = " index" 
37+         [Parameter (ParameterSetName   =   ' index' 
4138        [Nullable [int ]]$page_size  =  $null , 
4239
43-         [Parameter (ParameterSetName = " show" 
44-         [Nullable [Int ]]$id  =  $null 
40+         [Parameter (ParameterSetName   =   ' show' 
41+         [Nullable [Int64 ]]$id  =  $null 
4542    )
4643
47-     $resource_uri  =  " /configurations/${conf_id }${id} " 
48-     if (($PsCmdlet.ParameterSetName   -eq  " show" -and  ($conf_id  -eq  $null )) {
49-         $resource_uri  =  " /configuration_interfaces/${id} " 
44+     $resource_uri  =  ( ' /configurations/{0 }/relationships/configuration_interfaces/{1} '   -f   $conf_id ,   $id ) 
45+     if   (($PsCmdlet.ParameterSetName   -eq  ' show' -and  ($conf_id  -eq  $null )) {
46+         $resource_uri  =  ( ' /configuration_interfaces/{0} '   -f   $id ) 
5047    }
5148
52-     if ($PSCmdlet.ParameterSetName   -eq  " index" 
49+     if   ($PSCmdlet.ParameterSetName   -eq  ' index' 
5350        $body  =  @ {}
54-         if ($page_number ) {
55-             $body  +=  @ {" page[number]" =  $page_number }
51+         if   ($page_number ) {
52+             $body  +=  @ {' page[number]' =  $page_number }
5653        }
57-         if ($page_size ) {
58-             $body  +=  @ {" page[size]" =  $page_size }
54+         if   ($page_size ) {
55+             $body  +=  @ {' page[size]' =  $page_size }
5956        }
6057    }
6158
6259
63-     $ITGlue_Headers.Add  (" x-api-key" ,  (New-Object  System.Management.Automation.PSCredential ' N/A' ,  $ITGlue_API_Key ).GetNetworkCredential().Password)
64-     $rest_output  =  Invoke-RestMethod  - method " GET" - uri ($ITGlue_Base_URI  +  $resource_uri ) - headers $ITGlue_Headers  ` 
65-                                       - body $body  - ErrorAction Stop - ErrorVariable $web_error 
60+     $ITGlue_Headers.Add  (' x-api-key' ,  (New-Object  - TypeName  System.Management.Automation.PSCredential  - ArgumentList  ' N/A' ,  $ITGlue_API_Key ).GetNetworkCredential().Password)
61+     $rest_output  =  Invoke-RestMethod  - method ' GET' - uri ($ITGlue_Base_URI  +  $resource_uri ) - headers $ITGlue_Headers  ` 
62+         - body $body  - ErrorAction Stop - ErrorVariable $web_error 
6663    $ITGlue_Headers.Remove  (' x-api-key' > $null  #  Quietly clean up scope so the API key doesn't persist
6764
6865    $data  =  @ {}
6966    $data  =  $rest_output  
7067    return  $data 
7168}
7269
73- 
74- 
75- 
7670function  Set-ITGlueConfigurationInterfaces  {
7771    Param  (
78-         [Nullable [Int ]]$id , 
72+         [Nullable [Int64 ]]$id , 
7973
80-         [Nullable [Int ]]$conf_id  =  $null , 
74+         [Nullable [Int64 ]]$conf_id  =  $null , 
8175
82-         [Parameter (Mandatory = $true )]
76+         [Parameter (Mandatory   =   $true )]
8377        $data 
8478    )
8579
86-     $resource_uri  =  " /configuration_interfaces/${id} " 
80+     $resource_uri  =  ( ' /configuration_interfaces/{0} '   -f   $id ) 
8781
88-     if ($conf_id ) {
89-         $resource_uri  =  " /configurations/${conf_id }${id} " 
82+     if   ($conf_id ) {
83+         $resource_uri  =  ( ' /configurations/{0 }/relationships/configuration_interfaces/{1} '   -f   $conf_id ,   $id ) 
9084    }
9185
92-     $body  =  ConvertTo-Json  $data  - Depth $ITGlue_JSON_Conversion_Depth 
86+     $body  =  ConvertTo-Json  - InputObject  $data  - Depth $ITGlue_JSON_Conversion_Depth 
9387
94-     $ITGlue_Headers.Add  (" x-api-key" ,  (New-Object  System.Management.Automation.PSCredential ' N/A' ,  $ITGlue_API_Key ).GetNetworkCredential().Password)
95-     $rest_output  =  Invoke-RestMethod  - method " PATCH" - uri ($ITGlue_Base_URI  +  $resource_uri ) - headers $ITGlue_Headers  ` 
96-                                       - body $body  - ErrorAction Stop - ErrorVariable $web_error 
88+     $ITGlue_Headers.Add  (' x-api-key' ,  (New-Object  - TypeName  System.Management.Automation.PSCredential  - ArgumentList  ' N/A' ,  $ITGlue_API_Key ).GetNetworkCredential().Password)
89+     $rest_output  =  Invoke-RestMethod  - method ' PATCH' - uri ($ITGlue_Base_URI  +  $resource_uri ) - headers $ITGlue_Headers  ` 
90+         - body $body  - ErrorAction Stop - ErrorVariable $web_error 
9791    $ITGlue_Headers.Remove  (' x-api-key' > $null  #  Quietly clean up scope so the API key doesn't persist
9892
9993    $data  =  @ {}
10094    $data  =  $rest_output  
10195    return  $data 
102- }
96+ }
0 commit comments