Exemplo n.º 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));
        }
Exemplo n.º 2
0
        internal CommunicationIdentityAccessTokenResult(CommunicationIdentity identity)
        {
            if (identity == null)
            {
                throw new ArgumentNullException(nameof(identity));
            }

            Identity = identity;
        }
Exemplo n.º 3
0
 internal CommunicationIdentityAccessTokenResult(CommunicationIdentity identity, CommunicationIdentityAccessToken accessToken)
 {
     Identity    = identity;
     AccessToken = accessToken;
 }