From 5a0d4bd7ee6bee8e26f24664c8e0d0c8ec3b0a7e Mon Sep 17 00:00:00 2001 From: John Beisley Date: Sun, 11 Jul 2021 14:53:32 +0100 Subject: [PATCH] Add *Ctx methods for calling SOAP methods. Fixes #42. --- cmd/goupnpdcpgen/codetemplate.go | 22 +- dcps/av1/av1.go | 3843 +++++++++++++++++---- dcps/internetgateway1/internetgateway1.go | 1590 +++++++-- dcps/internetgateway2/internetgateway2.go | 2328 ++++++++++--- 4 files changed, 6409 insertions(+), 1374 deletions(-) diff --git a/cmd/goupnpdcpgen/codetemplate.go b/cmd/goupnpdcpgen/codetemplate.go index 47416ac..545bbd5 100644 --- a/cmd/goupnpdcpgen/codetemplate.go +++ b/cmd/goupnpdcpgen/codetemplate.go @@ -17,6 +17,7 @@ package {{$name}} // *********************************************************** import ( + "context" "net/url" "time" @@ -115,8 +116,10 @@ func new{{$srvIdent}}ClientsFromGenericClients(genericClients []goupnp.ServiceCl // Return values:{{range $woutargs}}{{if .HasDoc}} // // * {{.Name}}: {{.Document}}{{end}}{{end}}{{end}} -func (client *{{$srvIdent}}) {{.Name}}({{range $winargs -}} -{{.AsParameter}}, {{end -}} +func (client *{{$srvIdent}}) {{.Name}}Ctx( + ctx context.Context, +{{range $winargs }} {{.AsParameter}}, +{{end -}} ) ({{range $woutargs -}} {{.AsParameter}}, {{end}} err error) { // Request structure. @@ -132,7 +135,7 @@ func (client *{{$srvIdent}}) {{.Name}}({{range $winargs -}} response := {{if $woutargs}}&{{template "argstruct" $woutargs}}{{"{}"}}{{else}}{{"interface{}(nil)"}}{{end}} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction({{$srv.URNParts.Const}}, "{{.Name}}", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, {{$srv.URNParts.Const}}, "{{.Name}}", request, response); err != nil { return } @@ -144,6 +147,19 @@ func (client *{{$srvIdent}}) {{.Name}}({{range $winargs -}} // END Unmarshal arguments from response. return } + +// {{.Name}} is the legacy version of {{.Name}}Ctx, but uses +// context.Background() as the context. +func (client *{{$srvIdent}}) {{.Name}}({{range $winargs -}} + {{.AsParameter}}, {{end -}} + ) ({{range $woutargs -}} + {{.AsParameter}}, {{end}} err error) { + return client.{{.Name}}Ctx(context.Background(), + {{range $winargs }}{{.Name}}, + {{end}} + ) +} + {{end}} {{end}} diff --git a/dcps/av1/av1.go b/dcps/av1/av1.go index 67d2537..8c110d4 100644 --- a/dcps/av1/av1.go +++ b/dcps/av1/av1.go @@ -10,6 +10,7 @@ package av1 // *********************************************************** import ( + "context" "net/url" "time" @@ -98,7 +99,12 @@ func newAVTransport1ClientsFromGenericClients(genericClients []goupnp.ServiceCli return clients } -func (client *AVTransport1) SetAVTransportURI(InstanceID uint32, CurrentURI string, CurrentURIMetaData string) (err error) { +func (client *AVTransport1) SetAVTransportURICtx( + ctx context.Context, + InstanceID uint32, + CurrentURI string, + CurrentURIMetaData string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -122,7 +128,7 @@ func (client *AVTransport1) SetAVTransportURI(InstanceID uint32, CurrentURI stri response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "SetAVTransportURI", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "SetAVTransportURI", request, response); err != nil { return } @@ -132,7 +138,22 @@ func (client *AVTransport1) SetAVTransportURI(InstanceID uint32, CurrentURI stri return } -func (client *AVTransport1) SetNextAVTransportURI(InstanceID uint32, NextURI string, NextURIMetaData string) (err error) { +// SetAVTransportURI is the legacy version of SetAVTransportURICtx, but uses +// context.Background() as the context. +func (client *AVTransport1) SetAVTransportURI(InstanceID uint32, CurrentURI string, CurrentURIMetaData string) (err error) { + return client.SetAVTransportURICtx(context.Background(), + InstanceID, + CurrentURI, + CurrentURIMetaData, + ) +} + +func (client *AVTransport1) SetNextAVTransportURICtx( + ctx context.Context, + InstanceID uint32, + NextURI string, + NextURIMetaData string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -156,7 +177,7 @@ func (client *AVTransport1) SetNextAVTransportURI(InstanceID uint32, NextURI str response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "SetNextAVTransportURI", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "SetNextAVTransportURI", request, response); err != nil { return } @@ -166,11 +187,24 @@ func (client *AVTransport1) SetNextAVTransportURI(InstanceID uint32, NextURI str return } +// SetNextAVTransportURI is the legacy version of SetNextAVTransportURICtx, but uses +// context.Background() as the context. +func (client *AVTransport1) SetNextAVTransportURI(InstanceID uint32, NextURI string, NextURIMetaData string) (err error) { + return client.SetNextAVTransportURICtx(context.Background(), + InstanceID, + NextURI, + NextURIMetaData, + ) +} + // // Return values: // // * NrTracks: allowed value range: minimum=0 -func (client *AVTransport1) GetMediaInfo(InstanceID uint32) (NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { +func (client *AVTransport1) GetMediaInfoCtx( + ctx context.Context, + InstanceID uint32, +) (NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { // Request structure. request := &struct { InstanceID string @@ -196,7 +230,7 @@ func (client *AVTransport1) GetMediaInfo(InstanceID uint32) (NrTracks uint32, Me }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "GetMediaInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "GetMediaInfo", request, response); err != nil { return } @@ -233,6 +267,14 @@ func (client *AVTransport1) GetMediaInfo(InstanceID uint32) (NrTracks uint32, Me return } +// GetMediaInfo is the legacy version of GetMediaInfoCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) GetMediaInfo(InstanceID uint32) (NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { + return client.GetMediaInfoCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // @@ -241,7 +283,10 @@ func (client *AVTransport1) GetMediaInfo(InstanceID uint32) (NrTracks uint32, Me // * CurrentTransportStatus: allowed values: OK, ERROR_OCCURRED // // * CurrentSpeed: allowed values: 1 -func (client *AVTransport1) GetTransportInfo(InstanceID uint32) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) { +func (client *AVTransport1) GetTransportInfoCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) { // Request structure. request := &struct { InstanceID string @@ -261,7 +306,7 @@ func (client *AVTransport1) GetTransportInfo(InstanceID uint32) (CurrentTranspor }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "GetTransportInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "GetTransportInfo", request, response); err != nil { return } @@ -280,11 +325,22 @@ func (client *AVTransport1) GetTransportInfo(InstanceID uint32) (CurrentTranspor return } +// GetTransportInfo is the legacy version of GetTransportInfoCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) GetTransportInfo(InstanceID uint32) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) { + return client.GetTransportInfoCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // // * Track: allowed value range: minimum=0, step=1 -func (client *AVTransport1) GetPositionInfo(InstanceID uint32) (Track uint32, TrackDuration string, TrackMetaData string, TrackURI string, RelTime string, AbsTime string, RelCount int32, AbsCount int32, err error) { +func (client *AVTransport1) GetPositionInfoCtx( + ctx context.Context, + InstanceID uint32, +) (Track uint32, TrackDuration string, TrackMetaData string, TrackURI string, RelTime string, AbsTime string, RelCount int32, AbsCount int32, err error) { // Request structure. request := &struct { InstanceID string @@ -309,7 +365,7 @@ func (client *AVTransport1) GetPositionInfo(InstanceID uint32) (Track uint32, Tr }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "GetPositionInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "GetPositionInfo", request, response); err != nil { return } @@ -343,7 +399,18 @@ func (client *AVTransport1) GetPositionInfo(InstanceID uint32) (Track uint32, Tr return } -func (client *AVTransport1) GetDeviceCapabilities(InstanceID uint32) (PlayMedia string, RecMedia string, RecQualityModes string, err error) { +// GetPositionInfo is the legacy version of GetPositionInfoCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) GetPositionInfo(InstanceID uint32) (Track uint32, TrackDuration string, TrackMetaData string, TrackURI string, RelTime string, AbsTime string, RelCount int32, AbsCount int32, err error) { + return client.GetPositionInfoCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport1) GetDeviceCapabilitiesCtx( + ctx context.Context, + InstanceID uint32, +) (PlayMedia string, RecMedia string, RecQualityModes string, err error) { // Request structure. request := &struct { InstanceID string @@ -363,7 +430,7 @@ func (client *AVTransport1) GetDeviceCapabilities(InstanceID uint32) (PlayMedia }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "GetDeviceCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "GetDeviceCapabilities", request, response); err != nil { return } @@ -382,11 +449,22 @@ func (client *AVTransport1) GetDeviceCapabilities(InstanceID uint32) (PlayMedia return } +// GetDeviceCapabilities is the legacy version of GetDeviceCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) GetDeviceCapabilities(InstanceID uint32) (PlayMedia string, RecMedia string, RecQualityModes string, err error) { + return client.GetDeviceCapabilitiesCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // // * PlayMode: allowed values: NORMAL -func (client *AVTransport1) GetTransportSettings(InstanceID uint32) (PlayMode string, RecQualityMode string, err error) { +func (client *AVTransport1) GetTransportSettingsCtx( + ctx context.Context, + InstanceID uint32, +) (PlayMode string, RecQualityMode string, err error) { // Request structure. request := &struct { InstanceID string @@ -405,7 +483,7 @@ func (client *AVTransport1) GetTransportSettings(InstanceID uint32) (PlayMode st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "GetTransportSettings", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "GetTransportSettings", request, response); err != nil { return } @@ -421,7 +499,18 @@ func (client *AVTransport1) GetTransportSettings(InstanceID uint32) (PlayMode st return } -func (client *AVTransport1) Stop(InstanceID uint32) (err error) { +// GetTransportSettings is the legacy version of GetTransportSettingsCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) GetTransportSettings(InstanceID uint32) (PlayMode string, RecQualityMode string, err error) { + return client.GetTransportSettingsCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport1) StopCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -437,7 +526,7 @@ func (client *AVTransport1) Stop(InstanceID uint32) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Stop", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Stop", request, response); err != nil { return } @@ -447,12 +536,24 @@ func (client *AVTransport1) Stop(InstanceID uint32) (err error) { return } +// Stop is the legacy version of StopCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) Stop(InstanceID uint32) (err error) { + return client.StopCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * Speed: allowed values: 1 -func (client *AVTransport1) Play(InstanceID uint32, Speed string) (err error) { +func (client *AVTransport1) PlayCtx( + ctx context.Context, + InstanceID uint32, + Speed string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -472,7 +573,7 @@ func (client *AVTransport1) Play(InstanceID uint32, Speed string) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Play", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Play", request, response); err != nil { return } @@ -482,7 +583,56 @@ func (client *AVTransport1) Play(InstanceID uint32, Speed string) (err error) { return } +// Play is the legacy version of PlayCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) Play(InstanceID uint32, Speed string) (err error) { + return client.PlayCtx(context.Background(), + InstanceID, + Speed, + ) +} + +func (client *AVTransport1) PauseCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { + // Request structure. + request := &struct { + InstanceID string + }{} + // BEGIN Marshal arguments into request. + + if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Pause", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// Pause is the legacy version of PauseCtx, but uses +// context.Background() as the context. func (client *AVTransport1) Pause(InstanceID uint32) (err error) { + return client.PauseCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport1) RecordCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -498,7 +648,7 @@ func (client *AVTransport1) Pause(InstanceID uint32) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Pause", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Record", request, response); err != nil { return } @@ -508,30 +658,12 @@ func (client *AVTransport1) Pause(InstanceID uint32) (err error) { return } +// Record is the legacy version of RecordCtx, but uses +// context.Background() as the context. func (client *AVTransport1) Record(InstanceID uint32) (err error) { - // Request structure. - request := &struct { - InstanceID string - }{} - // BEGIN Marshal arguments into request. - - if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Record", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.RecordCtx(context.Background(), + InstanceID, + ) } // @@ -539,7 +671,12 @@ func (client *AVTransport1) Record(InstanceID uint32) (err error) { // // * Unit: allowed values: TRACK_NR -func (client *AVTransport1) Seek(InstanceID uint32, Unit string, Target string) (err error) { +func (client *AVTransport1) SeekCtx( + ctx context.Context, + InstanceID uint32, + Unit string, + Target string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -563,7 +700,7 @@ func (client *AVTransport1) Seek(InstanceID uint32, Unit string, Target string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Seek", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Seek", request, response); err != nil { return } @@ -573,7 +710,57 @@ func (client *AVTransport1) Seek(InstanceID uint32, Unit string, Target string) return } +// Seek is the legacy version of SeekCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) Seek(InstanceID uint32, Unit string, Target string) (err error) { + return client.SeekCtx(context.Background(), + InstanceID, + Unit, + Target, + ) +} + +func (client *AVTransport1) NextCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { + // Request structure. + request := &struct { + InstanceID string + }{} + // BEGIN Marshal arguments into request. + + if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Next", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// Next is the legacy version of NextCtx, but uses +// context.Background() as the context. func (client *AVTransport1) Next(InstanceID uint32) (err error) { + return client.NextCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport1) PreviousCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -589,7 +776,7 @@ func (client *AVTransport1) Next(InstanceID uint32) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Next", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "Previous", request, response); err != nil { return } @@ -599,30 +786,12 @@ func (client *AVTransport1) Next(InstanceID uint32) (err error) { return } +// Previous is the legacy version of PreviousCtx, but uses +// context.Background() as the context. func (client *AVTransport1) Previous(InstanceID uint32) (err error) { - // Request structure. - request := &struct { - InstanceID string - }{} - // BEGIN Marshal arguments into request. - - if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "Previous", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.PreviousCtx(context.Background(), + InstanceID, + ) } // @@ -630,7 +799,11 @@ func (client *AVTransport1) Previous(InstanceID uint32) (err error) { // // * NewPlayMode: allowed values: NORMAL -func (client *AVTransport1) SetPlayMode(InstanceID uint32, NewPlayMode string) (err error) { +func (client *AVTransport1) SetPlayModeCtx( + ctx context.Context, + InstanceID uint32, + NewPlayMode string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -650,7 +823,7 @@ func (client *AVTransport1) SetPlayMode(InstanceID uint32, NewPlayMode string) ( response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "SetPlayMode", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "SetPlayMode", request, response); err != nil { return } @@ -660,7 +833,20 @@ func (client *AVTransport1) SetPlayMode(InstanceID uint32, NewPlayMode string) ( return } -func (client *AVTransport1) SetRecordQualityMode(InstanceID uint32, NewRecordQualityMode string) (err error) { +// SetPlayMode is the legacy version of SetPlayModeCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) SetPlayMode(InstanceID uint32, NewPlayMode string) (err error) { + return client.SetPlayModeCtx(context.Background(), + InstanceID, + NewPlayMode, + ) +} + +func (client *AVTransport1) SetRecordQualityModeCtx( + ctx context.Context, + InstanceID uint32, + NewRecordQualityMode string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -680,7 +866,7 @@ func (client *AVTransport1) SetRecordQualityMode(InstanceID uint32, NewRecordQua response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "SetRecordQualityMode", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "SetRecordQualityMode", request, response); err != nil { return } @@ -690,7 +876,19 @@ func (client *AVTransport1) SetRecordQualityMode(InstanceID uint32, NewRecordQua return } -func (client *AVTransport1) GetCurrentTransportActions(InstanceID uint32) (Actions string, err error) { +// SetRecordQualityMode is the legacy version of SetRecordQualityModeCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) SetRecordQualityMode(InstanceID uint32, NewRecordQualityMode string) (err error) { + return client.SetRecordQualityModeCtx(context.Background(), + InstanceID, + NewRecordQualityMode, + ) +} + +func (client *AVTransport1) GetCurrentTransportActionsCtx( + ctx context.Context, + InstanceID uint32, +) (Actions string, err error) { // Request structure. request := &struct { InstanceID string @@ -708,7 +906,7 @@ func (client *AVTransport1) GetCurrentTransportActions(InstanceID uint32) (Actio }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_1, "GetCurrentTransportActions", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_1, "GetCurrentTransportActions", request, response); err != nil { return } @@ -721,6 +919,14 @@ func (client *AVTransport1) GetCurrentTransportActions(InstanceID uint32) (Actio return } +// GetCurrentTransportActions is the legacy version of GetCurrentTransportActionsCtx, but uses +// context.Background() as the context. +func (client *AVTransport1) GetCurrentTransportActions(InstanceID uint32) (Actions string, err error) { + return client.GetCurrentTransportActionsCtx(context.Background(), + InstanceID, + ) +} + // AVTransport2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:AVTransport:2". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -781,7 +987,12 @@ func newAVTransport2ClientsFromGenericClients(genericClients []goupnp.ServiceCli return clients } -func (client *AVTransport2) SetAVTransportURI(InstanceID uint32, CurrentURI string, CurrentURIMetaData string) (err error) { +func (client *AVTransport2) SetAVTransportURICtx( + ctx context.Context, + InstanceID uint32, + CurrentURI string, + CurrentURIMetaData string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -805,7 +1016,7 @@ func (client *AVTransport2) SetAVTransportURI(InstanceID uint32, CurrentURI stri response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "SetAVTransportURI", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "SetAVTransportURI", request, response); err != nil { return } @@ -815,7 +1026,22 @@ func (client *AVTransport2) SetAVTransportURI(InstanceID uint32, CurrentURI stri return } -func (client *AVTransport2) SetNextAVTransportURI(InstanceID uint32, NextURI string, NextURIMetaData string) (err error) { +// SetAVTransportURI is the legacy version of SetAVTransportURICtx, but uses +// context.Background() as the context. +func (client *AVTransport2) SetAVTransportURI(InstanceID uint32, CurrentURI string, CurrentURIMetaData string) (err error) { + return client.SetAVTransportURICtx(context.Background(), + InstanceID, + CurrentURI, + CurrentURIMetaData, + ) +} + +func (client *AVTransport2) SetNextAVTransportURICtx( + ctx context.Context, + InstanceID uint32, + NextURI string, + NextURIMetaData string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -839,7 +1065,7 @@ func (client *AVTransport2) SetNextAVTransportURI(InstanceID uint32, NextURI str response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "SetNextAVTransportURI", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "SetNextAVTransportURI", request, response); err != nil { return } @@ -849,11 +1075,24 @@ func (client *AVTransport2) SetNextAVTransportURI(InstanceID uint32, NextURI str return } +// SetNextAVTransportURI is the legacy version of SetNextAVTransportURICtx, but uses +// context.Background() as the context. +func (client *AVTransport2) SetNextAVTransportURI(InstanceID uint32, NextURI string, NextURIMetaData string) (err error) { + return client.SetNextAVTransportURICtx(context.Background(), + InstanceID, + NextURI, + NextURIMetaData, + ) +} + // // Return values: // // * NrTracks: allowed value range: minimum=0 -func (client *AVTransport2) GetMediaInfo(InstanceID uint32) (NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { +func (client *AVTransport2) GetMediaInfoCtx( + ctx context.Context, + InstanceID uint32, +) (NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { // Request structure. request := &struct { InstanceID string @@ -879,7 +1118,7 @@ func (client *AVTransport2) GetMediaInfo(InstanceID uint32) (NrTracks uint32, Me }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetMediaInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetMediaInfo", request, response); err != nil { return } @@ -916,13 +1155,24 @@ func (client *AVTransport2) GetMediaInfo(InstanceID uint32) (NrTracks uint32, Me return } +// GetMediaInfo is the legacy version of GetMediaInfoCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetMediaInfo(InstanceID uint32) (NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { + return client.GetMediaInfoCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // // * CurrentType: allowed values: NO_MEDIA, TRACK_AWARE, TRACK_UNAWARE // // * NrTracks: allowed value range: minimum=0 -func (client *AVTransport2) GetMediaInfo_Ext(InstanceID uint32) (CurrentType string, NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { +func (client *AVTransport2) GetMediaInfo_ExtCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentType string, NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { // Request structure. request := &struct { InstanceID string @@ -949,7 +1199,7 @@ func (client *AVTransport2) GetMediaInfo_Ext(InstanceID uint32) (CurrentType str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetMediaInfo_Ext", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetMediaInfo_Ext", request, response); err != nil { return } @@ -989,6 +1239,14 @@ func (client *AVTransport2) GetMediaInfo_Ext(InstanceID uint32) (CurrentType str return } +// GetMediaInfo_Ext is the legacy version of GetMediaInfo_ExtCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetMediaInfo_Ext(InstanceID uint32) (CurrentType string, NrTracks uint32, MediaDuration string, CurrentURI string, CurrentURIMetaData string, NextURI string, NextURIMetaData string, PlayMedium string, RecordMedium string, WriteStatus string, err error) { + return client.GetMediaInfo_ExtCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // @@ -997,7 +1255,10 @@ func (client *AVTransport2) GetMediaInfo_Ext(InstanceID uint32) (CurrentType str // * CurrentTransportStatus: allowed values: OK, ERROR_OCCURRED // // * CurrentSpeed: allowed values: 1 -func (client *AVTransport2) GetTransportInfo(InstanceID uint32) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) { +func (client *AVTransport2) GetTransportInfoCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) { // Request structure. request := &struct { InstanceID string @@ -1017,7 +1278,7 @@ func (client *AVTransport2) GetTransportInfo(InstanceID uint32) (CurrentTranspor }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetTransportInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetTransportInfo", request, response); err != nil { return } @@ -1036,11 +1297,22 @@ func (client *AVTransport2) GetTransportInfo(InstanceID uint32) (CurrentTranspor return } +// GetTransportInfo is the legacy version of GetTransportInfoCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetTransportInfo(InstanceID uint32) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) { + return client.GetTransportInfoCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // // * Track: allowed value range: minimum=0, step=1 -func (client *AVTransport2) GetPositionInfo(InstanceID uint32) (Track uint32, TrackDuration string, TrackMetaData string, TrackURI string, RelTime string, AbsTime string, RelCount int32, AbsCount int32, err error) { +func (client *AVTransport2) GetPositionInfoCtx( + ctx context.Context, + InstanceID uint32, +) (Track uint32, TrackDuration string, TrackMetaData string, TrackURI string, RelTime string, AbsTime string, RelCount int32, AbsCount int32, err error) { // Request structure. request := &struct { InstanceID string @@ -1065,7 +1337,7 @@ func (client *AVTransport2) GetPositionInfo(InstanceID uint32) (Track uint32, Tr }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetPositionInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetPositionInfo", request, response); err != nil { return } @@ -1099,7 +1371,18 @@ func (client *AVTransport2) GetPositionInfo(InstanceID uint32) (Track uint32, Tr return } -func (client *AVTransport2) GetDeviceCapabilities(InstanceID uint32) (PlayMedia string, RecMedia string, RecQualityModes string, err error) { +// GetPositionInfo is the legacy version of GetPositionInfoCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetPositionInfo(InstanceID uint32) (Track uint32, TrackDuration string, TrackMetaData string, TrackURI string, RelTime string, AbsTime string, RelCount int32, AbsCount int32, err error) { + return client.GetPositionInfoCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport2) GetDeviceCapabilitiesCtx( + ctx context.Context, + InstanceID uint32, +) (PlayMedia string, RecMedia string, RecQualityModes string, err error) { // Request structure. request := &struct { InstanceID string @@ -1119,7 +1402,7 @@ func (client *AVTransport2) GetDeviceCapabilities(InstanceID uint32) (PlayMedia }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetDeviceCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetDeviceCapabilities", request, response); err != nil { return } @@ -1138,11 +1421,22 @@ func (client *AVTransport2) GetDeviceCapabilities(InstanceID uint32) (PlayMedia return } +// GetDeviceCapabilities is the legacy version of GetDeviceCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetDeviceCapabilities(InstanceID uint32) (PlayMedia string, RecMedia string, RecQualityModes string, err error) { + return client.GetDeviceCapabilitiesCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // // * PlayMode: allowed values: NORMAL -func (client *AVTransport2) GetTransportSettings(InstanceID uint32) (PlayMode string, RecQualityMode string, err error) { +func (client *AVTransport2) GetTransportSettingsCtx( + ctx context.Context, + InstanceID uint32, +) (PlayMode string, RecQualityMode string, err error) { // Request structure. request := &struct { InstanceID string @@ -1161,7 +1455,7 @@ func (client *AVTransport2) GetTransportSettings(InstanceID uint32) (PlayMode st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetTransportSettings", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetTransportSettings", request, response); err != nil { return } @@ -1177,7 +1471,18 @@ func (client *AVTransport2) GetTransportSettings(InstanceID uint32) (PlayMode st return } -func (client *AVTransport2) Stop(InstanceID uint32) (err error) { +// GetTransportSettings is the legacy version of GetTransportSettingsCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetTransportSettings(InstanceID uint32) (PlayMode string, RecQualityMode string, err error) { + return client.GetTransportSettingsCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport2) StopCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1193,7 +1498,7 @@ func (client *AVTransport2) Stop(InstanceID uint32) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Stop", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Stop", request, response); err != nil { return } @@ -1203,12 +1508,24 @@ func (client *AVTransport2) Stop(InstanceID uint32) (err error) { return } +// Stop is the legacy version of StopCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) Stop(InstanceID uint32) (err error) { + return client.StopCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * Speed: allowed values: 1 -func (client *AVTransport2) Play(InstanceID uint32, Speed string) (err error) { +func (client *AVTransport2) PlayCtx( + ctx context.Context, + InstanceID uint32, + Speed string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1228,7 +1545,7 @@ func (client *AVTransport2) Play(InstanceID uint32, Speed string) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Play", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Play", request, response); err != nil { return } @@ -1238,7 +1555,56 @@ func (client *AVTransport2) Play(InstanceID uint32, Speed string) (err error) { return } +// Play is the legacy version of PlayCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) Play(InstanceID uint32, Speed string) (err error) { + return client.PlayCtx(context.Background(), + InstanceID, + Speed, + ) +} + +func (client *AVTransport2) PauseCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { + // Request structure. + request := &struct { + InstanceID string + }{} + // BEGIN Marshal arguments into request. + + if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Pause", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// Pause is the legacy version of PauseCtx, but uses +// context.Background() as the context. func (client *AVTransport2) Pause(InstanceID uint32) (err error) { + return client.PauseCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport2) RecordCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1254,7 +1620,7 @@ func (client *AVTransport2) Pause(InstanceID uint32) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Pause", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Record", request, response); err != nil { return } @@ -1264,30 +1630,12 @@ func (client *AVTransport2) Pause(InstanceID uint32) (err error) { return } +// Record is the legacy version of RecordCtx, but uses +// context.Background() as the context. func (client *AVTransport2) Record(InstanceID uint32) (err error) { - // Request structure. - request := &struct { - InstanceID string - }{} - // BEGIN Marshal arguments into request. - - if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Record", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.RecordCtx(context.Background(), + InstanceID, + ) } // @@ -1295,7 +1643,12 @@ func (client *AVTransport2) Record(InstanceID uint32) (err error) { // // * Unit: allowed values: TRACK_NR -func (client *AVTransport2) Seek(InstanceID uint32, Unit string, Target string) (err error) { +func (client *AVTransport2) SeekCtx( + ctx context.Context, + InstanceID uint32, + Unit string, + Target string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1319,7 +1672,7 @@ func (client *AVTransport2) Seek(InstanceID uint32, Unit string, Target string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Seek", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Seek", request, response); err != nil { return } @@ -1329,7 +1682,57 @@ func (client *AVTransport2) Seek(InstanceID uint32, Unit string, Target string) return } +// Seek is the legacy version of SeekCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) Seek(InstanceID uint32, Unit string, Target string) (err error) { + return client.SeekCtx(context.Background(), + InstanceID, + Unit, + Target, + ) +} + +func (client *AVTransport2) NextCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { + // Request structure. + request := &struct { + InstanceID string + }{} + // BEGIN Marshal arguments into request. + + if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Next", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// Next is the legacy version of NextCtx, but uses +// context.Background() as the context. func (client *AVTransport2) Next(InstanceID uint32) (err error) { + return client.NextCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport2) PreviousCtx( + ctx context.Context, + InstanceID uint32, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1345,7 +1748,7 @@ func (client *AVTransport2) Next(InstanceID uint32) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Next", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "Previous", request, response); err != nil { return } @@ -1355,30 +1758,12 @@ func (client *AVTransport2) Next(InstanceID uint32) (err error) { return } +// Previous is the legacy version of PreviousCtx, but uses +// context.Background() as the context. func (client *AVTransport2) Previous(InstanceID uint32) (err error) { - // Request structure. - request := &struct { - InstanceID string - }{} - // BEGIN Marshal arguments into request. - - if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "Previous", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.PreviousCtx(context.Background(), + InstanceID, + ) } // @@ -1386,7 +1771,11 @@ func (client *AVTransport2) Previous(InstanceID uint32) (err error) { // // * NewPlayMode: allowed values: NORMAL -func (client *AVTransport2) SetPlayMode(InstanceID uint32, NewPlayMode string) (err error) { +func (client *AVTransport2) SetPlayModeCtx( + ctx context.Context, + InstanceID uint32, + NewPlayMode string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1406,7 +1795,7 @@ func (client *AVTransport2) SetPlayMode(InstanceID uint32, NewPlayMode string) ( response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "SetPlayMode", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "SetPlayMode", request, response); err != nil { return } @@ -1416,7 +1805,20 @@ func (client *AVTransport2) SetPlayMode(InstanceID uint32, NewPlayMode string) ( return } -func (client *AVTransport2) SetRecordQualityMode(InstanceID uint32, NewRecordQualityMode string) (err error) { +// SetPlayMode is the legacy version of SetPlayModeCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) SetPlayMode(InstanceID uint32, NewPlayMode string) (err error) { + return client.SetPlayModeCtx(context.Background(), + InstanceID, + NewPlayMode, + ) +} + +func (client *AVTransport2) SetRecordQualityModeCtx( + ctx context.Context, + InstanceID uint32, + NewRecordQualityMode string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -1436,7 +1838,7 @@ func (client *AVTransport2) SetRecordQualityMode(InstanceID uint32, NewRecordQua response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "SetRecordQualityMode", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "SetRecordQualityMode", request, response); err != nil { return } @@ -1446,7 +1848,19 @@ func (client *AVTransport2) SetRecordQualityMode(InstanceID uint32, NewRecordQua return } -func (client *AVTransport2) GetCurrentTransportActions(InstanceID uint32) (Actions string, err error) { +// SetRecordQualityMode is the legacy version of SetRecordQualityModeCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) SetRecordQualityMode(InstanceID uint32, NewRecordQualityMode string) (err error) { + return client.SetRecordQualityModeCtx(context.Background(), + InstanceID, + NewRecordQualityMode, + ) +} + +func (client *AVTransport2) GetCurrentTransportActionsCtx( + ctx context.Context, + InstanceID uint32, +) (Actions string, err error) { // Request structure. request := &struct { InstanceID string @@ -1464,7 +1878,7 @@ func (client *AVTransport2) GetCurrentTransportActions(InstanceID uint32) (Actio }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetCurrentTransportActions", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetCurrentTransportActions", request, response); err != nil { return } @@ -1477,11 +1891,22 @@ func (client *AVTransport2) GetCurrentTransportActions(InstanceID uint32) (Actio return } +// GetCurrentTransportActions is the legacy version of GetCurrentTransportActionsCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetCurrentTransportActions(InstanceID uint32) (Actions string, err error) { + return client.GetCurrentTransportActionsCtx(context.Background(), + InstanceID, + ) +} + // // Return values: // // * CurrentDRMState: allowed values: OK -func (client *AVTransport2) GetDRMState(InstanceID uint32) (CurrentDRMState string, err error) { +func (client *AVTransport2) GetDRMStateCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentDRMState string, err error) { // Request structure. request := &struct { InstanceID string @@ -1499,7 +1924,7 @@ func (client *AVTransport2) GetDRMState(InstanceID uint32) (CurrentDRMState stri }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetDRMState", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetDRMState", request, response); err != nil { return } @@ -1512,7 +1937,19 @@ func (client *AVTransport2) GetDRMState(InstanceID uint32) (CurrentDRMState stri return } -func (client *AVTransport2) GetStateVariables(InstanceID uint32, StateVariableList string) (StateVariableValuePairs string, err error) { +// GetDRMState is the legacy version of GetDRMStateCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetDRMState(InstanceID uint32) (CurrentDRMState string, err error) { + return client.GetDRMStateCtx(context.Background(), + InstanceID, + ) +} + +func (client *AVTransport2) GetStateVariablesCtx( + ctx context.Context, + InstanceID uint32, + StateVariableList string, +) (StateVariableValuePairs string, err error) { // Request structure. request := &struct { InstanceID string @@ -1534,7 +1971,7 @@ func (client *AVTransport2) GetStateVariables(InstanceID uint32, StateVariableLi }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetStateVariables", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "GetStateVariables", request, response); err != nil { return } @@ -1547,7 +1984,23 @@ func (client *AVTransport2) GetStateVariables(InstanceID uint32, StateVariableLi return } -func (client *AVTransport2) SetStateVariables(InstanceID uint32, AVTransportUDN string, ServiceType string, ServiceId string, StateVariableValuePairs string) (StateVariableList string, err error) { +// GetStateVariables is the legacy version of GetStateVariablesCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) GetStateVariables(InstanceID uint32, StateVariableList string) (StateVariableValuePairs string, err error) { + return client.GetStateVariablesCtx(context.Background(), + InstanceID, + StateVariableList, + ) +} + +func (client *AVTransport2) SetStateVariablesCtx( + ctx context.Context, + InstanceID uint32, + AVTransportUDN string, + ServiceType string, + ServiceId string, + StateVariableValuePairs string, +) (StateVariableList string, err error) { // Request structure. request := &struct { InstanceID string @@ -1581,7 +2034,7 @@ func (client *AVTransport2) SetStateVariables(InstanceID uint32, AVTransportUDN }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "SetStateVariables", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_AVTransport_2, "SetStateVariables", request, response); err != nil { return } @@ -1594,6 +2047,18 @@ func (client *AVTransport2) SetStateVariables(InstanceID uint32, AVTransportUDN return } +// SetStateVariables is the legacy version of SetStateVariablesCtx, but uses +// context.Background() as the context. +func (client *AVTransport2) SetStateVariables(InstanceID uint32, AVTransportUDN string, ServiceType string, ServiceId string, StateVariableValuePairs string) (StateVariableList string, err error) { + return client.SetStateVariablesCtx(context.Background(), + InstanceID, + AVTransportUDN, + ServiceType, + ServiceId, + StateVariableValuePairs, + ) +} + // ConnectionManager1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ConnectionManager:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1654,7 +2119,9 @@ func newConnectionManager1ClientsFromGenericClients(genericClients []goupnp.Serv return clients } -func (client *ConnectionManager1) GetProtocolInfo() (Source string, Sink string, err error) { +func (client *ConnectionManager1) GetProtocolInfoCtx( + ctx context.Context, +) (Source string, Sink string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1668,7 +2135,7 @@ func (client *ConnectionManager1) GetProtocolInfo() (Source string, Sink string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_1, "GetProtocolInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_1, "GetProtocolInfo", request, response); err != nil { return } @@ -1684,12 +2151,24 @@ func (client *ConnectionManager1) GetProtocolInfo() (Source string, Sink string, return } +// GetProtocolInfo is the legacy version of GetProtocolInfoCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager1) GetProtocolInfo() (Source string, Sink string, err error) { + return client.GetProtocolInfoCtx(context.Background()) +} + // // Arguments: // // * Direction: allowed values: Input, Output -func (client *ConnectionManager1) PrepareForConnection(RemoteProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string) (ConnectionID int32, AVTransportID int32, RcsID int32, err error) { +func (client *ConnectionManager1) PrepareForConnectionCtx( + ctx context.Context, + RemoteProtocolInfo string, + PeerConnectionManager string, + PeerConnectionID int32, + Direction string, +) (ConnectionID int32, AVTransportID int32, RcsID int32, err error) { // Request structure. request := &struct { RemoteProtocolInfo string @@ -1721,7 +2200,7 @@ func (client *ConnectionManager1) PrepareForConnection(RemoteProtocolInfo string }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_1, "PrepareForConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_1, "PrepareForConnection", request, response); err != nil { return } @@ -1740,7 +2219,21 @@ func (client *ConnectionManager1) PrepareForConnection(RemoteProtocolInfo string return } -func (client *ConnectionManager1) ConnectionComplete(ConnectionID int32) (err error) { +// PrepareForConnection is the legacy version of PrepareForConnectionCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager1) PrepareForConnection(RemoteProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string) (ConnectionID int32, AVTransportID int32, RcsID int32, err error) { + return client.PrepareForConnectionCtx(context.Background(), + RemoteProtocolInfo, + PeerConnectionManager, + PeerConnectionID, + Direction, + ) +} + +func (client *ConnectionManager1) ConnectionCompleteCtx( + ctx context.Context, + ConnectionID int32, +) (err error) { // Request structure. request := &struct { ConnectionID string @@ -1756,7 +2249,7 @@ func (client *ConnectionManager1) ConnectionComplete(ConnectionID int32) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_1, "ConnectionComplete", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_1, "ConnectionComplete", request, response); err != nil { return } @@ -1766,7 +2259,17 @@ func (client *ConnectionManager1) ConnectionComplete(ConnectionID int32) (err er return } -func (client *ConnectionManager1) GetCurrentConnectionIDs() (ConnectionIDs string, err error) { +// ConnectionComplete is the legacy version of ConnectionCompleteCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager1) ConnectionComplete(ConnectionID int32) (err error) { + return client.ConnectionCompleteCtx(context.Background(), + ConnectionID, + ) +} + +func (client *ConnectionManager1) GetCurrentConnectionIDsCtx( + ctx context.Context, +) (ConnectionIDs string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1779,7 +2282,7 @@ func (client *ConnectionManager1) GetCurrentConnectionIDs() (ConnectionIDs strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_1, "GetCurrentConnectionIDs", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_1, "GetCurrentConnectionIDs", request, response); err != nil { return } @@ -1792,13 +2295,22 @@ func (client *ConnectionManager1) GetCurrentConnectionIDs() (ConnectionIDs strin return } +// GetCurrentConnectionIDs is the legacy version of GetCurrentConnectionIDsCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager1) GetCurrentConnectionIDs() (ConnectionIDs string, err error) { + return client.GetCurrentConnectionIDsCtx(context.Background()) +} + // // Return values: // // * Direction: allowed values: Input, Output // // * Status: allowed values: OK, ContentFormatMismatch, InsufficientBandwidth, UnreliableChannel, Unknown -func (client *ConnectionManager1) GetCurrentConnectionInfo(ConnectionID int32) (RcsID int32, AVTransportID int32, ProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string, Status string, err error) { +func (client *ConnectionManager1) GetCurrentConnectionInfoCtx( + ctx context.Context, + ConnectionID int32, +) (RcsID int32, AVTransportID int32, ProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string, Status string, err error) { // Request structure. request := &struct { ConnectionID string @@ -1822,7 +2334,7 @@ func (client *ConnectionManager1) GetCurrentConnectionInfo(ConnectionID int32) ( }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_1, "GetCurrentConnectionInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_1, "GetCurrentConnectionInfo", request, response); err != nil { return } @@ -1853,6 +2365,14 @@ func (client *ConnectionManager1) GetCurrentConnectionInfo(ConnectionID int32) ( return } +// GetCurrentConnectionInfo is the legacy version of GetCurrentConnectionInfoCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager1) GetCurrentConnectionInfo(ConnectionID int32) (RcsID int32, AVTransportID int32, ProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string, Status string, err error) { + return client.GetCurrentConnectionInfoCtx(context.Background(), + ConnectionID, + ) +} + // ConnectionManager2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ConnectionManager:2". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1913,7 +2433,9 @@ func newConnectionManager2ClientsFromGenericClients(genericClients []goupnp.Serv return clients } -func (client *ConnectionManager2) GetProtocolInfo() (Source string, Sink string, err error) { +func (client *ConnectionManager2) GetProtocolInfoCtx( + ctx context.Context, +) (Source string, Sink string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1927,7 +2449,7 @@ func (client *ConnectionManager2) GetProtocolInfo() (Source string, Sink string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_2, "GetProtocolInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_2, "GetProtocolInfo", request, response); err != nil { return } @@ -1943,12 +2465,24 @@ func (client *ConnectionManager2) GetProtocolInfo() (Source string, Sink string, return } +// GetProtocolInfo is the legacy version of GetProtocolInfoCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager2) GetProtocolInfo() (Source string, Sink string, err error) { + return client.GetProtocolInfoCtx(context.Background()) +} + // // Arguments: // // * Direction: allowed values: Input, Output -func (client *ConnectionManager2) PrepareForConnection(RemoteProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string) (ConnectionID int32, AVTransportID int32, RcsID int32, err error) { +func (client *ConnectionManager2) PrepareForConnectionCtx( + ctx context.Context, + RemoteProtocolInfo string, + PeerConnectionManager string, + PeerConnectionID int32, + Direction string, +) (ConnectionID int32, AVTransportID int32, RcsID int32, err error) { // Request structure. request := &struct { RemoteProtocolInfo string @@ -1980,7 +2514,7 @@ func (client *ConnectionManager2) PrepareForConnection(RemoteProtocolInfo string }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_2, "PrepareForConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_2, "PrepareForConnection", request, response); err != nil { return } @@ -1999,7 +2533,21 @@ func (client *ConnectionManager2) PrepareForConnection(RemoteProtocolInfo string return } -func (client *ConnectionManager2) ConnectionComplete(ConnectionID int32) (err error) { +// PrepareForConnection is the legacy version of PrepareForConnectionCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager2) PrepareForConnection(RemoteProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string) (ConnectionID int32, AVTransportID int32, RcsID int32, err error) { + return client.PrepareForConnectionCtx(context.Background(), + RemoteProtocolInfo, + PeerConnectionManager, + PeerConnectionID, + Direction, + ) +} + +func (client *ConnectionManager2) ConnectionCompleteCtx( + ctx context.Context, + ConnectionID int32, +) (err error) { // Request structure. request := &struct { ConnectionID string @@ -2015,7 +2563,7 @@ func (client *ConnectionManager2) ConnectionComplete(ConnectionID int32) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_2, "ConnectionComplete", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_2, "ConnectionComplete", request, response); err != nil { return } @@ -2025,7 +2573,17 @@ func (client *ConnectionManager2) ConnectionComplete(ConnectionID int32) (err er return } -func (client *ConnectionManager2) GetCurrentConnectionIDs() (ConnectionIDs string, err error) { +// ConnectionComplete is the legacy version of ConnectionCompleteCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager2) ConnectionComplete(ConnectionID int32) (err error) { + return client.ConnectionCompleteCtx(context.Background(), + ConnectionID, + ) +} + +func (client *ConnectionManager2) GetCurrentConnectionIDsCtx( + ctx context.Context, +) (ConnectionIDs string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2038,7 +2596,7 @@ func (client *ConnectionManager2) GetCurrentConnectionIDs() (ConnectionIDs strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_2, "GetCurrentConnectionIDs", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_2, "GetCurrentConnectionIDs", request, response); err != nil { return } @@ -2051,13 +2609,22 @@ func (client *ConnectionManager2) GetCurrentConnectionIDs() (ConnectionIDs strin return } +// GetCurrentConnectionIDs is the legacy version of GetCurrentConnectionIDsCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager2) GetCurrentConnectionIDs() (ConnectionIDs string, err error) { + return client.GetCurrentConnectionIDsCtx(context.Background()) +} + // // Return values: // // * Direction: allowed values: Input, Output // // * Status: allowed values: OK, ContentFormatMismatch, InsufficientBandwidth, UnreliableChannel, Unknown -func (client *ConnectionManager2) GetCurrentConnectionInfo(ConnectionID int32) (RcsID int32, AVTransportID int32, ProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string, Status string, err error) { +func (client *ConnectionManager2) GetCurrentConnectionInfoCtx( + ctx context.Context, + ConnectionID int32, +) (RcsID int32, AVTransportID int32, ProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string, Status string, err error) { // Request structure. request := &struct { ConnectionID string @@ -2081,7 +2648,7 @@ func (client *ConnectionManager2) GetCurrentConnectionInfo(ConnectionID int32) ( }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ConnectionManager_2, "GetCurrentConnectionInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ConnectionManager_2, "GetCurrentConnectionInfo", request, response); err != nil { return } @@ -2112,6 +2679,14 @@ func (client *ConnectionManager2) GetCurrentConnectionInfo(ConnectionID int32) ( return } +// GetCurrentConnectionInfo is the legacy version of GetCurrentConnectionInfoCtx, but uses +// context.Background() as the context. +func (client *ConnectionManager2) GetCurrentConnectionInfo(ConnectionID int32) (RcsID int32, AVTransportID int32, ProtocolInfo string, PeerConnectionManager string, PeerConnectionID int32, Direction string, Status string, err error) { + return client.GetCurrentConnectionInfoCtx(context.Background(), + ConnectionID, + ) +} + // ContentDirectory1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ContentDirectory:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -2172,7 +2747,9 @@ func newContentDirectory1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *ContentDirectory1) GetSearchCapabilities() (SearchCaps string, err error) { +func (client *ContentDirectory1) GetSearchCapabilitiesCtx( + ctx context.Context, +) (SearchCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2185,7 +2762,7 @@ func (client *ContentDirectory1) GetSearchCapabilities() (SearchCaps string, err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "GetSearchCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "GetSearchCapabilities", request, response); err != nil { return } @@ -2198,7 +2775,15 @@ func (client *ContentDirectory1) GetSearchCapabilities() (SearchCaps string, err return } -func (client *ContentDirectory1) GetSortCapabilities() (SortCaps string, err error) { +// GetSearchCapabilities is the legacy version of GetSearchCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) GetSearchCapabilities() (SearchCaps string, err error) { + return client.GetSearchCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory1) GetSortCapabilitiesCtx( + ctx context.Context, +) (SortCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2211,7 +2796,7 @@ func (client *ContentDirectory1) GetSortCapabilities() (SortCaps string, err err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "GetSortCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "GetSortCapabilities", request, response); err != nil { return } @@ -2224,7 +2809,15 @@ func (client *ContentDirectory1) GetSortCapabilities() (SortCaps string, err err return } -func (client *ContentDirectory1) GetSystemUpdateID() (Id uint32, err error) { +// GetSortCapabilities is the legacy version of GetSortCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) GetSortCapabilities() (SortCaps string, err error) { + return client.GetSortCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory1) GetSystemUpdateIDCtx( + ctx context.Context, +) (Id uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2237,7 +2830,7 @@ func (client *ContentDirectory1) GetSystemUpdateID() (Id uint32, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "GetSystemUpdateID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "GetSystemUpdateID", request, response); err != nil { return } @@ -2250,12 +2843,26 @@ func (client *ContentDirectory1) GetSystemUpdateID() (Id uint32, err error) { return } +// GetSystemUpdateID is the legacy version of GetSystemUpdateIDCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) GetSystemUpdateID() (Id uint32, err error) { + return client.GetSystemUpdateIDCtx(context.Background()) +} + // // Arguments: // // * BrowseFlag: allowed values: BrowseMetadata, BrowseDirectChildren -func (client *ContentDirectory1) Browse(ObjectID string, BrowseFlag string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +func (client *ContentDirectory1) BrowseCtx( + ctx context.Context, + ObjectID string, + BrowseFlag string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { ObjectID string @@ -2296,7 +2903,7 @@ func (client *ContentDirectory1) Browse(ObjectID string, BrowseFlag string, Filt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "Browse", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "Browse", request, response); err != nil { return } @@ -2318,7 +2925,28 @@ func (client *ContentDirectory1) Browse(ObjectID string, BrowseFlag string, Filt return } -func (client *ContentDirectory1) Search(ContainerID string, SearchCriteria string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// Browse is the legacy version of BrowseCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) Browse(ObjectID string, BrowseFlag string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseCtx(context.Background(), + ObjectID, + BrowseFlag, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ContentDirectory1) SearchCtx( + ctx context.Context, + ContainerID string, + SearchCriteria string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { ContainerID string @@ -2359,7 +2987,7 @@ func (client *ContentDirectory1) Search(ContainerID string, SearchCriteria strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "Search", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "Search", request, response); err != nil { return } @@ -2381,7 +3009,24 @@ func (client *ContentDirectory1) Search(ContainerID string, SearchCriteria strin return } -func (client *ContentDirectory1) CreateObject(ContainerID string, Elements string) (ObjectID string, Result string, err error) { +// Search is the legacy version of SearchCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) Search(ContainerID string, SearchCriteria string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.SearchCtx(context.Background(), + ContainerID, + SearchCriteria, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ContentDirectory1) CreateObjectCtx( + ctx context.Context, + ContainerID string, + Elements string, +) (ObjectID string, Result string, err error) { // Request structure. request := &struct { ContainerID string @@ -2404,7 +3049,7 @@ func (client *ContentDirectory1) CreateObject(ContainerID string, Elements strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "CreateObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "CreateObject", request, response); err != nil { return } @@ -2420,7 +3065,19 @@ func (client *ContentDirectory1) CreateObject(ContainerID string, Elements strin return } -func (client *ContentDirectory1) DestroyObject(ObjectID string) (err error) { +// CreateObject is the legacy version of CreateObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) CreateObject(ContainerID string, Elements string) (ObjectID string, Result string, err error) { + return client.CreateObjectCtx(context.Background(), + ContainerID, + Elements, + ) +} + +func (client *ContentDirectory1) DestroyObjectCtx( + ctx context.Context, + ObjectID string, +) (err error) { // Request structure. request := &struct { ObjectID string @@ -2436,7 +3093,7 @@ func (client *ContentDirectory1) DestroyObject(ObjectID string) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "DestroyObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "DestroyObject", request, response); err != nil { return } @@ -2446,7 +3103,20 @@ func (client *ContentDirectory1) DestroyObject(ObjectID string) (err error) { return } -func (client *ContentDirectory1) UpdateObject(ObjectID string, CurrentTagValue string, NewTagValue string) (err error) { +// DestroyObject is the legacy version of DestroyObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) DestroyObject(ObjectID string) (err error) { + return client.DestroyObjectCtx(context.Background(), + ObjectID, + ) +} + +func (client *ContentDirectory1) UpdateObjectCtx( + ctx context.Context, + ObjectID string, + CurrentTagValue string, + NewTagValue string, +) (err error) { // Request structure. request := &struct { ObjectID string @@ -2470,7 +3140,7 @@ func (client *ContentDirectory1) UpdateObject(ObjectID string, CurrentTagValue s response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "UpdateObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "UpdateObject", request, response); err != nil { return } @@ -2480,7 +3150,69 @@ func (client *ContentDirectory1) UpdateObject(ObjectID string, CurrentTagValue s return } +// UpdateObject is the legacy version of UpdateObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) UpdateObject(ObjectID string, CurrentTagValue string, NewTagValue string) (err error) { + return client.UpdateObjectCtx(context.Background(), + ObjectID, + CurrentTagValue, + NewTagValue, + ) +} + +func (client *ContentDirectory1) ImportResourceCtx( + ctx context.Context, + SourceURI *url.URL, + DestinationURI *url.URL, +) (TransferID uint32, err error) { + // Request structure. + request := &struct { + SourceURI string + DestinationURI string + }{} + // BEGIN Marshal arguments into request. + + if request.SourceURI, err = soap.MarshalURI(SourceURI); err != nil { + return + } + if request.DestinationURI, err = soap.MarshalURI(DestinationURI); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := &struct { + TransferID string + }{} + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "ImportResource", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + if TransferID, err = soap.UnmarshalUi4(response.TransferID); err != nil { + return + } + // END Unmarshal arguments from response. + return +} + +// ImportResource is the legacy version of ImportResourceCtx, but uses +// context.Background() as the context. func (client *ContentDirectory1) ImportResource(SourceURI *url.URL, DestinationURI *url.URL) (TransferID uint32, err error) { + return client.ImportResourceCtx(context.Background(), + SourceURI, + DestinationURI, + ) +} + +func (client *ContentDirectory1) ExportResourceCtx( + ctx context.Context, + SourceURI *url.URL, + DestinationURI *url.URL, +) (TransferID uint32, err error) { // Request structure. request := &struct { SourceURI string @@ -2502,7 +3234,7 @@ func (client *ContentDirectory1) ImportResource(SourceURI *url.URL, DestinationU }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "ImportResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "ExportResource", request, response); err != nil { return } @@ -2515,42 +3247,19 @@ func (client *ContentDirectory1) ImportResource(SourceURI *url.URL, DestinationU return } +// ExportResource is the legacy version of ExportResourceCtx, but uses +// context.Background() as the context. func (client *ContentDirectory1) ExportResource(SourceURI *url.URL, DestinationURI *url.URL) (TransferID uint32, err error) { - // Request structure. - request := &struct { - SourceURI string - DestinationURI string - }{} - // BEGIN Marshal arguments into request. - - if request.SourceURI, err = soap.MarshalURI(SourceURI); err != nil { - return - } - if request.DestinationURI, err = soap.MarshalURI(DestinationURI); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := &struct { - TransferID string - }{} - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "ExportResource", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - if TransferID, err = soap.UnmarshalUi4(response.TransferID); err != nil { - return - } - // END Unmarshal arguments from response. - return + return client.ExportResourceCtx(context.Background(), + SourceURI, + DestinationURI, + ) } -func (client *ContentDirectory1) StopTransferResource(TransferID uint32) (err error) { +func (client *ContentDirectory1) StopTransferResourceCtx( + ctx context.Context, + TransferID uint32, +) (err error) { // Request structure. request := &struct { TransferID string @@ -2566,7 +3275,7 @@ func (client *ContentDirectory1) StopTransferResource(TransferID uint32) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "StopTransferResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "StopTransferResource", request, response); err != nil { return } @@ -2576,11 +3285,22 @@ func (client *ContentDirectory1) StopTransferResource(TransferID uint32) (err er return } +// StopTransferResource is the legacy version of StopTransferResourceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) StopTransferResource(TransferID uint32) (err error) { + return client.StopTransferResourceCtx(context.Background(), + TransferID, + ) +} + // // Return values: // // * TransferStatus: allowed values: COMPLETED, ERROR, IN_PROGRESS, STOPPED -func (client *ContentDirectory1) GetTransferProgress(TransferID uint32) (TransferStatus string, TransferLength string, TransferTotal string, err error) { +func (client *ContentDirectory1) GetTransferProgressCtx( + ctx context.Context, + TransferID uint32, +) (TransferStatus string, TransferLength string, TransferTotal string, err error) { // Request structure. request := &struct { TransferID string @@ -2600,7 +3320,7 @@ func (client *ContentDirectory1) GetTransferProgress(TransferID uint32) (Transfe }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "GetTransferProgress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "GetTransferProgress", request, response); err != nil { return } @@ -2619,7 +3339,18 @@ func (client *ContentDirectory1) GetTransferProgress(TransferID uint32) (Transfe return } -func (client *ContentDirectory1) DeleteResource(ResourceURI *url.URL) (err error) { +// GetTransferProgress is the legacy version of GetTransferProgressCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) GetTransferProgress(TransferID uint32) (TransferStatus string, TransferLength string, TransferTotal string, err error) { + return client.GetTransferProgressCtx(context.Background(), + TransferID, + ) +} + +func (client *ContentDirectory1) DeleteResourceCtx( + ctx context.Context, + ResourceURI *url.URL, +) (err error) { // Request structure. request := &struct { ResourceURI string @@ -2635,7 +3366,7 @@ func (client *ContentDirectory1) DeleteResource(ResourceURI *url.URL) (err error response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "DeleteResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "DeleteResource", request, response); err != nil { return } @@ -2645,7 +3376,19 @@ func (client *ContentDirectory1) DeleteResource(ResourceURI *url.URL) (err error return } -func (client *ContentDirectory1) CreateReference(ContainerID string, ObjectID string) (NewID string, err error) { +// DeleteResource is the legacy version of DeleteResourceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) DeleteResource(ResourceURI *url.URL) (err error) { + return client.DeleteResourceCtx(context.Background(), + ResourceURI, + ) +} + +func (client *ContentDirectory1) CreateReferenceCtx( + ctx context.Context, + ContainerID string, + ObjectID string, +) (NewID string, err error) { // Request structure. request := &struct { ContainerID string @@ -2667,7 +3410,7 @@ func (client *ContentDirectory1) CreateReference(ContainerID string, ObjectID st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_1, "CreateReference", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_1, "CreateReference", request, response); err != nil { return } @@ -2680,6 +3423,15 @@ func (client *ContentDirectory1) CreateReference(ContainerID string, ObjectID st return } +// CreateReference is the legacy version of CreateReferenceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory1) CreateReference(ContainerID string, ObjectID string) (NewID string, err error) { + return client.CreateReferenceCtx(context.Background(), + ContainerID, + ObjectID, + ) +} + // ContentDirectory2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ContentDirectory:2". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -2740,7 +3492,9 @@ func newContentDirectory2ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *ContentDirectory2) GetSearchCapabilities() (SearchCaps string, err error) { +func (client *ContentDirectory2) GetSearchCapabilitiesCtx( + ctx context.Context, +) (SearchCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2753,7 +3507,7 @@ func (client *ContentDirectory2) GetSearchCapabilities() (SearchCaps string, err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "GetSearchCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "GetSearchCapabilities", request, response); err != nil { return } @@ -2766,7 +3520,15 @@ func (client *ContentDirectory2) GetSearchCapabilities() (SearchCaps string, err return } -func (client *ContentDirectory2) GetSortCapabilities() (SortCaps string, err error) { +// GetSearchCapabilities is the legacy version of GetSearchCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) GetSearchCapabilities() (SearchCaps string, err error) { + return client.GetSearchCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory2) GetSortCapabilitiesCtx( + ctx context.Context, +) (SortCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2779,7 +3541,7 @@ func (client *ContentDirectory2) GetSortCapabilities() (SortCaps string, err err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "GetSortCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "GetSortCapabilities", request, response); err != nil { return } @@ -2792,7 +3554,15 @@ func (client *ContentDirectory2) GetSortCapabilities() (SortCaps string, err err return } -func (client *ContentDirectory2) GetSortExtensionCapabilities() (SortExtensionCaps string, err error) { +// GetSortCapabilities is the legacy version of GetSortCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) GetSortCapabilities() (SortCaps string, err error) { + return client.GetSortCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory2) GetSortExtensionCapabilitiesCtx( + ctx context.Context, +) (SortExtensionCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2805,7 +3575,7 @@ func (client *ContentDirectory2) GetSortExtensionCapabilities() (SortExtensionCa }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "GetSortExtensionCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "GetSortExtensionCapabilities", request, response); err != nil { return } @@ -2818,7 +3588,15 @@ func (client *ContentDirectory2) GetSortExtensionCapabilities() (SortExtensionCa return } -func (client *ContentDirectory2) GetFeatureList() (FeatureList string, err error) { +// GetSortExtensionCapabilities is the legacy version of GetSortExtensionCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) GetSortExtensionCapabilities() (SortExtensionCaps string, err error) { + return client.GetSortExtensionCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory2) GetFeatureListCtx( + ctx context.Context, +) (FeatureList string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2831,7 +3609,7 @@ func (client *ContentDirectory2) GetFeatureList() (FeatureList string, err error }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "GetFeatureList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "GetFeatureList", request, response); err != nil { return } @@ -2844,7 +3622,15 @@ func (client *ContentDirectory2) GetFeatureList() (FeatureList string, err error return } -func (client *ContentDirectory2) GetSystemUpdateID() (Id uint32, err error) { +// GetFeatureList is the legacy version of GetFeatureListCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) GetFeatureList() (FeatureList string, err error) { + return client.GetFeatureListCtx(context.Background()) +} + +func (client *ContentDirectory2) GetSystemUpdateIDCtx( + ctx context.Context, +) (Id uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2857,7 +3643,7 @@ func (client *ContentDirectory2) GetSystemUpdateID() (Id uint32, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "GetSystemUpdateID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "GetSystemUpdateID", request, response); err != nil { return } @@ -2870,12 +3656,26 @@ func (client *ContentDirectory2) GetSystemUpdateID() (Id uint32, err error) { return } +// GetSystemUpdateID is the legacy version of GetSystemUpdateIDCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) GetSystemUpdateID() (Id uint32, err error) { + return client.GetSystemUpdateIDCtx(context.Background()) +} + // // Arguments: // // * BrowseFlag: allowed values: BrowseMetadata, BrowseDirectChildren -func (client *ContentDirectory2) Browse(ObjectID string, BrowseFlag string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +func (client *ContentDirectory2) BrowseCtx( + ctx context.Context, + ObjectID string, + BrowseFlag string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { ObjectID string @@ -2916,7 +3716,7 @@ func (client *ContentDirectory2) Browse(ObjectID string, BrowseFlag string, Filt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "Browse", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "Browse", request, response); err != nil { return } @@ -2938,7 +3738,28 @@ func (client *ContentDirectory2) Browse(ObjectID string, BrowseFlag string, Filt return } -func (client *ContentDirectory2) Search(ContainerID string, SearchCriteria string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// Browse is the legacy version of BrowseCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) Browse(ObjectID string, BrowseFlag string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseCtx(context.Background(), + ObjectID, + BrowseFlag, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ContentDirectory2) SearchCtx( + ctx context.Context, + ContainerID string, + SearchCriteria string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { ContainerID string @@ -2979,7 +3800,7 @@ func (client *ContentDirectory2) Search(ContainerID string, SearchCriteria strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "Search", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "Search", request, response); err != nil { return } @@ -3001,7 +3822,24 @@ func (client *ContentDirectory2) Search(ContainerID string, SearchCriteria strin return } -func (client *ContentDirectory2) CreateObject(ContainerID string, Elements string) (ObjectID string, Result string, err error) { +// Search is the legacy version of SearchCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) Search(ContainerID string, SearchCriteria string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.SearchCtx(context.Background(), + ContainerID, + SearchCriteria, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ContentDirectory2) CreateObjectCtx( + ctx context.Context, + ContainerID string, + Elements string, +) (ObjectID string, Result string, err error) { // Request structure. request := &struct { ContainerID string @@ -3024,7 +3862,7 @@ func (client *ContentDirectory2) CreateObject(ContainerID string, Elements strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "CreateObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "CreateObject", request, response); err != nil { return } @@ -3040,7 +3878,19 @@ func (client *ContentDirectory2) CreateObject(ContainerID string, Elements strin return } -func (client *ContentDirectory2) DestroyObject(ObjectID string) (err error) { +// CreateObject is the legacy version of CreateObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) CreateObject(ContainerID string, Elements string) (ObjectID string, Result string, err error) { + return client.CreateObjectCtx(context.Background(), + ContainerID, + Elements, + ) +} + +func (client *ContentDirectory2) DestroyObjectCtx( + ctx context.Context, + ObjectID string, +) (err error) { // Request structure. request := &struct { ObjectID string @@ -3056,7 +3906,7 @@ func (client *ContentDirectory2) DestroyObject(ObjectID string) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "DestroyObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "DestroyObject", request, response); err != nil { return } @@ -3066,7 +3916,20 @@ func (client *ContentDirectory2) DestroyObject(ObjectID string) (err error) { return } -func (client *ContentDirectory2) UpdateObject(ObjectID string, CurrentTagValue string, NewTagValue string) (err error) { +// DestroyObject is the legacy version of DestroyObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) DestroyObject(ObjectID string) (err error) { + return client.DestroyObjectCtx(context.Background(), + ObjectID, + ) +} + +func (client *ContentDirectory2) UpdateObjectCtx( + ctx context.Context, + ObjectID string, + CurrentTagValue string, + NewTagValue string, +) (err error) { // Request structure. request := &struct { ObjectID string @@ -3090,7 +3953,7 @@ func (client *ContentDirectory2) UpdateObject(ObjectID string, CurrentTagValue s response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "UpdateObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "UpdateObject", request, response); err != nil { return } @@ -3100,7 +3963,21 @@ func (client *ContentDirectory2) UpdateObject(ObjectID string, CurrentTagValue s return } -func (client *ContentDirectory2) MoveObject(ObjectID string, NewParentID string) (NewObjectID string, err error) { +// UpdateObject is the legacy version of UpdateObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) UpdateObject(ObjectID string, CurrentTagValue string, NewTagValue string) (err error) { + return client.UpdateObjectCtx(context.Background(), + ObjectID, + CurrentTagValue, + NewTagValue, + ) +} + +func (client *ContentDirectory2) MoveObjectCtx( + ctx context.Context, + ObjectID string, + NewParentID string, +) (NewObjectID string, err error) { // Request structure. request := &struct { ObjectID string @@ -3122,7 +3999,7 @@ func (client *ContentDirectory2) MoveObject(ObjectID string, NewParentID string) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "MoveObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "MoveObject", request, response); err != nil { return } @@ -3135,7 +4012,68 @@ func (client *ContentDirectory2) MoveObject(ObjectID string, NewParentID string) return } +// MoveObject is the legacy version of MoveObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) MoveObject(ObjectID string, NewParentID string) (NewObjectID string, err error) { + return client.MoveObjectCtx(context.Background(), + ObjectID, + NewParentID, + ) +} + +func (client *ContentDirectory2) ImportResourceCtx( + ctx context.Context, + SourceURI *url.URL, + DestinationURI *url.URL, +) (TransferID uint32, err error) { + // Request structure. + request := &struct { + SourceURI string + DestinationURI string + }{} + // BEGIN Marshal arguments into request. + + if request.SourceURI, err = soap.MarshalURI(SourceURI); err != nil { + return + } + if request.DestinationURI, err = soap.MarshalURI(DestinationURI); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := &struct { + TransferID string + }{} + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "ImportResource", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + if TransferID, err = soap.UnmarshalUi4(response.TransferID); err != nil { + return + } + // END Unmarshal arguments from response. + return +} + +// ImportResource is the legacy version of ImportResourceCtx, but uses +// context.Background() as the context. func (client *ContentDirectory2) ImportResource(SourceURI *url.URL, DestinationURI *url.URL) (TransferID uint32, err error) { + return client.ImportResourceCtx(context.Background(), + SourceURI, + DestinationURI, + ) +} + +func (client *ContentDirectory2) ExportResourceCtx( + ctx context.Context, + SourceURI *url.URL, + DestinationURI *url.URL, +) (TransferID uint32, err error) { // Request structure. request := &struct { SourceURI string @@ -3157,7 +4095,7 @@ func (client *ContentDirectory2) ImportResource(SourceURI *url.URL, DestinationU }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "ImportResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "ExportResource", request, response); err != nil { return } @@ -3170,42 +4108,19 @@ func (client *ContentDirectory2) ImportResource(SourceURI *url.URL, DestinationU return } +// ExportResource is the legacy version of ExportResourceCtx, but uses +// context.Background() as the context. func (client *ContentDirectory2) ExportResource(SourceURI *url.URL, DestinationURI *url.URL) (TransferID uint32, err error) { - // Request structure. - request := &struct { - SourceURI string - DestinationURI string - }{} - // BEGIN Marshal arguments into request. - - if request.SourceURI, err = soap.MarshalURI(SourceURI); err != nil { - return - } - if request.DestinationURI, err = soap.MarshalURI(DestinationURI); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := &struct { - TransferID string - }{} - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "ExportResource", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - if TransferID, err = soap.UnmarshalUi4(response.TransferID); err != nil { - return - } - // END Unmarshal arguments from response. - return + return client.ExportResourceCtx(context.Background(), + SourceURI, + DestinationURI, + ) } -func (client *ContentDirectory2) DeleteResource(ResourceURI *url.URL) (err error) { +func (client *ContentDirectory2) DeleteResourceCtx( + ctx context.Context, + ResourceURI *url.URL, +) (err error) { // Request structure. request := &struct { ResourceURI string @@ -3221,7 +4136,7 @@ func (client *ContentDirectory2) DeleteResource(ResourceURI *url.URL) (err error response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "DeleteResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "DeleteResource", request, response); err != nil { return } @@ -3231,7 +4146,18 @@ func (client *ContentDirectory2) DeleteResource(ResourceURI *url.URL) (err error return } -func (client *ContentDirectory2) StopTransferResource(TransferID uint32) (err error) { +// DeleteResource is the legacy version of DeleteResourceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) DeleteResource(ResourceURI *url.URL) (err error) { + return client.DeleteResourceCtx(context.Background(), + ResourceURI, + ) +} + +func (client *ContentDirectory2) StopTransferResourceCtx( + ctx context.Context, + TransferID uint32, +) (err error) { // Request structure. request := &struct { TransferID string @@ -3247,7 +4173,7 @@ func (client *ContentDirectory2) StopTransferResource(TransferID uint32) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "StopTransferResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "StopTransferResource", request, response); err != nil { return } @@ -3257,11 +4183,22 @@ func (client *ContentDirectory2) StopTransferResource(TransferID uint32) (err er return } +// StopTransferResource is the legacy version of StopTransferResourceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) StopTransferResource(TransferID uint32) (err error) { + return client.StopTransferResourceCtx(context.Background(), + TransferID, + ) +} + // // Return values: // // * TransferStatus: allowed values: COMPLETED, ERROR, IN_PROGRESS, STOPPED -func (client *ContentDirectory2) GetTransferProgress(TransferID uint32) (TransferStatus string, TransferLength string, TransferTotal string, err error) { +func (client *ContentDirectory2) GetTransferProgressCtx( + ctx context.Context, + TransferID uint32, +) (TransferStatus string, TransferLength string, TransferTotal string, err error) { // Request structure. request := &struct { TransferID string @@ -3281,7 +4218,7 @@ func (client *ContentDirectory2) GetTransferProgress(TransferID uint32) (Transfe }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "GetTransferProgress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "GetTransferProgress", request, response); err != nil { return } @@ -3300,7 +4237,19 @@ func (client *ContentDirectory2) GetTransferProgress(TransferID uint32) (Transfe return } -func (client *ContentDirectory2) CreateReference(ContainerID string, ObjectID string) (NewID string, err error) { +// GetTransferProgress is the legacy version of GetTransferProgressCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) GetTransferProgress(TransferID uint32) (TransferStatus string, TransferLength string, TransferTotal string, err error) { + return client.GetTransferProgressCtx(context.Background(), + TransferID, + ) +} + +func (client *ContentDirectory2) CreateReferenceCtx( + ctx context.Context, + ContainerID string, + ObjectID string, +) (NewID string, err error) { // Request structure. request := &struct { ContainerID string @@ -3322,7 +4271,7 @@ func (client *ContentDirectory2) CreateReference(ContainerID string, ObjectID st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_2, "CreateReference", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_2, "CreateReference", request, response); err != nil { return } @@ -3335,6 +4284,15 @@ func (client *ContentDirectory2) CreateReference(ContainerID string, ObjectID st return } +// CreateReference is the legacy version of CreateReferenceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory2) CreateReference(ContainerID string, ObjectID string) (NewID string, err error) { + return client.CreateReferenceCtx(context.Background(), + ContainerID, + ObjectID, + ) +} + // ContentDirectory3 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ContentDirectory:3". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -3395,7 +4353,9 @@ func newContentDirectory3ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *ContentDirectory3) GetSearchCapabilities() (SearchCaps string, err error) { +func (client *ContentDirectory3) GetSearchCapabilitiesCtx( + ctx context.Context, +) (SearchCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3408,7 +4368,7 @@ func (client *ContentDirectory3) GetSearchCapabilities() (SearchCaps string, err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetSearchCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetSearchCapabilities", request, response); err != nil { return } @@ -3421,7 +4381,15 @@ func (client *ContentDirectory3) GetSearchCapabilities() (SearchCaps string, err return } -func (client *ContentDirectory3) GetSortCapabilities() (SortCaps string, err error) { +// GetSearchCapabilities is the legacy version of GetSearchCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetSearchCapabilities() (SearchCaps string, err error) { + return client.GetSearchCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory3) GetSortCapabilitiesCtx( + ctx context.Context, +) (SortCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3434,7 +4402,7 @@ func (client *ContentDirectory3) GetSortCapabilities() (SortCaps string, err err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetSortCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetSortCapabilities", request, response); err != nil { return } @@ -3447,7 +4415,15 @@ func (client *ContentDirectory3) GetSortCapabilities() (SortCaps string, err err return } -func (client *ContentDirectory3) GetSortExtensionCapabilities() (SortExtensionCaps string, err error) { +// GetSortCapabilities is the legacy version of GetSortCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetSortCapabilities() (SortCaps string, err error) { + return client.GetSortCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory3) GetSortExtensionCapabilitiesCtx( + ctx context.Context, +) (SortExtensionCaps string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3460,7 +4436,7 @@ func (client *ContentDirectory3) GetSortExtensionCapabilities() (SortExtensionCa }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetSortExtensionCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetSortExtensionCapabilities", request, response); err != nil { return } @@ -3473,7 +4449,15 @@ func (client *ContentDirectory3) GetSortExtensionCapabilities() (SortExtensionCa return } -func (client *ContentDirectory3) GetFeatureList() (FeatureList string, err error) { +// GetSortExtensionCapabilities is the legacy version of GetSortExtensionCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetSortExtensionCapabilities() (SortExtensionCaps string, err error) { + return client.GetSortExtensionCapabilitiesCtx(context.Background()) +} + +func (client *ContentDirectory3) GetFeatureListCtx( + ctx context.Context, +) (FeatureList string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3486,7 +4470,7 @@ func (client *ContentDirectory3) GetFeatureList() (FeatureList string, err error }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetFeatureList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetFeatureList", request, response); err != nil { return } @@ -3499,7 +4483,15 @@ func (client *ContentDirectory3) GetFeatureList() (FeatureList string, err error return } -func (client *ContentDirectory3) GetSystemUpdateID() (Id uint32, err error) { +// GetFeatureList is the legacy version of GetFeatureListCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetFeatureList() (FeatureList string, err error) { + return client.GetFeatureListCtx(context.Background()) +} + +func (client *ContentDirectory3) GetSystemUpdateIDCtx( + ctx context.Context, +) (Id uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3512,7 +4504,7 @@ func (client *ContentDirectory3) GetSystemUpdateID() (Id uint32, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetSystemUpdateID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetSystemUpdateID", request, response); err != nil { return } @@ -3525,7 +4517,15 @@ func (client *ContentDirectory3) GetSystemUpdateID() (Id uint32, err error) { return } -func (client *ContentDirectory3) GetServiceResetToken() (ResetToken string, err error) { +// GetSystemUpdateID is the legacy version of GetSystemUpdateIDCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetSystemUpdateID() (Id uint32, err error) { + return client.GetSystemUpdateIDCtx(context.Background()) +} + +func (client *ContentDirectory3) GetServiceResetTokenCtx( + ctx context.Context, +) (ResetToken string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3538,7 +4538,7 @@ func (client *ContentDirectory3) GetServiceResetToken() (ResetToken string, err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetServiceResetToken", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetServiceResetToken", request, response); err != nil { return } @@ -3551,12 +4551,26 @@ func (client *ContentDirectory3) GetServiceResetToken() (ResetToken string, err return } +// GetServiceResetToken is the legacy version of GetServiceResetTokenCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetServiceResetToken() (ResetToken string, err error) { + return client.GetServiceResetTokenCtx(context.Background()) +} + // // Arguments: // // * BrowseFlag: allowed values: BrowseMetadata, BrowseDirectChildren -func (client *ContentDirectory3) Browse(ObjectID string, BrowseFlag string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +func (client *ContentDirectory3) BrowseCtx( + ctx context.Context, + ObjectID string, + BrowseFlag string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { ObjectID string @@ -3597,7 +4611,7 @@ func (client *ContentDirectory3) Browse(ObjectID string, BrowseFlag string, Filt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "Browse", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "Browse", request, response); err != nil { return } @@ -3619,7 +4633,28 @@ func (client *ContentDirectory3) Browse(ObjectID string, BrowseFlag string, Filt return } -func (client *ContentDirectory3) Search(ContainerID string, SearchCriteria string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// Browse is the legacy version of BrowseCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) Browse(ObjectID string, BrowseFlag string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseCtx(context.Background(), + ObjectID, + BrowseFlag, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ContentDirectory3) SearchCtx( + ctx context.Context, + ContainerID string, + SearchCriteria string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { ContainerID string @@ -3660,7 +4695,7 @@ func (client *ContentDirectory3) Search(ContainerID string, SearchCriteria strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "Search", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "Search", request, response); err != nil { return } @@ -3682,7 +4717,24 @@ func (client *ContentDirectory3) Search(ContainerID string, SearchCriteria strin return } -func (client *ContentDirectory3) CreateObject(ContainerID string, Elements string) (ObjectID string, Result string, err error) { +// Search is the legacy version of SearchCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) Search(ContainerID string, SearchCriteria string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.SearchCtx(context.Background(), + ContainerID, + SearchCriteria, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ContentDirectory3) CreateObjectCtx( + ctx context.Context, + ContainerID string, + Elements string, +) (ObjectID string, Result string, err error) { // Request structure. request := &struct { ContainerID string @@ -3705,7 +4757,7 @@ func (client *ContentDirectory3) CreateObject(ContainerID string, Elements strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "CreateObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "CreateObject", request, response); err != nil { return } @@ -3721,7 +4773,19 @@ func (client *ContentDirectory3) CreateObject(ContainerID string, Elements strin return } -func (client *ContentDirectory3) DestroyObject(ObjectID string) (err error) { +// CreateObject is the legacy version of CreateObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) CreateObject(ContainerID string, Elements string) (ObjectID string, Result string, err error) { + return client.CreateObjectCtx(context.Background(), + ContainerID, + Elements, + ) +} + +func (client *ContentDirectory3) DestroyObjectCtx( + ctx context.Context, + ObjectID string, +) (err error) { // Request structure. request := &struct { ObjectID string @@ -3737,7 +4801,7 @@ func (client *ContentDirectory3) DestroyObject(ObjectID string) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "DestroyObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "DestroyObject", request, response); err != nil { return } @@ -3747,7 +4811,20 @@ func (client *ContentDirectory3) DestroyObject(ObjectID string) (err error) { return } -func (client *ContentDirectory3) UpdateObject(ObjectID string, CurrentTagValue string, NewTagValue string) (err error) { +// DestroyObject is the legacy version of DestroyObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) DestroyObject(ObjectID string) (err error) { + return client.DestroyObjectCtx(context.Background(), + ObjectID, + ) +} + +func (client *ContentDirectory3) UpdateObjectCtx( + ctx context.Context, + ObjectID string, + CurrentTagValue string, + NewTagValue string, +) (err error) { // Request structure. request := &struct { ObjectID string @@ -3771,7 +4848,7 @@ func (client *ContentDirectory3) UpdateObject(ObjectID string, CurrentTagValue s response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "UpdateObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "UpdateObject", request, response); err != nil { return } @@ -3781,7 +4858,21 @@ func (client *ContentDirectory3) UpdateObject(ObjectID string, CurrentTagValue s return } -func (client *ContentDirectory3) MoveObject(ObjectID string, NewParentID string) (NewObjectID string, err error) { +// UpdateObject is the legacy version of UpdateObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) UpdateObject(ObjectID string, CurrentTagValue string, NewTagValue string) (err error) { + return client.UpdateObjectCtx(context.Background(), + ObjectID, + CurrentTagValue, + NewTagValue, + ) +} + +func (client *ContentDirectory3) MoveObjectCtx( + ctx context.Context, + ObjectID string, + NewParentID string, +) (NewObjectID string, err error) { // Request structure. request := &struct { ObjectID string @@ -3803,7 +4894,7 @@ func (client *ContentDirectory3) MoveObject(ObjectID string, NewParentID string) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "MoveObject", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "MoveObject", request, response); err != nil { return } @@ -3816,7 +4907,68 @@ func (client *ContentDirectory3) MoveObject(ObjectID string, NewParentID string) return } +// MoveObject is the legacy version of MoveObjectCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) MoveObject(ObjectID string, NewParentID string) (NewObjectID string, err error) { + return client.MoveObjectCtx(context.Background(), + ObjectID, + NewParentID, + ) +} + +func (client *ContentDirectory3) ImportResourceCtx( + ctx context.Context, + SourceURI *url.URL, + DestinationURI *url.URL, +) (TransferID uint32, err error) { + // Request structure. + request := &struct { + SourceURI string + DestinationURI string + }{} + // BEGIN Marshal arguments into request. + + if request.SourceURI, err = soap.MarshalURI(SourceURI); err != nil { + return + } + if request.DestinationURI, err = soap.MarshalURI(DestinationURI); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := &struct { + TransferID string + }{} + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "ImportResource", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + if TransferID, err = soap.UnmarshalUi4(response.TransferID); err != nil { + return + } + // END Unmarshal arguments from response. + return +} + +// ImportResource is the legacy version of ImportResourceCtx, but uses +// context.Background() as the context. func (client *ContentDirectory3) ImportResource(SourceURI *url.URL, DestinationURI *url.URL) (TransferID uint32, err error) { + return client.ImportResourceCtx(context.Background(), + SourceURI, + DestinationURI, + ) +} + +func (client *ContentDirectory3) ExportResourceCtx( + ctx context.Context, + SourceURI *url.URL, + DestinationURI *url.URL, +) (TransferID uint32, err error) { // Request structure. request := &struct { SourceURI string @@ -3838,7 +4990,7 @@ func (client *ContentDirectory3) ImportResource(SourceURI *url.URL, DestinationU }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "ImportResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "ExportResource", request, response); err != nil { return } @@ -3851,42 +5003,19 @@ func (client *ContentDirectory3) ImportResource(SourceURI *url.URL, DestinationU return } +// ExportResource is the legacy version of ExportResourceCtx, but uses +// context.Background() as the context. func (client *ContentDirectory3) ExportResource(SourceURI *url.URL, DestinationURI *url.URL) (TransferID uint32, err error) { - // Request structure. - request := &struct { - SourceURI string - DestinationURI string - }{} - // BEGIN Marshal arguments into request. - - if request.SourceURI, err = soap.MarshalURI(SourceURI); err != nil { - return - } - if request.DestinationURI, err = soap.MarshalURI(DestinationURI); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := &struct { - TransferID string - }{} - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "ExportResource", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - if TransferID, err = soap.UnmarshalUi4(response.TransferID); err != nil { - return - } - // END Unmarshal arguments from response. - return + return client.ExportResourceCtx(context.Background(), + SourceURI, + DestinationURI, + ) } -func (client *ContentDirectory3) DeleteResource(ResourceURI *url.URL) (err error) { +func (client *ContentDirectory3) DeleteResourceCtx( + ctx context.Context, + ResourceURI *url.URL, +) (err error) { // Request structure. request := &struct { ResourceURI string @@ -3902,7 +5031,7 @@ func (client *ContentDirectory3) DeleteResource(ResourceURI *url.URL) (err error response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "DeleteResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "DeleteResource", request, response); err != nil { return } @@ -3912,7 +5041,18 @@ func (client *ContentDirectory3) DeleteResource(ResourceURI *url.URL) (err error return } -func (client *ContentDirectory3) StopTransferResource(TransferID uint32) (err error) { +// DeleteResource is the legacy version of DeleteResourceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) DeleteResource(ResourceURI *url.URL) (err error) { + return client.DeleteResourceCtx(context.Background(), + ResourceURI, + ) +} + +func (client *ContentDirectory3) StopTransferResourceCtx( + ctx context.Context, + TransferID uint32, +) (err error) { // Request structure. request := &struct { TransferID string @@ -3928,7 +5068,7 @@ func (client *ContentDirectory3) StopTransferResource(TransferID uint32) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "StopTransferResource", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "StopTransferResource", request, response); err != nil { return } @@ -3938,11 +5078,22 @@ func (client *ContentDirectory3) StopTransferResource(TransferID uint32) (err er return } +// StopTransferResource is the legacy version of StopTransferResourceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) StopTransferResource(TransferID uint32) (err error) { + return client.StopTransferResourceCtx(context.Background(), + TransferID, + ) +} + // // Return values: // // * TransferStatus: allowed values: COMPLETED, ERROR, IN_PROGRESS, STOPPED -func (client *ContentDirectory3) GetTransferProgress(TransferID uint32) (TransferStatus string, TransferLength string, TransferTotal string, err error) { +func (client *ContentDirectory3) GetTransferProgressCtx( + ctx context.Context, + TransferID uint32, +) (TransferStatus string, TransferLength string, TransferTotal string, err error) { // Request structure. request := &struct { TransferID string @@ -3962,7 +5113,7 @@ func (client *ContentDirectory3) GetTransferProgress(TransferID uint32) (Transfe }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetTransferProgress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetTransferProgress", request, response); err != nil { return } @@ -3981,7 +5132,19 @@ func (client *ContentDirectory3) GetTransferProgress(TransferID uint32) (Transfe return } -func (client *ContentDirectory3) CreateReference(ContainerID string, ObjectID string) (NewID string, err error) { +// GetTransferProgress is the legacy version of GetTransferProgressCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetTransferProgress(TransferID uint32) (TransferStatus string, TransferLength string, TransferTotal string, err error) { + return client.GetTransferProgressCtx(context.Background(), + TransferID, + ) +} + +func (client *ContentDirectory3) CreateReferenceCtx( + ctx context.Context, + ContainerID string, + ObjectID string, +) (NewID string, err error) { // Request structure. request := &struct { ContainerID string @@ -4003,7 +5166,7 @@ func (client *ContentDirectory3) CreateReference(ContainerID string, ObjectID st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "CreateReference", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "CreateReference", request, response); err != nil { return } @@ -4016,7 +5179,21 @@ func (client *ContentDirectory3) CreateReference(ContainerID string, ObjectID st return } -func (client *ContentDirectory3) FreeFormQuery(ContainerID string, CDSView uint32, QueryRequest string) (QueryResult string, UpdateID uint32, err error) { +// CreateReference is the legacy version of CreateReferenceCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) CreateReference(ContainerID string, ObjectID string) (NewID string, err error) { + return client.CreateReferenceCtx(context.Background(), + ContainerID, + ObjectID, + ) +} + +func (client *ContentDirectory3) FreeFormQueryCtx( + ctx context.Context, + ContainerID string, + CDSView uint32, + QueryRequest string, +) (QueryResult string, UpdateID uint32, err error) { // Request structure. request := &struct { ContainerID string @@ -4043,7 +5220,7 @@ func (client *ContentDirectory3) FreeFormQuery(ContainerID string, CDSView uint3 }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "FreeFormQuery", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "FreeFormQuery", request, response); err != nil { return } @@ -4059,7 +5236,19 @@ func (client *ContentDirectory3) FreeFormQuery(ContainerID string, CDSView uint3 return } -func (client *ContentDirectory3) GetFreeFormQueryCapabilities() (FFQCapabilities string, err error) { +// FreeFormQuery is the legacy version of FreeFormQueryCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) FreeFormQuery(ContainerID string, CDSView uint32, QueryRequest string) (QueryResult string, UpdateID uint32, err error) { + return client.FreeFormQueryCtx(context.Background(), + ContainerID, + CDSView, + QueryRequest, + ) +} + +func (client *ContentDirectory3) GetFreeFormQueryCapabilitiesCtx( + ctx context.Context, +) (FFQCapabilities string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4072,7 +5261,7 @@ func (client *ContentDirectory3) GetFreeFormQueryCapabilities() (FFQCapabilities }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ContentDirectory_3, "GetFreeFormQueryCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ContentDirectory_3, "GetFreeFormQueryCapabilities", request, response); err != nil { return } @@ -4085,6 +5274,12 @@ func (client *ContentDirectory3) GetFreeFormQueryCapabilities() (FFQCapabilities return } +// GetFreeFormQueryCapabilities is the legacy version of GetFreeFormQueryCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ContentDirectory3) GetFreeFormQueryCapabilities() (FFQCapabilities string, err error) { + return client.GetFreeFormQueryCapabilitiesCtx(context.Background()) +} + // RenderingControl1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:RenderingControl:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -4145,7 +5340,10 @@ func newRenderingControl1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *RenderingControl1) ListPresets(InstanceID uint32) (CurrentPresetNameList string, err error) { +func (client *RenderingControl1) ListPresetsCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentPresetNameList string, err error) { // Request structure. request := &struct { InstanceID string @@ -4163,7 +5361,7 @@ func (client *RenderingControl1) ListPresets(InstanceID uint32) (CurrentPresetNa }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "ListPresets", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "ListPresets", request, response); err != nil { return } @@ -4176,12 +5374,24 @@ func (client *RenderingControl1) ListPresets(InstanceID uint32) (CurrentPresetNa return } +// ListPresets is the legacy version of ListPresetsCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) ListPresets(InstanceID uint32) (CurrentPresetNameList string, err error) { + return client.ListPresetsCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * PresetName: allowed values: FactoryDefaults -func (client *RenderingControl1) SelectPreset(InstanceID uint32, PresetName string) (err error) { +func (client *RenderingControl1) SelectPresetCtx( + ctx context.Context, + InstanceID uint32, + PresetName string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4201,7 +5411,7 @@ func (client *RenderingControl1) SelectPreset(InstanceID uint32, PresetName stri response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SelectPreset", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SelectPreset", request, response); err != nil { return } @@ -4211,11 +5421,23 @@ func (client *RenderingControl1) SelectPreset(InstanceID uint32, PresetName stri return } +// SelectPreset is the legacy version of SelectPresetCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SelectPreset(InstanceID uint32, PresetName string) (err error) { + return client.SelectPresetCtx(context.Background(), + InstanceID, + PresetName, + ) +} + // // Return values: // // * CurrentBrightness: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetBrightness(InstanceID uint32) (CurrentBrightness uint16, err error) { +func (client *RenderingControl1) GetBrightnessCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentBrightness uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4233,7 +5455,7 @@ func (client *RenderingControl1) GetBrightness(InstanceID uint32) (CurrentBright }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetBrightness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetBrightness", request, response); err != nil { return } @@ -4246,12 +5468,24 @@ func (client *RenderingControl1) GetBrightness(InstanceID uint32) (CurrentBright return } +// GetBrightness is the legacy version of GetBrightnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetBrightness(InstanceID uint32) (CurrentBrightness uint16, err error) { + return client.GetBrightnessCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredBrightness: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetBrightness(InstanceID uint32, DesiredBrightness uint16) (err error) { +func (client *RenderingControl1) SetBrightnessCtx( + ctx context.Context, + InstanceID uint32, + DesiredBrightness uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4271,7 +5505,7 @@ func (client *RenderingControl1) SetBrightness(InstanceID uint32, DesiredBrightn response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetBrightness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetBrightness", request, response); err != nil { return } @@ -4281,11 +5515,23 @@ func (client *RenderingControl1) SetBrightness(InstanceID uint32, DesiredBrightn return } +// SetBrightness is the legacy version of SetBrightnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetBrightness(InstanceID uint32, DesiredBrightness uint16) (err error) { + return client.SetBrightnessCtx(context.Background(), + InstanceID, + DesiredBrightness, + ) +} + // // Return values: // // * CurrentContrast: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetContrast(InstanceID uint32) (CurrentContrast uint16, err error) { +func (client *RenderingControl1) GetContrastCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentContrast uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4303,7 +5549,7 @@ func (client *RenderingControl1) GetContrast(InstanceID uint32) (CurrentContrast }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetContrast", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetContrast", request, response); err != nil { return } @@ -4316,12 +5562,24 @@ func (client *RenderingControl1) GetContrast(InstanceID uint32) (CurrentContrast return } +// GetContrast is the legacy version of GetContrastCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetContrast(InstanceID uint32) (CurrentContrast uint16, err error) { + return client.GetContrastCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredContrast: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetContrast(InstanceID uint32, DesiredContrast uint16) (err error) { +func (client *RenderingControl1) SetContrastCtx( + ctx context.Context, + InstanceID uint32, + DesiredContrast uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4341,7 +5599,7 @@ func (client *RenderingControl1) SetContrast(InstanceID uint32, DesiredContrast response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetContrast", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetContrast", request, response); err != nil { return } @@ -4351,11 +5609,23 @@ func (client *RenderingControl1) SetContrast(InstanceID uint32, DesiredContrast return } +// SetContrast is the legacy version of SetContrastCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetContrast(InstanceID uint32, DesiredContrast uint16) (err error) { + return client.SetContrastCtx(context.Background(), + InstanceID, + DesiredContrast, + ) +} + // // Return values: // // * CurrentSharpness: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetSharpness(InstanceID uint32) (CurrentSharpness uint16, err error) { +func (client *RenderingControl1) GetSharpnessCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentSharpness uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4373,7 +5643,7 @@ func (client *RenderingControl1) GetSharpness(InstanceID uint32) (CurrentSharpne }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetSharpness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetSharpness", request, response); err != nil { return } @@ -4386,12 +5656,24 @@ func (client *RenderingControl1) GetSharpness(InstanceID uint32) (CurrentSharpne return } +// GetSharpness is the legacy version of GetSharpnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetSharpness(InstanceID uint32) (CurrentSharpness uint16, err error) { + return client.GetSharpnessCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredSharpness: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetSharpness(InstanceID uint32, DesiredSharpness uint16) (err error) { +func (client *RenderingControl1) SetSharpnessCtx( + ctx context.Context, + InstanceID uint32, + DesiredSharpness uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4411,7 +5693,7 @@ func (client *RenderingControl1) SetSharpness(InstanceID uint32, DesiredSharpnes response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetSharpness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetSharpness", request, response); err != nil { return } @@ -4421,7 +5703,19 @@ func (client *RenderingControl1) SetSharpness(InstanceID uint32, DesiredSharpnes return } -func (client *RenderingControl1) GetRedVideoGain(InstanceID uint32) (CurrentRedVideoGain uint16, err error) { +// SetSharpness is the legacy version of SetSharpnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetSharpness(InstanceID uint32, DesiredSharpness uint16) (err error) { + return client.SetSharpnessCtx(context.Background(), + InstanceID, + DesiredSharpness, + ) +} + +func (client *RenderingControl1) GetRedVideoGainCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentRedVideoGain uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4439,7 +5733,7 @@ func (client *RenderingControl1) GetRedVideoGain(InstanceID uint32) (CurrentRedV }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetRedVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetRedVideoGain", request, response); err != nil { return } @@ -4452,7 +5746,19 @@ func (client *RenderingControl1) GetRedVideoGain(InstanceID uint32) (CurrentRedV return } -func (client *RenderingControl1) SetRedVideoGain(InstanceID uint32, DesiredRedVideoGain uint16) (err error) { +// GetRedVideoGain is the legacy version of GetRedVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetRedVideoGain(InstanceID uint32) (CurrentRedVideoGain uint16, err error) { + return client.GetRedVideoGainCtx(context.Background(), + InstanceID, + ) +} + +func (client *RenderingControl1) SetRedVideoGainCtx( + ctx context.Context, + InstanceID uint32, + DesiredRedVideoGain uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4472,7 +5778,7 @@ func (client *RenderingControl1) SetRedVideoGain(InstanceID uint32, DesiredRedVi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetRedVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetRedVideoGain", request, response); err != nil { return } @@ -4482,11 +5788,23 @@ func (client *RenderingControl1) SetRedVideoGain(InstanceID uint32, DesiredRedVi return } +// SetRedVideoGain is the legacy version of SetRedVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetRedVideoGain(InstanceID uint32, DesiredRedVideoGain uint16) (err error) { + return client.SetRedVideoGainCtx(context.Background(), + InstanceID, + DesiredRedVideoGain, + ) +} + // // Return values: // // * CurrentGreenVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetGreenVideoGain(InstanceID uint32) (CurrentGreenVideoGain uint16, err error) { +func (client *RenderingControl1) GetGreenVideoGainCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentGreenVideoGain uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4504,7 +5822,7 @@ func (client *RenderingControl1) GetGreenVideoGain(InstanceID uint32) (CurrentGr }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetGreenVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetGreenVideoGain", request, response); err != nil { return } @@ -4517,12 +5835,24 @@ func (client *RenderingControl1) GetGreenVideoGain(InstanceID uint32) (CurrentGr return } +// GetGreenVideoGain is the legacy version of GetGreenVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetGreenVideoGain(InstanceID uint32) (CurrentGreenVideoGain uint16, err error) { + return client.GetGreenVideoGainCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredGreenVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetGreenVideoGain(InstanceID uint32, DesiredGreenVideoGain uint16) (err error) { +func (client *RenderingControl1) SetGreenVideoGainCtx( + ctx context.Context, + InstanceID uint32, + DesiredGreenVideoGain uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4542,7 +5872,7 @@ func (client *RenderingControl1) SetGreenVideoGain(InstanceID uint32, DesiredGre response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetGreenVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetGreenVideoGain", request, response); err != nil { return } @@ -4552,11 +5882,23 @@ func (client *RenderingControl1) SetGreenVideoGain(InstanceID uint32, DesiredGre return } +// SetGreenVideoGain is the legacy version of SetGreenVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetGreenVideoGain(InstanceID uint32, DesiredGreenVideoGain uint16) (err error) { + return client.SetGreenVideoGainCtx(context.Background(), + InstanceID, + DesiredGreenVideoGain, + ) +} + // // Return values: // // * CurrentBlueVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetBlueVideoGain(InstanceID uint32) (CurrentBlueVideoGain uint16, err error) { +func (client *RenderingControl1) GetBlueVideoGainCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentBlueVideoGain uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4574,7 +5916,7 @@ func (client *RenderingControl1) GetBlueVideoGain(InstanceID uint32) (CurrentBlu }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetBlueVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetBlueVideoGain", request, response); err != nil { return } @@ -4587,12 +5929,24 @@ func (client *RenderingControl1) GetBlueVideoGain(InstanceID uint32) (CurrentBlu return } +// GetBlueVideoGain is the legacy version of GetBlueVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetBlueVideoGain(InstanceID uint32) (CurrentBlueVideoGain uint16, err error) { + return client.GetBlueVideoGainCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredBlueVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetBlueVideoGain(InstanceID uint32, DesiredBlueVideoGain uint16) (err error) { +func (client *RenderingControl1) SetBlueVideoGainCtx( + ctx context.Context, + InstanceID uint32, + DesiredBlueVideoGain uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4612,7 +5966,7 @@ func (client *RenderingControl1) SetBlueVideoGain(InstanceID uint32, DesiredBlue response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetBlueVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetBlueVideoGain", request, response); err != nil { return } @@ -4622,11 +5976,23 @@ func (client *RenderingControl1) SetBlueVideoGain(InstanceID uint32, DesiredBlue return } +// SetBlueVideoGain is the legacy version of SetBlueVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetBlueVideoGain(InstanceID uint32, DesiredBlueVideoGain uint16) (err error) { + return client.SetBlueVideoGainCtx(context.Background(), + InstanceID, + DesiredBlueVideoGain, + ) +} + // // Return values: // // * CurrentRedVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetRedVideoBlackLevel(InstanceID uint32) (CurrentRedVideoBlackLevel uint16, err error) { +func (client *RenderingControl1) GetRedVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentRedVideoBlackLevel uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4644,7 +6010,7 @@ func (client *RenderingControl1) GetRedVideoBlackLevel(InstanceID uint32) (Curre }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetRedVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetRedVideoBlackLevel", request, response); err != nil { return } @@ -4657,12 +6023,24 @@ func (client *RenderingControl1) GetRedVideoBlackLevel(InstanceID uint32) (Curre return } +// GetRedVideoBlackLevel is the legacy version of GetRedVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetRedVideoBlackLevel(InstanceID uint32) (CurrentRedVideoBlackLevel uint16, err error) { + return client.GetRedVideoBlackLevelCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredRedVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetRedVideoBlackLevel(InstanceID uint32, DesiredRedVideoBlackLevel uint16) (err error) { +func (client *RenderingControl1) SetRedVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, + DesiredRedVideoBlackLevel uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4682,7 +6060,7 @@ func (client *RenderingControl1) SetRedVideoBlackLevel(InstanceID uint32, Desire response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetRedVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetRedVideoBlackLevel", request, response); err != nil { return } @@ -4692,11 +6070,23 @@ func (client *RenderingControl1) SetRedVideoBlackLevel(InstanceID uint32, Desire return } +// SetRedVideoBlackLevel is the legacy version of SetRedVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetRedVideoBlackLevel(InstanceID uint32, DesiredRedVideoBlackLevel uint16) (err error) { + return client.SetRedVideoBlackLevelCtx(context.Background(), + InstanceID, + DesiredRedVideoBlackLevel, + ) +} + // // Return values: // // * CurrentGreenVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetGreenVideoBlackLevel(InstanceID uint32) (CurrentGreenVideoBlackLevel uint16, err error) { +func (client *RenderingControl1) GetGreenVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentGreenVideoBlackLevel uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4714,7 +6104,7 @@ func (client *RenderingControl1) GetGreenVideoBlackLevel(InstanceID uint32) (Cur }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetGreenVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetGreenVideoBlackLevel", request, response); err != nil { return } @@ -4727,12 +6117,24 @@ func (client *RenderingControl1) GetGreenVideoBlackLevel(InstanceID uint32) (Cur return } +// GetGreenVideoBlackLevel is the legacy version of GetGreenVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetGreenVideoBlackLevel(InstanceID uint32) (CurrentGreenVideoBlackLevel uint16, err error) { + return client.GetGreenVideoBlackLevelCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredGreenVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetGreenVideoBlackLevel(InstanceID uint32, DesiredGreenVideoBlackLevel uint16) (err error) { +func (client *RenderingControl1) SetGreenVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, + DesiredGreenVideoBlackLevel uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4752,7 +6154,7 @@ func (client *RenderingControl1) SetGreenVideoBlackLevel(InstanceID uint32, Desi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetGreenVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetGreenVideoBlackLevel", request, response); err != nil { return } @@ -4762,11 +6164,23 @@ func (client *RenderingControl1) SetGreenVideoBlackLevel(InstanceID uint32, Desi return } +// SetGreenVideoBlackLevel is the legacy version of SetGreenVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetGreenVideoBlackLevel(InstanceID uint32, DesiredGreenVideoBlackLevel uint16) (err error) { + return client.SetGreenVideoBlackLevelCtx(context.Background(), + InstanceID, + DesiredGreenVideoBlackLevel, + ) +} + // // Return values: // // * CurrentBlueVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetBlueVideoBlackLevel(InstanceID uint32) (CurrentBlueVideoBlackLevel uint16, err error) { +func (client *RenderingControl1) GetBlueVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentBlueVideoBlackLevel uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4784,7 +6198,7 @@ func (client *RenderingControl1) GetBlueVideoBlackLevel(InstanceID uint32) (Curr }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetBlueVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetBlueVideoBlackLevel", request, response); err != nil { return } @@ -4797,12 +6211,24 @@ func (client *RenderingControl1) GetBlueVideoBlackLevel(InstanceID uint32) (Curr return } +// GetBlueVideoBlackLevel is the legacy version of GetBlueVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetBlueVideoBlackLevel(InstanceID uint32) (CurrentBlueVideoBlackLevel uint16, err error) { + return client.GetBlueVideoBlackLevelCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredBlueVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetBlueVideoBlackLevel(InstanceID uint32, DesiredBlueVideoBlackLevel uint16) (err error) { +func (client *RenderingControl1) SetBlueVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, + DesiredBlueVideoBlackLevel uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4822,7 +6248,7 @@ func (client *RenderingControl1) SetBlueVideoBlackLevel(InstanceID uint32, Desir response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetBlueVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetBlueVideoBlackLevel", request, response); err != nil { return } @@ -4832,11 +6258,23 @@ func (client *RenderingControl1) SetBlueVideoBlackLevel(InstanceID uint32, Desir return } +// SetBlueVideoBlackLevel is the legacy version of SetBlueVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetBlueVideoBlackLevel(InstanceID uint32, DesiredBlueVideoBlackLevel uint16) (err error) { + return client.SetBlueVideoBlackLevelCtx(context.Background(), + InstanceID, + DesiredBlueVideoBlackLevel, + ) +} + // // Return values: // // * CurrentColorTemperature: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetColorTemperature(InstanceID uint32) (CurrentColorTemperature uint16, err error) { +func (client *RenderingControl1) GetColorTemperatureCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentColorTemperature uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -4854,7 +6292,7 @@ func (client *RenderingControl1) GetColorTemperature(InstanceID uint32) (Current }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetColorTemperature", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetColorTemperature", request, response); err != nil { return } @@ -4867,12 +6305,24 @@ func (client *RenderingControl1) GetColorTemperature(InstanceID uint32) (Current return } +// GetColorTemperature is the legacy version of GetColorTemperatureCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetColorTemperature(InstanceID uint32) (CurrentColorTemperature uint16, err error) { + return client.GetColorTemperatureCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredColorTemperature: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetColorTemperature(InstanceID uint32, DesiredColorTemperature uint16) (err error) { +func (client *RenderingControl1) SetColorTemperatureCtx( + ctx context.Context, + InstanceID uint32, + DesiredColorTemperature uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4892,7 +6342,7 @@ func (client *RenderingControl1) SetColorTemperature(InstanceID uint32, DesiredC response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetColorTemperature", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetColorTemperature", request, response); err != nil { return } @@ -4902,11 +6352,23 @@ func (client *RenderingControl1) SetColorTemperature(InstanceID uint32, DesiredC return } +// SetColorTemperature is the legacy version of SetColorTemperatureCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetColorTemperature(InstanceID uint32, DesiredColorTemperature uint16) (err error) { + return client.SetColorTemperatureCtx(context.Background(), + InstanceID, + DesiredColorTemperature, + ) +} + // // Return values: // // * CurrentHorizontalKeystone: allowed value range: step=1 -func (client *RenderingControl1) GetHorizontalKeystone(InstanceID uint32) (CurrentHorizontalKeystone int16, err error) { +func (client *RenderingControl1) GetHorizontalKeystoneCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentHorizontalKeystone int16, err error) { // Request structure. request := &struct { InstanceID string @@ -4924,7 +6386,7 @@ func (client *RenderingControl1) GetHorizontalKeystone(InstanceID uint32) (Curre }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetHorizontalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetHorizontalKeystone", request, response); err != nil { return } @@ -4937,12 +6399,24 @@ func (client *RenderingControl1) GetHorizontalKeystone(InstanceID uint32) (Curre return } +// GetHorizontalKeystone is the legacy version of GetHorizontalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetHorizontalKeystone(InstanceID uint32) (CurrentHorizontalKeystone int16, err error) { + return client.GetHorizontalKeystoneCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredHorizontalKeystone: allowed value range: step=1 -func (client *RenderingControl1) SetHorizontalKeystone(InstanceID uint32, DesiredHorizontalKeystone int16) (err error) { +func (client *RenderingControl1) SetHorizontalKeystoneCtx( + ctx context.Context, + InstanceID uint32, + DesiredHorizontalKeystone int16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -4962,7 +6436,7 @@ func (client *RenderingControl1) SetHorizontalKeystone(InstanceID uint32, Desire response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetHorizontalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetHorizontalKeystone", request, response); err != nil { return } @@ -4972,11 +6446,23 @@ func (client *RenderingControl1) SetHorizontalKeystone(InstanceID uint32, Desire return } +// SetHorizontalKeystone is the legacy version of SetHorizontalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetHorizontalKeystone(InstanceID uint32, DesiredHorizontalKeystone int16) (err error) { + return client.SetHorizontalKeystoneCtx(context.Background(), + InstanceID, + DesiredHorizontalKeystone, + ) +} + // // Return values: // // * CurrentVerticalKeystone: allowed value range: step=1 -func (client *RenderingControl1) GetVerticalKeystone(InstanceID uint32) (CurrentVerticalKeystone int16, err error) { +func (client *RenderingControl1) GetVerticalKeystoneCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentVerticalKeystone int16, err error) { // Request structure. request := &struct { InstanceID string @@ -4994,7 +6480,7 @@ func (client *RenderingControl1) GetVerticalKeystone(InstanceID uint32) (Current }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetVerticalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetVerticalKeystone", request, response); err != nil { return } @@ -5007,12 +6493,24 @@ func (client *RenderingControl1) GetVerticalKeystone(InstanceID uint32) (Current return } +// GetVerticalKeystone is the legacy version of GetVerticalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetVerticalKeystone(InstanceID uint32) (CurrentVerticalKeystone int16, err error) { + return client.GetVerticalKeystoneCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredVerticalKeystone: allowed value range: step=1 -func (client *RenderingControl1) SetVerticalKeystone(InstanceID uint32, DesiredVerticalKeystone int16) (err error) { +func (client *RenderingControl1) SetVerticalKeystoneCtx( + ctx context.Context, + InstanceID uint32, + DesiredVerticalKeystone int16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5032,7 +6530,7 @@ func (client *RenderingControl1) SetVerticalKeystone(InstanceID uint32, DesiredV response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetVerticalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetVerticalKeystone", request, response); err != nil { return } @@ -5042,12 +6540,25 @@ func (client *RenderingControl1) SetVerticalKeystone(InstanceID uint32, DesiredV return } +// SetVerticalKeystone is the legacy version of SetVerticalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetVerticalKeystone(InstanceID uint32, DesiredVerticalKeystone int16) (err error) { + return client.SetVerticalKeystoneCtx(context.Background(), + InstanceID, + DesiredVerticalKeystone, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) GetMute(InstanceID uint32, Channel string) (CurrentMute bool, err error) { +func (client *RenderingControl1) GetMuteCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentMute bool, err error) { // Request structure. request := &struct { InstanceID string @@ -5069,7 +6580,7 @@ func (client *RenderingControl1) GetMute(InstanceID uint32, Channel string) (Cur }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetMute", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetMute", request, response); err != nil { return } @@ -5082,12 +6593,26 @@ func (client *RenderingControl1) GetMute(InstanceID uint32, Channel string) (Cur return } +// GetMute is the legacy version of GetMuteCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetMute(InstanceID uint32, Channel string) (CurrentMute bool, err error) { + return client.GetMuteCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) SetMute(InstanceID uint32, Channel string, DesiredMute bool) (err error) { +func (client *RenderingControl1) SetMuteCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredMute bool, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5111,7 +6636,7 @@ func (client *RenderingControl1) SetMute(InstanceID uint32, Channel string, Desi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetMute", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetMute", request, response); err != nil { return } @@ -5121,6 +6646,16 @@ func (client *RenderingControl1) SetMute(InstanceID uint32, Channel string, Desi return } +// SetMute is the legacy version of SetMuteCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetMute(InstanceID uint32, Channel string, DesiredMute bool) (err error) { + return client.SetMuteCtx(context.Background(), + InstanceID, + Channel, + DesiredMute, + ) +} + // // Arguments: // @@ -5130,7 +6665,11 @@ func (client *RenderingControl1) SetMute(InstanceID uint32, Channel string, Desi // Return values: // // * CurrentVolume: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) GetVolume(InstanceID uint32, Channel string) (CurrentVolume uint16, err error) { +func (client *RenderingControl1) GetVolumeCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentVolume uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5152,7 +6691,7 @@ func (client *RenderingControl1) GetVolume(InstanceID uint32, Channel string) (C }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetVolume", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetVolume", request, response); err != nil { return } @@ -5165,6 +6704,15 @@ func (client *RenderingControl1) GetVolume(InstanceID uint32, Channel string) (C return } +// GetVolume is the legacy version of GetVolumeCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetVolume(InstanceID uint32, Channel string) (CurrentVolume uint16, err error) { + return client.GetVolumeCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // @@ -5172,7 +6720,12 @@ func (client *RenderingControl1) GetVolume(InstanceID uint32, Channel string) (C // // * DesiredVolume: allowed value range: minimum=0, step=1 -func (client *RenderingControl1) SetVolume(InstanceID uint32, Channel string, DesiredVolume uint16) (err error) { +func (client *RenderingControl1) SetVolumeCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredVolume uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5196,7 +6749,7 @@ func (client *RenderingControl1) SetVolume(InstanceID uint32, Channel string, De response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetVolume", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetVolume", request, response); err != nil { return } @@ -5206,12 +6759,26 @@ func (client *RenderingControl1) SetVolume(InstanceID uint32, Channel string, De return } +// SetVolume is the legacy version of SetVolumeCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetVolume(InstanceID uint32, Channel string, DesiredVolume uint16) (err error) { + return client.SetVolumeCtx(context.Background(), + InstanceID, + Channel, + DesiredVolume, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) GetVolumeDB(InstanceID uint32, Channel string) (CurrentVolume int16, err error) { +func (client *RenderingControl1) GetVolumeDBCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentVolume int16, err error) { // Request structure. request := &struct { InstanceID string @@ -5233,7 +6800,7 @@ func (client *RenderingControl1) GetVolumeDB(InstanceID uint32, Channel string) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetVolumeDB", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetVolumeDB", request, response); err != nil { return } @@ -5246,12 +6813,26 @@ func (client *RenderingControl1) GetVolumeDB(InstanceID uint32, Channel string) return } +// GetVolumeDB is the legacy version of GetVolumeDBCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetVolumeDB(InstanceID uint32, Channel string) (CurrentVolume int16, err error) { + return client.GetVolumeDBCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) SetVolumeDB(InstanceID uint32, Channel string, DesiredVolume int16) (err error) { +func (client *RenderingControl1) SetVolumeDBCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredVolume int16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5275,7 +6856,7 @@ func (client *RenderingControl1) SetVolumeDB(InstanceID uint32, Channel string, response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetVolumeDB", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetVolumeDB", request, response); err != nil { return } @@ -5285,12 +6866,26 @@ func (client *RenderingControl1) SetVolumeDB(InstanceID uint32, Channel string, return } +// SetVolumeDB is the legacy version of SetVolumeDBCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetVolumeDB(InstanceID uint32, Channel string, DesiredVolume int16) (err error) { + return client.SetVolumeDBCtx(context.Background(), + InstanceID, + Channel, + DesiredVolume, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) GetVolumeDBRange(InstanceID uint32, Channel string) (MinValue int16, MaxValue int16, err error) { +func (client *RenderingControl1) GetVolumeDBRangeCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (MinValue int16, MaxValue int16, err error) { // Request structure. request := &struct { InstanceID string @@ -5313,7 +6908,7 @@ func (client *RenderingControl1) GetVolumeDBRange(InstanceID uint32, Channel str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetVolumeDBRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetVolumeDBRange", request, response); err != nil { return } @@ -5329,12 +6924,25 @@ func (client *RenderingControl1) GetVolumeDBRange(InstanceID uint32, Channel str return } +// GetVolumeDBRange is the legacy version of GetVolumeDBRangeCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetVolumeDBRange(InstanceID uint32, Channel string) (MinValue int16, MaxValue int16, err error) { + return client.GetVolumeDBRangeCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) GetLoudness(InstanceID uint32, Channel string) (CurrentLoudness bool, err error) { +func (client *RenderingControl1) GetLoudnessCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentLoudness bool, err error) { // Request structure. request := &struct { InstanceID string @@ -5356,7 +6964,7 @@ func (client *RenderingControl1) GetLoudness(InstanceID uint32, Channel string) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "GetLoudness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "GetLoudness", request, response); err != nil { return } @@ -5369,12 +6977,26 @@ func (client *RenderingControl1) GetLoudness(InstanceID uint32, Channel string) return } +// GetLoudness is the legacy version of GetLoudnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) GetLoudness(InstanceID uint32, Channel string) (CurrentLoudness bool, err error) { + return client.GetLoudnessCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl1) SetLoudness(InstanceID uint32, Channel string, DesiredLoudness bool) (err error) { +func (client *RenderingControl1) SetLoudnessCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredLoudness bool, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5398,7 +7020,7 @@ func (client *RenderingControl1) SetLoudness(InstanceID uint32, Channel string, response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_1, "SetLoudness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_1, "SetLoudness", request, response); err != nil { return } @@ -5408,6 +7030,16 @@ func (client *RenderingControl1) SetLoudness(InstanceID uint32, Channel string, return } +// SetLoudness is the legacy version of SetLoudnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl1) SetLoudness(InstanceID uint32, Channel string, DesiredLoudness bool) (err error) { + return client.SetLoudnessCtx(context.Background(), + InstanceID, + Channel, + DesiredLoudness, + ) +} + // RenderingControl2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:RenderingControl:2". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -5468,7 +7100,10 @@ func newRenderingControl2ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *RenderingControl2) ListPresets(InstanceID uint32) (CurrentPresetNameList string, err error) { +func (client *RenderingControl2) ListPresetsCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentPresetNameList string, err error) { // Request structure. request := &struct { InstanceID string @@ -5486,7 +7121,7 @@ func (client *RenderingControl2) ListPresets(InstanceID uint32) (CurrentPresetNa }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "ListPresets", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "ListPresets", request, response); err != nil { return } @@ -5499,12 +7134,24 @@ func (client *RenderingControl2) ListPresets(InstanceID uint32) (CurrentPresetNa return } +// ListPresets is the legacy version of ListPresetsCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) ListPresets(InstanceID uint32) (CurrentPresetNameList string, err error) { + return client.ListPresetsCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * PresetName: allowed values: FactoryDefaults -func (client *RenderingControl2) SelectPreset(InstanceID uint32, PresetName string) (err error) { +func (client *RenderingControl2) SelectPresetCtx( + ctx context.Context, + InstanceID uint32, + PresetName string, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5524,7 +7171,7 @@ func (client *RenderingControl2) SelectPreset(InstanceID uint32, PresetName stri response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SelectPreset", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SelectPreset", request, response); err != nil { return } @@ -5534,11 +7181,23 @@ func (client *RenderingControl2) SelectPreset(InstanceID uint32, PresetName stri return } +// SelectPreset is the legacy version of SelectPresetCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SelectPreset(InstanceID uint32, PresetName string) (err error) { + return client.SelectPresetCtx(context.Background(), + InstanceID, + PresetName, + ) +} + // // Return values: // // * CurrentBrightness: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetBrightness(InstanceID uint32) (CurrentBrightness uint16, err error) { +func (client *RenderingControl2) GetBrightnessCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentBrightness uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5556,7 +7215,7 @@ func (client *RenderingControl2) GetBrightness(InstanceID uint32) (CurrentBright }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetBrightness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetBrightness", request, response); err != nil { return } @@ -5569,12 +7228,24 @@ func (client *RenderingControl2) GetBrightness(InstanceID uint32) (CurrentBright return } +// GetBrightness is the legacy version of GetBrightnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetBrightness(InstanceID uint32) (CurrentBrightness uint16, err error) { + return client.GetBrightnessCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredBrightness: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetBrightness(InstanceID uint32, DesiredBrightness uint16) (err error) { +func (client *RenderingControl2) SetBrightnessCtx( + ctx context.Context, + InstanceID uint32, + DesiredBrightness uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5594,7 +7265,7 @@ func (client *RenderingControl2) SetBrightness(InstanceID uint32, DesiredBrightn response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetBrightness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetBrightness", request, response); err != nil { return } @@ -5604,11 +7275,23 @@ func (client *RenderingControl2) SetBrightness(InstanceID uint32, DesiredBrightn return } +// SetBrightness is the legacy version of SetBrightnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetBrightness(InstanceID uint32, DesiredBrightness uint16) (err error) { + return client.SetBrightnessCtx(context.Background(), + InstanceID, + DesiredBrightness, + ) +} + // // Return values: // // * CurrentContrast: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetContrast(InstanceID uint32) (CurrentContrast uint16, err error) { +func (client *RenderingControl2) GetContrastCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentContrast uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5626,7 +7309,7 @@ func (client *RenderingControl2) GetContrast(InstanceID uint32) (CurrentContrast }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetContrast", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetContrast", request, response); err != nil { return } @@ -5639,12 +7322,24 @@ func (client *RenderingControl2) GetContrast(InstanceID uint32) (CurrentContrast return } +// GetContrast is the legacy version of GetContrastCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetContrast(InstanceID uint32) (CurrentContrast uint16, err error) { + return client.GetContrastCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredContrast: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetContrast(InstanceID uint32, DesiredContrast uint16) (err error) { +func (client *RenderingControl2) SetContrastCtx( + ctx context.Context, + InstanceID uint32, + DesiredContrast uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5664,7 +7359,7 @@ func (client *RenderingControl2) SetContrast(InstanceID uint32, DesiredContrast response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetContrast", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetContrast", request, response); err != nil { return } @@ -5674,11 +7369,23 @@ func (client *RenderingControl2) SetContrast(InstanceID uint32, DesiredContrast return } +// SetContrast is the legacy version of SetContrastCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetContrast(InstanceID uint32, DesiredContrast uint16) (err error) { + return client.SetContrastCtx(context.Background(), + InstanceID, + DesiredContrast, + ) +} + // // Return values: // // * CurrentSharpness: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetSharpness(InstanceID uint32) (CurrentSharpness uint16, err error) { +func (client *RenderingControl2) GetSharpnessCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentSharpness uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5696,7 +7403,7 @@ func (client *RenderingControl2) GetSharpness(InstanceID uint32) (CurrentSharpne }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetSharpness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetSharpness", request, response); err != nil { return } @@ -5709,12 +7416,24 @@ func (client *RenderingControl2) GetSharpness(InstanceID uint32) (CurrentSharpne return } +// GetSharpness is the legacy version of GetSharpnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetSharpness(InstanceID uint32) (CurrentSharpness uint16, err error) { + return client.GetSharpnessCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredSharpness: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetSharpness(InstanceID uint32, DesiredSharpness uint16) (err error) { +func (client *RenderingControl2) SetSharpnessCtx( + ctx context.Context, + InstanceID uint32, + DesiredSharpness uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5734,7 +7453,7 @@ func (client *RenderingControl2) SetSharpness(InstanceID uint32, DesiredSharpnes response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetSharpness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetSharpness", request, response); err != nil { return } @@ -5744,11 +7463,23 @@ func (client *RenderingControl2) SetSharpness(InstanceID uint32, DesiredSharpnes return } +// SetSharpness is the legacy version of SetSharpnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetSharpness(InstanceID uint32, DesiredSharpness uint16) (err error) { + return client.SetSharpnessCtx(context.Background(), + InstanceID, + DesiredSharpness, + ) +} + // // Return values: // // * CurrentRedVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetRedVideoGain(InstanceID uint32) (CurrentRedVideoGain uint16, err error) { +func (client *RenderingControl2) GetRedVideoGainCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentRedVideoGain uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5766,7 +7497,7 @@ func (client *RenderingControl2) GetRedVideoGain(InstanceID uint32) (CurrentRedV }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetRedVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetRedVideoGain", request, response); err != nil { return } @@ -5779,12 +7510,24 @@ func (client *RenderingControl2) GetRedVideoGain(InstanceID uint32) (CurrentRedV return } +// GetRedVideoGain is the legacy version of GetRedVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetRedVideoGain(InstanceID uint32) (CurrentRedVideoGain uint16, err error) { + return client.GetRedVideoGainCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredRedVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetRedVideoGain(InstanceID uint32, DesiredRedVideoGain uint16) (err error) { +func (client *RenderingControl2) SetRedVideoGainCtx( + ctx context.Context, + InstanceID uint32, + DesiredRedVideoGain uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5804,7 +7547,7 @@ func (client *RenderingControl2) SetRedVideoGain(InstanceID uint32, DesiredRedVi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetRedVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetRedVideoGain", request, response); err != nil { return } @@ -5814,11 +7557,23 @@ func (client *RenderingControl2) SetRedVideoGain(InstanceID uint32, DesiredRedVi return } +// SetRedVideoGain is the legacy version of SetRedVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetRedVideoGain(InstanceID uint32, DesiredRedVideoGain uint16) (err error) { + return client.SetRedVideoGainCtx(context.Background(), + InstanceID, + DesiredRedVideoGain, + ) +} + // // Return values: // // * CurrentGreenVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetGreenVideoGain(InstanceID uint32) (CurrentGreenVideoGain uint16, err error) { +func (client *RenderingControl2) GetGreenVideoGainCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentGreenVideoGain uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5836,7 +7591,7 @@ func (client *RenderingControl2) GetGreenVideoGain(InstanceID uint32) (CurrentGr }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetGreenVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetGreenVideoGain", request, response); err != nil { return } @@ -5849,12 +7604,24 @@ func (client *RenderingControl2) GetGreenVideoGain(InstanceID uint32) (CurrentGr return } +// GetGreenVideoGain is the legacy version of GetGreenVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetGreenVideoGain(InstanceID uint32) (CurrentGreenVideoGain uint16, err error) { + return client.GetGreenVideoGainCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredGreenVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetGreenVideoGain(InstanceID uint32, DesiredGreenVideoGain uint16) (err error) { +func (client *RenderingControl2) SetGreenVideoGainCtx( + ctx context.Context, + InstanceID uint32, + DesiredGreenVideoGain uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5874,7 +7641,7 @@ func (client *RenderingControl2) SetGreenVideoGain(InstanceID uint32, DesiredGre response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetGreenVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetGreenVideoGain", request, response); err != nil { return } @@ -5884,11 +7651,23 @@ func (client *RenderingControl2) SetGreenVideoGain(InstanceID uint32, DesiredGre return } +// SetGreenVideoGain is the legacy version of SetGreenVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetGreenVideoGain(InstanceID uint32, DesiredGreenVideoGain uint16) (err error) { + return client.SetGreenVideoGainCtx(context.Background(), + InstanceID, + DesiredGreenVideoGain, + ) +} + // // Return values: // // * CurrentBlueVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetBlueVideoGain(InstanceID uint32) (CurrentBlueVideoGain uint16, err error) { +func (client *RenderingControl2) GetBlueVideoGainCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentBlueVideoGain uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5906,7 +7685,7 @@ func (client *RenderingControl2) GetBlueVideoGain(InstanceID uint32) (CurrentBlu }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetBlueVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetBlueVideoGain", request, response); err != nil { return } @@ -5919,12 +7698,24 @@ func (client *RenderingControl2) GetBlueVideoGain(InstanceID uint32) (CurrentBlu return } +// GetBlueVideoGain is the legacy version of GetBlueVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetBlueVideoGain(InstanceID uint32) (CurrentBlueVideoGain uint16, err error) { + return client.GetBlueVideoGainCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredBlueVideoGain: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetBlueVideoGain(InstanceID uint32, DesiredBlueVideoGain uint16) (err error) { +func (client *RenderingControl2) SetBlueVideoGainCtx( + ctx context.Context, + InstanceID uint32, + DesiredBlueVideoGain uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -5944,7 +7735,7 @@ func (client *RenderingControl2) SetBlueVideoGain(InstanceID uint32, DesiredBlue response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetBlueVideoGain", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetBlueVideoGain", request, response); err != nil { return } @@ -5954,11 +7745,23 @@ func (client *RenderingControl2) SetBlueVideoGain(InstanceID uint32, DesiredBlue return } +// SetBlueVideoGain is the legacy version of SetBlueVideoGainCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetBlueVideoGain(InstanceID uint32, DesiredBlueVideoGain uint16) (err error) { + return client.SetBlueVideoGainCtx(context.Background(), + InstanceID, + DesiredBlueVideoGain, + ) +} + // // Return values: // // * CurrentRedVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetRedVideoBlackLevel(InstanceID uint32) (CurrentRedVideoBlackLevel uint16, err error) { +func (client *RenderingControl2) GetRedVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentRedVideoBlackLevel uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -5976,7 +7779,7 @@ func (client *RenderingControl2) GetRedVideoBlackLevel(InstanceID uint32) (Curre }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetRedVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetRedVideoBlackLevel", request, response); err != nil { return } @@ -5989,12 +7792,24 @@ func (client *RenderingControl2) GetRedVideoBlackLevel(InstanceID uint32) (Curre return } +// GetRedVideoBlackLevel is the legacy version of GetRedVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetRedVideoBlackLevel(InstanceID uint32) (CurrentRedVideoBlackLevel uint16, err error) { + return client.GetRedVideoBlackLevelCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredRedVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetRedVideoBlackLevel(InstanceID uint32, DesiredRedVideoBlackLevel uint16) (err error) { +func (client *RenderingControl2) SetRedVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, + DesiredRedVideoBlackLevel uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6014,7 +7829,7 @@ func (client *RenderingControl2) SetRedVideoBlackLevel(InstanceID uint32, Desire response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetRedVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetRedVideoBlackLevel", request, response); err != nil { return } @@ -6024,11 +7839,23 @@ func (client *RenderingControl2) SetRedVideoBlackLevel(InstanceID uint32, Desire return } +// SetRedVideoBlackLevel is the legacy version of SetRedVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetRedVideoBlackLevel(InstanceID uint32, DesiredRedVideoBlackLevel uint16) (err error) { + return client.SetRedVideoBlackLevelCtx(context.Background(), + InstanceID, + DesiredRedVideoBlackLevel, + ) +} + // // Return values: // // * CurrentGreenVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetGreenVideoBlackLevel(InstanceID uint32) (CurrentGreenVideoBlackLevel uint16, err error) { +func (client *RenderingControl2) GetGreenVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentGreenVideoBlackLevel uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -6046,7 +7873,7 @@ func (client *RenderingControl2) GetGreenVideoBlackLevel(InstanceID uint32) (Cur }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetGreenVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetGreenVideoBlackLevel", request, response); err != nil { return } @@ -6059,12 +7886,24 @@ func (client *RenderingControl2) GetGreenVideoBlackLevel(InstanceID uint32) (Cur return } +// GetGreenVideoBlackLevel is the legacy version of GetGreenVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetGreenVideoBlackLevel(InstanceID uint32) (CurrentGreenVideoBlackLevel uint16, err error) { + return client.GetGreenVideoBlackLevelCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredGreenVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetGreenVideoBlackLevel(InstanceID uint32, DesiredGreenVideoBlackLevel uint16) (err error) { +func (client *RenderingControl2) SetGreenVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, + DesiredGreenVideoBlackLevel uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6084,7 +7923,7 @@ func (client *RenderingControl2) SetGreenVideoBlackLevel(InstanceID uint32, Desi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetGreenVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetGreenVideoBlackLevel", request, response); err != nil { return } @@ -6094,11 +7933,23 @@ func (client *RenderingControl2) SetGreenVideoBlackLevel(InstanceID uint32, Desi return } +// SetGreenVideoBlackLevel is the legacy version of SetGreenVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetGreenVideoBlackLevel(InstanceID uint32, DesiredGreenVideoBlackLevel uint16) (err error) { + return client.SetGreenVideoBlackLevelCtx(context.Background(), + InstanceID, + DesiredGreenVideoBlackLevel, + ) +} + // // Return values: // // * CurrentBlueVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetBlueVideoBlackLevel(InstanceID uint32) (CurrentBlueVideoBlackLevel uint16, err error) { +func (client *RenderingControl2) GetBlueVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentBlueVideoBlackLevel uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -6116,7 +7967,7 @@ func (client *RenderingControl2) GetBlueVideoBlackLevel(InstanceID uint32) (Curr }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetBlueVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetBlueVideoBlackLevel", request, response); err != nil { return } @@ -6129,12 +7980,24 @@ func (client *RenderingControl2) GetBlueVideoBlackLevel(InstanceID uint32) (Curr return } +// GetBlueVideoBlackLevel is the legacy version of GetBlueVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetBlueVideoBlackLevel(InstanceID uint32) (CurrentBlueVideoBlackLevel uint16, err error) { + return client.GetBlueVideoBlackLevelCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredBlueVideoBlackLevel: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetBlueVideoBlackLevel(InstanceID uint32, DesiredBlueVideoBlackLevel uint16) (err error) { +func (client *RenderingControl2) SetBlueVideoBlackLevelCtx( + ctx context.Context, + InstanceID uint32, + DesiredBlueVideoBlackLevel uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6154,7 +8017,7 @@ func (client *RenderingControl2) SetBlueVideoBlackLevel(InstanceID uint32, Desir response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetBlueVideoBlackLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetBlueVideoBlackLevel", request, response); err != nil { return } @@ -6164,11 +8027,23 @@ func (client *RenderingControl2) SetBlueVideoBlackLevel(InstanceID uint32, Desir return } +// SetBlueVideoBlackLevel is the legacy version of SetBlueVideoBlackLevelCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetBlueVideoBlackLevel(InstanceID uint32, DesiredBlueVideoBlackLevel uint16) (err error) { + return client.SetBlueVideoBlackLevelCtx(context.Background(), + InstanceID, + DesiredBlueVideoBlackLevel, + ) +} + // // Return values: // // * CurrentColorTemperature: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetColorTemperature(InstanceID uint32) (CurrentColorTemperature uint16, err error) { +func (client *RenderingControl2) GetColorTemperatureCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentColorTemperature uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -6186,7 +8061,7 @@ func (client *RenderingControl2) GetColorTemperature(InstanceID uint32) (Current }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetColorTemperature", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetColorTemperature", request, response); err != nil { return } @@ -6199,12 +8074,24 @@ func (client *RenderingControl2) GetColorTemperature(InstanceID uint32) (Current return } +// GetColorTemperature is the legacy version of GetColorTemperatureCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetColorTemperature(InstanceID uint32) (CurrentColorTemperature uint16, err error) { + return client.GetColorTemperatureCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredColorTemperature: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetColorTemperature(InstanceID uint32, DesiredColorTemperature uint16) (err error) { +func (client *RenderingControl2) SetColorTemperatureCtx( + ctx context.Context, + InstanceID uint32, + DesiredColorTemperature uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6224,7 +8111,7 @@ func (client *RenderingControl2) SetColorTemperature(InstanceID uint32, DesiredC response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetColorTemperature", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetColorTemperature", request, response); err != nil { return } @@ -6234,11 +8121,23 @@ func (client *RenderingControl2) SetColorTemperature(InstanceID uint32, DesiredC return } +// SetColorTemperature is the legacy version of SetColorTemperatureCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetColorTemperature(InstanceID uint32, DesiredColorTemperature uint16) (err error) { + return client.SetColorTemperatureCtx(context.Background(), + InstanceID, + DesiredColorTemperature, + ) +} + // // Return values: // // * CurrentHorizontalKeystone: allowed value range: step=1 -func (client *RenderingControl2) GetHorizontalKeystone(InstanceID uint32) (CurrentHorizontalKeystone int16, err error) { +func (client *RenderingControl2) GetHorizontalKeystoneCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentHorizontalKeystone int16, err error) { // Request structure. request := &struct { InstanceID string @@ -6256,7 +8155,7 @@ func (client *RenderingControl2) GetHorizontalKeystone(InstanceID uint32) (Curre }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetHorizontalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetHorizontalKeystone", request, response); err != nil { return } @@ -6269,12 +8168,24 @@ func (client *RenderingControl2) GetHorizontalKeystone(InstanceID uint32) (Curre return } +// GetHorizontalKeystone is the legacy version of GetHorizontalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetHorizontalKeystone(InstanceID uint32) (CurrentHorizontalKeystone int16, err error) { + return client.GetHorizontalKeystoneCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredHorizontalKeystone: allowed value range: step=1 -func (client *RenderingControl2) SetHorizontalKeystone(InstanceID uint32, DesiredHorizontalKeystone int16) (err error) { +func (client *RenderingControl2) SetHorizontalKeystoneCtx( + ctx context.Context, + InstanceID uint32, + DesiredHorizontalKeystone int16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6294,7 +8205,7 @@ func (client *RenderingControl2) SetHorizontalKeystone(InstanceID uint32, Desire response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetHorizontalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetHorizontalKeystone", request, response); err != nil { return } @@ -6304,11 +8215,23 @@ func (client *RenderingControl2) SetHorizontalKeystone(InstanceID uint32, Desire return } +// SetHorizontalKeystone is the legacy version of SetHorizontalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetHorizontalKeystone(InstanceID uint32, DesiredHorizontalKeystone int16) (err error) { + return client.SetHorizontalKeystoneCtx(context.Background(), + InstanceID, + DesiredHorizontalKeystone, + ) +} + // // Return values: // // * CurrentVerticalKeystone: allowed value range: step=1 -func (client *RenderingControl2) GetVerticalKeystone(InstanceID uint32) (CurrentVerticalKeystone int16, err error) { +func (client *RenderingControl2) GetVerticalKeystoneCtx( + ctx context.Context, + InstanceID uint32, +) (CurrentVerticalKeystone int16, err error) { // Request structure. request := &struct { InstanceID string @@ -6326,7 +8249,7 @@ func (client *RenderingControl2) GetVerticalKeystone(InstanceID uint32) (Current }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetVerticalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetVerticalKeystone", request, response); err != nil { return } @@ -6339,12 +8262,24 @@ func (client *RenderingControl2) GetVerticalKeystone(InstanceID uint32) (Current return } +// GetVerticalKeystone is the legacy version of GetVerticalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetVerticalKeystone(InstanceID uint32) (CurrentVerticalKeystone int16, err error) { + return client.GetVerticalKeystoneCtx(context.Background(), + InstanceID, + ) +} + // // Arguments: // // * DesiredVerticalKeystone: allowed value range: step=1 -func (client *RenderingControl2) SetVerticalKeystone(InstanceID uint32, DesiredVerticalKeystone int16) (err error) { +func (client *RenderingControl2) SetVerticalKeystoneCtx( + ctx context.Context, + InstanceID uint32, + DesiredVerticalKeystone int16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6364,7 +8299,7 @@ func (client *RenderingControl2) SetVerticalKeystone(InstanceID uint32, DesiredV response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetVerticalKeystone", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetVerticalKeystone", request, response); err != nil { return } @@ -6374,12 +8309,25 @@ func (client *RenderingControl2) SetVerticalKeystone(InstanceID uint32, DesiredV return } +// SetVerticalKeystone is the legacy version of SetVerticalKeystoneCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetVerticalKeystone(InstanceID uint32, DesiredVerticalKeystone int16) (err error) { + return client.SetVerticalKeystoneCtx(context.Background(), + InstanceID, + DesiredVerticalKeystone, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) GetMute(InstanceID uint32, Channel string) (CurrentMute bool, err error) { +func (client *RenderingControl2) GetMuteCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentMute bool, err error) { // Request structure. request := &struct { InstanceID string @@ -6401,7 +8349,7 @@ func (client *RenderingControl2) GetMute(InstanceID uint32, Channel string) (Cur }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetMute", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetMute", request, response); err != nil { return } @@ -6414,12 +8362,26 @@ func (client *RenderingControl2) GetMute(InstanceID uint32, Channel string) (Cur return } +// GetMute is the legacy version of GetMuteCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetMute(InstanceID uint32, Channel string) (CurrentMute bool, err error) { + return client.GetMuteCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) SetMute(InstanceID uint32, Channel string, DesiredMute bool) (err error) { +func (client *RenderingControl2) SetMuteCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredMute bool, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6443,7 +8405,7 @@ func (client *RenderingControl2) SetMute(InstanceID uint32, Channel string, Desi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetMute", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetMute", request, response); err != nil { return } @@ -6453,6 +8415,16 @@ func (client *RenderingControl2) SetMute(InstanceID uint32, Channel string, Desi return } +// SetMute is the legacy version of SetMuteCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetMute(InstanceID uint32, Channel string, DesiredMute bool) (err error) { + return client.SetMuteCtx(context.Background(), + InstanceID, + Channel, + DesiredMute, + ) +} + // // Arguments: // @@ -6462,7 +8434,11 @@ func (client *RenderingControl2) SetMute(InstanceID uint32, Channel string, Desi // Return values: // // * CurrentVolume: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) GetVolume(InstanceID uint32, Channel string) (CurrentVolume uint16, err error) { +func (client *RenderingControl2) GetVolumeCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentVolume uint16, err error) { // Request structure. request := &struct { InstanceID string @@ -6484,7 +8460,7 @@ func (client *RenderingControl2) GetVolume(InstanceID uint32, Channel string) (C }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetVolume", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetVolume", request, response); err != nil { return } @@ -6497,6 +8473,15 @@ func (client *RenderingControl2) GetVolume(InstanceID uint32, Channel string) (C return } +// GetVolume is the legacy version of GetVolumeCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetVolume(InstanceID uint32, Channel string) (CurrentVolume uint16, err error) { + return client.GetVolumeCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // @@ -6504,7 +8489,12 @@ func (client *RenderingControl2) GetVolume(InstanceID uint32, Channel string) (C // // * DesiredVolume: allowed value range: minimum=0, step=1 -func (client *RenderingControl2) SetVolume(InstanceID uint32, Channel string, DesiredVolume uint16) (err error) { +func (client *RenderingControl2) SetVolumeCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredVolume uint16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6528,7 +8518,7 @@ func (client *RenderingControl2) SetVolume(InstanceID uint32, Channel string, De response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetVolume", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetVolume", request, response); err != nil { return } @@ -6538,12 +8528,26 @@ func (client *RenderingControl2) SetVolume(InstanceID uint32, Channel string, De return } +// SetVolume is the legacy version of SetVolumeCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetVolume(InstanceID uint32, Channel string, DesiredVolume uint16) (err error) { + return client.SetVolumeCtx(context.Background(), + InstanceID, + Channel, + DesiredVolume, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) GetVolumeDB(InstanceID uint32, Channel string) (CurrentVolume int16, err error) { +func (client *RenderingControl2) GetVolumeDBCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentVolume int16, err error) { // Request structure. request := &struct { InstanceID string @@ -6565,7 +8569,7 @@ func (client *RenderingControl2) GetVolumeDB(InstanceID uint32, Channel string) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetVolumeDB", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetVolumeDB", request, response); err != nil { return } @@ -6578,12 +8582,26 @@ func (client *RenderingControl2) GetVolumeDB(InstanceID uint32, Channel string) return } +// GetVolumeDB is the legacy version of GetVolumeDBCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetVolumeDB(InstanceID uint32, Channel string) (CurrentVolume int16, err error) { + return client.GetVolumeDBCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) SetVolumeDB(InstanceID uint32, Channel string, DesiredVolume int16) (err error) { +func (client *RenderingControl2) SetVolumeDBCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredVolume int16, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6607,7 +8625,7 @@ func (client *RenderingControl2) SetVolumeDB(InstanceID uint32, Channel string, response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetVolumeDB", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetVolumeDB", request, response); err != nil { return } @@ -6617,12 +8635,26 @@ func (client *RenderingControl2) SetVolumeDB(InstanceID uint32, Channel string, return } +// SetVolumeDB is the legacy version of SetVolumeDBCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetVolumeDB(InstanceID uint32, Channel string, DesiredVolume int16) (err error) { + return client.SetVolumeDBCtx(context.Background(), + InstanceID, + Channel, + DesiredVolume, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) GetVolumeDBRange(InstanceID uint32, Channel string) (MinValue int16, MaxValue int16, err error) { +func (client *RenderingControl2) GetVolumeDBRangeCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (MinValue int16, MaxValue int16, err error) { // Request structure. request := &struct { InstanceID string @@ -6645,7 +8677,7 @@ func (client *RenderingControl2) GetVolumeDBRange(InstanceID uint32, Channel str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetVolumeDBRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetVolumeDBRange", request, response); err != nil { return } @@ -6661,12 +8693,25 @@ func (client *RenderingControl2) GetVolumeDBRange(InstanceID uint32, Channel str return } +// GetVolumeDBRange is the legacy version of GetVolumeDBRangeCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetVolumeDBRange(InstanceID uint32, Channel string) (MinValue int16, MaxValue int16, err error) { + return client.GetVolumeDBRangeCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) GetLoudness(InstanceID uint32, Channel string) (CurrentLoudness bool, err error) { +func (client *RenderingControl2) GetLoudnessCtx( + ctx context.Context, + InstanceID uint32, + Channel string, +) (CurrentLoudness bool, err error) { // Request structure. request := &struct { InstanceID string @@ -6688,7 +8733,7 @@ func (client *RenderingControl2) GetLoudness(InstanceID uint32, Channel string) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetLoudness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetLoudness", request, response); err != nil { return } @@ -6701,12 +8746,26 @@ func (client *RenderingControl2) GetLoudness(InstanceID uint32, Channel string) return } +// GetLoudness is the legacy version of GetLoudnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetLoudness(InstanceID uint32, Channel string) (CurrentLoudness bool, err error) { + return client.GetLoudnessCtx(context.Background(), + InstanceID, + Channel, + ) +} + // // Arguments: // // * Channel: allowed values: Master -func (client *RenderingControl2) SetLoudness(InstanceID uint32, Channel string, DesiredLoudness bool) (err error) { +func (client *RenderingControl2) SetLoudnessCtx( + ctx context.Context, + InstanceID uint32, + Channel string, + DesiredLoudness bool, +) (err error) { // Request structure. request := &struct { InstanceID string @@ -6730,7 +8789,7 @@ func (client *RenderingControl2) SetLoudness(InstanceID uint32, Channel string, response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetLoudness", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetLoudness", request, response); err != nil { return } @@ -6740,7 +8799,21 @@ func (client *RenderingControl2) SetLoudness(InstanceID uint32, Channel string, return } -func (client *RenderingControl2) GetStateVariables(InstanceID uint32, StateVariableList string) (StateVariableValuePairs string, err error) { +// SetLoudness is the legacy version of SetLoudnessCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetLoudness(InstanceID uint32, Channel string, DesiredLoudness bool) (err error) { + return client.SetLoudnessCtx(context.Background(), + InstanceID, + Channel, + DesiredLoudness, + ) +} + +func (client *RenderingControl2) GetStateVariablesCtx( + ctx context.Context, + InstanceID uint32, + StateVariableList string, +) (StateVariableValuePairs string, err error) { // Request structure. request := &struct { InstanceID string @@ -6762,7 +8835,7 @@ func (client *RenderingControl2) GetStateVariables(InstanceID uint32, StateVaria }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "GetStateVariables", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "GetStateVariables", request, response); err != nil { return } @@ -6775,7 +8848,23 @@ func (client *RenderingControl2) GetStateVariables(InstanceID uint32, StateVaria return } -func (client *RenderingControl2) SetStateVariables(InstanceID uint32, RenderingControlUDN string, ServiceType string, ServiceId string, StateVariableValuePairs string) (StateVariableList string, err error) { +// GetStateVariables is the legacy version of GetStateVariablesCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) GetStateVariables(InstanceID uint32, StateVariableList string) (StateVariableValuePairs string, err error) { + return client.GetStateVariablesCtx(context.Background(), + InstanceID, + StateVariableList, + ) +} + +func (client *RenderingControl2) SetStateVariablesCtx( + ctx context.Context, + InstanceID uint32, + RenderingControlUDN string, + ServiceType string, + ServiceId string, + StateVariableValuePairs string, +) (StateVariableList string, err error) { // Request structure. request := &struct { InstanceID string @@ -6809,7 +8898,7 @@ func (client *RenderingControl2) SetStateVariables(InstanceID uint32, RenderingC }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_RenderingControl_2, "SetStateVariables", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_RenderingControl_2, "SetStateVariables", request, response); err != nil { return } @@ -6822,6 +8911,18 @@ func (client *RenderingControl2) SetStateVariables(InstanceID uint32, RenderingC return } +// SetStateVariables is the legacy version of SetStateVariablesCtx, but uses +// context.Background() as the context. +func (client *RenderingControl2) SetStateVariables(InstanceID uint32, RenderingControlUDN string, ServiceType string, ServiceId string, StateVariableValuePairs string) (StateVariableList string, err error) { + return client.SetStateVariablesCtx(context.Background(), + InstanceID, + RenderingControlUDN, + ServiceType, + ServiceId, + StateVariableValuePairs, + ) +} + // ScheduledRecording1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ScheduledRecording:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -6882,7 +8983,9 @@ func newScheduledRecording1ClientsFromGenericClients(genericClients []goupnp.Ser return clients } -func (client *ScheduledRecording1) GetSortCapabilities() (SortCaps string, SortLevelCap uint32, err error) { +func (client *ScheduledRecording1) GetSortCapabilitiesCtx( + ctx context.Context, +) (SortCaps string, SortLevelCap uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -6896,7 +8999,7 @@ func (client *ScheduledRecording1) GetSortCapabilities() (SortCaps string, SortL }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetSortCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetSortCapabilities", request, response); err != nil { return } @@ -6912,12 +9015,21 @@ func (client *ScheduledRecording1) GetSortCapabilities() (SortCaps string, SortL return } +// GetSortCapabilities is the legacy version of GetSortCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetSortCapabilities() (SortCaps string, SortLevelCap uint32, err error) { + return client.GetSortCapabilitiesCtx(context.Background()) +} + // // Arguments: // // * DataTypeID: allowed values: A_ARG_TYPE_RecordSchedule, A_ARG_TYPE_RecordTask, A_ARG_TYPE_RecordScheduleParts -func (client *ScheduledRecording1) GetPropertyList(DataTypeID string) (PropertyList string, err error) { +func (client *ScheduledRecording1) GetPropertyListCtx( + ctx context.Context, + DataTypeID string, +) (PropertyList string, err error) { // Request structure. request := &struct { DataTypeID string @@ -6935,7 +9047,7 @@ func (client *ScheduledRecording1) GetPropertyList(DataTypeID string) (PropertyL }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetPropertyList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetPropertyList", request, response); err != nil { return } @@ -6948,12 +9060,24 @@ func (client *ScheduledRecording1) GetPropertyList(DataTypeID string) (PropertyL return } +// GetPropertyList is the legacy version of GetPropertyListCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetPropertyList(DataTypeID string) (PropertyList string, err error) { + return client.GetPropertyListCtx(context.Background(), + DataTypeID, + ) +} + // // Arguments: // // * DataTypeID: allowed values: A_ARG_TYPE_RecordSchedule, A_ARG_TYPE_RecordTask, A_ARG_TYPE_RecordScheduleParts -func (client *ScheduledRecording1) GetAllowedValues(DataTypeID string, Filter string) (PropertyInfo string, err error) { +func (client *ScheduledRecording1) GetAllowedValuesCtx( + ctx context.Context, + DataTypeID string, + Filter string, +) (PropertyInfo string, err error) { // Request structure. request := &struct { DataTypeID string @@ -6975,7 +9099,7 @@ func (client *ScheduledRecording1) GetAllowedValues(DataTypeID string, Filter st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetAllowedValues", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetAllowedValues", request, response); err != nil { return } @@ -6988,7 +9112,18 @@ func (client *ScheduledRecording1) GetAllowedValues(DataTypeID string, Filter st return } -func (client *ScheduledRecording1) GetStateUpdateID() (Id uint32, err error) { +// GetAllowedValues is the legacy version of GetAllowedValuesCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetAllowedValues(DataTypeID string, Filter string) (PropertyInfo string, err error) { + return client.GetAllowedValuesCtx(context.Background(), + DataTypeID, + Filter, + ) +} + +func (client *ScheduledRecording1) GetStateUpdateIDCtx( + ctx context.Context, +) (Id uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -7001,7 +9136,7 @@ func (client *ScheduledRecording1) GetStateUpdateID() (Id uint32, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetStateUpdateID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetStateUpdateID", request, response); err != nil { return } @@ -7014,7 +9149,19 @@ func (client *ScheduledRecording1) GetStateUpdateID() (Id uint32, err error) { return } -func (client *ScheduledRecording1) BrowseRecordSchedules(Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// GetStateUpdateID is the legacy version of GetStateUpdateIDCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetStateUpdateID() (Id uint32, err error) { + return client.GetStateUpdateIDCtx(context.Background()) +} + +func (client *ScheduledRecording1) BrowseRecordSchedulesCtx( + ctx context.Context, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { Filter string @@ -7047,7 +9194,7 @@ func (client *ScheduledRecording1) BrowseRecordSchedules(Filter string, Starting }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "BrowseRecordSchedules", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "BrowseRecordSchedules", request, response); err != nil { return } @@ -7069,7 +9216,25 @@ func (client *ScheduledRecording1) BrowseRecordSchedules(Filter string, Starting return } -func (client *ScheduledRecording1) BrowseRecordTasks(RecordScheduleID string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// BrowseRecordSchedules is the legacy version of BrowseRecordSchedulesCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) BrowseRecordSchedules(Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseRecordSchedulesCtx(context.Background(), + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ScheduledRecording1) BrowseRecordTasksCtx( + ctx context.Context, + RecordScheduleID string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7106,7 +9271,7 @@ func (client *ScheduledRecording1) BrowseRecordTasks(RecordScheduleID string, Fi }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "BrowseRecordTasks", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "BrowseRecordTasks", request, response); err != nil { return } @@ -7128,7 +9293,22 @@ func (client *ScheduledRecording1) BrowseRecordTasks(RecordScheduleID string, Fi return } -func (client *ScheduledRecording1) CreateRecordSchedule(Elements string) (RecordScheduleID string, Result string, UpdateID uint32, err error) { +// BrowseRecordTasks is the legacy version of BrowseRecordTasksCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) BrowseRecordTasks(RecordScheduleID string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseRecordTasksCtx(context.Background(), + RecordScheduleID, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ScheduledRecording1) CreateRecordScheduleCtx( + ctx context.Context, + Elements string, +) (RecordScheduleID string, Result string, UpdateID uint32, err error) { // Request structure. request := &struct { Elements string @@ -7148,7 +9328,7 @@ func (client *ScheduledRecording1) CreateRecordSchedule(Elements string) (Record }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "CreateRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "CreateRecordSchedule", request, response); err != nil { return } @@ -7167,7 +9347,18 @@ func (client *ScheduledRecording1) CreateRecordSchedule(Elements string) (Record return } -func (client *ScheduledRecording1) DeleteRecordSchedule(RecordScheduleID string) (err error) { +// CreateRecordSchedule is the legacy version of CreateRecordScheduleCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) CreateRecordSchedule(Elements string) (RecordScheduleID string, Result string, UpdateID uint32, err error) { + return client.CreateRecordScheduleCtx(context.Background(), + Elements, + ) +} + +func (client *ScheduledRecording1) DeleteRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, +) (err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7183,7 +9374,7 @@ func (client *ScheduledRecording1) DeleteRecordSchedule(RecordScheduleID string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "DeleteRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "DeleteRecordSchedule", request, response); err != nil { return } @@ -7193,7 +9384,19 @@ func (client *ScheduledRecording1) DeleteRecordSchedule(RecordScheduleID string) return } -func (client *ScheduledRecording1) GetRecordSchedule(RecordScheduleID string, Filter string) (Result string, UpdateID uint32, err error) { +// DeleteRecordSchedule is the legacy version of DeleteRecordScheduleCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) DeleteRecordSchedule(RecordScheduleID string) (err error) { + return client.DeleteRecordScheduleCtx(context.Background(), + RecordScheduleID, + ) +} + +func (client *ScheduledRecording1) GetRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, + Filter string, +) (Result string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7216,7 +9419,7 @@ func (client *ScheduledRecording1) GetRecordSchedule(RecordScheduleID string, Fi }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetRecordSchedule", request, response); err != nil { return } @@ -7232,7 +9435,56 @@ func (client *ScheduledRecording1) GetRecordSchedule(RecordScheduleID string, Fi return } +// GetRecordSchedule is the legacy version of GetRecordScheduleCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetRecordSchedule(RecordScheduleID string, Filter string) (Result string, UpdateID uint32, err error) { + return client.GetRecordScheduleCtx(context.Background(), + RecordScheduleID, + Filter, + ) +} + +func (client *ScheduledRecording1) EnableRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, +) (err error) { + // Request structure. + request := &struct { + RecordScheduleID string + }{} + // BEGIN Marshal arguments into request. + + if request.RecordScheduleID, err = soap.MarshalString(RecordScheduleID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "EnableRecordSchedule", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// EnableRecordSchedule is the legacy version of EnableRecordScheduleCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording1) EnableRecordSchedule(RecordScheduleID string) (err error) { + return client.EnableRecordScheduleCtx(context.Background(), + RecordScheduleID, + ) +} + +func (client *ScheduledRecording1) DisableRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, +) (err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7248,7 +9500,7 @@ func (client *ScheduledRecording1) EnableRecordSchedule(RecordScheduleID string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "EnableRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "DisableRecordSchedule", request, response); err != nil { return } @@ -7258,33 +9510,18 @@ func (client *ScheduledRecording1) EnableRecordSchedule(RecordScheduleID string) return } +// DisableRecordSchedule is the legacy version of DisableRecordScheduleCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording1) DisableRecordSchedule(RecordScheduleID string) (err error) { - // Request structure. - request := &struct { - RecordScheduleID string - }{} - // BEGIN Marshal arguments into request. - - if request.RecordScheduleID, err = soap.MarshalString(RecordScheduleID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "DisableRecordSchedule", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DisableRecordScheduleCtx(context.Background(), + RecordScheduleID, + ) } -func (client *ScheduledRecording1) DeleteRecordTask(RecordTaskID string) (err error) { +func (client *ScheduledRecording1) DeleteRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { // Request structure. request := &struct { RecordTaskID string @@ -7300,7 +9537,7 @@ func (client *ScheduledRecording1) DeleteRecordTask(RecordTaskID string) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "DeleteRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "DeleteRecordTask", request, response); err != nil { return } @@ -7310,7 +9547,19 @@ func (client *ScheduledRecording1) DeleteRecordTask(RecordTaskID string) (err er return } -func (client *ScheduledRecording1) GetRecordTask(RecordTaskID string, Filter string) (Result string, UpdateID uint32, err error) { +// DeleteRecordTask is the legacy version of DeleteRecordTaskCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) DeleteRecordTask(RecordTaskID string) (err error) { + return client.DeleteRecordTaskCtx(context.Background(), + RecordTaskID, + ) +} + +func (client *ScheduledRecording1) GetRecordTaskCtx( + ctx context.Context, + RecordTaskID string, + Filter string, +) (Result string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordTaskID string @@ -7333,7 +9582,7 @@ func (client *ScheduledRecording1) GetRecordTask(RecordTaskID string, Filter str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetRecordTask", request, response); err != nil { return } @@ -7349,7 +9598,56 @@ func (client *ScheduledRecording1) GetRecordTask(RecordTaskID string, Filter str return } +// GetRecordTask is the legacy version of GetRecordTaskCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetRecordTask(RecordTaskID string, Filter string) (Result string, UpdateID uint32, err error) { + return client.GetRecordTaskCtx(context.Background(), + RecordTaskID, + Filter, + ) +} + +func (client *ScheduledRecording1) EnableRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { + // Request structure. + request := &struct { + RecordTaskID string + }{} + // BEGIN Marshal arguments into request. + + if request.RecordTaskID, err = soap.MarshalString(RecordTaskID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "EnableRecordTask", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// EnableRecordTask is the legacy version of EnableRecordTaskCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording1) EnableRecordTask(RecordTaskID string) (err error) { + return client.EnableRecordTaskCtx(context.Background(), + RecordTaskID, + ) +} + +func (client *ScheduledRecording1) DisableRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { // Request structure. request := &struct { RecordTaskID string @@ -7365,7 +9663,7 @@ func (client *ScheduledRecording1) EnableRecordTask(RecordTaskID string) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "EnableRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "DisableRecordTask", request, response); err != nil { return } @@ -7375,7 +9673,18 @@ func (client *ScheduledRecording1) EnableRecordTask(RecordTaskID string) (err er return } +// DisableRecordTask is the legacy version of DisableRecordTaskCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording1) DisableRecordTask(RecordTaskID string) (err error) { + return client.DisableRecordTaskCtx(context.Background(), + RecordTaskID, + ) +} + +func (client *ScheduledRecording1) ResetRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { // Request structure. request := &struct { RecordTaskID string @@ -7391,7 +9700,7 @@ func (client *ScheduledRecording1) DisableRecordTask(RecordTaskID string) (err e response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "DisableRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "ResetRecordTask", request, response); err != nil { return } @@ -7401,33 +9710,18 @@ func (client *ScheduledRecording1) DisableRecordTask(RecordTaskID string) (err e return } +// ResetRecordTask is the legacy version of ResetRecordTaskCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording1) ResetRecordTask(RecordTaskID string) (err error) { - // Request structure. - request := &struct { - RecordTaskID string - }{} - // BEGIN Marshal arguments into request. - - if request.RecordTaskID, err = soap.MarshalString(RecordTaskID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "ResetRecordTask", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ResetRecordTaskCtx(context.Background(), + RecordTaskID, + ) } -func (client *ScheduledRecording1) GetRecordScheduleConflicts(RecordScheduleID string) (RecordScheduleConflictIDList string, UpdateID uint32, err error) { +func (client *ScheduledRecording1) GetRecordScheduleConflictsCtx( + ctx context.Context, + RecordScheduleID string, +) (RecordScheduleConflictIDList string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7446,7 +9740,7 @@ func (client *ScheduledRecording1) GetRecordScheduleConflicts(RecordScheduleID s }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetRecordScheduleConflicts", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetRecordScheduleConflicts", request, response); err != nil { return } @@ -7462,7 +9756,18 @@ func (client *ScheduledRecording1) GetRecordScheduleConflicts(RecordScheduleID s return } -func (client *ScheduledRecording1) GetRecordTaskConflicts(RecordTaskID string) (RecordTaskConflictIDList string, UpdateID uint32, err error) { +// GetRecordScheduleConflicts is the legacy version of GetRecordScheduleConflictsCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetRecordScheduleConflicts(RecordScheduleID string) (RecordScheduleConflictIDList string, UpdateID uint32, err error) { + return client.GetRecordScheduleConflictsCtx(context.Background(), + RecordScheduleID, + ) +} + +func (client *ScheduledRecording1) GetRecordTaskConflictsCtx( + ctx context.Context, + RecordTaskID string, +) (RecordTaskConflictIDList string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordTaskID string @@ -7481,7 +9786,7 @@ func (client *ScheduledRecording1) GetRecordTaskConflicts(RecordTaskID string) ( }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_1, "GetRecordTaskConflicts", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_1, "GetRecordTaskConflicts", request, response); err != nil { return } @@ -7497,6 +9802,14 @@ func (client *ScheduledRecording1) GetRecordTaskConflicts(RecordTaskID string) ( return } +// GetRecordTaskConflicts is the legacy version of GetRecordTaskConflictsCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording1) GetRecordTaskConflicts(RecordTaskID string) (RecordTaskConflictIDList string, UpdateID uint32, err error) { + return client.GetRecordTaskConflictsCtx(context.Background(), + RecordTaskID, + ) +} + // ScheduledRecording2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:ScheduledRecording:2". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -7557,7 +9870,9 @@ func newScheduledRecording2ClientsFromGenericClients(genericClients []goupnp.Ser return clients } -func (client *ScheduledRecording2) GetSortCapabilities() (SortCaps string, SortLevelCap uint32, err error) { +func (client *ScheduledRecording2) GetSortCapabilitiesCtx( + ctx context.Context, +) (SortCaps string, SortLevelCap uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -7571,7 +9886,7 @@ func (client *ScheduledRecording2) GetSortCapabilities() (SortCaps string, SortL }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetSortCapabilities", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetSortCapabilities", request, response); err != nil { return } @@ -7587,12 +9902,21 @@ func (client *ScheduledRecording2) GetSortCapabilities() (SortCaps string, SortL return } +// GetSortCapabilities is the legacy version of GetSortCapabilitiesCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetSortCapabilities() (SortCaps string, SortLevelCap uint32, err error) { + return client.GetSortCapabilitiesCtx(context.Background()) +} + // // Arguments: // // * DataTypeID: allowed values: A_ARG_TYPE_RecordSchedule, A_ARG_TYPE_RecordTask, A_ARG_TYPE_RecordScheduleParts -func (client *ScheduledRecording2) GetPropertyList(DataTypeID string) (PropertyList string, err error) { +func (client *ScheduledRecording2) GetPropertyListCtx( + ctx context.Context, + DataTypeID string, +) (PropertyList string, err error) { // Request structure. request := &struct { DataTypeID string @@ -7610,7 +9934,7 @@ func (client *ScheduledRecording2) GetPropertyList(DataTypeID string) (PropertyL }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetPropertyList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetPropertyList", request, response); err != nil { return } @@ -7623,12 +9947,24 @@ func (client *ScheduledRecording2) GetPropertyList(DataTypeID string) (PropertyL return } +// GetPropertyList is the legacy version of GetPropertyListCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetPropertyList(DataTypeID string) (PropertyList string, err error) { + return client.GetPropertyListCtx(context.Background(), + DataTypeID, + ) +} + // // Arguments: // // * DataTypeID: allowed values: A_ARG_TYPE_RecordSchedule, A_ARG_TYPE_RecordTask, A_ARG_TYPE_RecordScheduleParts -func (client *ScheduledRecording2) GetAllowedValues(DataTypeID string, Filter string) (PropertyInfo string, err error) { +func (client *ScheduledRecording2) GetAllowedValuesCtx( + ctx context.Context, + DataTypeID string, + Filter string, +) (PropertyInfo string, err error) { // Request structure. request := &struct { DataTypeID string @@ -7650,7 +9986,7 @@ func (client *ScheduledRecording2) GetAllowedValues(DataTypeID string, Filter st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetAllowedValues", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetAllowedValues", request, response); err != nil { return } @@ -7663,7 +9999,18 @@ func (client *ScheduledRecording2) GetAllowedValues(DataTypeID string, Filter st return } -func (client *ScheduledRecording2) GetStateUpdateID() (Id uint32, err error) { +// GetAllowedValues is the legacy version of GetAllowedValuesCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetAllowedValues(DataTypeID string, Filter string) (PropertyInfo string, err error) { + return client.GetAllowedValuesCtx(context.Background(), + DataTypeID, + Filter, + ) +} + +func (client *ScheduledRecording2) GetStateUpdateIDCtx( + ctx context.Context, +) (Id uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -7676,7 +10023,7 @@ func (client *ScheduledRecording2) GetStateUpdateID() (Id uint32, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetStateUpdateID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetStateUpdateID", request, response); err != nil { return } @@ -7689,7 +10036,19 @@ func (client *ScheduledRecording2) GetStateUpdateID() (Id uint32, err error) { return } -func (client *ScheduledRecording2) BrowseRecordSchedules(Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// GetStateUpdateID is the legacy version of GetStateUpdateIDCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetStateUpdateID() (Id uint32, err error) { + return client.GetStateUpdateIDCtx(context.Background()) +} + +func (client *ScheduledRecording2) BrowseRecordSchedulesCtx( + ctx context.Context, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { Filter string @@ -7722,7 +10081,7 @@ func (client *ScheduledRecording2) BrowseRecordSchedules(Filter string, Starting }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "BrowseRecordSchedules", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "BrowseRecordSchedules", request, response); err != nil { return } @@ -7744,7 +10103,25 @@ func (client *ScheduledRecording2) BrowseRecordSchedules(Filter string, Starting return } -func (client *ScheduledRecording2) BrowseRecordTasks(RecordScheduleID string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { +// BrowseRecordSchedules is the legacy version of BrowseRecordSchedulesCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) BrowseRecordSchedules(Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseRecordSchedulesCtx(context.Background(), + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ScheduledRecording2) BrowseRecordTasksCtx( + ctx context.Context, + RecordScheduleID string, + Filter string, + StartingIndex uint32, + RequestedCount uint32, + SortCriteria string, +) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7781,7 +10158,7 @@ func (client *ScheduledRecording2) BrowseRecordTasks(RecordScheduleID string, Fi }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "BrowseRecordTasks", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "BrowseRecordTasks", request, response); err != nil { return } @@ -7803,7 +10180,22 @@ func (client *ScheduledRecording2) BrowseRecordTasks(RecordScheduleID string, Fi return } -func (client *ScheduledRecording2) CreateRecordSchedule(Elements string) (RecordScheduleID string, Result string, UpdateID uint32, err error) { +// BrowseRecordTasks is the legacy version of BrowseRecordTasksCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) BrowseRecordTasks(RecordScheduleID string, Filter string, StartingIndex uint32, RequestedCount uint32, SortCriteria string) (Result string, NumberReturned uint32, TotalMatches uint32, UpdateID uint32, err error) { + return client.BrowseRecordTasksCtx(context.Background(), + RecordScheduleID, + Filter, + StartingIndex, + RequestedCount, + SortCriteria, + ) +} + +func (client *ScheduledRecording2) CreateRecordScheduleCtx( + ctx context.Context, + Elements string, +) (RecordScheduleID string, Result string, UpdateID uint32, err error) { // Request structure. request := &struct { Elements string @@ -7823,7 +10215,7 @@ func (client *ScheduledRecording2) CreateRecordSchedule(Elements string) (Record }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "CreateRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "CreateRecordSchedule", request, response); err != nil { return } @@ -7842,7 +10234,18 @@ func (client *ScheduledRecording2) CreateRecordSchedule(Elements string) (Record return } -func (client *ScheduledRecording2) DeleteRecordSchedule(RecordScheduleID string) (err error) { +// CreateRecordSchedule is the legacy version of CreateRecordScheduleCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) CreateRecordSchedule(Elements string) (RecordScheduleID string, Result string, UpdateID uint32, err error) { + return client.CreateRecordScheduleCtx(context.Background(), + Elements, + ) +} + +func (client *ScheduledRecording2) DeleteRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, +) (err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7858,7 +10261,7 @@ func (client *ScheduledRecording2) DeleteRecordSchedule(RecordScheduleID string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "DeleteRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "DeleteRecordSchedule", request, response); err != nil { return } @@ -7868,7 +10271,19 @@ func (client *ScheduledRecording2) DeleteRecordSchedule(RecordScheduleID string) return } -func (client *ScheduledRecording2) GetRecordSchedule(RecordScheduleID string, Filter string) (Result string, UpdateID uint32, err error) { +// DeleteRecordSchedule is the legacy version of DeleteRecordScheduleCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) DeleteRecordSchedule(RecordScheduleID string) (err error) { + return client.DeleteRecordScheduleCtx(context.Background(), + RecordScheduleID, + ) +} + +func (client *ScheduledRecording2) GetRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, + Filter string, +) (Result string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7891,7 +10306,7 @@ func (client *ScheduledRecording2) GetRecordSchedule(RecordScheduleID string, Fi }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetRecordSchedule", request, response); err != nil { return } @@ -7907,7 +10322,56 @@ func (client *ScheduledRecording2) GetRecordSchedule(RecordScheduleID string, Fi return } +// GetRecordSchedule is the legacy version of GetRecordScheduleCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetRecordSchedule(RecordScheduleID string, Filter string) (Result string, UpdateID uint32, err error) { + return client.GetRecordScheduleCtx(context.Background(), + RecordScheduleID, + Filter, + ) +} + +func (client *ScheduledRecording2) EnableRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, +) (err error) { + // Request structure. + request := &struct { + RecordScheduleID string + }{} + // BEGIN Marshal arguments into request. + + if request.RecordScheduleID, err = soap.MarshalString(RecordScheduleID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "EnableRecordSchedule", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// EnableRecordSchedule is the legacy version of EnableRecordScheduleCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording2) EnableRecordSchedule(RecordScheduleID string) (err error) { + return client.EnableRecordScheduleCtx(context.Background(), + RecordScheduleID, + ) +} + +func (client *ScheduledRecording2) DisableRecordScheduleCtx( + ctx context.Context, + RecordScheduleID string, +) (err error) { // Request structure. request := &struct { RecordScheduleID string @@ -7923,7 +10387,7 @@ func (client *ScheduledRecording2) EnableRecordSchedule(RecordScheduleID string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "EnableRecordSchedule", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "DisableRecordSchedule", request, response); err != nil { return } @@ -7933,33 +10397,18 @@ func (client *ScheduledRecording2) EnableRecordSchedule(RecordScheduleID string) return } +// DisableRecordSchedule is the legacy version of DisableRecordScheduleCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording2) DisableRecordSchedule(RecordScheduleID string) (err error) { - // Request structure. - request := &struct { - RecordScheduleID string - }{} - // BEGIN Marshal arguments into request. - - if request.RecordScheduleID, err = soap.MarshalString(RecordScheduleID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "DisableRecordSchedule", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DisableRecordScheduleCtx(context.Background(), + RecordScheduleID, + ) } -func (client *ScheduledRecording2) DeleteRecordTask(RecordTaskID string) (err error) { +func (client *ScheduledRecording2) DeleteRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { // Request structure. request := &struct { RecordTaskID string @@ -7975,7 +10424,7 @@ func (client *ScheduledRecording2) DeleteRecordTask(RecordTaskID string) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "DeleteRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "DeleteRecordTask", request, response); err != nil { return } @@ -7985,7 +10434,19 @@ func (client *ScheduledRecording2) DeleteRecordTask(RecordTaskID string) (err er return } -func (client *ScheduledRecording2) GetRecordTask(RecordTaskID string, Filter string) (Result string, UpdateID uint32, err error) { +// DeleteRecordTask is the legacy version of DeleteRecordTaskCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) DeleteRecordTask(RecordTaskID string) (err error) { + return client.DeleteRecordTaskCtx(context.Background(), + RecordTaskID, + ) +} + +func (client *ScheduledRecording2) GetRecordTaskCtx( + ctx context.Context, + RecordTaskID string, + Filter string, +) (Result string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordTaskID string @@ -8008,7 +10469,7 @@ func (client *ScheduledRecording2) GetRecordTask(RecordTaskID string, Filter str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetRecordTask", request, response); err != nil { return } @@ -8024,7 +10485,56 @@ func (client *ScheduledRecording2) GetRecordTask(RecordTaskID string, Filter str return } +// GetRecordTask is the legacy version of GetRecordTaskCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetRecordTask(RecordTaskID string, Filter string) (Result string, UpdateID uint32, err error) { + return client.GetRecordTaskCtx(context.Background(), + RecordTaskID, + Filter, + ) +} + +func (client *ScheduledRecording2) EnableRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { + // Request structure. + request := &struct { + RecordTaskID string + }{} + // BEGIN Marshal arguments into request. + + if request.RecordTaskID, err = soap.MarshalString(RecordTaskID); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "EnableRecordTask", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// EnableRecordTask is the legacy version of EnableRecordTaskCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording2) EnableRecordTask(RecordTaskID string) (err error) { + return client.EnableRecordTaskCtx(context.Background(), + RecordTaskID, + ) +} + +func (client *ScheduledRecording2) DisableRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { // Request structure. request := &struct { RecordTaskID string @@ -8040,7 +10550,7 @@ func (client *ScheduledRecording2) EnableRecordTask(RecordTaskID string) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "EnableRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "DisableRecordTask", request, response); err != nil { return } @@ -8050,7 +10560,18 @@ func (client *ScheduledRecording2) EnableRecordTask(RecordTaskID string) (err er return } +// DisableRecordTask is the legacy version of DisableRecordTaskCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording2) DisableRecordTask(RecordTaskID string) (err error) { + return client.DisableRecordTaskCtx(context.Background(), + RecordTaskID, + ) +} + +func (client *ScheduledRecording2) ResetRecordTaskCtx( + ctx context.Context, + RecordTaskID string, +) (err error) { // Request structure. request := &struct { RecordTaskID string @@ -8066,7 +10587,7 @@ func (client *ScheduledRecording2) DisableRecordTask(RecordTaskID string) (err e response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "DisableRecordTask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "ResetRecordTask", request, response); err != nil { return } @@ -8076,33 +10597,18 @@ func (client *ScheduledRecording2) DisableRecordTask(RecordTaskID string) (err e return } +// ResetRecordTask is the legacy version of ResetRecordTaskCtx, but uses +// context.Background() as the context. func (client *ScheduledRecording2) ResetRecordTask(RecordTaskID string) (err error) { - // Request structure. - request := &struct { - RecordTaskID string - }{} - // BEGIN Marshal arguments into request. - - if request.RecordTaskID, err = soap.MarshalString(RecordTaskID); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "ResetRecordTask", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ResetRecordTaskCtx(context.Background(), + RecordTaskID, + ) } -func (client *ScheduledRecording2) GetRecordScheduleConflicts(RecordScheduleID string) (RecordScheduleConflictIDList string, UpdateID uint32, err error) { +func (client *ScheduledRecording2) GetRecordScheduleConflictsCtx( + ctx context.Context, + RecordScheduleID string, +) (RecordScheduleConflictIDList string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordScheduleID string @@ -8121,7 +10627,7 @@ func (client *ScheduledRecording2) GetRecordScheduleConflicts(RecordScheduleID s }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetRecordScheduleConflicts", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetRecordScheduleConflicts", request, response); err != nil { return } @@ -8137,7 +10643,18 @@ func (client *ScheduledRecording2) GetRecordScheduleConflicts(RecordScheduleID s return } -func (client *ScheduledRecording2) GetRecordTaskConflicts(RecordTaskID string) (RecordTaskConflictIDList string, UpdateID uint32, err error) { +// GetRecordScheduleConflicts is the legacy version of GetRecordScheduleConflictsCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetRecordScheduleConflicts(RecordScheduleID string) (RecordScheduleConflictIDList string, UpdateID uint32, err error) { + return client.GetRecordScheduleConflictsCtx(context.Background(), + RecordScheduleID, + ) +} + +func (client *ScheduledRecording2) GetRecordTaskConflictsCtx( + ctx context.Context, + RecordTaskID string, +) (RecordTaskConflictIDList string, UpdateID uint32, err error) { // Request structure. request := &struct { RecordTaskID string @@ -8156,7 +10673,7 @@ func (client *ScheduledRecording2) GetRecordTaskConflicts(RecordTaskID string) ( }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_ScheduledRecording_2, "GetRecordTaskConflicts", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_ScheduledRecording_2, "GetRecordTaskConflicts", request, response); err != nil { return } @@ -8171,3 +10688,11 @@ func (client *ScheduledRecording2) GetRecordTaskConflicts(RecordTaskID string) ( // END Unmarshal arguments from response. return } + +// GetRecordTaskConflicts is the legacy version of GetRecordTaskConflictsCtx, but uses +// context.Background() as the context. +func (client *ScheduledRecording2) GetRecordTaskConflicts(RecordTaskID string) (RecordTaskConflictIDList string, UpdateID uint32, err error) { + return client.GetRecordTaskConflictsCtx(context.Background(), + RecordTaskID, + ) +} diff --git a/dcps/internetgateway1/internetgateway1.go b/dcps/internetgateway1/internetgateway1.go index e933504..0ac9d54 100644 --- a/dcps/internetgateway1/internetgateway1.go +++ b/dcps/internetgateway1/internetgateway1.go @@ -10,6 +10,7 @@ package internetgateway1 // *********************************************************** import ( + "context" "net/url" "time" @@ -100,7 +101,10 @@ func newLANHostConfigManagement1ClientsFromGenericClients(genericClients []goupn return clients } -func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerConfigurable bool) (err error) { +func (client *LANHostConfigManagement1) SetDHCPServerConfigurableCtx( + ctx context.Context, + NewDHCPServerConfigurable bool, +) (err error) { // Request structure. request := &struct { NewDHCPServerConfigurable string @@ -116,7 +120,7 @@ func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerC response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDHCPServerConfigurable", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDHCPServerConfigurable", request, response); err != nil { return } @@ -126,7 +130,17 @@ func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerC return } -func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServerConfigurable bool, err error) { +// SetDHCPServerConfigurable is the legacy version of SetDHCPServerConfigurableCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerConfigurable bool) (err error) { + return client.SetDHCPServerConfigurableCtx(context.Background(), + NewDHCPServerConfigurable, + ) +} + +func (client *LANHostConfigManagement1) GetDHCPServerConfigurableCtx( + ctx context.Context, +) (NewDHCPServerConfigurable bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -139,7 +153,7 @@ func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServ }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDHCPServerConfigurable", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDHCPServerConfigurable", request, response); err != nil { return } @@ -152,7 +166,16 @@ func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServ return } -func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err error) { +// GetDHCPServerConfigurable is the legacy version of GetDHCPServerConfigurableCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServerConfigurable bool, err error) { + return client.GetDHCPServerConfigurableCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetDHCPRelayCtx( + ctx context.Context, + NewDHCPRelay bool, +) (err error) { // Request structure. request := &struct { NewDHCPRelay string @@ -168,7 +191,7 @@ func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDHCPRelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDHCPRelay", request, response); err != nil { return } @@ -178,7 +201,17 @@ func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err err return } -func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err error) { +// SetDHCPRelay is the legacy version of SetDHCPRelayCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err error) { + return client.SetDHCPRelayCtx(context.Background(), + NewDHCPRelay, + ) +} + +func (client *LANHostConfigManagement1) GetDHCPRelayCtx( + ctx context.Context, +) (NewDHCPRelay bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -191,7 +224,7 @@ func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDHCPRelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDHCPRelay", request, response); err != nil { return } @@ -204,7 +237,16 @@ func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err e return } -func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err error) { +// GetDHCPRelay is the legacy version of GetDHCPRelayCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err error) { + return client.GetDHCPRelayCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetSubnetMaskCtx( + ctx context.Context, + NewSubnetMask string, +) (err error) { // Request structure. request := &struct { NewSubnetMask string @@ -220,7 +262,7 @@ func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetSubnetMask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetSubnetMask", request, response); err != nil { return } @@ -230,7 +272,17 @@ func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err return } -func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, err error) { +// SetSubnetMask is the legacy version of SetSubnetMaskCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err error) { + return client.SetSubnetMaskCtx(context.Background(), + NewSubnetMask, + ) +} + +func (client *LANHostConfigManagement1) GetSubnetMaskCtx( + ctx context.Context, +) (NewSubnetMask string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -243,7 +295,7 @@ func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetSubnetMask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetSubnetMask", request, response); err != nil { return } @@ -256,7 +308,53 @@ func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, e return } +// GetSubnetMask is the legacy version of GetSubnetMaskCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, err error) { + return client.GetSubnetMaskCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetIPRouterCtx( + ctx context.Context, + NewIPRouters string, +) (err error) { + // Request structure. + request := &struct { + NewIPRouters string + }{} + // BEGIN Marshal arguments into request. + + if request.NewIPRouters, err = soap.MarshalString(NewIPRouters); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetIPRouter", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// SetIPRouter is the legacy version of SetIPRouterCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err error) { + return client.SetIPRouterCtx(context.Background(), + NewIPRouters, + ) +} + +func (client *LANHostConfigManagement1) DeleteIPRouterCtx( + ctx context.Context, + NewIPRouters string, +) (err error) { // Request structure. request := &struct { NewIPRouters string @@ -272,7 +370,7 @@ func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetIPRouter", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteIPRouter", request, response); err != nil { return } @@ -282,33 +380,17 @@ func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err er return } +// DeleteIPRouter is the legacy version of DeleteIPRouterCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) DeleteIPRouter(NewIPRouters string) (err error) { - // Request structure. - request := &struct { - NewIPRouters string - }{} - // BEGIN Marshal arguments into request. - - if request.NewIPRouters, err = soap.MarshalString(NewIPRouters); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "DeleteIPRouter", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DeleteIPRouterCtx(context.Background(), + NewIPRouters, + ) } -func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, err error) { +func (client *LANHostConfigManagement1) GetIPRoutersListCtx( + ctx context.Context, +) (NewIPRouters string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -321,7 +403,7 @@ func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetIPRoutersList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetIPRoutersList", request, response); err != nil { return } @@ -334,7 +416,16 @@ func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, return } -func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err error) { +// GetIPRoutersList is the legacy version of GetIPRoutersListCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, err error) { + return client.GetIPRoutersListCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetDomainNameCtx( + ctx context.Context, + NewDomainName string, +) (err error) { // Request structure. request := &struct { NewDomainName string @@ -350,7 +441,7 @@ func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDomainName", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDomainName", request, response); err != nil { return } @@ -360,7 +451,17 @@ func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err return } -func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, err error) { +// SetDomainName is the legacy version of SetDomainNameCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err error) { + return client.SetDomainNameCtx(context.Background(), + NewDomainName, + ) +} + +func (client *LANHostConfigManagement1) GetDomainNameCtx( + ctx context.Context, +) (NewDomainName string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -373,7 +474,7 @@ func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDomainName", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDomainName", request, response); err != nil { return } @@ -386,7 +487,17 @@ func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, e return } -func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, NewMaxAddress string) (err error) { +// GetDomainName is the legacy version of GetDomainNameCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, err error) { + return client.GetDomainNameCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetAddressRangeCtx( + ctx context.Context, + NewMinAddress string, + NewMaxAddress string, +) (err error) { // Request structure. request := &struct { NewMinAddress string @@ -406,7 +517,7 @@ func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, Ne response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetAddressRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetAddressRange", request, response); err != nil { return } @@ -416,7 +527,18 @@ func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, Ne return } -func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, NewMaxAddress string, err error) { +// SetAddressRange is the legacy version of SetAddressRangeCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, NewMaxAddress string) (err error) { + return client.SetAddressRangeCtx(context.Background(), + NewMinAddress, + NewMaxAddress, + ) +} + +func (client *LANHostConfigManagement1) GetAddressRangeCtx( + ctx context.Context, +) (NewMinAddress string, NewMaxAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -430,7 +552,7 @@ func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetAddressRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetAddressRange", request, response); err != nil { return } @@ -446,7 +568,53 @@ func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, return } +// GetAddressRange is the legacy version of GetAddressRangeCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, NewMaxAddress string, err error) { + return client.GetAddressRangeCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetReservedAddressCtx( + ctx context.Context, + NewReservedAddresses string, +) (err error) { + // Request structure. + request := &struct { + NewReservedAddresses string + }{} + // BEGIN Marshal arguments into request. + + if request.NewReservedAddresses, err = soap.MarshalString(NewReservedAddresses); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetReservedAddress", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// SetReservedAddress is the legacy version of SetReservedAddressCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses string) (err error) { + return client.SetReservedAddressCtx(context.Background(), + NewReservedAddresses, + ) +} + +func (client *LANHostConfigManagement1) DeleteReservedAddressCtx( + ctx context.Context, + NewReservedAddresses string, +) (err error) { // Request structure. request := &struct { NewReservedAddresses string @@ -462,7 +630,7 @@ func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetReservedAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteReservedAddress", request, response); err != nil { return } @@ -472,33 +640,17 @@ func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses return } +// DeleteReservedAddress is the legacy version of DeleteReservedAddressCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) DeleteReservedAddress(NewReservedAddresses string) (err error) { - // Request structure. - request := &struct { - NewReservedAddresses string - }{} - // BEGIN Marshal arguments into request. - - if request.NewReservedAddresses, err = soap.MarshalString(NewReservedAddresses); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "DeleteReservedAddress", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DeleteReservedAddressCtx(context.Background(), + NewReservedAddresses, + ) } -func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddresses string, err error) { +func (client *LANHostConfigManagement1) GetReservedAddressesCtx( + ctx context.Context, +) (NewReservedAddresses string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -511,7 +663,7 @@ func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddre }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetReservedAddresses", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetReservedAddresses", request, response); err != nil { return } @@ -524,7 +676,53 @@ func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddre return } +// GetReservedAddresses is the legacy version of GetReservedAddressesCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddresses string, err error) { + return client.GetReservedAddressesCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetDNSServerCtx( + ctx context.Context, + NewDNSServers string, +) (err error) { + // Request structure. + request := &struct { + NewDNSServers string + }{} + // BEGIN Marshal arguments into request. + + if request.NewDNSServers, err = soap.MarshalString(NewDNSServers); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDNSServer", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// SetDNSServer is the legacy version of SetDNSServerCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err error) { + return client.SetDNSServerCtx(context.Background(), + NewDNSServers, + ) +} + +func (client *LANHostConfigManagement1) DeleteDNSServerCtx( + ctx context.Context, + NewDNSServers string, +) (err error) { // Request structure. request := &struct { NewDNSServers string @@ -540,7 +738,7 @@ func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDNSServer", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteDNSServer", request, response); err != nil { return } @@ -550,33 +748,17 @@ func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err return } +// DeleteDNSServer is the legacy version of DeleteDNSServerCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) DeleteDNSServer(NewDNSServers string) (err error) { - // Request structure. - request := &struct { - NewDNSServers string - }{} - // BEGIN Marshal arguments into request. - - if request.NewDNSServers, err = soap.MarshalString(NewDNSServers); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "DeleteDNSServer", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DeleteDNSServerCtx(context.Background(), + NewDNSServers, + ) } -func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, err error) { +func (client *LANHostConfigManagement1) GetDNSServersCtx( + ctx context.Context, +) (NewDNSServers string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -589,7 +771,7 @@ func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDNSServers", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDNSServers", request, response); err != nil { return } @@ -602,6 +784,12 @@ func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, e return } +// GetDNSServers is the legacy version of GetDNSServersCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, err error) { + return client.GetDNSServersCtx(context.Background()) +} + // Layer3Forwarding1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:Layer3Forwarding:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -662,7 +850,10 @@ func newLayer3Forwarding1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectionService string) (err error) { +func (client *Layer3Forwarding1) SetDefaultConnectionServiceCtx( + ctx context.Context, + NewDefaultConnectionService string, +) (err error) { // Request structure. request := &struct { NewDefaultConnectionService string @@ -678,7 +869,7 @@ func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectio response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_Layer3Forwarding_1, "SetDefaultConnectionService", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_Layer3Forwarding_1, "SetDefaultConnectionService", request, response); err != nil { return } @@ -688,7 +879,17 @@ func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectio return } -func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnectionService string, err error) { +// SetDefaultConnectionService is the legacy version of SetDefaultConnectionServiceCtx, but uses +// context.Background() as the context. +func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectionService string) (err error) { + return client.SetDefaultConnectionServiceCtx(context.Background(), + NewDefaultConnectionService, + ) +} + +func (client *Layer3Forwarding1) GetDefaultConnectionServiceCtx( + ctx context.Context, +) (NewDefaultConnectionService string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -701,7 +902,7 @@ func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnec }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_Layer3Forwarding_1, "GetDefaultConnectionService", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_Layer3Forwarding_1, "GetDefaultConnectionService", request, response); err != nil { return } @@ -714,6 +915,12 @@ func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnec return } +// GetDefaultConnectionService is the legacy version of GetDefaultConnectionServiceCtx, but uses +// context.Background() as the context. +func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnectionService string, err error) { + return client.GetDefaultConnectionServiceCtx(context.Background()) +} + // WANCableLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANCableLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -780,7 +987,9 @@ func newWANCableLinkConfig1ClientsFromGenericClients(genericClients []goupnp.Ser // * NewCableLinkConfigState: allowed values: notReady, dsSyncComplete, usParamAcquired, rangingComplete, ipComplete, todEstablished, paramTransferComplete, registrationComplete, operational, accessDenied // // * NewLinkType: allowed values: Ethernet -func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigState string, NewLinkType string, err error) { +func (client *WANCableLinkConfig1) GetCableLinkConfigInfoCtx( + ctx context.Context, +) (NewCableLinkConfigState string, NewLinkType string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -794,7 +1003,7 @@ func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigS }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetCableLinkConfigInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetCableLinkConfigInfo", request, response); err != nil { return } @@ -810,7 +1019,15 @@ func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigS return } -func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFrequency uint32, err error) { +// GetCableLinkConfigInfo is the legacy version of GetCableLinkConfigInfoCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigState string, NewLinkType string, err error) { + return client.GetCableLinkConfigInfoCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetDownstreamFrequencyCtx( + ctx context.Context, +) (NewDownstreamFrequency uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -823,7 +1040,7 @@ func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFreque }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetDownstreamFrequency", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetDownstreamFrequency", request, response); err != nil { return } @@ -836,11 +1053,19 @@ func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFreque return } +// GetDownstreamFrequency is the legacy version of GetDownstreamFrequencyCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFrequency uint32, err error) { + return client.GetDownstreamFrequencyCtx(context.Background()) +} + // // Return values: // // * NewDownstreamModulation: allowed values: 64QAM, 256QAM -func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModulation string, err error) { +func (client *WANCableLinkConfig1) GetDownstreamModulationCtx( + ctx context.Context, +) (NewDownstreamModulation string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -853,7 +1078,7 @@ func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModul }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetDownstreamModulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetDownstreamModulation", request, response); err != nil { return } @@ -866,7 +1091,15 @@ func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModul return } -func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency uint32, err error) { +// GetDownstreamModulation is the legacy version of GetDownstreamModulationCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModulation string, err error) { + return client.GetDownstreamModulationCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetUpstreamFrequencyCtx( + ctx context.Context, +) (NewUpstreamFrequency uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -879,7 +1112,7 @@ func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamFrequency", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamFrequency", request, response); err != nil { return } @@ -892,11 +1125,19 @@ func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency return } +// GetUpstreamFrequency is the legacy version of GetUpstreamFrequencyCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency uint32, err error) { + return client.GetUpstreamFrequencyCtx(context.Background()) +} + // // Return values: // // * NewUpstreamModulation: allowed values: QPSK, 16QAM -func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulation string, err error) { +func (client *WANCableLinkConfig1) GetUpstreamModulationCtx( + ctx context.Context, +) (NewUpstreamModulation string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -909,7 +1150,7 @@ func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulatio }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamModulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamModulation", request, response); err != nil { return } @@ -922,7 +1163,15 @@ func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulatio return } -func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID uint32, err error) { +// GetUpstreamModulation is the legacy version of GetUpstreamModulationCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulation string, err error) { + return client.GetUpstreamModulationCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetUpstreamChannelIDCtx( + ctx context.Context, +) (NewUpstreamChannelID uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -935,7 +1184,7 @@ func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamChannelID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamChannelID", request, response); err != nil { return } @@ -948,7 +1197,15 @@ func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID return } -func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLevel uint32, err error) { +// GetUpstreamChannelID is the legacy version of GetUpstreamChannelIDCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID uint32, err error) { + return client.GetUpstreamChannelIDCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetUpstreamPowerLevelCtx( + ctx context.Context, +) (NewUpstreamPowerLevel uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -961,7 +1218,7 @@ func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLeve }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamPowerLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamPowerLevel", request, response); err != nil { return } @@ -974,7 +1231,15 @@ func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLeve return } -func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEnabled bool, err error) { +// GetUpstreamPowerLevel is the legacy version of GetUpstreamPowerLevelCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLevel uint32, err error) { + return client.GetUpstreamPowerLevelCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetBPIEncryptionEnabledCtx( + ctx context.Context, +) (NewBPIEncryptionEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -987,7 +1252,7 @@ func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEn }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetBPIEncryptionEnabled", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetBPIEncryptionEnabled", request, response); err != nil { return } @@ -1000,7 +1265,15 @@ func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEn return } -func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err error) { +// GetBPIEncryptionEnabled is the legacy version of GetBPIEncryptionEnabledCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEnabled bool, err error) { + return client.GetBPIEncryptionEnabledCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetConfigFileCtx( + ctx context.Context, +) (NewConfigFile string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1013,7 +1286,7 @@ func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err er }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetConfigFile", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetConfigFile", request, response); err != nil { return } @@ -1026,7 +1299,15 @@ func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err er return } -func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err error) { +// GetConfigFile is the legacy version of GetConfigFileCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err error) { + return client.GetConfigFileCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetTFTPServerCtx( + ctx context.Context, +) (NewTFTPServer string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1039,7 +1320,7 @@ func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err er }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetTFTPServer", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetTFTPServer", request, response); err != nil { return } @@ -1052,6 +1333,12 @@ func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err er return } +// GetTFTPServer is the legacy version of GetTFTPServerCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err error) { + return client.GetTFTPServerCtx(context.Background()) +} + // WANCommonInterfaceConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1112,7 +1399,10 @@ func newWANCommonInterfaceConfig1ClientsFromGenericClients(genericClients []goup return clients } -func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInternet bool) (err error) { +func (client *WANCommonInterfaceConfig1) SetEnabledForInternetCtx( + ctx context.Context, + NewEnabledForInternet bool, +) (err error) { // Request structure. request := &struct { NewEnabledForInternet string @@ -1128,7 +1418,7 @@ func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInte response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "SetEnabledForInternet", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "SetEnabledForInternet", request, response); err != nil { return } @@ -1138,7 +1428,17 @@ func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInte return } -func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForInternet bool, err error) { +// SetEnabledForInternet is the legacy version of SetEnabledForInternetCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInternet bool) (err error) { + return client.SetEnabledForInternetCtx(context.Background(), + NewEnabledForInternet, + ) +} + +func (client *WANCommonInterfaceConfig1) GetEnabledForInternetCtx( + ctx context.Context, +) (NewEnabledForInternet bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1151,7 +1451,7 @@ func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForI }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetEnabledForInternet", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetEnabledForInternet", request, response); err != nil { return } @@ -1164,13 +1464,21 @@ func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForI return } +// GetEnabledForInternet is the legacy version of GetEnabledForInternetCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForInternet bool, err error) { + return client.GetEnabledForInternetCtx(context.Background()) +} + // // Return values: // // * NewWANAccessType: allowed values: DSL, POTS, Cable, Ethernet // // * NewPhysicalLinkStatus: allowed values: Up, Down -func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) { +func (client *WANCommonInterfaceConfig1) GetCommonLinkPropertiesCtx( + ctx context.Context, +) (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1186,7 +1494,7 @@ func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccess }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetCommonLinkProperties", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetCommonLinkProperties", request, response); err != nil { return } @@ -1208,7 +1516,15 @@ func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccess return } -func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessProvider string, err error) { +// GetCommonLinkProperties is the legacy version of GetCommonLinkPropertiesCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) { + return client.GetCommonLinkPropertiesCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetWANAccessProviderCtx( + ctx context.Context, +) (NewWANAccessProvider string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1221,7 +1537,7 @@ func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessPro }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetWANAccessProvider", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetWANAccessProvider", request, response); err != nil { return } @@ -1234,11 +1550,19 @@ func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessPro return } +// GetWANAccessProvider is the legacy version of GetWANAccessProviderCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessProvider string, err error) { + return client.GetWANAccessProviderCtx(context.Background()) +} + // // Return values: // // * NewMaximumActiveConnections: allowed value range: minimum=1, step=1 -func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaximumActiveConnections uint16, err error) { +func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnectionsCtx( + ctx context.Context, +) (NewMaximumActiveConnections uint16, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1251,7 +1575,7 @@ func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaxim }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetMaximumActiveConnections", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetMaximumActiveConnections", request, response); err != nil { return } @@ -1264,7 +1588,15 @@ func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaxim return } -func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent uint64, err error) { +// GetMaximumActiveConnections is the legacy version of GetMaximumActiveConnectionsCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaximumActiveConnections uint16, err error) { + return client.GetMaximumActiveConnectionsCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalBytesSentCtx( + ctx context.Context, +) (NewTotalBytesSent uint64, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1277,7 +1609,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalBytesSent", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalBytesSent", request, response); err != nil { return } @@ -1290,7 +1622,15 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent return } -func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesReceived uint64, err error) { +// GetTotalBytesSent is the legacy version of GetTotalBytesSentCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent uint64, err error) { + return client.GetTotalBytesSentCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalBytesReceivedCtx( + ctx context.Context, +) (NewTotalBytesReceived uint64, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1303,7 +1643,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesR }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalBytesReceived", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalBytesReceived", request, response); err != nil { return } @@ -1316,7 +1656,15 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesR return } -func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsSent uint32, err error) { +// GetTotalBytesReceived is the legacy version of GetTotalBytesReceivedCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesReceived uint64, err error) { + return client.GetTotalBytesReceivedCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalPacketsSentCtx( + ctx context.Context, +) (NewTotalPacketsSent uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1329,7 +1677,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsS }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalPacketsSent", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalPacketsSent", request, response); err != nil { return } @@ -1342,7 +1690,15 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsS return } -func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPacketsReceived uint32, err error) { +// GetTotalPacketsSent is the legacy version of GetTotalPacketsSentCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsSent uint32, err error) { + return client.GetTotalPacketsSentCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceivedCtx( + ctx context.Context, +) (NewTotalPacketsReceived uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1355,7 +1711,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPack }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalPacketsReceived", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalPacketsReceived", request, response); err != nil { return } @@ -1368,7 +1724,16 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPack return } -func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnectionIndex uint16) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) { +// GetTotalPacketsReceived is the legacy version of GetTotalPacketsReceivedCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPacketsReceived uint32, err error) { + return client.GetTotalPacketsReceivedCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetActiveConnectionCtx( + ctx context.Context, + NewActiveConnectionIndex uint16, +) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) { // Request structure. request := &struct { NewActiveConnectionIndex string @@ -1387,7 +1752,7 @@ func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnection }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetActiveConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetActiveConnection", request, response); err != nil { return } @@ -1403,6 +1768,14 @@ func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnection return } +// GetActiveConnection is the legacy version of GetActiveConnectionCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnectionIndex uint16) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) { + return client.GetActiveConnectionCtx(context.Background(), + NewActiveConnectionIndex, + ) +} + // WANDSLLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANDSLLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1463,7 +1836,10 @@ func newWANDSLLinkConfig1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) { +func (client *WANDSLLinkConfig1) SetDSLLinkTypeCtx( + ctx context.Context, + NewLinkType string, +) (err error) { // Request structure. request := &struct { NewLinkType string @@ -1479,7 +1855,7 @@ func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetDSLLinkType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetDSLLinkType", request, response); err != nil { return } @@ -1489,11 +1865,21 @@ func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) return } +// SetDSLLinkType is the legacy version of SetDSLLinkTypeCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) { + return client.SetDSLLinkTypeCtx(context.Background(), + NewLinkType, + ) +} + // // Return values: // // * NewLinkStatus: allowed values: Up, Down -func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkStatus string, err error) { +func (client *WANDSLLinkConfig1) GetDSLLinkInfoCtx( + ctx context.Context, +) (NewLinkType string, NewLinkStatus string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1507,7 +1893,7 @@ func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkSt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetDSLLinkInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetDSLLinkInfo", request, response); err != nil { return } @@ -1523,7 +1909,15 @@ func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkSt return } -func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) { +// GetDSLLinkInfo is the legacy version of GetDSLLinkInfoCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkStatus string, err error) { + return client.GetDSLLinkInfoCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) GetAutoConfigCtx( + ctx context.Context, +) (NewAutoConfig bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1536,7 +1930,7 @@ func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetAutoConfig", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetAutoConfig", request, response); err != nil { return } @@ -1549,7 +1943,15 @@ func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) return } -func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, err error) { +// GetAutoConfig is the legacy version of GetAutoConfigCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) { + return client.GetAutoConfigCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) GetModulationTypeCtx( + ctx context.Context, +) (NewModulationType string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1562,7 +1964,7 @@ func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetModulationType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetModulationType", request, response); err != nil { return } @@ -1575,7 +1977,16 @@ func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, return } -func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress string) (err error) { +// GetModulationType is the legacy version of GetModulationTypeCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, err error) { + return client.GetModulationTypeCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) SetDestinationAddressCtx( + ctx context.Context, + NewDestinationAddress string, +) (err error) { // Request structure. request := &struct { NewDestinationAddress string @@ -1591,7 +2002,7 @@ func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress str response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetDestinationAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetDestinationAddress", request, response); err != nil { return } @@ -1601,7 +2012,17 @@ func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress str return } -func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress string, err error) { +// SetDestinationAddress is the legacy version of SetDestinationAddressCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress string) (err error) { + return client.SetDestinationAddressCtx(context.Background(), + NewDestinationAddress, + ) +} + +func (client *WANDSLLinkConfig1) GetDestinationAddressCtx( + ctx context.Context, +) (NewDestinationAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1614,7 +2035,7 @@ func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetDestinationAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetDestinationAddress", request, response); err != nil { return } @@ -1627,7 +2048,16 @@ func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress return } -func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) (err error) { +// GetDestinationAddress is the legacy version of GetDestinationAddressCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress string, err error) { + return client.GetDestinationAddressCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) SetATMEncapsulationCtx( + ctx context.Context, + NewATMEncapsulation string, +) (err error) { // Request structure. request := &struct { NewATMEncapsulation string @@ -1643,7 +2073,7 @@ func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetATMEncapsulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetATMEncapsulation", request, response); err != nil { return } @@ -1653,7 +2083,17 @@ func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) return } -func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation string, err error) { +// SetATMEncapsulation is the legacy version of SetATMEncapsulationCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) (err error) { + return client.SetATMEncapsulationCtx(context.Background(), + NewATMEncapsulation, + ) +} + +func (client *WANDSLLinkConfig1) GetATMEncapsulationCtx( + ctx context.Context, +) (NewATMEncapsulation string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1666,7 +2106,7 @@ func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation stri }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetATMEncapsulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetATMEncapsulation", request, response); err != nil { return } @@ -1679,7 +2119,16 @@ func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation stri return } -func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err error) { +// GetATMEncapsulation is the legacy version of GetATMEncapsulationCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation string, err error) { + return client.GetATMEncapsulationCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) SetFCSPreservedCtx( + ctx context.Context, + NewFCSPreserved bool, +) (err error) { // Request structure. request := &struct { NewFCSPreserved string @@ -1695,7 +2144,7 @@ func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err erro response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetFCSPreserved", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetFCSPreserved", request, response); err != nil { return } @@ -1705,7 +2154,17 @@ func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err erro return } -func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err error) { +// SetFCSPreserved is the legacy version of SetFCSPreservedCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err error) { + return client.SetFCSPreservedCtx(context.Background(), + NewFCSPreserved, + ) +} + +func (client *WANDSLLinkConfig1) GetFCSPreservedCtx( + ctx context.Context, +) (NewFCSPreserved bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1718,7 +2177,7 @@ func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err er }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetFCSPreserved", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetFCSPreserved", request, response); err != nil { return } @@ -1731,6 +2190,12 @@ func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err er return } +// GetFCSPreserved is the legacy version of GetFCSPreservedCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err error) { + return client.GetFCSPreservedCtx(context.Background()) +} + // WANEthernetLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANEthernetLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1795,7 +2260,9 @@ func newWANEthernetLinkConfig1ClientsFromGenericClients(genericClients []goupnp. // Return values: // // * NewEthernetLinkStatus: allowed values: Up, Down -func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkStatus string, err error) { +func (client *WANEthernetLinkConfig1) GetEthernetLinkStatusCtx( + ctx context.Context, +) (NewEthernetLinkStatus string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1808,7 +2275,7 @@ func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkSt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANEthernetLinkConfig_1, "GetEthernetLinkStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANEthernetLinkConfig_1, "GetEthernetLinkStatus", request, response); err != nil { return } @@ -1821,6 +2288,12 @@ func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkSt return } +// GetEthernetLinkStatus is the legacy version of GetEthernetLinkStatusCtx, but uses +// context.Background() as the context. +func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkStatus string, err error) { + return client.GetEthernetLinkStatusCtx(context.Background()) +} + // WANIPConnection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPConnection:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1881,7 +2354,10 @@ func newWANIPConnection1ClientsFromGenericClients(genericClients []goupnp.Servic return clients } -func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err error) { +func (client *WANIPConnection1) SetConnectionTypeCtx( + ctx context.Context, + NewConnectionType string, +) (err error) { // Request structure. request := &struct { NewConnectionType string @@ -1897,7 +2373,7 @@ func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetConnectionType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetConnectionType", request, response); err != nil { return } @@ -1907,11 +2383,21 @@ func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err return } +// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err error) { + return client.SetConnectionTypeCtx(context.Background(), + NewConnectionType, + ) +} + // // Return values: // // * NewPossibleConnectionTypes: allowed values: Unconfigured, IP_Routed, IP_Bridged -func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { +func (client *WANIPConnection1) GetConnectionTypeInfoCtx( + ctx context.Context, +) (NewConnectionType string, NewPossibleConnectionTypes string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1925,7 +2411,7 @@ func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { return } @@ -1941,7 +2427,44 @@ func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType strin return } +// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { + return client.GetConnectionTypeInfoCtx(context.Background()) +} + +func (client *WANIPConnection1) RequestConnectionCtx( + ctx context.Context, +) (err error) { + // Request structure. + request := interface{}(nil) + // BEGIN Marshal arguments into request. + + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "RequestConnection", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// RequestConnection is the legacy version of RequestConnectionCtx, but uses +// context.Background() as the context. func (client *WANIPConnection1) RequestConnection() (err error) { + return client.RequestConnectionCtx(context.Background()) +} + +func (client *WANIPConnection1) RequestTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1952,7 +2475,7 @@ func (client *WANIPConnection1) RequestConnection() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "RequestConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "RequestTermination", request, response); err != nil { return } @@ -1962,7 +2485,15 @@ func (client *WANIPConnection1) RequestConnection() (err error) { return } +// RequestTermination is the legacy version of RequestTerminationCtx, but uses +// context.Background() as the context. func (client *WANIPConnection1) RequestTermination() (err error) { + return client.RequestTerminationCtx(context.Background()) +} + +func (client *WANIPConnection1) ForceTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1973,7 +2504,7 @@ func (client *WANIPConnection1) RequestTermination() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "RequestTermination", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "ForceTermination", request, response); err != nil { return } @@ -1983,28 +2514,16 @@ func (client *WANIPConnection1) RequestTermination() (err error) { return } +// ForceTermination is the legacy version of ForceTerminationCtx, but uses +// context.Background() as the context. func (client *WANIPConnection1) ForceTermination() (err error) { - // Request structure. - request := interface{}(nil) - // BEGIN Marshal arguments into request. - - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "ForceTermination", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ForceTerminationCtx(context.Background()) } -func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { +func (client *WANIPConnection1) SetAutoDisconnectTimeCtx( + ctx context.Context, + NewAutoDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewAutoDisconnectTime string @@ -2020,7 +2539,7 @@ func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { return } @@ -2030,7 +2549,18 @@ func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint return } -func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { +// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { + return client.SetAutoDisconnectTimeCtx(context.Background(), + NewAutoDisconnectTime, + ) +} + +func (client *WANIPConnection1) SetIdleDisconnectTimeCtx( + ctx context.Context, + NewIdleDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewIdleDisconnectTime string @@ -2046,7 +2576,7 @@ func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { return } @@ -2056,7 +2586,18 @@ func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint return } -func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { +// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { + return client.SetIdleDisconnectTimeCtx(context.Background(), + NewIdleDisconnectTime, + ) +} + +func (client *WANIPConnection1) SetWarnDisconnectDelayCtx( + ctx context.Context, + NewWarnDisconnectDelay uint32, +) (err error) { // Request structure. request := &struct { NewWarnDisconnectDelay string @@ -2072,7 +2613,7 @@ func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay ui response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { return } @@ -2082,13 +2623,23 @@ func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay ui return } +// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { + return client.SetWarnDisconnectDelayCtx(context.Background(), + NewWarnDisconnectDelay, + ) +} + // // Return values: // // * NewConnectionStatus: allowed values: Unconfigured, Connected, Disconnected // // * NewLastConnectionError: allowed values: ERROR_NONE -func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { +func (client *WANIPConnection1) GetStatusInfoCtx( + ctx context.Context, +) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2103,7 +2654,7 @@ func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, New }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetStatusInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetStatusInfo", request, response); err != nil { return } @@ -2122,7 +2673,15 @@ func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, New return } -func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { +// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { + return client.GetStatusInfoCtx(context.Background()) +} + +func (client *WANIPConnection1) GetAutoDisconnectTimeCtx( + ctx context.Context, +) (NewAutoDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2135,7 +2694,7 @@ func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { return } @@ -2148,7 +2707,15 @@ func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime u return } -func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { +// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { + return client.GetAutoDisconnectTimeCtx(context.Background()) +} + +func (client *WANIPConnection1) GetIdleDisconnectTimeCtx( + ctx context.Context, +) (NewIdleDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2161,7 +2728,7 @@ func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { return } @@ -2174,7 +2741,15 @@ func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime u return } -func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { +// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { + return client.GetIdleDisconnectTimeCtx(context.Background()) +} + +func (client *WANIPConnection1) GetWarnDisconnectDelayCtx( + ctx context.Context, +) (NewWarnDisconnectDelay uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2187,7 +2762,7 @@ func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { return } @@ -2200,7 +2775,15 @@ func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay return } -func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { +// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { + return client.GetWarnDisconnectDelayCtx(context.Background()) +} + +func (client *WANIPConnection1) GetNATRSIPStatusCtx( + ctx context.Context, +) (NewRSIPAvailable bool, NewNATEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2214,7 +2797,7 @@ func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNA }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetNATRSIPStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetNATRSIPStatus", request, response); err != nil { return } @@ -2230,11 +2813,20 @@ func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNA return } +// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { + return client.GetNATRSIPStatusCtx(context.Background()) +} + // // Return values: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANIPConnection1) GetGenericPortMappingEntryCtx( + ctx context.Context, + NewPortMappingIndex uint16, +) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewPortMappingIndex string @@ -2259,7 +2851,7 @@ func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { return } @@ -2293,12 +2885,25 @@ func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex u return } +// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetGenericPortMappingEntryCtx(context.Background(), + NewPortMappingIndex, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANIPConnection1) GetSpecificPortMappingEntryCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewRemoteHost string @@ -2328,7 +2933,7 @@ func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { return } @@ -2353,12 +2958,32 @@ func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string return } +// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetSpecificPortMappingEntryCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { +func (client *WANIPConnection1) AddPortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, + NewInternalPort uint16, + NewInternalClient string, + NewEnabled bool, + NewPortMappingDescription string, + NewLeaseDuration uint32, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -2402,7 +3027,7 @@ func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternal response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "AddPortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "AddPortMapping", request, response); err != nil { return } @@ -2412,12 +3037,32 @@ func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternal return } +// AddPortMapping is the legacy version of AddPortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { + return client.AddPortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + NewInternalPort, + NewInternalClient, + NewEnabled, + NewPortMappingDescription, + NewLeaseDuration, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { +func (client *WANIPConnection1) DeletePortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -2441,7 +3086,7 @@ func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExter response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "DeletePortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "DeletePortMapping", request, response); err != nil { return } @@ -2451,7 +3096,19 @@ func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExter return } -func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { +// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { + return client.DeletePortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + +func (client *WANIPConnection1) GetExternalIPAddressCtx( + ctx context.Context, +) (NewExternalIPAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2464,7 +3121,7 @@ func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetExternalIPAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetExternalIPAddress", request, response); err != nil { return } @@ -2477,6 +3134,12 @@ func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress str return } +// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { + return client.GetExternalIPAddressCtx(context.Background()) +} + // WANPOTSLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANPOTSLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -2542,7 +3205,12 @@ func newWANPOTSLinkConfig1ClientsFromGenericClients(genericClients []goupnp.Serv // // * NewLinkType: allowed values: PPP_Dialup -func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInfo string, NewLinkType string) (err error) { +func (client *WANPOTSLinkConfig1) SetISPInfoCtx( + ctx context.Context, + NewISPPhoneNumber string, + NewISPInfo string, + NewLinkType string, +) (err error) { // Request structure. request := &struct { NewISPPhoneNumber string @@ -2566,7 +3234,7 @@ func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInf response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "SetISPInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "SetISPInfo", request, response); err != nil { return } @@ -2576,7 +3244,21 @@ func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInf return } -func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, NewDelayBetweenRetries uint32) (err error) { +// SetISPInfo is the legacy version of SetISPInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInfo string, NewLinkType string) (err error) { + return client.SetISPInfoCtx(context.Background(), + NewISPPhoneNumber, + NewISPInfo, + NewLinkType, + ) +} + +func (client *WANPOTSLinkConfig1) SetCallRetryInfoCtx( + ctx context.Context, + NewNumberOfRetries uint32, + NewDelayBetweenRetries uint32, +) (err error) { // Request structure. request := &struct { NewNumberOfRetries string @@ -2596,7 +3278,7 @@ func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, Ne response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "SetCallRetryInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "SetCallRetryInfo", request, response); err != nil { return } @@ -2606,11 +3288,22 @@ func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, Ne return } +// SetCallRetryInfo is the legacy version of SetCallRetryInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, NewDelayBetweenRetries uint32) (err error) { + return client.SetCallRetryInfoCtx(context.Background(), + NewNumberOfRetries, + NewDelayBetweenRetries, + ) +} + // // Return values: // // * NewLinkType: allowed values: PPP_Dialup -func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) { +func (client *WANPOTSLinkConfig1) GetISPInfoCtx( + ctx context.Context, +) (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2625,7 +3318,7 @@ func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISP }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetISPInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetISPInfo", request, response); err != nil { return } @@ -2644,7 +3337,15 @@ func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISP return } -func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) { +// GetISPInfo is the legacy version of GetISPInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) { + return client.GetISPInfoCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetCallRetryInfoCtx( + ctx context.Context, +) (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2658,7 +3359,7 @@ func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetCallRetryInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetCallRetryInfo", request, response); err != nil { return } @@ -2674,7 +3375,15 @@ func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, return } -func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { +// GetCallRetryInfo is the legacy version of GetCallRetryInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) { + return client.GetCallRetryInfoCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetFclassCtx( + ctx context.Context, +) (NewFclass string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2687,7 +3396,7 @@ func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetFclass", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetFclass", request, response); err != nil { return } @@ -2700,7 +3409,15 @@ func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { return } -func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulationSupported string, err error) { +// GetFclass is the legacy version of GetFclassCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { + return client.GetFclassCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetDataModulationSupportedCtx( + ctx context.Context, +) (NewDataModulationSupported string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2713,7 +3430,7 @@ func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulatio }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetDataModulationSupported", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataModulationSupported", request, response); err != nil { return } @@ -2726,7 +3443,15 @@ func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulatio return } -func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err error) { +// GetDataModulationSupported is the legacy version of GetDataModulationSupportedCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulationSupported string, err error) { + return client.GetDataModulationSupportedCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetDataProtocolCtx( + ctx context.Context, +) (NewDataProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2739,7 +3464,7 @@ func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetDataProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataProtocol", request, response); err != nil { return } @@ -2752,7 +3477,15 @@ func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err return } -func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression string, err error) { +// GetDataProtocol is the legacy version of GetDataProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err error) { + return client.GetDataProtocolCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetDataCompressionCtx( + ctx context.Context, +) (NewDataCompression string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2765,7 +3498,7 @@ func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetDataCompression", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataCompression", request, response); err != nil { return } @@ -2778,7 +3511,15 @@ func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression strin return } -func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRCommandSupported bool, err error) { +// GetDataCompression is the legacy version of GetDataCompressionCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression string, err error) { + return client.GetDataCompressionCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupportedCtx( + ctx context.Context, +) (NewPlusVTRCommandSupported bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2791,7 +3532,7 @@ func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRComman }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetPlusVTRCommandSupported", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetPlusVTRCommandSupported", request, response); err != nil { return } @@ -2804,6 +3545,12 @@ func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRComman return } +// GetPlusVTRCommandSupported is the legacy version of GetPlusVTRCommandSupportedCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRCommandSupported bool, err error) { + return client.GetPlusVTRCommandSupportedCtx(context.Background()) +} + // WANPPPConnection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANPPPConnection:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -2864,7 +3611,10 @@ func newWANPPPConnection1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (err error) { +func (client *WANPPPConnection1) SetConnectionTypeCtx( + ctx context.Context, + NewConnectionType string, +) (err error) { // Request structure. request := &struct { NewConnectionType string @@ -2880,7 +3630,7 @@ func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetConnectionType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetConnectionType", request, response); err != nil { return } @@ -2890,11 +3640,21 @@ func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (er return } +// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (err error) { + return client.SetConnectionTypeCtx(context.Background(), + NewConnectionType, + ) +} + // // Return values: // // * NewPossibleConnectionTypes: allowed values: Unconfigured, IP_Routed, DHCP_Spoofed, PPPoE_Bridged, PPTP_Relay, L2TP_Relay, PPPoE_Relay -func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { +func (client *WANPPPConnection1) GetConnectionTypeInfoCtx( + ctx context.Context, +) (NewConnectionType string, NewPossibleConnectionTypes string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2908,7 +3668,7 @@ func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType stri }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { return } @@ -2924,7 +3684,17 @@ func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType stri return } -func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPassword string) (err error) { +// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { + return client.GetConnectionTypeInfoCtx(context.Background()) +} + +func (client *WANPPPConnection1) ConfigureConnectionCtx( + ctx context.Context, + NewUserName string, + NewPassword string, +) (err error) { // Request structure. request := &struct { NewUserName string @@ -2944,7 +3714,7 @@ func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPass response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "ConfigureConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "ConfigureConnection", request, response); err != nil { return } @@ -2954,7 +3724,47 @@ func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPass return } +// ConfigureConnection is the legacy version of ConfigureConnectionCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPassword string) (err error) { + return client.ConfigureConnectionCtx(context.Background(), + NewUserName, + NewPassword, + ) +} + +func (client *WANPPPConnection1) RequestConnectionCtx( + ctx context.Context, +) (err error) { + // Request structure. + request := interface{}(nil) + // BEGIN Marshal arguments into request. + + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "RequestConnection", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// RequestConnection is the legacy version of RequestConnectionCtx, but uses +// context.Background() as the context. func (client *WANPPPConnection1) RequestConnection() (err error) { + return client.RequestConnectionCtx(context.Background()) +} + +func (client *WANPPPConnection1) RequestTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2965,7 +3775,7 @@ func (client *WANPPPConnection1) RequestConnection() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "RequestConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "RequestTermination", request, response); err != nil { return } @@ -2975,7 +3785,15 @@ func (client *WANPPPConnection1) RequestConnection() (err error) { return } +// RequestTermination is the legacy version of RequestTerminationCtx, but uses +// context.Background() as the context. func (client *WANPPPConnection1) RequestTermination() (err error) { + return client.RequestTerminationCtx(context.Background()) +} + +func (client *WANPPPConnection1) ForceTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2986,7 +3804,7 @@ func (client *WANPPPConnection1) RequestTermination() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "RequestTermination", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "ForceTermination", request, response); err != nil { return } @@ -2996,28 +3814,16 @@ func (client *WANPPPConnection1) RequestTermination() (err error) { return } +// ForceTermination is the legacy version of ForceTerminationCtx, but uses +// context.Background() as the context. func (client *WANPPPConnection1) ForceTermination() (err error) { - // Request structure. - request := interface{}(nil) - // BEGIN Marshal arguments into request. - - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "ForceTermination", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ForceTerminationCtx(context.Background()) } -func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { +func (client *WANPPPConnection1) SetAutoDisconnectTimeCtx( + ctx context.Context, + NewAutoDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewAutoDisconnectTime string @@ -3033,7 +3839,7 @@ func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uin response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { return } @@ -3043,7 +3849,18 @@ func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uin return } -func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { +// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { + return client.SetAutoDisconnectTimeCtx(context.Background(), + NewAutoDisconnectTime, + ) +} + +func (client *WANPPPConnection1) SetIdleDisconnectTimeCtx( + ctx context.Context, + NewIdleDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewIdleDisconnectTime string @@ -3059,7 +3876,7 @@ func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uin response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { return } @@ -3069,7 +3886,18 @@ func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uin return } -func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { +// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { + return client.SetIdleDisconnectTimeCtx(context.Background(), + NewIdleDisconnectTime, + ) +} + +func (client *WANPPPConnection1) SetWarnDisconnectDelayCtx( + ctx context.Context, + NewWarnDisconnectDelay uint32, +) (err error) { // Request structure. request := &struct { NewWarnDisconnectDelay string @@ -3085,7 +3913,7 @@ func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay u response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { return } @@ -3095,13 +3923,23 @@ func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay u return } +// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { + return client.SetWarnDisconnectDelayCtx(context.Background(), + NewWarnDisconnectDelay, + ) +} + // // Return values: // // * NewConnectionStatus: allowed values: Unconfigured, Connected, Disconnected // // * NewLastConnectionError: allowed values: ERROR_NONE -func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { +func (client *WANPPPConnection1) GetStatusInfoCtx( + ctx context.Context, +) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3116,7 +3954,7 @@ func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, Ne }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetStatusInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetStatusInfo", request, response); err != nil { return } @@ -3135,7 +3973,15 @@ func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, Ne return } -func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) { +// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { + return client.GetStatusInfoCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetLinkLayerMaxBitRatesCtx( + ctx context.Context, +) (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3149,7 +3995,7 @@ func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRat }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetLinkLayerMaxBitRates", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetLinkLayerMaxBitRates", request, response); err != nil { return } @@ -3165,7 +4011,15 @@ func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRat return } -func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionProtocol string, err error) { +// GetLinkLayerMaxBitRates is the legacy version of GetLinkLayerMaxBitRatesCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) { + return client.GetLinkLayerMaxBitRatesCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPPPEncryptionProtocolCtx( + ctx context.Context, +) (NewPPPEncryptionProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3178,7 +4032,7 @@ func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionPro }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPPPEncryptionProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPEncryptionProtocol", request, response); err != nil { return } @@ -3191,7 +4045,15 @@ func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionPro return } -func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionProtocol string, err error) { +// GetPPPEncryptionProtocol is the legacy version of GetPPPEncryptionProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionProtocol string, err error) { + return client.GetPPPEncryptionProtocolCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPPPCompressionProtocolCtx( + ctx context.Context, +) (NewPPPCompressionProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3204,7 +4066,7 @@ func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionP }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPPPCompressionProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPCompressionProtocol", request, response); err != nil { return } @@ -3217,7 +4079,15 @@ func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionP return } -func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthenticationProtocol string, err error) { +// GetPPPCompressionProtocol is the legacy version of GetPPPCompressionProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionProtocol string, err error) { + return client.GetPPPCompressionProtocolCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPPPAuthenticationProtocolCtx( + ctx context.Context, +) (NewPPPAuthenticationProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3230,7 +4100,7 @@ func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthentic }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPPPAuthenticationProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPAuthenticationProtocol", request, response); err != nil { return } @@ -3243,7 +4113,15 @@ func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthentic return } -func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { +// GetPPPAuthenticationProtocol is the legacy version of GetPPPAuthenticationProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthenticationProtocol string, err error) { + return client.GetPPPAuthenticationProtocolCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetUserNameCtx( + ctx context.Context, +) (NewUserName string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3256,7 +4134,7 @@ func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetUserName", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetUserName", request, response); err != nil { return } @@ -3269,7 +4147,15 @@ func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { return } -func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { +// GetUserName is the legacy version of GetUserNameCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { + return client.GetUserNameCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPasswordCtx( + ctx context.Context, +) (NewPassword string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3282,7 +4168,7 @@ func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPassword", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPassword", request, response); err != nil { return } @@ -3295,7 +4181,15 @@ func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { return } -func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { +// GetPassword is the legacy version of GetPasswordCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { + return client.GetPasswordCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetAutoDisconnectTimeCtx( + ctx context.Context, +) (NewAutoDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3308,7 +4202,7 @@ func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { return } @@ -3321,7 +4215,15 @@ func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime return } -func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { +// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { + return client.GetAutoDisconnectTimeCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetIdleDisconnectTimeCtx( + ctx context.Context, +) (NewIdleDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3334,7 +4236,7 @@ func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { return } @@ -3347,7 +4249,15 @@ func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime return } -func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { +// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { + return client.GetIdleDisconnectTimeCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetWarnDisconnectDelayCtx( + ctx context.Context, +) (NewWarnDisconnectDelay uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3360,7 +4270,7 @@ func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDela }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { return } @@ -3373,7 +4283,15 @@ func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDela return } -func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { +// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { + return client.GetWarnDisconnectDelayCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetNATRSIPStatusCtx( + ctx context.Context, +) (NewRSIPAvailable bool, NewNATEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3387,7 +4305,7 @@ func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewN }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetNATRSIPStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetNATRSIPStatus", request, response); err != nil { return } @@ -3403,11 +4321,20 @@ func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewN return } +// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { + return client.GetNATRSIPStatusCtx(context.Background()) +} + // // Return values: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANPPPConnection1) GetGenericPortMappingEntryCtx( + ctx context.Context, + NewPortMappingIndex uint16, +) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewPortMappingIndex string @@ -3432,7 +4359,7 @@ func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { return } @@ -3466,12 +4393,25 @@ func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex return } +// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetGenericPortMappingEntryCtx(context.Background(), + NewPortMappingIndex, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANPPPConnection1) GetSpecificPortMappingEntryCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3501,7 +4441,7 @@ func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { return } @@ -3526,12 +4466,32 @@ func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost strin return } +// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetSpecificPortMappingEntryCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { +func (client *WANPPPConnection1) AddPortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, + NewInternalPort uint16, + NewInternalClient string, + NewEnabled bool, + NewPortMappingDescription string, + NewLeaseDuration uint32, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3575,7 +4535,7 @@ func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExterna response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "AddPortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "AddPortMapping", request, response); err != nil { return } @@ -3585,12 +4545,32 @@ func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExterna return } +// AddPortMapping is the legacy version of AddPortMappingCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { + return client.AddPortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + NewInternalPort, + NewInternalClient, + NewEnabled, + NewPortMappingDescription, + NewLeaseDuration, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { +func (client *WANPPPConnection1) DeletePortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3614,7 +4594,7 @@ func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExte response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "DeletePortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "DeletePortMapping", request, response); err != nil { return } @@ -3624,7 +4604,19 @@ func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExte return } -func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { +// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { + return client.DeletePortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + +func (client *WANPPPConnection1) GetExternalIPAddressCtx( + ctx context.Context, +) (NewExternalIPAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3637,7 +4629,7 @@ func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetExternalIPAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetExternalIPAddress", request, response); err != nil { return } @@ -3649,3 +4641,9 @@ func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress st // END Unmarshal arguments from response. return } + +// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { + return client.GetExternalIPAddressCtx(context.Background()) +} diff --git a/dcps/internetgateway2/internetgateway2.go b/dcps/internetgateway2/internetgateway2.go index 4eb5f61..0e7a18f 100644 --- a/dcps/internetgateway2/internetgateway2.go +++ b/dcps/internetgateway2/internetgateway2.go @@ -10,6 +10,7 @@ package internetgateway2 // *********************************************************** import ( + "context" "net/url" "time" @@ -105,7 +106,11 @@ func newDeviceProtection1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *DeviceProtection1) SendSetupMessage(ProtocolType string, InMessage []byte) (OutMessage []byte, err error) { +func (client *DeviceProtection1) SendSetupMessageCtx( + ctx context.Context, + ProtocolType string, + InMessage []byte, +) (OutMessage []byte, err error) { // Request structure. request := &struct { ProtocolType string @@ -127,7 +132,7 @@ func (client *DeviceProtection1) SendSetupMessage(ProtocolType string, InMessage }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "SendSetupMessage", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "SendSetupMessage", request, response); err != nil { return } @@ -140,7 +145,18 @@ func (client *DeviceProtection1) SendSetupMessage(ProtocolType string, InMessage return } -func (client *DeviceProtection1) GetSupportedProtocols() (ProtocolList string, err error) { +// SendSetupMessage is the legacy version of SendSetupMessageCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) SendSetupMessage(ProtocolType string, InMessage []byte) (OutMessage []byte, err error) { + return client.SendSetupMessageCtx(context.Background(), + ProtocolType, + InMessage, + ) +} + +func (client *DeviceProtection1) GetSupportedProtocolsCtx( + ctx context.Context, +) (ProtocolList string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -153,7 +169,7 @@ func (client *DeviceProtection1) GetSupportedProtocols() (ProtocolList string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "GetSupportedProtocols", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetSupportedProtocols", request, response); err != nil { return } @@ -166,7 +182,15 @@ func (client *DeviceProtection1) GetSupportedProtocols() (ProtocolList string, e return } -func (client *DeviceProtection1) GetAssignedRoles() (RoleList string, err error) { +// GetSupportedProtocols is the legacy version of GetSupportedProtocolsCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) GetSupportedProtocols() (ProtocolList string, err error) { + return client.GetSupportedProtocolsCtx(context.Background()) +} + +func (client *DeviceProtection1) GetAssignedRolesCtx( + ctx context.Context, +) (RoleList string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -179,7 +203,7 @@ func (client *DeviceProtection1) GetAssignedRoles() (RoleList string, err error) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "GetAssignedRoles", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetAssignedRoles", request, response); err != nil { return } @@ -192,7 +216,18 @@ func (client *DeviceProtection1) GetAssignedRoles() (RoleList string, err error) return } -func (client *DeviceProtection1) GetRolesForAction(DeviceUDN string, ServiceId string, ActionName string) (RoleList string, RestrictedRoleList string, err error) { +// GetAssignedRoles is the legacy version of GetAssignedRolesCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) GetAssignedRoles() (RoleList string, err error) { + return client.GetAssignedRolesCtx(context.Background()) +} + +func (client *DeviceProtection1) GetRolesForActionCtx( + ctx context.Context, + DeviceUDN string, + ServiceId string, + ActionName string, +) (RoleList string, RestrictedRoleList string, err error) { // Request structure. request := &struct { DeviceUDN string @@ -219,7 +254,7 @@ func (client *DeviceProtection1) GetRolesForAction(DeviceUDN string, ServiceId s }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "GetRolesForAction", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetRolesForAction", request, response); err != nil { return } @@ -235,7 +270,21 @@ func (client *DeviceProtection1) GetRolesForAction(DeviceUDN string, ServiceId s return } -func (client *DeviceProtection1) GetUserLoginChallenge(ProtocolType string, Name string) (Salt []byte, Challenge []byte, err error) { +// GetRolesForAction is the legacy version of GetRolesForActionCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) GetRolesForAction(DeviceUDN string, ServiceId string, ActionName string) (RoleList string, RestrictedRoleList string, err error) { + return client.GetRolesForActionCtx(context.Background(), + DeviceUDN, + ServiceId, + ActionName, + ) +} + +func (client *DeviceProtection1) GetUserLoginChallengeCtx( + ctx context.Context, + ProtocolType string, + Name string, +) (Salt []byte, Challenge []byte, err error) { // Request structure. request := &struct { ProtocolType string @@ -258,7 +307,7 @@ func (client *DeviceProtection1) GetUserLoginChallenge(ProtocolType string, Name }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "GetUserLoginChallenge", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetUserLoginChallenge", request, response); err != nil { return } @@ -274,7 +323,21 @@ func (client *DeviceProtection1) GetUserLoginChallenge(ProtocolType string, Name return } -func (client *DeviceProtection1) UserLogin(ProtocolType string, Challenge []byte, Authenticator []byte) (err error) { +// GetUserLoginChallenge is the legacy version of GetUserLoginChallengeCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) GetUserLoginChallenge(ProtocolType string, Name string) (Salt []byte, Challenge []byte, err error) { + return client.GetUserLoginChallengeCtx(context.Background(), + ProtocolType, + Name, + ) +} + +func (client *DeviceProtection1) UserLoginCtx( + ctx context.Context, + ProtocolType string, + Challenge []byte, + Authenticator []byte, +) (err error) { // Request structure. request := &struct { ProtocolType string @@ -298,7 +361,7 @@ func (client *DeviceProtection1) UserLogin(ProtocolType string, Challenge []byte response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "UserLogin", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "UserLogin", request, response); err != nil { return } @@ -308,7 +371,19 @@ func (client *DeviceProtection1) UserLogin(ProtocolType string, Challenge []byte return } -func (client *DeviceProtection1) UserLogout() (err error) { +// UserLogin is the legacy version of UserLoginCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) UserLogin(ProtocolType string, Challenge []byte, Authenticator []byte) (err error) { + return client.UserLoginCtx(context.Background(), + ProtocolType, + Challenge, + Authenticator, + ) +} + +func (client *DeviceProtection1) UserLogoutCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -319,7 +394,7 @@ func (client *DeviceProtection1) UserLogout() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "UserLogout", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "UserLogout", request, response); err != nil { return } @@ -329,7 +404,15 @@ func (client *DeviceProtection1) UserLogout() (err error) { return } -func (client *DeviceProtection1) GetACLData() (ACL string, err error) { +// UserLogout is the legacy version of UserLogoutCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) UserLogout() (err error) { + return client.UserLogoutCtx(context.Background()) +} + +func (client *DeviceProtection1) GetACLDataCtx( + ctx context.Context, +) (ACL string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -342,7 +425,7 @@ func (client *DeviceProtection1) GetACLData() (ACL string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "GetACLData", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "GetACLData", request, response); err != nil { return } @@ -355,7 +438,16 @@ func (client *DeviceProtection1) GetACLData() (ACL string, err error) { return } -func (client *DeviceProtection1) AddIdentityList(IdentityList string) (IdentityListResult string, err error) { +// GetACLData is the legacy version of GetACLDataCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) GetACLData() (ACL string, err error) { + return client.GetACLDataCtx(context.Background()) +} + +func (client *DeviceProtection1) AddIdentityListCtx( + ctx context.Context, + IdentityList string, +) (IdentityListResult string, err error) { // Request structure. request := &struct { IdentityList string @@ -373,7 +465,7 @@ func (client *DeviceProtection1) AddIdentityList(IdentityList string) (IdentityL }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "AddIdentityList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "AddIdentityList", request, response); err != nil { return } @@ -386,7 +478,18 @@ func (client *DeviceProtection1) AddIdentityList(IdentityList string) (IdentityL return } -func (client *DeviceProtection1) RemoveIdentity(Identity string) (err error) { +// AddIdentityList is the legacy version of AddIdentityListCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) AddIdentityList(IdentityList string) (IdentityListResult string, err error) { + return client.AddIdentityListCtx(context.Background(), + IdentityList, + ) +} + +func (client *DeviceProtection1) RemoveIdentityCtx( + ctx context.Context, + Identity string, +) (err error) { // Request structure. request := &struct { Identity string @@ -402,7 +505,7 @@ func (client *DeviceProtection1) RemoveIdentity(Identity string) (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "RemoveIdentity", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "RemoveIdentity", request, response); err != nil { return } @@ -412,7 +515,21 @@ func (client *DeviceProtection1) RemoveIdentity(Identity string) (err error) { return } -func (client *DeviceProtection1) SetUserLoginPassword(ProtocolType string, Name string, Stored []byte, Salt []byte) (err error) { +// RemoveIdentity is the legacy version of RemoveIdentityCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) RemoveIdentity(Identity string) (err error) { + return client.RemoveIdentityCtx(context.Background(), + Identity, + ) +} + +func (client *DeviceProtection1) SetUserLoginPasswordCtx( + ctx context.Context, + ProtocolType string, + Name string, + Stored []byte, + Salt []byte, +) (err error) { // Request structure. request := &struct { ProtocolType string @@ -440,7 +557,7 @@ func (client *DeviceProtection1) SetUserLoginPassword(ProtocolType string, Name response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "SetUserLoginPassword", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "SetUserLoginPassword", request, response); err != nil { return } @@ -450,7 +567,65 @@ func (client *DeviceProtection1) SetUserLoginPassword(ProtocolType string, Name return } +// SetUserLoginPassword is the legacy version of SetUserLoginPasswordCtx, but uses +// context.Background() as the context. +func (client *DeviceProtection1) SetUserLoginPassword(ProtocolType string, Name string, Stored []byte, Salt []byte) (err error) { + return client.SetUserLoginPasswordCtx(context.Background(), + ProtocolType, + Name, + Stored, + Salt, + ) +} + +func (client *DeviceProtection1) AddRolesForIdentityCtx( + ctx context.Context, + Identity string, + RoleList string, +) (err error) { + // Request structure. + request := &struct { + Identity string + RoleList string + }{} + // BEGIN Marshal arguments into request. + + if request.Identity, err = soap.MarshalString(Identity); err != nil { + return + } + if request.RoleList, err = soap.MarshalString(RoleList); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "AddRolesForIdentity", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// AddRolesForIdentity is the legacy version of AddRolesForIdentityCtx, but uses +// context.Background() as the context. func (client *DeviceProtection1) AddRolesForIdentity(Identity string, RoleList string) (err error) { + return client.AddRolesForIdentityCtx(context.Background(), + Identity, + RoleList, + ) +} + +func (client *DeviceProtection1) RemoveRolesForIdentityCtx( + ctx context.Context, + Identity string, + RoleList string, +) (err error) { // Request structure. request := &struct { Identity string @@ -470,7 +645,7 @@ func (client *DeviceProtection1) AddRolesForIdentity(Identity string, RoleList s response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "AddRolesForIdentity", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_DeviceProtection_1, "RemoveRolesForIdentity", request, response); err != nil { return } @@ -480,34 +655,13 @@ func (client *DeviceProtection1) AddRolesForIdentity(Identity string, RoleList s return } +// RemoveRolesForIdentity is the legacy version of RemoveRolesForIdentityCtx, but uses +// context.Background() as the context. func (client *DeviceProtection1) RemoveRolesForIdentity(Identity string, RoleList string) (err error) { - // Request structure. - request := &struct { - Identity string - RoleList string - }{} - // BEGIN Marshal arguments into request. - - if request.Identity, err = soap.MarshalString(Identity); err != nil { - return - } - if request.RoleList, err = soap.MarshalString(RoleList); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_DeviceProtection_1, "RemoveRolesForIdentity", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.RemoveRolesForIdentityCtx(context.Background(), + Identity, + RoleList, + ) } // LANHostConfigManagement1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:LANHostConfigManagement:1". See @@ -570,7 +724,10 @@ func newLANHostConfigManagement1ClientsFromGenericClients(genericClients []goupn return clients } -func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerConfigurable bool) (err error) { +func (client *LANHostConfigManagement1) SetDHCPServerConfigurableCtx( + ctx context.Context, + NewDHCPServerConfigurable bool, +) (err error) { // Request structure. request := &struct { NewDHCPServerConfigurable string @@ -586,7 +743,7 @@ func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerC response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDHCPServerConfigurable", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDHCPServerConfigurable", request, response); err != nil { return } @@ -596,7 +753,17 @@ func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerC return } -func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServerConfigurable bool, err error) { +// SetDHCPServerConfigurable is the legacy version of SetDHCPServerConfigurableCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetDHCPServerConfigurable(NewDHCPServerConfigurable bool) (err error) { + return client.SetDHCPServerConfigurableCtx(context.Background(), + NewDHCPServerConfigurable, + ) +} + +func (client *LANHostConfigManagement1) GetDHCPServerConfigurableCtx( + ctx context.Context, +) (NewDHCPServerConfigurable bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -609,7 +776,7 @@ func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServ }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDHCPServerConfigurable", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDHCPServerConfigurable", request, response); err != nil { return } @@ -622,7 +789,16 @@ func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServ return } -func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err error) { +// GetDHCPServerConfigurable is the legacy version of GetDHCPServerConfigurableCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDHCPServerConfigurable() (NewDHCPServerConfigurable bool, err error) { + return client.GetDHCPServerConfigurableCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetDHCPRelayCtx( + ctx context.Context, + NewDHCPRelay bool, +) (err error) { // Request structure. request := &struct { NewDHCPRelay string @@ -638,7 +814,7 @@ func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDHCPRelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDHCPRelay", request, response); err != nil { return } @@ -648,7 +824,17 @@ func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err err return } -func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err error) { +// SetDHCPRelay is the legacy version of SetDHCPRelayCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetDHCPRelay(NewDHCPRelay bool) (err error) { + return client.SetDHCPRelayCtx(context.Background(), + NewDHCPRelay, + ) +} + +func (client *LANHostConfigManagement1) GetDHCPRelayCtx( + ctx context.Context, +) (NewDHCPRelay bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -661,7 +847,7 @@ func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDHCPRelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDHCPRelay", request, response); err != nil { return } @@ -674,7 +860,16 @@ func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err e return } -func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err error) { +// GetDHCPRelay is the legacy version of GetDHCPRelayCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDHCPRelay() (NewDHCPRelay bool, err error) { + return client.GetDHCPRelayCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetSubnetMaskCtx( + ctx context.Context, + NewSubnetMask string, +) (err error) { // Request structure. request := &struct { NewSubnetMask string @@ -690,7 +885,7 @@ func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetSubnetMask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetSubnetMask", request, response); err != nil { return } @@ -700,7 +895,17 @@ func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err return } -func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, err error) { +// SetSubnetMask is the legacy version of SetSubnetMaskCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetSubnetMask(NewSubnetMask string) (err error) { + return client.SetSubnetMaskCtx(context.Background(), + NewSubnetMask, + ) +} + +func (client *LANHostConfigManagement1) GetSubnetMaskCtx( + ctx context.Context, +) (NewSubnetMask string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -713,7 +918,7 @@ func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetSubnetMask", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetSubnetMask", request, response); err != nil { return } @@ -726,7 +931,53 @@ func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, e return } +// GetSubnetMask is the legacy version of GetSubnetMaskCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetSubnetMask() (NewSubnetMask string, err error) { + return client.GetSubnetMaskCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetIPRouterCtx( + ctx context.Context, + NewIPRouters string, +) (err error) { + // Request structure. + request := &struct { + NewIPRouters string + }{} + // BEGIN Marshal arguments into request. + + if request.NewIPRouters, err = soap.MarshalString(NewIPRouters); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetIPRouter", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// SetIPRouter is the legacy version of SetIPRouterCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err error) { + return client.SetIPRouterCtx(context.Background(), + NewIPRouters, + ) +} + +func (client *LANHostConfigManagement1) DeleteIPRouterCtx( + ctx context.Context, + NewIPRouters string, +) (err error) { // Request structure. request := &struct { NewIPRouters string @@ -742,7 +993,7 @@ func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetIPRouter", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteIPRouter", request, response); err != nil { return } @@ -752,33 +1003,17 @@ func (client *LANHostConfigManagement1) SetIPRouter(NewIPRouters string) (err er return } +// DeleteIPRouter is the legacy version of DeleteIPRouterCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) DeleteIPRouter(NewIPRouters string) (err error) { - // Request structure. - request := &struct { - NewIPRouters string - }{} - // BEGIN Marshal arguments into request. - - if request.NewIPRouters, err = soap.MarshalString(NewIPRouters); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "DeleteIPRouter", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DeleteIPRouterCtx(context.Background(), + NewIPRouters, + ) } -func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, err error) { +func (client *LANHostConfigManagement1) GetIPRoutersListCtx( + ctx context.Context, +) (NewIPRouters string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -791,7 +1026,7 @@ func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetIPRoutersList", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetIPRoutersList", request, response); err != nil { return } @@ -804,7 +1039,16 @@ func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, return } -func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err error) { +// GetIPRoutersList is the legacy version of GetIPRoutersListCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetIPRoutersList() (NewIPRouters string, err error) { + return client.GetIPRoutersListCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetDomainNameCtx( + ctx context.Context, + NewDomainName string, +) (err error) { // Request structure. request := &struct { NewDomainName string @@ -820,7 +1064,7 @@ func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDomainName", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDomainName", request, response); err != nil { return } @@ -830,7 +1074,17 @@ func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err return } -func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, err error) { +// SetDomainName is the legacy version of SetDomainNameCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetDomainName(NewDomainName string) (err error) { + return client.SetDomainNameCtx(context.Background(), + NewDomainName, + ) +} + +func (client *LANHostConfigManagement1) GetDomainNameCtx( + ctx context.Context, +) (NewDomainName string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -843,7 +1097,7 @@ func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDomainName", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDomainName", request, response); err != nil { return } @@ -856,7 +1110,17 @@ func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, e return } -func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, NewMaxAddress string) (err error) { +// GetDomainName is the legacy version of GetDomainNameCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDomainName() (NewDomainName string, err error) { + return client.GetDomainNameCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetAddressRangeCtx( + ctx context.Context, + NewMinAddress string, + NewMaxAddress string, +) (err error) { // Request structure. request := &struct { NewMinAddress string @@ -876,7 +1140,7 @@ func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, Ne response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetAddressRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetAddressRange", request, response); err != nil { return } @@ -886,7 +1150,18 @@ func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, Ne return } -func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, NewMaxAddress string, err error) { +// SetAddressRange is the legacy version of SetAddressRangeCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) SetAddressRange(NewMinAddress string, NewMaxAddress string) (err error) { + return client.SetAddressRangeCtx(context.Background(), + NewMinAddress, + NewMaxAddress, + ) +} + +func (client *LANHostConfigManagement1) GetAddressRangeCtx( + ctx context.Context, +) (NewMinAddress string, NewMaxAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -900,7 +1175,7 @@ func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetAddressRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetAddressRange", request, response); err != nil { return } @@ -916,7 +1191,53 @@ func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, return } +// GetAddressRange is the legacy version of GetAddressRangeCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetAddressRange() (NewMinAddress string, NewMaxAddress string, err error) { + return client.GetAddressRangeCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetReservedAddressCtx( + ctx context.Context, + NewReservedAddresses string, +) (err error) { + // Request structure. + request := &struct { + NewReservedAddresses string + }{} + // BEGIN Marshal arguments into request. + + if request.NewReservedAddresses, err = soap.MarshalString(NewReservedAddresses); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetReservedAddress", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// SetReservedAddress is the legacy version of SetReservedAddressCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses string) (err error) { + return client.SetReservedAddressCtx(context.Background(), + NewReservedAddresses, + ) +} + +func (client *LANHostConfigManagement1) DeleteReservedAddressCtx( + ctx context.Context, + NewReservedAddresses string, +) (err error) { // Request structure. request := &struct { NewReservedAddresses string @@ -932,7 +1253,7 @@ func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetReservedAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteReservedAddress", request, response); err != nil { return } @@ -942,33 +1263,17 @@ func (client *LANHostConfigManagement1) SetReservedAddress(NewReservedAddresses return } +// DeleteReservedAddress is the legacy version of DeleteReservedAddressCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) DeleteReservedAddress(NewReservedAddresses string) (err error) { - // Request structure. - request := &struct { - NewReservedAddresses string - }{} - // BEGIN Marshal arguments into request. - - if request.NewReservedAddresses, err = soap.MarshalString(NewReservedAddresses); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "DeleteReservedAddress", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DeleteReservedAddressCtx(context.Background(), + NewReservedAddresses, + ) } -func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddresses string, err error) { +func (client *LANHostConfigManagement1) GetReservedAddressesCtx( + ctx context.Context, +) (NewReservedAddresses string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -981,7 +1286,7 @@ func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddre }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetReservedAddresses", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetReservedAddresses", request, response); err != nil { return } @@ -994,7 +1299,53 @@ func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddre return } +// GetReservedAddresses is the legacy version of GetReservedAddressesCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetReservedAddresses() (NewReservedAddresses string, err error) { + return client.GetReservedAddressesCtx(context.Background()) +} + +func (client *LANHostConfigManagement1) SetDNSServerCtx( + ctx context.Context, + NewDNSServers string, +) (err error) { + // Request structure. + request := &struct { + NewDNSServers string + }{} + // BEGIN Marshal arguments into request. + + if request.NewDNSServers, err = soap.MarshalString(NewDNSServers); err != nil { + return + } + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "SetDNSServer", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// SetDNSServer is the legacy version of SetDNSServerCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err error) { + return client.SetDNSServerCtx(context.Background(), + NewDNSServers, + ) +} + +func (client *LANHostConfigManagement1) DeleteDNSServerCtx( + ctx context.Context, + NewDNSServers string, +) (err error) { // Request structure. request := &struct { NewDNSServers string @@ -1010,7 +1361,7 @@ func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "SetDNSServer", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "DeleteDNSServer", request, response); err != nil { return } @@ -1020,33 +1371,17 @@ func (client *LANHostConfigManagement1) SetDNSServer(NewDNSServers string) (err return } +// DeleteDNSServer is the legacy version of DeleteDNSServerCtx, but uses +// context.Background() as the context. func (client *LANHostConfigManagement1) DeleteDNSServer(NewDNSServers string) (err error) { - // Request structure. - request := &struct { - NewDNSServers string - }{} - // BEGIN Marshal arguments into request. - - if request.NewDNSServers, err = soap.MarshalString(NewDNSServers); err != nil { - return - } - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "DeleteDNSServer", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.DeleteDNSServerCtx(context.Background(), + NewDNSServers, + ) } -func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, err error) { +func (client *LANHostConfigManagement1) GetDNSServersCtx( + ctx context.Context, +) (NewDNSServers string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1059,7 +1394,7 @@ func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, e }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_LANHostConfigManagement_1, "GetDNSServers", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_LANHostConfigManagement_1, "GetDNSServers", request, response); err != nil { return } @@ -1072,6 +1407,12 @@ func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, e return } +// GetDNSServers is the legacy version of GetDNSServersCtx, but uses +// context.Background() as the context. +func (client *LANHostConfigManagement1) GetDNSServers() (NewDNSServers string, err error) { + return client.GetDNSServersCtx(context.Background()) +} + // Layer3Forwarding1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:Layer3Forwarding:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1132,7 +1473,10 @@ func newLayer3Forwarding1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectionService string) (err error) { +func (client *Layer3Forwarding1) SetDefaultConnectionServiceCtx( + ctx context.Context, + NewDefaultConnectionService string, +) (err error) { // Request structure. request := &struct { NewDefaultConnectionService string @@ -1148,7 +1492,7 @@ func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectio response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_Layer3Forwarding_1, "SetDefaultConnectionService", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_Layer3Forwarding_1, "SetDefaultConnectionService", request, response); err != nil { return } @@ -1158,7 +1502,17 @@ func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectio return } -func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnectionService string, err error) { +// SetDefaultConnectionService is the legacy version of SetDefaultConnectionServiceCtx, but uses +// context.Background() as the context. +func (client *Layer3Forwarding1) SetDefaultConnectionService(NewDefaultConnectionService string) (err error) { + return client.SetDefaultConnectionServiceCtx(context.Background(), + NewDefaultConnectionService, + ) +} + +func (client *Layer3Forwarding1) GetDefaultConnectionServiceCtx( + ctx context.Context, +) (NewDefaultConnectionService string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1171,7 +1525,7 @@ func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnec }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_Layer3Forwarding_1, "GetDefaultConnectionService", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_Layer3Forwarding_1, "GetDefaultConnectionService", request, response); err != nil { return } @@ -1184,6 +1538,12 @@ func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnec return } +// GetDefaultConnectionService is the legacy version of GetDefaultConnectionServiceCtx, but uses +// context.Background() as the context. +func (client *Layer3Forwarding1) GetDefaultConnectionService() (NewDefaultConnectionService string, err error) { + return client.GetDefaultConnectionServiceCtx(context.Background()) +} + // WANCableLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANCableLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1250,7 +1610,9 @@ func newWANCableLinkConfig1ClientsFromGenericClients(genericClients []goupnp.Ser // * NewCableLinkConfigState: allowed values: notReady, dsSyncComplete, usParamAcquired, rangingComplete, ipComplete, todEstablished, paramTransferComplete, registrationComplete, operational, accessDenied // // * NewLinkType: allowed values: Ethernet -func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigState string, NewLinkType string, err error) { +func (client *WANCableLinkConfig1) GetCableLinkConfigInfoCtx( + ctx context.Context, +) (NewCableLinkConfigState string, NewLinkType string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1264,7 +1626,7 @@ func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigS }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetCableLinkConfigInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetCableLinkConfigInfo", request, response); err != nil { return } @@ -1280,7 +1642,15 @@ func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigS return } -func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFrequency uint32, err error) { +// GetCableLinkConfigInfo is the legacy version of GetCableLinkConfigInfoCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetCableLinkConfigInfo() (NewCableLinkConfigState string, NewLinkType string, err error) { + return client.GetCableLinkConfigInfoCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetDownstreamFrequencyCtx( + ctx context.Context, +) (NewDownstreamFrequency uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1293,7 +1663,7 @@ func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFreque }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetDownstreamFrequency", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetDownstreamFrequency", request, response); err != nil { return } @@ -1306,11 +1676,19 @@ func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFreque return } +// GetDownstreamFrequency is the legacy version of GetDownstreamFrequencyCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetDownstreamFrequency() (NewDownstreamFrequency uint32, err error) { + return client.GetDownstreamFrequencyCtx(context.Background()) +} + // // Return values: // // * NewDownstreamModulation: allowed values: 64QAM, 256QAM -func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModulation string, err error) { +func (client *WANCableLinkConfig1) GetDownstreamModulationCtx( + ctx context.Context, +) (NewDownstreamModulation string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1323,7 +1701,7 @@ func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModul }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetDownstreamModulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetDownstreamModulation", request, response); err != nil { return } @@ -1336,7 +1714,15 @@ func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModul return } -func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency uint32, err error) { +// GetDownstreamModulation is the legacy version of GetDownstreamModulationCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetDownstreamModulation() (NewDownstreamModulation string, err error) { + return client.GetDownstreamModulationCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetUpstreamFrequencyCtx( + ctx context.Context, +) (NewUpstreamFrequency uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1349,7 +1735,7 @@ func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamFrequency", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamFrequency", request, response); err != nil { return } @@ -1362,11 +1748,19 @@ func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency return } +// GetUpstreamFrequency is the legacy version of GetUpstreamFrequencyCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamFrequency() (NewUpstreamFrequency uint32, err error) { + return client.GetUpstreamFrequencyCtx(context.Background()) +} + // // Return values: // // * NewUpstreamModulation: allowed values: QPSK, 16QAM -func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulation string, err error) { +func (client *WANCableLinkConfig1) GetUpstreamModulationCtx( + ctx context.Context, +) (NewUpstreamModulation string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1379,7 +1773,7 @@ func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulatio }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamModulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamModulation", request, response); err != nil { return } @@ -1392,7 +1786,15 @@ func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulatio return } -func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID uint32, err error) { +// GetUpstreamModulation is the legacy version of GetUpstreamModulationCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamModulation() (NewUpstreamModulation string, err error) { + return client.GetUpstreamModulationCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetUpstreamChannelIDCtx( + ctx context.Context, +) (NewUpstreamChannelID uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1405,7 +1807,7 @@ func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamChannelID", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamChannelID", request, response); err != nil { return } @@ -1418,7 +1820,15 @@ func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID return } -func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLevel uint32, err error) { +// GetUpstreamChannelID is the legacy version of GetUpstreamChannelIDCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamChannelID() (NewUpstreamChannelID uint32, err error) { + return client.GetUpstreamChannelIDCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetUpstreamPowerLevelCtx( + ctx context.Context, +) (NewUpstreamPowerLevel uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1431,7 +1841,7 @@ func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLeve }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetUpstreamPowerLevel", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetUpstreamPowerLevel", request, response); err != nil { return } @@ -1444,7 +1854,15 @@ func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLeve return } -func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEnabled bool, err error) { +// GetUpstreamPowerLevel is the legacy version of GetUpstreamPowerLevelCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetUpstreamPowerLevel() (NewUpstreamPowerLevel uint32, err error) { + return client.GetUpstreamPowerLevelCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetBPIEncryptionEnabledCtx( + ctx context.Context, +) (NewBPIEncryptionEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1457,7 +1875,7 @@ func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEn }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetBPIEncryptionEnabled", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetBPIEncryptionEnabled", request, response); err != nil { return } @@ -1470,7 +1888,15 @@ func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEn return } -func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err error) { +// GetBPIEncryptionEnabled is the legacy version of GetBPIEncryptionEnabledCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetBPIEncryptionEnabled() (NewBPIEncryptionEnabled bool, err error) { + return client.GetBPIEncryptionEnabledCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetConfigFileCtx( + ctx context.Context, +) (NewConfigFile string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1483,7 +1909,7 @@ func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err er }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetConfigFile", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetConfigFile", request, response); err != nil { return } @@ -1496,7 +1922,15 @@ func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err er return } -func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err error) { +// GetConfigFile is the legacy version of GetConfigFileCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetConfigFile() (NewConfigFile string, err error) { + return client.GetConfigFileCtx(context.Background()) +} + +func (client *WANCableLinkConfig1) GetTFTPServerCtx( + ctx context.Context, +) (NewTFTPServer string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1509,7 +1943,7 @@ func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err er }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCableLinkConfig_1, "GetTFTPServer", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCableLinkConfig_1, "GetTFTPServer", request, response); err != nil { return } @@ -1522,6 +1956,12 @@ func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err er return } +// GetTFTPServer is the legacy version of GetTFTPServerCtx, but uses +// context.Background() as the context. +func (client *WANCableLinkConfig1) GetTFTPServer() (NewTFTPServer string, err error) { + return client.GetTFTPServerCtx(context.Background()) +} + // WANCommonInterfaceConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1582,7 +2022,10 @@ func newWANCommonInterfaceConfig1ClientsFromGenericClients(genericClients []goup return clients } -func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInternet bool) (err error) { +func (client *WANCommonInterfaceConfig1) SetEnabledForInternetCtx( + ctx context.Context, + NewEnabledForInternet bool, +) (err error) { // Request structure. request := &struct { NewEnabledForInternet string @@ -1598,7 +2041,7 @@ func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInte response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "SetEnabledForInternet", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "SetEnabledForInternet", request, response); err != nil { return } @@ -1608,7 +2051,17 @@ func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInte return } -func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForInternet bool, err error) { +// SetEnabledForInternet is the legacy version of SetEnabledForInternetCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) SetEnabledForInternet(NewEnabledForInternet bool) (err error) { + return client.SetEnabledForInternetCtx(context.Background(), + NewEnabledForInternet, + ) +} + +func (client *WANCommonInterfaceConfig1) GetEnabledForInternetCtx( + ctx context.Context, +) (NewEnabledForInternet bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1621,7 +2074,7 @@ func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForI }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetEnabledForInternet", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetEnabledForInternet", request, response); err != nil { return } @@ -1634,13 +2087,21 @@ func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForI return } +// GetEnabledForInternet is the legacy version of GetEnabledForInternetCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetEnabledForInternet() (NewEnabledForInternet bool, err error) { + return client.GetEnabledForInternetCtx(context.Background()) +} + // // Return values: // // * NewWANAccessType: allowed values: DSL, POTS, Cable, Ethernet // // * NewPhysicalLinkStatus: allowed values: Up, Down -func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) { +func (client *WANCommonInterfaceConfig1) GetCommonLinkPropertiesCtx( + ctx context.Context, +) (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1656,7 +2117,7 @@ func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccess }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetCommonLinkProperties", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetCommonLinkProperties", request, response); err != nil { return } @@ -1678,7 +2139,15 @@ func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccess return } -func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessProvider string, err error) { +// GetCommonLinkProperties is the legacy version of GetCommonLinkPropertiesCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetCommonLinkProperties() (NewWANAccessType string, NewLayer1UpstreamMaxBitRate uint32, NewLayer1DownstreamMaxBitRate uint32, NewPhysicalLinkStatus string, err error) { + return client.GetCommonLinkPropertiesCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetWANAccessProviderCtx( + ctx context.Context, +) (NewWANAccessProvider string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1691,7 +2160,7 @@ func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessPro }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetWANAccessProvider", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetWANAccessProvider", request, response); err != nil { return } @@ -1704,11 +2173,19 @@ func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessPro return } +// GetWANAccessProvider is the legacy version of GetWANAccessProviderCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetWANAccessProvider() (NewWANAccessProvider string, err error) { + return client.GetWANAccessProviderCtx(context.Background()) +} + // // Return values: // // * NewMaximumActiveConnections: allowed value range: minimum=1, step=1 -func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaximumActiveConnections uint16, err error) { +func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnectionsCtx( + ctx context.Context, +) (NewMaximumActiveConnections uint16, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1721,7 +2198,7 @@ func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaxim }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetMaximumActiveConnections", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetMaximumActiveConnections", request, response); err != nil { return } @@ -1734,7 +2211,15 @@ func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaxim return } -func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent uint64, err error) { +// GetMaximumActiveConnections is the legacy version of GetMaximumActiveConnectionsCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetMaximumActiveConnections() (NewMaximumActiveConnections uint16, err error) { + return client.GetMaximumActiveConnectionsCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalBytesSentCtx( + ctx context.Context, +) (NewTotalBytesSent uint64, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1747,7 +2232,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalBytesSent", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalBytesSent", request, response); err != nil { return } @@ -1760,7 +2245,15 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent return } -func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesReceived uint64, err error) { +// GetTotalBytesSent is the legacy version of GetTotalBytesSentCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalBytesSent() (NewTotalBytesSent uint64, err error) { + return client.GetTotalBytesSentCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalBytesReceivedCtx( + ctx context.Context, +) (NewTotalBytesReceived uint64, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1773,7 +2266,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesR }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalBytesReceived", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalBytesReceived", request, response); err != nil { return } @@ -1786,7 +2279,15 @@ func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesR return } -func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsSent uint32, err error) { +// GetTotalBytesReceived is the legacy version of GetTotalBytesReceivedCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalBytesReceived() (NewTotalBytesReceived uint64, err error) { + return client.GetTotalBytesReceivedCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalPacketsSentCtx( + ctx context.Context, +) (NewTotalPacketsSent uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1799,7 +2300,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsS }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalPacketsSent", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalPacketsSent", request, response); err != nil { return } @@ -1812,7 +2313,15 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsS return } -func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPacketsReceived uint32, err error) { +// GetTotalPacketsSent is the legacy version of GetTotalPacketsSentCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalPacketsSent() (NewTotalPacketsSent uint32, err error) { + return client.GetTotalPacketsSentCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceivedCtx( + ctx context.Context, +) (NewTotalPacketsReceived uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1825,7 +2334,7 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPack }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetTotalPacketsReceived", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetTotalPacketsReceived", request, response); err != nil { return } @@ -1838,7 +2347,16 @@ func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPack return } -func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnectionIndex uint16) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) { +// GetTotalPacketsReceived is the legacy version of GetTotalPacketsReceivedCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetTotalPacketsReceived() (NewTotalPacketsReceived uint32, err error) { + return client.GetTotalPacketsReceivedCtx(context.Background()) +} + +func (client *WANCommonInterfaceConfig1) GetActiveConnectionCtx( + ctx context.Context, + NewActiveConnectionIndex uint16, +) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) { // Request structure. request := &struct { NewActiveConnectionIndex string @@ -1857,7 +2375,7 @@ func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnection }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANCommonInterfaceConfig_1, "GetActiveConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANCommonInterfaceConfig_1, "GetActiveConnection", request, response); err != nil { return } @@ -1873,6 +2391,14 @@ func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnection return } +// GetActiveConnection is the legacy version of GetActiveConnectionCtx, but uses +// context.Background() as the context. +func (client *WANCommonInterfaceConfig1) GetActiveConnection(NewActiveConnectionIndex uint16) (NewActiveConnDeviceContainer string, NewActiveConnectionServiceID string, err error) { + return client.GetActiveConnectionCtx(context.Background(), + NewActiveConnectionIndex, + ) +} + // WANDSLLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANDSLLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -1933,7 +2459,10 @@ func newWANDSLLinkConfig1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) { +func (client *WANDSLLinkConfig1) SetDSLLinkTypeCtx( + ctx context.Context, + NewLinkType string, +) (err error) { // Request structure. request := &struct { NewLinkType string @@ -1949,7 +2478,7 @@ func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetDSLLinkType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetDSLLinkType", request, response); err != nil { return } @@ -1959,11 +2488,21 @@ func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) return } +// SetDSLLinkType is the legacy version of SetDSLLinkTypeCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetDSLLinkType(NewLinkType string) (err error) { + return client.SetDSLLinkTypeCtx(context.Background(), + NewLinkType, + ) +} + // // Return values: // // * NewLinkStatus: allowed values: Up, Down -func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkStatus string, err error) { +func (client *WANDSLLinkConfig1) GetDSLLinkInfoCtx( + ctx context.Context, +) (NewLinkType string, NewLinkStatus string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -1977,7 +2516,7 @@ func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkSt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetDSLLinkInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetDSLLinkInfo", request, response); err != nil { return } @@ -1993,7 +2532,15 @@ func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkSt return } -func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) { +// GetDSLLinkInfo is the legacy version of GetDSLLinkInfoCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetDSLLinkInfo() (NewLinkType string, NewLinkStatus string, err error) { + return client.GetDSLLinkInfoCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) GetAutoConfigCtx( + ctx context.Context, +) (NewAutoConfig bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2006,7 +2553,7 @@ func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetAutoConfig", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetAutoConfig", request, response); err != nil { return } @@ -2019,7 +2566,15 @@ func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) return } -func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, err error) { +// GetAutoConfig is the legacy version of GetAutoConfigCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetAutoConfig() (NewAutoConfig bool, err error) { + return client.GetAutoConfigCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) GetModulationTypeCtx( + ctx context.Context, +) (NewModulationType string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2032,7 +2587,7 @@ func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetModulationType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetModulationType", request, response); err != nil { return } @@ -2045,7 +2600,16 @@ func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, return } -func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress string) (err error) { +// GetModulationType is the legacy version of GetModulationTypeCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetModulationType() (NewModulationType string, err error) { + return client.GetModulationTypeCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) SetDestinationAddressCtx( + ctx context.Context, + NewDestinationAddress string, +) (err error) { // Request structure. request := &struct { NewDestinationAddress string @@ -2061,7 +2625,7 @@ func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress str response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetDestinationAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetDestinationAddress", request, response); err != nil { return } @@ -2071,7 +2635,17 @@ func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress str return } -func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress string, err error) { +// SetDestinationAddress is the legacy version of SetDestinationAddressCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetDestinationAddress(NewDestinationAddress string) (err error) { + return client.SetDestinationAddressCtx(context.Background(), + NewDestinationAddress, + ) +} + +func (client *WANDSLLinkConfig1) GetDestinationAddressCtx( + ctx context.Context, +) (NewDestinationAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2084,7 +2658,7 @@ func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetDestinationAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetDestinationAddress", request, response); err != nil { return } @@ -2097,7 +2671,16 @@ func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress return } -func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) (err error) { +// GetDestinationAddress is the legacy version of GetDestinationAddressCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetDestinationAddress() (NewDestinationAddress string, err error) { + return client.GetDestinationAddressCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) SetATMEncapsulationCtx( + ctx context.Context, + NewATMEncapsulation string, +) (err error) { // Request structure. request := &struct { NewATMEncapsulation string @@ -2113,7 +2696,7 @@ func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetATMEncapsulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetATMEncapsulation", request, response); err != nil { return } @@ -2123,7 +2706,17 @@ func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) return } -func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation string, err error) { +// SetATMEncapsulation is the legacy version of SetATMEncapsulationCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetATMEncapsulation(NewATMEncapsulation string) (err error) { + return client.SetATMEncapsulationCtx(context.Background(), + NewATMEncapsulation, + ) +} + +func (client *WANDSLLinkConfig1) GetATMEncapsulationCtx( + ctx context.Context, +) (NewATMEncapsulation string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2136,7 +2729,7 @@ func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation stri }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetATMEncapsulation", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetATMEncapsulation", request, response); err != nil { return } @@ -2149,7 +2742,16 @@ func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation stri return } -func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err error) { +// GetATMEncapsulation is the legacy version of GetATMEncapsulationCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetATMEncapsulation() (NewATMEncapsulation string, err error) { + return client.GetATMEncapsulationCtx(context.Background()) +} + +func (client *WANDSLLinkConfig1) SetFCSPreservedCtx( + ctx context.Context, + NewFCSPreserved bool, +) (err error) { // Request structure. request := &struct { NewFCSPreserved string @@ -2165,7 +2767,7 @@ func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err erro response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "SetFCSPreserved", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "SetFCSPreserved", request, response); err != nil { return } @@ -2175,7 +2777,17 @@ func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err erro return } -func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err error) { +// SetFCSPreserved is the legacy version of SetFCSPreservedCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) SetFCSPreserved(NewFCSPreserved bool) (err error) { + return client.SetFCSPreservedCtx(context.Background(), + NewFCSPreserved, + ) +} + +func (client *WANDSLLinkConfig1) GetFCSPreservedCtx( + ctx context.Context, +) (NewFCSPreserved bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2188,7 +2800,7 @@ func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err er }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANDSLLinkConfig_1, "GetFCSPreserved", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANDSLLinkConfig_1, "GetFCSPreserved", request, response); err != nil { return } @@ -2201,6 +2813,12 @@ func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err er return } +// GetFCSPreserved is the legacy version of GetFCSPreservedCtx, but uses +// context.Background() as the context. +func (client *WANDSLLinkConfig1) GetFCSPreserved() (NewFCSPreserved bool, err error) { + return client.GetFCSPreservedCtx(context.Background()) +} + // WANEthernetLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANEthernetLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -2265,7 +2883,9 @@ func newWANEthernetLinkConfig1ClientsFromGenericClients(genericClients []goupnp. // Return values: // // * NewEthernetLinkStatus: allowed values: Up, Down -func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkStatus string, err error) { +func (client *WANEthernetLinkConfig1) GetEthernetLinkStatusCtx( + ctx context.Context, +) (NewEthernetLinkStatus string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2278,7 +2898,7 @@ func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkSt }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANEthernetLinkConfig_1, "GetEthernetLinkStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANEthernetLinkConfig_1, "GetEthernetLinkStatus", request, response); err != nil { return } @@ -2291,6 +2911,12 @@ func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkSt return } +// GetEthernetLinkStatus is the legacy version of GetEthernetLinkStatusCtx, but uses +// context.Background() as the context. +func (client *WANEthernetLinkConfig1) GetEthernetLinkStatus() (NewEthernetLinkStatus string, err error) { + return client.GetEthernetLinkStatusCtx(context.Background()) +} + // WANIPConnection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPConnection:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -2351,7 +2977,10 @@ func newWANIPConnection1ClientsFromGenericClients(genericClients []goupnp.Servic return clients } -func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err error) { +func (client *WANIPConnection1) SetConnectionTypeCtx( + ctx context.Context, + NewConnectionType string, +) (err error) { // Request structure. request := &struct { NewConnectionType string @@ -2367,7 +2996,7 @@ func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetConnectionType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetConnectionType", request, response); err != nil { return } @@ -2377,11 +3006,21 @@ func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err return } +// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetConnectionType(NewConnectionType string) (err error) { + return client.SetConnectionTypeCtx(context.Background(), + NewConnectionType, + ) +} + // // Return values: // // * NewPossibleConnectionTypes: allowed values: Unconfigured, IP_Routed, IP_Bridged -func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { +func (client *WANIPConnection1) GetConnectionTypeInfoCtx( + ctx context.Context, +) (NewConnectionType string, NewPossibleConnectionTypes string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2395,7 +3034,7 @@ func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { return } @@ -2411,7 +3050,44 @@ func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType strin return } +// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { + return client.GetConnectionTypeInfoCtx(context.Background()) +} + +func (client *WANIPConnection1) RequestConnectionCtx( + ctx context.Context, +) (err error) { + // Request structure. + request := interface{}(nil) + // BEGIN Marshal arguments into request. + + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "RequestConnection", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// RequestConnection is the legacy version of RequestConnectionCtx, but uses +// context.Background() as the context. func (client *WANIPConnection1) RequestConnection() (err error) { + return client.RequestConnectionCtx(context.Background()) +} + +func (client *WANIPConnection1) RequestTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2422,7 +3098,7 @@ func (client *WANIPConnection1) RequestConnection() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "RequestConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "RequestTermination", request, response); err != nil { return } @@ -2432,7 +3108,15 @@ func (client *WANIPConnection1) RequestConnection() (err error) { return } +// RequestTermination is the legacy version of RequestTerminationCtx, but uses +// context.Background() as the context. func (client *WANIPConnection1) RequestTermination() (err error) { + return client.RequestTerminationCtx(context.Background()) +} + +func (client *WANIPConnection1) ForceTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2443,7 +3127,7 @@ func (client *WANIPConnection1) RequestTermination() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "RequestTermination", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "ForceTermination", request, response); err != nil { return } @@ -2453,28 +3137,16 @@ func (client *WANIPConnection1) RequestTermination() (err error) { return } +// ForceTermination is the legacy version of ForceTerminationCtx, but uses +// context.Background() as the context. func (client *WANIPConnection1) ForceTermination() (err error) { - // Request structure. - request := interface{}(nil) - // BEGIN Marshal arguments into request. - - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "ForceTermination", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ForceTerminationCtx(context.Background()) } -func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { +func (client *WANIPConnection1) SetAutoDisconnectTimeCtx( + ctx context.Context, + NewAutoDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewAutoDisconnectTime string @@ -2490,7 +3162,7 @@ func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { return } @@ -2500,7 +3172,18 @@ func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint return } -func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { +// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { + return client.SetAutoDisconnectTimeCtx(context.Background(), + NewAutoDisconnectTime, + ) +} + +func (client *WANIPConnection1) SetIdleDisconnectTimeCtx( + ctx context.Context, + NewIdleDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewIdleDisconnectTime string @@ -2516,7 +3199,7 @@ func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { return } @@ -2526,7 +3209,18 @@ func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint return } -func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { +// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { + return client.SetIdleDisconnectTimeCtx(context.Background(), + NewIdleDisconnectTime, + ) +} + +func (client *WANIPConnection1) SetWarnDisconnectDelayCtx( + ctx context.Context, + NewWarnDisconnectDelay uint32, +) (err error) { // Request structure. request := &struct { NewWarnDisconnectDelay string @@ -2542,7 +3236,7 @@ func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay ui response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { return } @@ -2552,13 +3246,23 @@ func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay ui return } +// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { + return client.SetWarnDisconnectDelayCtx(context.Background(), + NewWarnDisconnectDelay, + ) +} + // // Return values: // // * NewConnectionStatus: allowed values: Unconfigured, Connected, Disconnected // // * NewLastConnectionError: allowed values: ERROR_NONE -func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { +func (client *WANIPConnection1) GetStatusInfoCtx( + ctx context.Context, +) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2573,7 +3277,7 @@ func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, New }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetStatusInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetStatusInfo", request, response); err != nil { return } @@ -2592,7 +3296,15 @@ func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, New return } -func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { +// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { + return client.GetStatusInfoCtx(context.Background()) +} + +func (client *WANIPConnection1) GetAutoDisconnectTimeCtx( + ctx context.Context, +) (NewAutoDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2605,7 +3317,7 @@ func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { return } @@ -2618,7 +3330,15 @@ func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime u return } -func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { +// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { + return client.GetAutoDisconnectTimeCtx(context.Background()) +} + +func (client *WANIPConnection1) GetIdleDisconnectTimeCtx( + ctx context.Context, +) (NewIdleDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2631,7 +3351,7 @@ func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { return } @@ -2644,7 +3364,15 @@ func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime u return } -func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { +// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { + return client.GetIdleDisconnectTimeCtx(context.Background()) +} + +func (client *WANIPConnection1) GetWarnDisconnectDelayCtx( + ctx context.Context, +) (NewWarnDisconnectDelay uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2657,7 +3385,7 @@ func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { return } @@ -2670,7 +3398,15 @@ func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay return } -func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { +// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { + return client.GetWarnDisconnectDelayCtx(context.Background()) +} + +func (client *WANIPConnection1) GetNATRSIPStatusCtx( + ctx context.Context, +) (NewRSIPAvailable bool, NewNATEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2684,7 +3420,7 @@ func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNA }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetNATRSIPStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetNATRSIPStatus", request, response); err != nil { return } @@ -2700,11 +3436,20 @@ func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNA return } +// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { + return client.GetNATRSIPStatusCtx(context.Background()) +} + // // Return values: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANIPConnection1) GetGenericPortMappingEntryCtx( + ctx context.Context, + NewPortMappingIndex uint16, +) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewPortMappingIndex string @@ -2729,7 +3474,7 @@ func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { return } @@ -2763,12 +3508,25 @@ func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex u return } +// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetGenericPortMappingEntryCtx(context.Background(), + NewPortMappingIndex, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANIPConnection1) GetSpecificPortMappingEntryCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewRemoteHost string @@ -2798,7 +3556,7 @@ func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { return } @@ -2823,12 +3581,32 @@ func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string return } +// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetSpecificPortMappingEntryCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { +func (client *WANIPConnection1) AddPortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, + NewInternalPort uint16, + NewInternalClient string, + NewEnabled bool, + NewPortMappingDescription string, + NewLeaseDuration uint32, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -2872,7 +3650,7 @@ func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternal response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "AddPortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "AddPortMapping", request, response); err != nil { return } @@ -2882,12 +3660,32 @@ func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternal return } +// AddPortMapping is the legacy version of AddPortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { + return client.AddPortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + NewInternalPort, + NewInternalClient, + NewEnabled, + NewPortMappingDescription, + NewLeaseDuration, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { +func (client *WANIPConnection1) DeletePortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -2911,7 +3709,7 @@ func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExter response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "DeletePortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "DeletePortMapping", request, response); err != nil { return } @@ -2921,7 +3719,19 @@ func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExter return } -func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { +// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { + return client.DeletePortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + +func (client *WANIPConnection1) GetExternalIPAddressCtx( + ctx context.Context, +) (NewExternalIPAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -2934,7 +3744,7 @@ func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_1, "GetExternalIPAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_1, "GetExternalIPAddress", request, response); err != nil { return } @@ -2947,6 +3757,12 @@ func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress str return } +// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { + return client.GetExternalIPAddressCtx(context.Background()) +} + // WANIPConnection2 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPConnection:2". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -3007,7 +3823,10 @@ func newWANIPConnection2ClientsFromGenericClients(genericClients []goupnp.Servic return clients } -func (client *WANIPConnection2) SetConnectionType(NewConnectionType string) (err error) { +func (client *WANIPConnection2) SetConnectionTypeCtx( + ctx context.Context, + NewConnectionType string, +) (err error) { // Request structure. request := &struct { NewConnectionType string @@ -3023,7 +3842,7 @@ func (client *WANIPConnection2) SetConnectionType(NewConnectionType string) (err response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "SetConnectionType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetConnectionType", request, response); err != nil { return } @@ -3033,7 +3852,17 @@ func (client *WANIPConnection2) SetConnectionType(NewConnectionType string) (err return } -func (client *WANIPConnection2) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { +// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) SetConnectionType(NewConnectionType string) (err error) { + return client.SetConnectionTypeCtx(context.Background(), + NewConnectionType, + ) +} + +func (client *WANIPConnection2) GetConnectionTypeInfoCtx( + ctx context.Context, +) (NewConnectionType string, NewPossibleConnectionTypes string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3047,7 +3876,7 @@ func (client *WANIPConnection2) GetConnectionTypeInfo() (NewConnectionType strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetConnectionTypeInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetConnectionTypeInfo", request, response); err != nil { return } @@ -3063,7 +3892,44 @@ func (client *WANIPConnection2) GetConnectionTypeInfo() (NewConnectionType strin return } +// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { + return client.GetConnectionTypeInfoCtx(context.Background()) +} + +func (client *WANIPConnection2) RequestConnectionCtx( + ctx context.Context, +) (err error) { + // Request structure. + request := interface{}(nil) + // BEGIN Marshal arguments into request. + + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "RequestConnection", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// RequestConnection is the legacy version of RequestConnectionCtx, but uses +// context.Background() as the context. func (client *WANIPConnection2) RequestConnection() (err error) { + return client.RequestConnectionCtx(context.Background()) +} + +func (client *WANIPConnection2) RequestTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3074,7 +3940,7 @@ func (client *WANIPConnection2) RequestConnection() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "RequestConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "RequestTermination", request, response); err != nil { return } @@ -3084,7 +3950,15 @@ func (client *WANIPConnection2) RequestConnection() (err error) { return } +// RequestTermination is the legacy version of RequestTerminationCtx, but uses +// context.Background() as the context. func (client *WANIPConnection2) RequestTermination() (err error) { + return client.RequestTerminationCtx(context.Background()) +} + +func (client *WANIPConnection2) ForceTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3095,7 +3969,7 @@ func (client *WANIPConnection2) RequestTermination() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "RequestTermination", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "ForceTermination", request, response); err != nil { return } @@ -3105,28 +3979,16 @@ func (client *WANIPConnection2) RequestTermination() (err error) { return } +// ForceTermination is the legacy version of ForceTerminationCtx, but uses +// context.Background() as the context. func (client *WANIPConnection2) ForceTermination() (err error) { - // Request structure. - request := interface{}(nil) - // BEGIN Marshal arguments into request. - - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "ForceTermination", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ForceTerminationCtx(context.Background()) } -func (client *WANIPConnection2) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { +func (client *WANIPConnection2) SetAutoDisconnectTimeCtx( + ctx context.Context, + NewAutoDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewAutoDisconnectTime string @@ -3142,7 +4004,7 @@ func (client *WANIPConnection2) SetAutoDisconnectTime(NewAutoDisconnectTime uint response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "SetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetAutoDisconnectTime", request, response); err != nil { return } @@ -3152,7 +4014,18 @@ func (client *WANIPConnection2) SetAutoDisconnectTime(NewAutoDisconnectTime uint return } -func (client *WANIPConnection2) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { +// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { + return client.SetAutoDisconnectTimeCtx(context.Background(), + NewAutoDisconnectTime, + ) +} + +func (client *WANIPConnection2) SetIdleDisconnectTimeCtx( + ctx context.Context, + NewIdleDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewIdleDisconnectTime string @@ -3168,7 +4041,7 @@ func (client *WANIPConnection2) SetIdleDisconnectTime(NewIdleDisconnectTime uint response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "SetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetIdleDisconnectTime", request, response); err != nil { return } @@ -3178,7 +4051,18 @@ func (client *WANIPConnection2) SetIdleDisconnectTime(NewIdleDisconnectTime uint return } -func (client *WANIPConnection2) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { +// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { + return client.SetIdleDisconnectTimeCtx(context.Background(), + NewIdleDisconnectTime, + ) +} + +func (client *WANIPConnection2) SetWarnDisconnectDelayCtx( + ctx context.Context, + NewWarnDisconnectDelay uint32, +) (err error) { // Request structure. request := &struct { NewWarnDisconnectDelay string @@ -3194,7 +4078,7 @@ func (client *WANIPConnection2) SetWarnDisconnectDelay(NewWarnDisconnectDelay ui response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "SetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "SetWarnDisconnectDelay", request, response); err != nil { return } @@ -3204,13 +4088,23 @@ func (client *WANIPConnection2) SetWarnDisconnectDelay(NewWarnDisconnectDelay ui return } +// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { + return client.SetWarnDisconnectDelayCtx(context.Background(), + NewWarnDisconnectDelay, + ) +} + // // Return values: // // * NewConnectionStatus: allowed values: Unconfigured, Connecting, Connected, PendingDisconnect, Disconnecting, Disconnected // // * NewLastConnectionError: allowed values: ERROR_NONE, ERROR_COMMAND_ABORTED, ERROR_NOT_ENABLED_FOR_INTERNET, ERROR_USER_DISCONNECT, ERROR_ISP_DISCONNECT, ERROR_IDLE_DISCONNECT, ERROR_FORCED_DISCONNECT, ERROR_NO_CARRIER, ERROR_IP_CONFIGURATION, ERROR_UNKNOWN -func (client *WANIPConnection2) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { +func (client *WANIPConnection2) GetStatusInfoCtx( + ctx context.Context, +) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3225,7 +4119,7 @@ func (client *WANIPConnection2) GetStatusInfo() (NewConnectionStatus string, New }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetStatusInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetStatusInfo", request, response); err != nil { return } @@ -3244,7 +4138,15 @@ func (client *WANIPConnection2) GetStatusInfo() (NewConnectionStatus string, New return } -func (client *WANIPConnection2) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { +// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { + return client.GetStatusInfoCtx(context.Background()) +} + +func (client *WANIPConnection2) GetAutoDisconnectTimeCtx( + ctx context.Context, +) (NewAutoDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3257,7 +4159,7 @@ func (client *WANIPConnection2) GetAutoDisconnectTime() (NewAutoDisconnectTime u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetAutoDisconnectTime", request, response); err != nil { return } @@ -3270,7 +4172,15 @@ func (client *WANIPConnection2) GetAutoDisconnectTime() (NewAutoDisconnectTime u return } -func (client *WANIPConnection2) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { +// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { + return client.GetAutoDisconnectTimeCtx(context.Background()) +} + +func (client *WANIPConnection2) GetIdleDisconnectTimeCtx( + ctx context.Context, +) (NewIdleDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3283,7 +4193,7 @@ func (client *WANIPConnection2) GetIdleDisconnectTime() (NewIdleDisconnectTime u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetIdleDisconnectTime", request, response); err != nil { return } @@ -3296,7 +4206,15 @@ func (client *WANIPConnection2) GetIdleDisconnectTime() (NewIdleDisconnectTime u return } -func (client *WANIPConnection2) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { +// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { + return client.GetIdleDisconnectTimeCtx(context.Background()) +} + +func (client *WANIPConnection2) GetWarnDisconnectDelayCtx( + ctx context.Context, +) (NewWarnDisconnectDelay uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3309,7 +4227,7 @@ func (client *WANIPConnection2) GetWarnDisconnectDelay() (NewWarnDisconnectDelay }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetWarnDisconnectDelay", request, response); err != nil { return } @@ -3322,7 +4240,15 @@ func (client *WANIPConnection2) GetWarnDisconnectDelay() (NewWarnDisconnectDelay return } -func (client *WANIPConnection2) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { +// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { + return client.GetWarnDisconnectDelayCtx(context.Background()) +} + +func (client *WANIPConnection2) GetNATRSIPStatusCtx( + ctx context.Context, +) (NewRSIPAvailable bool, NewNATEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3336,7 +4262,7 @@ func (client *WANIPConnection2) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNA }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetNATRSIPStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetNATRSIPStatus", request, response); err != nil { return } @@ -3352,11 +4278,20 @@ func (client *WANIPConnection2) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNA return } +// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { + return client.GetNATRSIPStatusCtx(context.Background()) +} + // // Return values: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANIPConnection2) GetGenericPortMappingEntryCtx( + ctx context.Context, + NewPortMappingIndex uint16, +) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewPortMappingIndex string @@ -3381,7 +4316,7 @@ func (client *WANIPConnection2) GetGenericPortMappingEntry(NewPortMappingIndex u }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetGenericPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetGenericPortMappingEntry", request, response); err != nil { return } @@ -3415,12 +4350,25 @@ func (client *WANIPConnection2) GetGenericPortMappingEntry(NewPortMappingIndex u return } +// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetGenericPortMappingEntryCtx(context.Background(), + NewPortMappingIndex, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANIPConnection2) GetSpecificPortMappingEntryCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3450,7 +4398,7 @@ func (client *WANIPConnection2) GetSpecificPortMappingEntry(NewRemoteHost string }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetSpecificPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetSpecificPortMappingEntry", request, response); err != nil { return } @@ -3475,12 +4423,32 @@ func (client *WANIPConnection2) GetSpecificPortMappingEntry(NewRemoteHost string return } +// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetSpecificPortMappingEntryCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { +func (client *WANIPConnection2) AddPortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, + NewInternalPort uint16, + NewInternalClient string, + NewEnabled bool, + NewPortMappingDescription string, + NewLeaseDuration uint32, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3524,7 +4492,7 @@ func (client *WANIPConnection2) AddPortMapping(NewRemoteHost string, NewExternal response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "AddPortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "AddPortMapping", request, response); err != nil { return } @@ -3534,12 +4502,32 @@ func (client *WANIPConnection2) AddPortMapping(NewRemoteHost string, NewExternal return } +// AddPortMapping is the legacy version of AddPortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { + return client.AddPortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + NewInternalPort, + NewInternalClient, + NewEnabled, + NewPortMappingDescription, + NewLeaseDuration, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { +func (client *WANIPConnection2) DeletePortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3563,7 +4551,7 @@ func (client *WANIPConnection2) DeletePortMapping(NewRemoteHost string, NewExter response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "DeletePortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "DeletePortMapping", request, response); err != nil { return } @@ -3573,12 +4561,28 @@ func (client *WANIPConnection2) DeletePortMapping(NewRemoteHost string, NewExter return } +// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { + return client.DeletePortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) DeletePortMappingRange(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool) (err error) { +func (client *WANIPConnection2) DeletePortMappingRangeCtx( + ctx context.Context, + NewStartPort uint16, + NewEndPort uint16, + NewProtocol string, + NewManage bool, +) (err error) { // Request structure. request := &struct { NewStartPort string @@ -3606,7 +4610,7 @@ func (client *WANIPConnection2) DeletePortMappingRange(NewStartPort uint16, NewE response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "DeletePortMappingRange", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "DeletePortMappingRange", request, response); err != nil { return } @@ -3616,7 +4620,20 @@ func (client *WANIPConnection2) DeletePortMappingRange(NewStartPort uint16, NewE return } -func (client *WANIPConnection2) GetExternalIPAddress() (NewExternalIPAddress string, err error) { +// DeletePortMappingRange is the legacy version of DeletePortMappingRangeCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) DeletePortMappingRange(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool) (err error) { + return client.DeletePortMappingRangeCtx(context.Background(), + NewStartPort, + NewEndPort, + NewProtocol, + NewManage, + ) +} + +func (client *WANIPConnection2) GetExternalIPAddressCtx( + ctx context.Context, +) (NewExternalIPAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3629,7 +4646,7 @@ func (client *WANIPConnection2) GetExternalIPAddress() (NewExternalIPAddress str }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetExternalIPAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetExternalIPAddress", request, response); err != nil { return } @@ -3642,12 +4659,25 @@ func (client *WANIPConnection2) GetExternalIPAddress() (NewExternalIPAddress str return } +// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetExternalIPAddress() (NewExternalIPAddress string, err error) { + return client.GetExternalIPAddressCtx(context.Background()) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) GetListOfPortMappings(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool, NewNumberOfPorts uint16) (NewPortListing string, err error) { +func (client *WANIPConnection2) GetListOfPortMappingsCtx( + ctx context.Context, + NewStartPort uint16, + NewEndPort uint16, + NewProtocol string, + NewManage bool, + NewNumberOfPorts uint16, +) (NewPortListing string, err error) { // Request structure. request := &struct { NewStartPort string @@ -3681,7 +4711,7 @@ func (client *WANIPConnection2) GetListOfPortMappings(NewStartPort uint16, NewEn }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "GetListOfPortMappings", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "GetListOfPortMappings", request, response); err != nil { return } @@ -3694,12 +4724,34 @@ func (client *WANIPConnection2) GetListOfPortMappings(NewStartPort uint16, NewEn return } +// GetListOfPortMappings is the legacy version of GetListOfPortMappingsCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) GetListOfPortMappings(NewStartPort uint16, NewEndPort uint16, NewProtocol string, NewManage bool, NewNumberOfPorts uint16) (NewPortListing string, err error) { + return client.GetListOfPortMappingsCtx(context.Background(), + NewStartPort, + NewEndPort, + NewProtocol, + NewManage, + NewNumberOfPorts, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANIPConnection2) AddAnyPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (NewReservedPort uint16, err error) { +func (client *WANIPConnection2) AddAnyPortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, + NewInternalPort uint16, + NewInternalClient string, + NewEnabled bool, + NewPortMappingDescription string, + NewLeaseDuration uint32, +) (NewReservedPort uint16, err error) { // Request structure. request := &struct { NewRemoteHost string @@ -3745,7 +4797,7 @@ func (client *WANIPConnection2) AddAnyPortMapping(NewRemoteHost string, NewExter }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPConnection_2, "AddAnyPortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPConnection_2, "AddAnyPortMapping", request, response); err != nil { return } @@ -3758,6 +4810,21 @@ func (client *WANIPConnection2) AddAnyPortMapping(NewRemoteHost string, NewExter return } +// AddAnyPortMapping is the legacy version of AddAnyPortMappingCtx, but uses +// context.Background() as the context. +func (client *WANIPConnection2) AddAnyPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (NewReservedPort uint16, err error) { + return client.AddAnyPortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + NewInternalPort, + NewInternalClient, + NewEnabled, + NewPortMappingDescription, + NewLeaseDuration, + ) +} + // WANIPv6FirewallControl1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -3818,7 +4885,9 @@ func newWANIPv6FirewallControl1ClientsFromGenericClients(genericClients []goupnp return clients } -func (client *WANIPv6FirewallControl1) GetFirewallStatus() (FirewallEnabled bool, InboundPinholeAllowed bool, err error) { +func (client *WANIPv6FirewallControl1) GetFirewallStatusCtx( + ctx context.Context, +) (FirewallEnabled bool, InboundPinholeAllowed bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -3832,7 +4901,7 @@ func (client *WANIPv6FirewallControl1) GetFirewallStatus() (FirewallEnabled bool }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "GetFirewallStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "GetFirewallStatus", request, response); err != nil { return } @@ -3848,7 +4917,20 @@ func (client *WANIPv6FirewallControl1) GetFirewallStatus() (FirewallEnabled bool return } -func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeout(RemoteHost string, RemotePort uint16, InternalClient string, InternalPort uint16, Protocol uint16) (OutboundPinholeTimeout uint32, err error) { +// GetFirewallStatus is the legacy version of GetFirewallStatusCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) GetFirewallStatus() (FirewallEnabled bool, InboundPinholeAllowed bool, err error) { + return client.GetFirewallStatusCtx(context.Background()) +} + +func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeoutCtx( + ctx context.Context, + RemoteHost string, + RemotePort uint16, + InternalClient string, + InternalPort uint16, + Protocol uint16, +) (OutboundPinholeTimeout uint32, err error) { // Request structure. request := &struct { RemoteHost string @@ -3882,7 +4964,7 @@ func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeout(RemoteHost stri }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "GetOutboundPinholeTimeout", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "GetOutboundPinholeTimeout", request, response); err != nil { return } @@ -3895,12 +4977,32 @@ func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeout(RemoteHost stri return } +// GetOutboundPinholeTimeout is the legacy version of GetOutboundPinholeTimeoutCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) GetOutboundPinholeTimeout(RemoteHost string, RemotePort uint16, InternalClient string, InternalPort uint16, Protocol uint16) (OutboundPinholeTimeout uint32, err error) { + return client.GetOutboundPinholeTimeoutCtx(context.Background(), + RemoteHost, + RemotePort, + InternalClient, + InternalPort, + Protocol, + ) +} + // // Arguments: // // * LeaseTime: allowed value range: minimum=1, maximum=86400 -func (client *WANIPv6FirewallControl1) AddPinhole(RemoteHost string, RemotePort uint16, InternalClient string, InternalPort uint16, Protocol uint16, LeaseTime uint32) (UniqueID uint16, err error) { +func (client *WANIPv6FirewallControl1) AddPinholeCtx( + ctx context.Context, + RemoteHost string, + RemotePort uint16, + InternalClient string, + InternalPort uint16, + Protocol uint16, + LeaseTime uint32, +) (UniqueID uint16, err error) { // Request structure. request := &struct { RemoteHost string @@ -3938,7 +5040,7 @@ func (client *WANIPv6FirewallControl1) AddPinhole(RemoteHost string, RemotePort }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "AddPinhole", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "AddPinhole", request, response); err != nil { return } @@ -3951,12 +5053,29 @@ func (client *WANIPv6FirewallControl1) AddPinhole(RemoteHost string, RemotePort return } +// AddPinhole is the legacy version of AddPinholeCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) AddPinhole(RemoteHost string, RemotePort uint16, InternalClient string, InternalPort uint16, Protocol uint16, LeaseTime uint32) (UniqueID uint16, err error) { + return client.AddPinholeCtx(context.Background(), + RemoteHost, + RemotePort, + InternalClient, + InternalPort, + Protocol, + LeaseTime, + ) +} + // // Arguments: // // * NewLeaseTime: allowed value range: minimum=1, maximum=86400 -func (client *WANIPv6FirewallControl1) UpdatePinhole(UniqueID uint16, NewLeaseTime uint32) (err error) { +func (client *WANIPv6FirewallControl1) UpdatePinholeCtx( + ctx context.Context, + UniqueID uint16, + NewLeaseTime uint32, +) (err error) { // Request structure. request := &struct { UniqueID string @@ -3976,7 +5095,7 @@ func (client *WANIPv6FirewallControl1) UpdatePinhole(UniqueID uint16, NewLeaseTi response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "UpdatePinhole", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "UpdatePinhole", request, response); err != nil { return } @@ -3986,7 +5105,19 @@ func (client *WANIPv6FirewallControl1) UpdatePinhole(UniqueID uint16, NewLeaseTi return } -func (client *WANIPv6FirewallControl1) DeletePinhole(UniqueID uint16) (err error) { +// UpdatePinhole is the legacy version of UpdatePinholeCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) UpdatePinhole(UniqueID uint16, NewLeaseTime uint32) (err error) { + return client.UpdatePinholeCtx(context.Background(), + UniqueID, + NewLeaseTime, + ) +} + +func (client *WANIPv6FirewallControl1) DeletePinholeCtx( + ctx context.Context, + UniqueID uint16, +) (err error) { // Request structure. request := &struct { UniqueID string @@ -4002,7 +5133,7 @@ func (client *WANIPv6FirewallControl1) DeletePinhole(UniqueID uint16) (err error response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "DeletePinhole", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "DeletePinhole", request, response); err != nil { return } @@ -4012,7 +5143,18 @@ func (client *WANIPv6FirewallControl1) DeletePinhole(UniqueID uint16) (err error return } -func (client *WANIPv6FirewallControl1) GetPinholePackets(UniqueID uint16) (PinholePackets uint32, err error) { +// DeletePinhole is the legacy version of DeletePinholeCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) DeletePinhole(UniqueID uint16) (err error) { + return client.DeletePinholeCtx(context.Background(), + UniqueID, + ) +} + +func (client *WANIPv6FirewallControl1) GetPinholePacketsCtx( + ctx context.Context, + UniqueID uint16, +) (PinholePackets uint32, err error) { // Request structure. request := &struct { UniqueID string @@ -4030,7 +5172,7 @@ func (client *WANIPv6FirewallControl1) GetPinholePackets(UniqueID uint16) (Pinho }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "GetPinholePackets", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "GetPinholePackets", request, response); err != nil { return } @@ -4043,7 +5185,18 @@ func (client *WANIPv6FirewallControl1) GetPinholePackets(UniqueID uint16) (Pinho return } -func (client *WANIPv6FirewallControl1) CheckPinholeWorking(UniqueID uint16) (IsWorking bool, err error) { +// GetPinholePackets is the legacy version of GetPinholePacketsCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) GetPinholePackets(UniqueID uint16) (PinholePackets uint32, err error) { + return client.GetPinholePacketsCtx(context.Background(), + UniqueID, + ) +} + +func (client *WANIPv6FirewallControl1) CheckPinholeWorkingCtx( + ctx context.Context, + UniqueID uint16, +) (IsWorking bool, err error) { // Request structure. request := &struct { UniqueID string @@ -4061,7 +5214,7 @@ func (client *WANIPv6FirewallControl1) CheckPinholeWorking(UniqueID uint16) (IsW }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANIPv6FirewallControl_1, "CheckPinholeWorking", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANIPv6FirewallControl_1, "CheckPinholeWorking", request, response); err != nil { return } @@ -4074,6 +5227,14 @@ func (client *WANIPv6FirewallControl1) CheckPinholeWorking(UniqueID uint16) (IsW return } +// CheckPinholeWorking is the legacy version of CheckPinholeWorkingCtx, but uses +// context.Background() as the context. +func (client *WANIPv6FirewallControl1) CheckPinholeWorking(UniqueID uint16) (IsWorking bool, err error) { + return client.CheckPinholeWorkingCtx(context.Background(), + UniqueID, + ) +} + // WANPOTSLinkConfig1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANPOTSLinkConfig:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -4139,7 +5300,12 @@ func newWANPOTSLinkConfig1ClientsFromGenericClients(genericClients []goupnp.Serv // // * NewLinkType: allowed values: PPP_Dialup -func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInfo string, NewLinkType string) (err error) { +func (client *WANPOTSLinkConfig1) SetISPInfoCtx( + ctx context.Context, + NewISPPhoneNumber string, + NewISPInfo string, + NewLinkType string, +) (err error) { // Request structure. request := &struct { NewISPPhoneNumber string @@ -4163,7 +5329,7 @@ func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInf response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "SetISPInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "SetISPInfo", request, response); err != nil { return } @@ -4173,7 +5339,21 @@ func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInf return } -func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, NewDelayBetweenRetries uint32) (err error) { +// SetISPInfo is the legacy version of SetISPInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) SetISPInfo(NewISPPhoneNumber string, NewISPInfo string, NewLinkType string) (err error) { + return client.SetISPInfoCtx(context.Background(), + NewISPPhoneNumber, + NewISPInfo, + NewLinkType, + ) +} + +func (client *WANPOTSLinkConfig1) SetCallRetryInfoCtx( + ctx context.Context, + NewNumberOfRetries uint32, + NewDelayBetweenRetries uint32, +) (err error) { // Request structure. request := &struct { NewNumberOfRetries string @@ -4193,7 +5373,7 @@ func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, Ne response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "SetCallRetryInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "SetCallRetryInfo", request, response); err != nil { return } @@ -4203,11 +5383,22 @@ func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, Ne return } +// SetCallRetryInfo is the legacy version of SetCallRetryInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) SetCallRetryInfo(NewNumberOfRetries uint32, NewDelayBetweenRetries uint32) (err error) { + return client.SetCallRetryInfoCtx(context.Background(), + NewNumberOfRetries, + NewDelayBetweenRetries, + ) +} + // // Return values: // // * NewLinkType: allowed values: PPP_Dialup -func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) { +func (client *WANPOTSLinkConfig1) GetISPInfoCtx( + ctx context.Context, +) (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4222,7 +5413,7 @@ func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISP }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetISPInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetISPInfo", request, response); err != nil { return } @@ -4241,7 +5432,15 @@ func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISP return } -func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) { +// GetISPInfo is the legacy version of GetISPInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetISPInfo() (NewISPPhoneNumber string, NewISPInfo string, NewLinkType string, err error) { + return client.GetISPInfoCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetCallRetryInfoCtx( + ctx context.Context, +) (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4255,7 +5454,7 @@ func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetCallRetryInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetCallRetryInfo", request, response); err != nil { return } @@ -4271,7 +5470,15 @@ func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, return } -func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { +// GetCallRetryInfo is the legacy version of GetCallRetryInfoCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetCallRetryInfo() (NewNumberOfRetries uint32, NewDelayBetweenRetries uint32, err error) { + return client.GetCallRetryInfoCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetFclassCtx( + ctx context.Context, +) (NewFclass string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4284,7 +5491,7 @@ func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetFclass", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetFclass", request, response); err != nil { return } @@ -4297,7 +5504,15 @@ func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { return } -func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulationSupported string, err error) { +// GetFclass is the legacy version of GetFclassCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetFclass() (NewFclass string, err error) { + return client.GetFclassCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetDataModulationSupportedCtx( + ctx context.Context, +) (NewDataModulationSupported string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4310,7 +5525,7 @@ func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulatio }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetDataModulationSupported", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataModulationSupported", request, response); err != nil { return } @@ -4323,7 +5538,15 @@ func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulatio return } -func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err error) { +// GetDataModulationSupported is the legacy version of GetDataModulationSupportedCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetDataModulationSupported() (NewDataModulationSupported string, err error) { + return client.GetDataModulationSupportedCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetDataProtocolCtx( + ctx context.Context, +) (NewDataProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4336,7 +5559,7 @@ func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetDataProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataProtocol", request, response); err != nil { return } @@ -4349,7 +5572,15 @@ func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err return } -func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression string, err error) { +// GetDataProtocol is the legacy version of GetDataProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetDataProtocol() (NewDataProtocol string, err error) { + return client.GetDataProtocolCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetDataCompressionCtx( + ctx context.Context, +) (NewDataCompression string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4362,7 +5593,7 @@ func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetDataCompression", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetDataCompression", request, response); err != nil { return } @@ -4375,7 +5606,15 @@ func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression strin return } -func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRCommandSupported bool, err error) { +// GetDataCompression is the legacy version of GetDataCompressionCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetDataCompression() (NewDataCompression string, err error) { + return client.GetDataCompressionCtx(context.Background()) +} + +func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupportedCtx( + ctx context.Context, +) (NewPlusVTRCommandSupported bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4388,7 +5627,7 @@ func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRComman }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPOTSLinkConfig_1, "GetPlusVTRCommandSupported", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPOTSLinkConfig_1, "GetPlusVTRCommandSupported", request, response); err != nil { return } @@ -4401,6 +5640,12 @@ func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRComman return } +// GetPlusVTRCommandSupported is the legacy version of GetPlusVTRCommandSupportedCtx, but uses +// context.Background() as the context. +func (client *WANPOTSLinkConfig1) GetPlusVTRCommandSupported() (NewPlusVTRCommandSupported bool, err error) { + return client.GetPlusVTRCommandSupportedCtx(context.Background()) +} + // WANPPPConnection1 is a client for UPnP SOAP service with URN "urn:schemas-upnp-org:service:WANPPPConnection:1". See // goupnp.ServiceClient, which contains RootDevice and Service attributes which // are provided for informational value. @@ -4461,7 +5706,10 @@ func newWANPPPConnection1ClientsFromGenericClients(genericClients []goupnp.Servi return clients } -func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (err error) { +func (client *WANPPPConnection1) SetConnectionTypeCtx( + ctx context.Context, + NewConnectionType string, +) (err error) { // Request structure. request := &struct { NewConnectionType string @@ -4477,7 +5725,7 @@ func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (er response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetConnectionType", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetConnectionType", request, response); err != nil { return } @@ -4487,11 +5735,21 @@ func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (er return } +// SetConnectionType is the legacy version of SetConnectionTypeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetConnectionType(NewConnectionType string) (err error) { + return client.SetConnectionTypeCtx(context.Background(), + NewConnectionType, + ) +} + // // Return values: // // * NewPossibleConnectionTypes: allowed values: Unconfigured, IP_Routed, DHCP_Spoofed, PPPoE_Bridged, PPTP_Relay, L2TP_Relay, PPPoE_Relay -func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { +func (client *WANPPPConnection1) GetConnectionTypeInfoCtx( + ctx context.Context, +) (NewConnectionType string, NewPossibleConnectionTypes string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4505,7 +5763,7 @@ func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType stri }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetConnectionTypeInfo", request, response); err != nil { return } @@ -4521,7 +5779,17 @@ func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType stri return } -func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPassword string) (err error) { +// GetConnectionTypeInfo is the legacy version of GetConnectionTypeInfoCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetConnectionTypeInfo() (NewConnectionType string, NewPossibleConnectionTypes string, err error) { + return client.GetConnectionTypeInfoCtx(context.Background()) +} + +func (client *WANPPPConnection1) ConfigureConnectionCtx( + ctx context.Context, + NewUserName string, + NewPassword string, +) (err error) { // Request structure. request := &struct { NewUserName string @@ -4541,7 +5809,7 @@ func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPass response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "ConfigureConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "ConfigureConnection", request, response); err != nil { return } @@ -4551,7 +5819,47 @@ func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPass return } +// ConfigureConnection is the legacy version of ConfigureConnectionCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) ConfigureConnection(NewUserName string, NewPassword string) (err error) { + return client.ConfigureConnectionCtx(context.Background(), + NewUserName, + NewPassword, + ) +} + +func (client *WANPPPConnection1) RequestConnectionCtx( + ctx context.Context, +) (err error) { + // Request structure. + request := interface{}(nil) + // BEGIN Marshal arguments into request. + + // END Marshal arguments into request. + + // Response structure. + response := interface{}(nil) + + // Perform the SOAP call. + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "RequestConnection", request, response); err != nil { + return + } + + // BEGIN Unmarshal arguments from response. + + // END Unmarshal arguments from response. + return +} + +// RequestConnection is the legacy version of RequestConnectionCtx, but uses +// context.Background() as the context. func (client *WANPPPConnection1) RequestConnection() (err error) { + return client.RequestConnectionCtx(context.Background()) +} + +func (client *WANPPPConnection1) RequestTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4562,7 +5870,7 @@ func (client *WANPPPConnection1) RequestConnection() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "RequestConnection", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "RequestTermination", request, response); err != nil { return } @@ -4572,7 +5880,15 @@ func (client *WANPPPConnection1) RequestConnection() (err error) { return } +// RequestTermination is the legacy version of RequestTerminationCtx, but uses +// context.Background() as the context. func (client *WANPPPConnection1) RequestTermination() (err error) { + return client.RequestTerminationCtx(context.Background()) +} + +func (client *WANPPPConnection1) ForceTerminationCtx( + ctx context.Context, +) (err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4583,7 +5899,7 @@ func (client *WANPPPConnection1) RequestTermination() (err error) { response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "RequestTermination", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "ForceTermination", request, response); err != nil { return } @@ -4593,28 +5909,16 @@ func (client *WANPPPConnection1) RequestTermination() (err error) { return } +// ForceTermination is the legacy version of ForceTerminationCtx, but uses +// context.Background() as the context. func (client *WANPPPConnection1) ForceTermination() (err error) { - // Request structure. - request := interface{}(nil) - // BEGIN Marshal arguments into request. - - // END Marshal arguments into request. - - // Response structure. - response := interface{}(nil) - - // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "ForceTermination", request, response); err != nil { - return - } - - // BEGIN Unmarshal arguments from response. - - // END Unmarshal arguments from response. - return + return client.ForceTerminationCtx(context.Background()) } -func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { +func (client *WANPPPConnection1) SetAutoDisconnectTimeCtx( + ctx context.Context, + NewAutoDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewAutoDisconnectTime string @@ -4630,7 +5934,7 @@ func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uin response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetAutoDisconnectTime", request, response); err != nil { return } @@ -4640,7 +5944,18 @@ func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uin return } -func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { +// SetAutoDisconnectTime is the legacy version of SetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetAutoDisconnectTime(NewAutoDisconnectTime uint32) (err error) { + return client.SetAutoDisconnectTimeCtx(context.Background(), + NewAutoDisconnectTime, + ) +} + +func (client *WANPPPConnection1) SetIdleDisconnectTimeCtx( + ctx context.Context, + NewIdleDisconnectTime uint32, +) (err error) { // Request structure. request := &struct { NewIdleDisconnectTime string @@ -4656,7 +5971,7 @@ func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uin response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetIdleDisconnectTime", request, response); err != nil { return } @@ -4666,7 +5981,18 @@ func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uin return } -func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { +// SetIdleDisconnectTime is the legacy version of SetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetIdleDisconnectTime(NewIdleDisconnectTime uint32) (err error) { + return client.SetIdleDisconnectTimeCtx(context.Background(), + NewIdleDisconnectTime, + ) +} + +func (client *WANPPPConnection1) SetWarnDisconnectDelayCtx( + ctx context.Context, + NewWarnDisconnectDelay uint32, +) (err error) { // Request structure. request := &struct { NewWarnDisconnectDelay string @@ -4682,7 +6008,7 @@ func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay u response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "SetWarnDisconnectDelay", request, response); err != nil { return } @@ -4692,13 +6018,23 @@ func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay u return } +// SetWarnDisconnectDelay is the legacy version of SetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) SetWarnDisconnectDelay(NewWarnDisconnectDelay uint32) (err error) { + return client.SetWarnDisconnectDelayCtx(context.Background(), + NewWarnDisconnectDelay, + ) +} + // // Return values: // // * NewConnectionStatus: allowed values: Unconfigured, Connected, Disconnected // // * NewLastConnectionError: allowed values: ERROR_NONE -func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { +func (client *WANPPPConnection1) GetStatusInfoCtx( + ctx context.Context, +) (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4713,7 +6049,7 @@ func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, Ne }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetStatusInfo", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetStatusInfo", request, response); err != nil { return } @@ -4732,7 +6068,15 @@ func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, Ne return } -func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) { +// GetStatusInfo is the legacy version of GetStatusInfoCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetStatusInfo() (NewConnectionStatus string, NewLastConnectionError string, NewUptime uint32, err error) { + return client.GetStatusInfoCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetLinkLayerMaxBitRatesCtx( + ctx context.Context, +) (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4746,7 +6090,7 @@ func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRat }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetLinkLayerMaxBitRates", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetLinkLayerMaxBitRates", request, response); err != nil { return } @@ -4762,7 +6106,15 @@ func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRat return } -func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionProtocol string, err error) { +// GetLinkLayerMaxBitRates is the legacy version of GetLinkLayerMaxBitRatesCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetLinkLayerMaxBitRates() (NewUpstreamMaxBitRate uint32, NewDownstreamMaxBitRate uint32, err error) { + return client.GetLinkLayerMaxBitRatesCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPPPEncryptionProtocolCtx( + ctx context.Context, +) (NewPPPEncryptionProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4775,7 +6127,7 @@ func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionPro }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPPPEncryptionProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPEncryptionProtocol", request, response); err != nil { return } @@ -4788,7 +6140,15 @@ func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionPro return } -func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionProtocol string, err error) { +// GetPPPEncryptionProtocol is the legacy version of GetPPPEncryptionProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPPPEncryptionProtocol() (NewPPPEncryptionProtocol string, err error) { + return client.GetPPPEncryptionProtocolCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPPPCompressionProtocolCtx( + ctx context.Context, +) (NewPPPCompressionProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4801,7 +6161,7 @@ func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionP }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPPPCompressionProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPCompressionProtocol", request, response); err != nil { return } @@ -4814,7 +6174,15 @@ func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionP return } -func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthenticationProtocol string, err error) { +// GetPPPCompressionProtocol is the legacy version of GetPPPCompressionProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPPPCompressionProtocol() (NewPPPCompressionProtocol string, err error) { + return client.GetPPPCompressionProtocolCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPPPAuthenticationProtocolCtx( + ctx context.Context, +) (NewPPPAuthenticationProtocol string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4827,7 +6195,7 @@ func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthentic }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPPPAuthenticationProtocol", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPPPAuthenticationProtocol", request, response); err != nil { return } @@ -4840,7 +6208,15 @@ func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthentic return } -func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { +// GetPPPAuthenticationProtocol is the legacy version of GetPPPAuthenticationProtocolCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPPPAuthenticationProtocol() (NewPPPAuthenticationProtocol string, err error) { + return client.GetPPPAuthenticationProtocolCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetUserNameCtx( + ctx context.Context, +) (NewUserName string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4853,7 +6229,7 @@ func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetUserName", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetUserName", request, response); err != nil { return } @@ -4866,7 +6242,15 @@ func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { return } -func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { +// GetUserName is the legacy version of GetUserNameCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetUserName() (NewUserName string, err error) { + return client.GetUserNameCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetPasswordCtx( + ctx context.Context, +) (NewPassword string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4879,7 +6263,7 @@ func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetPassword", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetPassword", request, response); err != nil { return } @@ -4892,7 +6276,15 @@ func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { return } -func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { +// GetPassword is the legacy version of GetPasswordCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetPassword() (NewPassword string, err error) { + return client.GetPasswordCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetAutoDisconnectTimeCtx( + ctx context.Context, +) (NewAutoDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4905,7 +6297,7 @@ func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetAutoDisconnectTime", request, response); err != nil { return } @@ -4918,7 +6310,15 @@ func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime return } -func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { +// GetAutoDisconnectTime is the legacy version of GetAutoDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetAutoDisconnectTime() (NewAutoDisconnectTime uint32, err error) { + return client.GetAutoDisconnectTimeCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetIdleDisconnectTimeCtx( + ctx context.Context, +) (NewIdleDisconnectTime uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4931,7 +6331,7 @@ func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetIdleDisconnectTime", request, response); err != nil { return } @@ -4944,7 +6344,15 @@ func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime return } -func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { +// GetIdleDisconnectTime is the legacy version of GetIdleDisconnectTimeCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetIdleDisconnectTime() (NewIdleDisconnectTime uint32, err error) { + return client.GetIdleDisconnectTimeCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetWarnDisconnectDelayCtx( + ctx context.Context, +) (NewWarnDisconnectDelay uint32, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4957,7 +6365,7 @@ func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDela }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetWarnDisconnectDelay", request, response); err != nil { return } @@ -4970,7 +6378,15 @@ func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDela return } -func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { +// GetWarnDisconnectDelay is the legacy version of GetWarnDisconnectDelayCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetWarnDisconnectDelay() (NewWarnDisconnectDelay uint32, err error) { + return client.GetWarnDisconnectDelayCtx(context.Background()) +} + +func (client *WANPPPConnection1) GetNATRSIPStatusCtx( + ctx context.Context, +) (NewRSIPAvailable bool, NewNATEnabled bool, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -4984,7 +6400,7 @@ func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewN }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetNATRSIPStatus", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetNATRSIPStatus", request, response); err != nil { return } @@ -5000,11 +6416,20 @@ func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewN return } +// GetNATRSIPStatus is the legacy version of GetNATRSIPStatusCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetNATRSIPStatus() (NewRSIPAvailable bool, NewNATEnabled bool, err error) { + return client.GetNATRSIPStatusCtx(context.Background()) +} + // // Return values: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANPPPConnection1) GetGenericPortMappingEntryCtx( + ctx context.Context, + NewPortMappingIndex uint16, +) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewPortMappingIndex string @@ -5029,7 +6454,7 @@ func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetGenericPortMappingEntry", request, response); err != nil { return } @@ -5063,12 +6488,25 @@ func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex return } +// GetGenericPortMappingEntry is the legacy version of GetGenericPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetGenericPortMappingEntry(NewPortMappingIndex uint16) (NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetGenericPortMappingEntryCtx(context.Background(), + NewPortMappingIndex, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { +func (client *WANPPPConnection1) GetSpecificPortMappingEntryCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { // Request structure. request := &struct { NewRemoteHost string @@ -5098,7 +6536,7 @@ func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost strin }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetSpecificPortMappingEntry", request, response); err != nil { return } @@ -5123,12 +6561,32 @@ func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost strin return } +// GetSpecificPortMappingEntry is the legacy version of GetSpecificPortMappingEntryCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetSpecificPortMappingEntry(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32, err error) { + return client.GetSpecificPortMappingEntryCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { +func (client *WANPPPConnection1) AddPortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, + NewInternalPort uint16, + NewInternalClient string, + NewEnabled bool, + NewPortMappingDescription string, + NewLeaseDuration uint32, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -5172,7 +6630,7 @@ func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExterna response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "AddPortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "AddPortMapping", request, response); err != nil { return } @@ -5182,12 +6640,32 @@ func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExterna return } +// AddPortMapping is the legacy version of AddPortMappingCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) AddPortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string, NewInternalPort uint16, NewInternalClient string, NewEnabled bool, NewPortMappingDescription string, NewLeaseDuration uint32) (err error) { + return client.AddPortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + NewInternalPort, + NewInternalClient, + NewEnabled, + NewPortMappingDescription, + NewLeaseDuration, + ) +} + // // Arguments: // // * NewProtocol: allowed values: TCP, UDP -func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { +func (client *WANPPPConnection1) DeletePortMappingCtx( + ctx context.Context, + NewRemoteHost string, + NewExternalPort uint16, + NewProtocol string, +) (err error) { // Request structure. request := &struct { NewRemoteHost string @@ -5211,7 +6689,7 @@ func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExte response := interface{}(nil) // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "DeletePortMapping", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "DeletePortMapping", request, response); err != nil { return } @@ -5221,7 +6699,19 @@ func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExte return } -func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { +// DeletePortMapping is the legacy version of DeletePortMappingCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) DeletePortMapping(NewRemoteHost string, NewExternalPort uint16, NewProtocol string) (err error) { + return client.DeletePortMappingCtx(context.Background(), + NewRemoteHost, + NewExternalPort, + NewProtocol, + ) +} + +func (client *WANPPPConnection1) GetExternalIPAddressCtx( + ctx context.Context, +) (NewExternalIPAddress string, err error) { // Request structure. request := interface{}(nil) // BEGIN Marshal arguments into request. @@ -5234,7 +6724,7 @@ func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress st }{} // Perform the SOAP call. - if err = client.SOAPClient.PerformAction(URN_WANPPPConnection_1, "GetExternalIPAddress", request, response); err != nil { + if err = client.SOAPClient.PerformActionCtx(ctx, URN_WANPPPConnection_1, "GetExternalIPAddress", request, response); err != nil { return } @@ -5246,3 +6736,9 @@ func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress st // END Unmarshal arguments from response. return } + +// GetExternalIPAddress is the legacy version of GetExternalIPAddressCtx, but uses +// context.Background() as the context. +func (client *WANPPPConnection1) GetExternalIPAddress() (NewExternalIPAddress string, err error) { + return client.GetExternalIPAddressCtx(context.Background()) +}