public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("SamplingStrategyResponse");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                field.Name = "strategyType";
                field.Type = TType.I32;
                field.ID   = 1;
                await oprot.WriteFieldBeginAsync(field, cancellationToken);

                await oprot.WriteI32Async((int)StrategyType, cancellationToken);

                await oprot.WriteFieldEndAsync(cancellationToken);

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

                    await ProbabilisticSampling.WriteAsync(oprot, cancellationToken);

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

                    await RateLimitingSampling.WriteAsync(oprot, cancellationToken);

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

                    await OperationSampling.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                hashcode = (hashcode * 397) + StrategyType.GetHashCode();
                if ((ProbabilisticSampling != null) && __isset.probabilisticSampling)
                {
                    hashcode = (hashcode * 397) + ProbabilisticSampling.GetHashCode();
                }
                if ((RateLimitingSampling != null) && __isset.rateLimitingSampling)
                {
                    hashcode = (hashcode * 397) + RateLimitingSampling.GetHashCode();
                }
                if ((OperationSampling != null) && __isset.operationSampling)
                {
                    hashcode = (hashcode * 397) + OperationSampling.GetHashCode();
                }
            }
            return(hashcode);
        }
        public override string ToString()
        {
            var sb = new StringBuilder("SamplingStrategyResponse(");

            sb.Append(", StrategyType: ");
            sb.Append(StrategyType);
            if (ProbabilisticSampling != null && __isset.probabilisticSampling)
            {
                sb.Append(", ProbabilisticSampling: ");
                sb.Append(ProbabilisticSampling == null ? "<null>" : ProbabilisticSampling.ToString());
            }
            if (RateLimitingSampling != null && __isset.rateLimitingSampling)
            {
                sb.Append(", RateLimitingSampling: ");
                sb.Append(RateLimitingSampling == null ? "<null>" : RateLimitingSampling.ToString());
            }
            if (OperationSampling != null && __isset.operationSampling)
            {
                sb.Append(", OperationSampling: ");
                sb.Append(OperationSampling == null ? "<null>" : OperationSampling.ToString());
            }
            sb.Append(")");
            return(sb.ToString());
        }
        public override string ToString()
        {
            var sb = new StringBuilder("SamplingStrategyResponse(");

            sb.Append(", StrategyType: ");
            StrategyType.ToString(sb);
            if ((ProbabilisticSampling != null) && __isset.probabilisticSampling)
            {
                sb.Append(", ProbabilisticSampling: ");
                ProbabilisticSampling.ToString(sb);
            }
            if ((RateLimitingSampling != null) && __isset.rateLimitingSampling)
            {
                sb.Append(", RateLimitingSampling: ");
                RateLimitingSampling.ToString(sb);
            }
            if ((OperationSampling != null) && __isset.operationSampling)
            {
                sb.Append(", OperationSampling: ");
                OperationSampling.ToString(sb);
            }
            sb.Append(')');
            return(sb.ToString());
        }