예제 #1
0
        internal static CommunicationIdentityAccessTokenResult DeserializeCommunicationIdentityAccessTokenResult(JsonElement element)
        {
            CommunicationIdentity             identity    = default;
            Optional <CommunicationUserToken> accessToken = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    identity = CommunicationIdentity.DeserializeCommunicationIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("accessToken"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    accessToken = CommunicationUserToken.DeserializeCommunicationUserToken(property.Value);
                    continue;
                }
            }
            return(new CommunicationIdentityAccessTokenResult(identity, accessToken.Value));
        }
예제 #2
0
        internal CommunicationIdentityAccessTokenResult(CommunicationIdentity identity)
        {
            if (identity == null)
            {
                throw new ArgumentNullException(nameof(identity));
            }

            Identity = identity;
        }
예제 #3
0
 internal CommunicationIdentityAccessTokenResult(CommunicationIdentity identity, CommunicationIdentityAccessToken accessToken)
 {
     Identity    = identity;
     AccessToken = accessToken;
 }