2016-10-29 22:22:20 +00:00
|
|
|
using System.Collections.Generic;
|
2019-01-13 19:16:19 +00:00
|
|
|
using Emby.Dlna.Common;
|
2020-09-13 13:36:10 +00:00
|
|
|
using MediaBrowser.Model.Dlna;
|
2016-10-29 22:22:20 +00:00
|
|
|
|
2016-10-29 22:34:54 +00:00
|
|
|
namespace Emby.Dlna.MediaReceiverRegistrar
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="ServiceActionListBuilder" />.
|
|
|
|
/// </summary>
|
|
|
|
public static class ServiceActionListBuilder
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns a list of services that this instance provides.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>An <see cref="IEnumerable{ServiceAction}"/>.</returns>
|
|
|
|
public static IEnumerable<ServiceAction> GetActions()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2019-01-13 19:16:19 +00:00
|
|
|
return new[]
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
GetIsValidated(),
|
|
|
|
GetIsAuthorized(),
|
|
|
|
GetRegisterDevice(),
|
|
|
|
GetGetAuthorizationDeniedUpdateID(),
|
|
|
|
GetGetAuthorizationGrantedUpdateID(),
|
|
|
|
GetGetValidationRevokedUpdateID(),
|
|
|
|
GetGetValidationSucceededUpdateID()
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "IsValidated".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
2019-01-06 20:50:43 +00:00
|
|
|
private static ServiceAction GetIsValidated()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "IsValidated"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "DeviceID",
|
|
|
|
Direction = "in"
|
|
|
|
});
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "Result",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "IsAuthorized".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
2019-01-06 20:50:43 +00:00
|
|
|
private static ServiceAction GetIsAuthorized()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "IsAuthorized"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "DeviceID",
|
|
|
|
Direction = "in"
|
|
|
|
});
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "Result",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "RegisterDevice".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
2019-01-06 20:50:43 +00:00
|
|
|
private static ServiceAction GetRegisterDevice()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "RegisterDevice"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "RegistrationReqMsg",
|
|
|
|
Direction = "in"
|
|
|
|
});
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "RegistrationRespMsg",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "GetValidationSucceededUpdateID".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
2019-01-06 20:50:43 +00:00
|
|
|
private static ServiceAction GetGetValidationSucceededUpdateID()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "GetValidationSucceededUpdateID"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "ValidationSucceededUpdateID",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "GetGetAuthorizationDeniedUpdateID".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
|
|
|
private static ServiceAction GetGetAuthorizationDeniedUpdateID()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "GetAuthorizationDeniedUpdateID"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "AuthorizationDeniedUpdateID",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "GetValidationRevokedUpdateID".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
|
|
|
private static ServiceAction GetGetValidationRevokedUpdateID()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "GetValidationRevokedUpdateID"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "ValidationRevokedUpdateID",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2020-09-13 13:36:10 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Returns the action details for "GetAuthorizationGrantedUpdateID".
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="ServiceAction"/>.</returns>
|
|
|
|
private static ServiceAction GetGetAuthorizationGrantedUpdateID()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
var action = new ServiceAction
|
|
|
|
{
|
|
|
|
Name = "GetAuthorizationGrantedUpdateID"
|
|
|
|
};
|
|
|
|
|
|
|
|
action.ArgumentList.Add(new Argument
|
|
|
|
{
|
|
|
|
Name = "AuthorizationGrantedUpdateID",
|
|
|
|
Direction = "out"
|
|
|
|
});
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|