11use base64:: Engine ;
22use ironposh_winrm:: {
3- cores:: { Attribute , DesiredStream , Receive , Shell , Tag , Text , Time , tag_name } ,
3+ cores:: { Attribute , DesiredStreamTag , StreamTag , Tag , Text , Time } ,
44 rsp:: {
55 commandline:: CommandLineValue ,
6- receive:: { CommandStateValue , ReceiveValue } ,
7- shell_value:: ShellValue ,
6+ receive:: { CommandStateTag , CommandStateValue , ReceiveTag , ReceiveValue } ,
7+ shell_value:: { ShellTag , ShellValue } ,
88 } ,
99 soap:: { SoapEnvelope , body:: SoapBody } ,
1010 ws_management:: { OptionSetValue , SelectorSetValue , WsAction , WsMan } ,
@@ -67,7 +67,7 @@ impl WinRunspace {
6767 option_set : Option < OptionSetValue > ,
6868 open_content : & ' a str ,
6969 ) -> impl Into < Element < ' a > > {
70- let shell = Tag :: from_name ( Shell )
70+ let shell = Tag :: from_name ( ShellTag )
7171 . with_attribute ( ironposh_winrm:: cores:: Attribute :: ShellId (
7272 self . id . to_string ( ) . into ( ) ,
7373 ) )
@@ -130,7 +130,7 @@ impl WinRunspace {
130130 // Join stream names with spaces as required by Windows Shell schema
131131 let combined_streams = stream_names. join ( " " ) ;
132132 let mut tag =
133- Tag :: from_name ( DesiredStream ) . with_value ( Text :: from ( combined_streams) ) ;
133+ Tag :: from_name ( DesiredStreamTag ) . with_value ( Text :: from ( combined_streams) ) ;
134134
135135 if let Some ( command_id) = command_id {
136136 tag = tag. with_attribute ( Attribute :: CommandId ( command_id) ) ;
@@ -144,7 +144,7 @@ impl WinRunspace {
144144 . desired_streams ( desired_stream_tags)
145145 . build ( ) ;
146146
147- let receive_tag = Tag :: from_name ( Receive )
147+ let receive_tag = Tag :: from_name ( ReceiveTag )
148148 . with_value ( receive)
149149 . with_declaration ( ironposh_winrm:: cores:: Namespace :: WsmanShell ) ;
150150
@@ -172,9 +172,12 @@ impl WinRunspace {
172172
173173 /// Build a Disconnect request targeting this shell (MS-WSMV 3.1.4.13).
174174 pub ( crate ) fn fire_disconnect < ' a > ( & ' a self , ws_man : & ' a WsMan ) -> impl Into < Element < ' a > > {
175- use ironposh_winrm:: { cores:: Namespace , rsp:: disconnect:: DisconnectValue } ;
175+ use ironposh_winrm:: {
176+ cores:: Namespace ,
177+ rsp:: disconnect:: { DisconnectTag , DisconnectValue } ,
178+ } ;
176179
177- let disconnect_tag = Tag :: from_name ( tag_name :: Disconnect )
180+ let disconnect_tag = Tag :: from_name ( DisconnectTag )
178181 . with_declaration ( Namespace :: WsmanShell )
179182 . with_value ( DisconnectValue :: builder ( ) . build ( ) ) ;
180183
@@ -197,13 +200,16 @@ impl WinRunspace {
197200 option_set : Option < OptionSetValue > ,
198201 connect_payload : & ' a str ,
199202 ) -> impl Into < Element < ' a > > {
200- use ironposh_winrm:: { cores:: Namespace , rsp:: connect:: ConnectValue } ;
203+ use ironposh_winrm:: {
204+ cores:: Namespace ,
205+ rsp:: connect:: { ConnectTag , ConnectValue } ,
206+ } ;
201207
202208 let connect_value = ConnectValue {
203209 connect_xml : Tag :: new ( connect_payload) . with_declaration ( Namespace :: PowerShellRemoting ) ,
204210 } ;
205211
206- let connect_tag = Tag :: from_name ( tag_name :: Connect )
212+ let connect_tag = Tag :: from_name ( ConnectTag )
207213 . with_declaration ( Namespace :: WsmanShell )
208214 . with_value ( connect_value) ;
209215
@@ -218,9 +224,9 @@ impl WinRunspace {
218224
219225 /// Build a Reconnect request targeting this shell (MS-WSMV 3.1.4.14).
220226 pub ( crate ) fn fire_reconnect < ' a > ( & ' a self , ws_man : & ' a WsMan ) -> impl Into < Element < ' a > > {
221- use ironposh_winrm:: cores:: { Empty , Namespace } ;
227+ use ironposh_winrm:: cores:: { Empty , Namespace , ReconnectTag } ;
222228
223- let reconnect_tag = Tag :: from_name ( tag_name :: Reconnect )
229+ let reconnect_tag = Tag :: from_name ( ReconnectTag )
224230 . with_declaration ( Namespace :: WsmanShell )
225231 . with_value ( Empty ) ;
226232
@@ -390,20 +396,17 @@ impl WinRunspace {
390396 data : & ' a [ String ] ,
391397 ) -> Result < impl Into < Element < ' a > > , crate :: PwshCoreError > {
392398 use ironposh_winrm:: {
393- cores:: {
394- Namespace , Tag ,
395- tag_name:: { Send , Stream } ,
396- } ,
397- rsp:: send:: SendValue ,
399+ cores:: { Namespace , StreamTag , Tag } ,
400+ rsp:: send:: { SendTag , SendValue } ,
398401 soap:: body:: SoapBody ,
399402 } ;
400403
401404 // Create a Stream tag for each fragment
402405 // Each fragment is a base64-encoded PSRP fragment that goes in its own <rsp:Stream> element
403- let streams: Vec < Tag < Text , Stream > > = data
406+ let streams: Vec < Tag < Text , StreamTag > > = data
404407 . iter ( )
405408 . map ( |fragment| {
406- Tag :: from_name ( Stream )
409+ Tag :: from_name ( StreamTag )
407410 . with_value ( Text :: from ( fragment. as_str ( ) ) )
408411 . with_attribute ( Attribute :: Name ( "stdin" . into ( ) ) )
409412 } )
@@ -413,12 +416,12 @@ impl WinRunspace {
413416
414417 // Add send tag with SendValue containing multiple streams
415418 let send_tag = if let Some ( cmd_id) = command_id {
416- Tag :: from_name ( Send )
419+ Tag :: from_name ( SendTag )
417420 . with_value ( send_value)
418421 . with_attribute ( Attribute :: CommandId ( cmd_id) )
419422 . with_declaration ( Namespace :: WsmanShell )
420423 } else {
421- Tag :: from_name ( Send )
424+ Tag :: from_name ( SendTag )
422425 . with_value ( send_value)
423426 . with_declaration ( Namespace :: WsmanShell )
424427 } ;
@@ -460,18 +463,15 @@ impl WinRunspace {
460463 connection : & ' a WsMan ,
461464 id : Uuid ,
462465 ) -> Result < impl Into < Element < ' a > > , crate :: PwshCoreError > {
463- use ironposh_winrm:: cores:: {
464- Namespace ,
465- tag_name:: { Signal , SignalCode } ,
466- } ;
466+ use ironposh_winrm:: cores:: { Namespace , SignalCodeTag , SignalTag } ;
467467
468468 // Build <rsp:Code>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/ctrl_c</rsp:Code>
469- let code = Tag :: from_name ( SignalCode ) . with_value ( Text :: from (
469+ let code = Tag :: from_name ( SignalCodeTag ) . with_value ( Text :: from (
470470 "http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate" ,
471471 ) ) ;
472472
473473 // Build <w:Signal CommandId="...">...</w:Signal>
474- let signal = Tag :: from_name ( Signal )
474+ let signal = Tag :: from_name ( SignalTag )
475475 . with_attribute ( Attribute :: CommandId ( id) )
476476 . with_value ( code)
477477 . with_declaration ( Namespace :: WsmanShell ) ;
@@ -535,10 +535,10 @@ impl Stream {
535535 }
536536}
537537
538- impl < ' a > TryFrom < & Tag < ' a , Text < ' a > , tag_name :: Stream > > for Stream {
538+ impl < ' a > TryFrom < & Tag < ' a , Text < ' a > , StreamTag > > for Stream {
539539 type Error = crate :: PwshCoreError ;
540540
541- fn try_from ( value : & Tag < ' a , Text < ' a > , tag_name :: Stream > ) -> Result < Self , Self :: Error > {
541+ fn try_from ( value : & Tag < ' a , Text < ' a > , StreamTag > ) -> Result < Self , Self :: Error > {
542542 let attributes = & value. attributes ;
543543 let name = attributes
544544 . iter ( )
@@ -577,11 +577,11 @@ pub struct CommandState {
577577 pub exit_code : Option < i32 > ,
578578}
579579
580- impl < ' a > TryFrom < & Tag < ' a , CommandStateValue < ' a > , tag_name :: CommandState > > for CommandState {
580+ impl < ' a > TryFrom < & Tag < ' a , CommandStateValue < ' a > , CommandStateTag > > for CommandState {
581581 type Error = crate :: PwshCoreError ;
582582
583583 fn try_from (
584- value : & Tag < ' a , CommandStateValue < ' a > , tag_name :: CommandState > ,
584+ value : & Tag < ' a , CommandStateValue < ' a > , CommandStateTag > ,
585585 ) -> Result < Self , Self :: Error > {
586586 let command_id = value
587587 . attributes
0 commit comments