From 088cdc89931abdfb6da64fb283ab086267e0fa49 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Thu, 3 Nov 2016 22:25:51 -0400 Subject: [PATCH] [videosubscriberaccount] Small update for Xcode 8.2 beta 1 --- .../VSAccountMetadataRequest.cs | 19 ++++++++ .../VSAccountProviderAuthenticationScheme.cs | 33 ++++++++++++++ src/frameworks.sources | 2 + src/videosubscriberaccount.cs | 43 +++++++++++++++++++ tests/introspection/iOS/iOSApiProtocolTest.cs | 6 +++ 5 files changed, 103 insertions(+) create mode 100644 src/VideoSubscriberAccount/VSAccountMetadataRequest.cs create mode 100644 src/VideoSubscriberAccount/VSAccountProviderAuthenticationScheme.cs diff --git a/src/VideoSubscriberAccount/VSAccountMetadataRequest.cs b/src/VideoSubscriberAccount/VSAccountMetadataRequest.cs new file mode 100644 index 000000000000..1a41cbdf661b --- /dev/null +++ b/src/VideoSubscriberAccount/VSAccountMetadataRequest.cs @@ -0,0 +1,19 @@ +using System; +using System.Threading.Tasks; +using XamCore.ObjCRuntime; + +namespace XamCore.VideoSubscriberAccount { + + public partial class VSAccountMetadataRequest { + + [TV (10,1)][iOS (10,2)] + public VSAccountProviderAuthenticationScheme[] SupportedAuthenticationSchemes { + get { + return VSAccountProviderAuthenticationSchemeExtensions.GetValues (SupportedAuthenticationSchemesString); + } + set { + SupportedAuthenticationSchemesString = value?.GetConstants (); + } + } + } +} diff --git a/src/VideoSubscriberAccount/VSAccountProviderAuthenticationScheme.cs b/src/VideoSubscriberAccount/VSAccountProviderAuthenticationScheme.cs new file mode 100644 index 000000000000..f06a3a8a7a4a --- /dev/null +++ b/src/VideoSubscriberAccount/VSAccountProviderAuthenticationScheme.cs @@ -0,0 +1,33 @@ +using System; +using System.Threading.Tasks; +using XamCore.Foundation; + +namespace XamCore.VideoSubscriberAccount { + + public static partial class VSAccountProviderAuthenticationSchemeExtensions { + + // these are less common pattern so it's not automatically generated + + public static NSString[] GetConstants (this VSAccountProviderAuthenticationScheme[] self) + { + if (self == null) + throw new ArgumentNullException (nameof (self)); + + var array = new NSString [self.Length]; + for (int n = 0; n < self.Length; n++) + array [n] = self [n].GetConstant (); + return array; + } + + public static VSAccountProviderAuthenticationScheme[] GetValues (NSString[] constants) + { + if (constants == null) + throw new ArgumentNullException (nameof (constants)); + + var array = new VSAccountProviderAuthenticationScheme [constants.Length]; + for (int n = 0; n < constants.Length; n++) + array [n] = GetValue (constants [n]); + return array; + } + } +} diff --git a/src/frameworks.sources b/src/frameworks.sources index e1a4bcb24b34..cca4180426a3 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1337,6 +1337,8 @@ USERNOTIFICATIONS_SOURCES = \ VIDEOSUBSCRIBERACCOUNT_SOURCES = \ VideoSubscriberAccount/VSAccountManager.cs \ + VideoSubscriberAccount/VSAccountMetadataRequest.cs \ + VideoSubscriberAccount/VSAccountProviderAuthenticationScheme.cs \ # VideoToolbox diff --git a/src/videosubscriberaccount.cs b/src/videosubscriberaccount.cs index 47b8f4d1ad9a..ec6f425ed46f 100644 --- a/src/videosubscriberaccount.cs +++ b/src/videosubscriberaccount.cs @@ -54,6 +54,10 @@ interface VSErrorInfoKeys { [Field ("VSErrorInfoKeyUnsupportedProviderIdentifier")] NSString UnsupportedProviderIdentifierKey { get; } + + [TV (10,1)][iOS (10,2)] + [Field ("VSErrorInfoKeyAccountProviderResponse")] + NSString AccountProviderResponseKey { get; } } [Introduced (PlatformName.iOS, 10, 0)] @@ -67,6 +71,9 @@ interface VSErrorInfo { string SamlResponseStatus { get; } string UnsupportedProviderIdentifier { get; } + + [TV (10,1)][iOS (10,2)] + string AccountProviderResponse { get; } } interface IVSAccountManagerDelegate { } @@ -154,6 +161,10 @@ interface VSAccountMetadata { [NullAllowed, Export ("SAMLAttributeQueryResponse")] string SamlAttributeQueryResponse { get; } + + [TV (10,1)][iOS (10,2)] + [NullAllowed, Export ("accountProviderResponse", ArgumentSemantic.Strong)] + VSAccountProviderResponse AccountProviderResponse { get; } } [Introduced (PlatformName.iOS, 10, 0)] @@ -188,6 +199,38 @@ interface VSAccountMetadataRequest { [Export ("attributeNames", ArgumentSemantic.Copy)] string [] AttributeNames { get; set; } + + [Protected] + [TV (10,1)][iOS (10,2)] + [Export ("supportedAuthenticationSchemes", ArgumentSemantic.Copy)] + NSString[] SupportedAuthenticationSchemesString { get; set; } + } + + [iOS (10,2)] + [TV (10,1)] + [BaseType (typeof (NSObject))] + interface VSAccountProviderResponse { + + [Protected] + [Export ("authenticationScheme")] + NSString AuthenticationSchemeString { get; } + + [Wrap ("VSAccountProviderAuthenticationSchemeExtensions.GetValue (AuthenticationSchemeString)")] + VSAccountProviderAuthenticationScheme AuthenticationScheme { get; } + + [NullAllowed, Export ("status")] + string Status { get; } + + [NullAllowed, Export ("body")] + string Body { get; } } + + [iOS (10,2)] + [TV (10,1)] + enum VSAccountProviderAuthenticationScheme { + [Field ("VSAccountProviderAuthenticationSchemeSAML")] + Saml, + } + } diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 677b270d7b1e..1ddc34f845a6 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -177,6 +177,8 @@ protected override bool Skip (Type type, string protocolName) case "SFSafariViewControllerConfiguration": case "VSAccountMetadata": case "VSAccountMetadataRequest": + // iOS 10.2 + case "VSAccountProviderResponse": return true; #if __WATCHOS__ case "CLKComplicationTemplate": @@ -274,6 +276,8 @@ protected override bool Skip (Type type, string protocolName) case "SFSafariViewControllerConfiguration": case "VSAccountMetadata": case "VSAccountMetadataRequest": + // iOS 10.2 + case "VSAccountProviderResponse": return true; #if __WATCHOS__ case "CLKComplicationTemplate": @@ -350,6 +354,8 @@ protected override bool Skip (Type type, string protocolName) case "SFSafariViewControllerConfiguration": case "VSAccountMetadata": case "VSAccountMetadataRequest": + // iOS 10.2 + case "VSAccountProviderResponse": return true; #if __WATCHOS__ case "CLKComplicationTimelineEntry":