/**********************************************************************************
* Blueprint Reality Inc. CONFIDENTIAL
* 2021 Blueprint Reality Inc.
* All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains, the property of
* Blueprint Reality Inc. and its suppliers, if any.  The intellectual and
* technical concepts contained herein are proprietary to Blueprint Reality Inc.
* and its suppliers and may be covered by Patents, pending patents, and are
* protected by trade secret or copyright law.
*
* Dissemination of this information or reproduction of this material is strictly
* forbidden unless prior written permission is obtained from Blueprint Reality Inc.
***********************************************************************************/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Thrift;
using Thrift.Collections;
using System.Runtime.Serialization;
using Thrift.Protocol;
using Thrift.Transport;
using Thrift.Proxy;

namespace BlueprintReality.MixCast.Shared
{

  #if !SILVERLIGHT
  [Serializable]
  #endif
  public partial class VideoInput : TBase
  {
    private string _identifier;
    private double _fieldOfView;
    private BlueprintReality.Thrift.Vector3 _currentPosition;
    private BlueprintReality.Thrift.Quaternion _currentRotation;
    private bool _projectToUser;
    private List<string> _projectToCameras;

    public string Identifier
    {
      get
      {
        return _identifier;
      }
      set
      {
        __isset.identifier = true;
        this._identifier = value;
      }
    }

    public double FieldOfView
    {
      get
      {
        return _fieldOfView;
      }
      set
      {
        __isset.fieldOfView = true;
        this._fieldOfView = value;
      }
    }

    public BlueprintReality.Thrift.Vector3 CurrentPosition
    {
      get
      {
        return _currentPosition;
      }
      set
      {
        __isset.currentPosition = true;
        this._currentPosition = value;
      }
    }

    public BlueprintReality.Thrift.Quaternion CurrentRotation
    {
      get
      {
        return _currentRotation;
      }
      set
      {
        __isset.currentRotation = true;
        this._currentRotation = value;
      }
    }

    public bool ProjectToUser
    {
      get
      {
        return _projectToUser;
      }
      set
      {
        __isset.projectToUser = true;
        this._projectToUser = value;
      }
    }

    public List<string> ProjectToCameras
    {
      get
      {
        return _projectToCameras;
      }
      set
      {
        __isset.projectToCameras = true;
        this._projectToCameras = value;
      }
    }


    public Isset __isset;
    #if !SILVERLIGHT
    [Serializable]
    #endif
    public struct Isset {
      public bool identifier;
      public bool fieldOfView;
      public bool currentPosition;
      public bool currentRotation;
      public bool projectToUser;
      public bool projectToCameras;
    }

    public VideoInput() {
    }

    public void Read (TProtocol iprot)
    {
      iprot.IncrementRecursionDepth();
      try
      {
        TField field;
        iprot.ReadStructBegin();
        while (true)
        {
          field = iprot.ReadFieldBegin();
          if (field.Type == TType.Stop) { 
            break;
          }
          switch (field.ID)
          {
            case 1:
              if (field.Type == TType.String) {
                Identifier = iprot.ReadString();
              } else { 
                TProtocolUtil.Skip(iprot, field.Type);
              }
              break;
            case 2:
              if (field.Type == TType.Double) {
                FieldOfView = iprot.ReadDouble();
              } else { 
                TProtocolUtil.Skip(iprot, field.Type);
              }
              break;
            case 3:
              if (field.Type == TType.Struct) {
                CurrentPosition = new BlueprintReality.Thrift.Vector3();
                CurrentPosition.Read(iprot);
              } else { 
                TProtocolUtil.Skip(iprot, field.Type);
              }
              break;
            case 4:
              if (field.Type == TType.Struct) {
                CurrentRotation = new BlueprintReality.Thrift.Quaternion();
                CurrentRotation.Read(iprot);
              } else { 
                TProtocolUtil.Skip(iprot, field.Type);
              }
              break;
            case 5:
              if (field.Type == TType.Bool) {
                ProjectToUser = iprot.ReadBool();
              } else { 
                TProtocolUtil.Skip(iprot, field.Type);
              }
              break;
            case 6:
              if (field.Type == TType.List) {
                {
                  ProjectToCameras = new List<string>();
                  TList _list0 = iprot.ReadListBegin();
                  for( int _i1 = 0; _i1 < _list0.Count; ++_i1)
                  {
                    string _elem2;
                    _elem2 = iprot.ReadString();
                    ProjectToCameras.Add(_elem2);
                  }
                  iprot.ReadListEnd();
                }
              } else { 
                TProtocolUtil.Skip(iprot, field.Type);
              }
              break;
            default: 
              TProtocolUtil.Skip(iprot, field.Type);
              break;
          }
          iprot.ReadFieldEnd();
        }
        iprot.ReadStructEnd();
      }
      finally
      {
        iprot.DecrementRecursionDepth();
      }
    }

    public void Write(TProtocol oprot) {
      oprot.IncrementRecursionDepth();
      try
      {
        TStruct struc = new TStruct("VideoInput");
        oprot.WriteStructBegin(struc);
        TField field = new TField();
        if (Identifier != null && __isset.identifier) {
          field.Name = "identifier";
          field.Type = TType.String;
          field.ID = 1;
          oprot.WriteFieldBegin(field);
          oprot.WriteString(Identifier);
          oprot.WriteFieldEnd();
        }
        if (__isset.fieldOfView) {
          field.Name = "fieldOfView";
          field.Type = TType.Double;
          field.ID = 2;
          oprot.WriteFieldBegin(field);
          oprot.WriteDouble(FieldOfView);
          oprot.WriteFieldEnd();
        }
        if (CurrentPosition != null && __isset.currentPosition) {
          field.Name = "currentPosition";
          field.Type = TType.Struct;
          field.ID = 3;
          oprot.WriteFieldBegin(field);
          CurrentPosition.Write(oprot);
          oprot.WriteFieldEnd();
        }
        if (CurrentRotation != null && __isset.currentRotation) {
          field.Name = "currentRotation";
          field.Type = TType.Struct;
          field.ID = 4;
          oprot.WriteFieldBegin(field);
          CurrentRotation.Write(oprot);
          oprot.WriteFieldEnd();
        }
        if (__isset.projectToUser) {
          field.Name = "projectToUser";
          field.Type = TType.Bool;
          field.ID = 5;
          oprot.WriteFieldBegin(field);
          oprot.WriteBool(ProjectToUser);
          oprot.WriteFieldEnd();
        }
        if (ProjectToCameras != null && __isset.projectToCameras) {
          field.Name = "projectToCameras";
          field.Type = TType.List;
          field.ID = 6;
          oprot.WriteFieldBegin(field);
          {
            oprot.WriteListBegin(new TList(TType.String, ProjectToCameras.Count));
            foreach (string _iter3 in ProjectToCameras)
            {
              oprot.WriteString(_iter3);
            }
            oprot.WriteListEnd();
          }
          oprot.WriteFieldEnd();
        }
        oprot.WriteFieldStop();
        oprot.WriteStructEnd();
      }
      finally
      {
        oprot.DecrementRecursionDepth();
      }
    }

    public override string ToString() {
      StringBuilder __sb = new StringBuilder("VideoInput(");
      bool __first = true;
      if (Identifier != null && __isset.identifier) {
        if(!__first) { __sb.Append(", "); }
        __first = false;
        __sb.Append("Identifier: ");
        __sb.Append(Identifier);
      }
      if (__isset.fieldOfView) {
        if(!__first) { __sb.Append(", "); }
        __first = false;
        __sb.Append("FieldOfView: ");
        __sb.Append(FieldOfView);
      }
      if (CurrentPosition != null && __isset.currentPosition) {
        if(!__first) { __sb.Append(", "); }
        __first = false;
        __sb.Append("CurrentPosition: ");
        __sb.Append(CurrentPosition== null ? "<null>" : CurrentPosition.ToString());
      }
      if (CurrentRotation != null && __isset.currentRotation) {
        if(!__first) { __sb.Append(", "); }
        __first = false;
        __sb.Append("CurrentRotation: ");
        __sb.Append(CurrentRotation== null ? "<null>" : CurrentRotation.ToString());
      }
      if (__isset.projectToUser) {
        if(!__first) { __sb.Append(", "); }
        __first = false;
        __sb.Append("ProjectToUser: ");
        __sb.Append(ProjectToUser);
      }
      if (ProjectToCameras != null && __isset.projectToCameras) {
        if(!__first) { __sb.Append(", "); }
        __first = false;
        __sb.Append("ProjectToCameras: ");
        __sb.Append(ProjectToCameras);
      }
      __sb.Append(")");
      return __sb.ToString();
    }

  }

}
