示例#1
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("PaidCallResponse");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (Host != null && __isset.host)
         {
             field.Name = "host";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             Host.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Dialing != null && __isset.dialing)
         {
             field.Name = "dialing";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             Dialing.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Token != null && __isset.token)
         {
             field.Name = "token";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Token);
             oprot.WriteFieldEnd();
         }
         if (SpotItems != null && __isset.spotItems)
         {
             field.Name = "spotItems";
             field.Type = TType.List;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, SpotItems.Count));
                 foreach (SpotItem _iter110 in SpotItems)
                 {
                     _iter110.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
示例#2
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("PaidCallResponse(");
        bool __first = true;

        if (Host != null && __isset.host)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Host: ");
            sb.Append(Host == null ? "<null>" : Host.ToString());
        }
        if (Dialing != null && __isset.dialing)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Dialing: ");
            sb.Append(Dialing == null ? "<null>" : Dialing.ToString());
        }
        if (Token != null && __isset.token)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Token: ");
            sb.Append(Token);
        }
        if (SpotItems != null && __isset.spotItems)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SpotItems: ");
            sb.Append(SpotItems);
        }
        sb.Append(")");
        return(sb.ToString());
    }
示例#3
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.host)
            {
                hashcode = (hashcode * 397) + Host.GetHashCode();
            }
            if (__isset.dialing)
            {
                hashcode = (hashcode * 397) + Dialing.GetHashCode();
            }
            if (__isset.token)
            {
                hashcode = (hashcode * 397) + Token.GetHashCode();
            }
            if (__isset.spotItems)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(SpotItems);
            }
        }
        return(hashcode);
    }
示例#4
0
    public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
    {
        oprot.IncrementRecursionDepth();
        try
        {
            var struc = new TStruct("PaidCallResponse");
            await oprot.WriteStructBeginAsync(struc, cancellationToken);

            var field = new TField();
            if (Host != null && __isset.host)
            {
                field.Name = "host";
                field.Type = TType.Struct;
                field.ID   = 1;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await Host.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (Dialing != null && __isset.dialing)
            {
                field.Name = "dialing";
                field.Type = TType.Struct;
                field.ID   = 2;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await Dialing.WriteAsync(oprot, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (Token != null && __isset.token)
            {
                field.Name = "token";
                field.Type = TType.String;
                field.ID   = 3;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteStringAsync(Token, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            if (SpotItems != null && __isset.spotItems)
            {
                field.Name = "spotItems";
                field.Type = TType.List;
                field.ID   = 4;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                {
                    await oprot.WriteListBeginAsync(new TList(TType.Struct, SpotItems.Count), cancellationToken);

                    foreach (SpotItem _iter35 in SpotItems)
                    {
                        await _iter35.WriteAsync(oprot, cancellationToken);
                    }
                    await oprot.WriteListEndAsync(cancellationToken);
                }
                await oprot.WriteFieldEndAsync(cancellationToken);
            }
            await oprot.WriteFieldStopAsync(cancellationToken);

            await oprot.WriteStructEndAsync(cancellationToken);
        }
        finally
        {
            oprot.DecrementRecursionDepth();
        }
    }