Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/VideoSubscriberAccount/VSAccountMetadataRequest.cs
Original file line number Diff line number Diff line change
@@ -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 ();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
2 changes: 2 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,8 @@ USERNOTIFICATIONS_SOURCES = \

VIDEOSUBSCRIBERACCOUNT_SOURCES = \
VideoSubscriberAccount/VSAccountManager.cs \
VideoSubscriberAccount/VSAccountMetadataRequest.cs \
VideoSubscriberAccount/VSAccountProviderAuthenticationScheme.cs \

# VideoToolbox

Expand Down
43 changes: 43 additions & 0 deletions src/videosubscriberaccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -67,6 +71,9 @@ interface VSErrorInfo {
string SamlResponseStatus { get; }

string UnsupportedProviderIdentifier { get; }

[TV (10,1)][iOS (10,2)]
string AccountProviderResponse { get; }
}

interface IVSAccountManagerDelegate { }
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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,
}

}

6 changes: 6 additions & 0 deletions tests/introspection/iOS/iOSApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down