using System;

using GEst.Common;
using GEst.Common.Collections;
using GEst.Entities;
using GEst.Common.Fields;
using GEst.Expression;

namespace VCLib.Entities
{
    /// <summary>
    /// Метод веб-службы
    /// </summary>
    [Serializable]
    public class CUSTOM_WEBSERVICE_METHOD : VCLibDataObject
    {
        #region Constructors
        public CUSTOM_WEBSERVICE_METHOD()
            : base(CUSTOM_WEBSERVICE_METHOD._Entity)
        {
        }
        protected CUSTOM_WEBSERVICE_METHOD(string DataName)
            : base(DataName)
        {
        }
        protected CUSTOM_WEBSERVICE_METHOD(GEst.Description.IObjectDescription od, Apartment apartment, object pkValue)
            : base(od, apartment, pkValue)
        {
        }
        protected CUSTOM_WEBSERVICE_METHOD(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        {
        }
        protected override BaseObject KernelGetObject(GEst.Description.IObjectDescription od, Apartment apartment, object pkValue)
        {
            return new CUSTOM_WEBSERVICE_METHOD(od, apartment, pkValue);
        }
        protected override BaseObject KernelGetObject()
        {
            return new CUSTOM_WEBSERVICE_METHOD(DataName);
        }
        #endregion

        #region Attributes
        /// <summary>
        /// Идентификатор
        /// </summary>
        public const string aCustomWebserviceMethodID = "CustomWebserviceMethodID";
        /// <summary>
        /// Идентификатор
        /// </summary>
        public static readonly StepString siaCustomWebserviceMethodID = new StepString(aCustomWebserviceMethodID);
        /// <summary>
        /// Идентификатор
        /// </summary>
        public GuidField CustomWebserviceMethodID
        {
            get
            {
                return (GuidField)Fields[aCustomWebserviceMethodID];
            }
        }
        /// <summary>
        /// Описание
        /// </summary>
        public const string aDescr = "Descr";
        /// <summary>
        /// Описание
        /// </summary>
        public static readonly StepString siaDescr = new StepString(aDescr);
        /// <summary>
        /// Описание
        /// </summary>
        public StringField Descr
        {
            get
            {
                return (StringField)Fields[aDescr];
            }
        }
        /// <summary>
        /// Лексема обработки запроса
        /// </summary>
        public const string aMethodLexem = "MethodLexem";
        /// <summary>
        /// Лексема обработки запроса
        /// </summary>
        public static readonly StepString siaMethodLexem = new StepString(aMethodLexem);
        /// <summary>
        /// Лексема обработки запроса
        /// </summary>
        public StringField MethodLexem
        {
            get
            {
                return (StringField)Fields[aMethodLexem];
            }
        }
        /// <summary>
        /// Требуется аутентификация
        /// </summary>
        public const string aNeedAuth = "NeedAuth";
        /// <summary>
        /// Требуется аутентификация
        /// </summary>
        public static readonly StepString siaNeedAuth = new StepString(aNeedAuth);
        /// <summary>
        /// Требуется аутентификация
        /// </summary>
        public BoolField NeedAuth
        {
            get
            {
                return (BoolField)Fields[aNeedAuth];
            }
        }
        /// <summary>
        /// Путь
        /// </summary>
        public const string aPath = "Path";
        /// <summary>
        /// Путь
        /// </summary>
        public static readonly StepString siaPath = new StepString(aPath);
        /// <summary>
        /// Путь
        /// </summary>
        public StringField Path
        {
            get
            {
                return (StringField)Fields[aPath];
            }
        }
        /// <summary>
        /// Тип передаваемого объекта
        /// </summary>
        public const string aContentType = "ContentType";
        /// <summary>
        /// Тип передаваемого объекта
        /// </summary>
        public static readonly StepString siaContentType = new StepString(aContentType);
        /// <summary>
        /// Тип передаваемого объекта
        /// </summary>
        public StringField ContentType
        {
            get
            {
                return (StringField)Fields[aContentType];
            }
        }
        /// <summary>
        /// Тип кодировки
        /// </summary>
        public const string aContentEncoding = "ContentEncoding";
        /// <summary>
        /// Тип кодировки
        /// </summary>
        public static readonly StepString siaContentEncoding = new StepString(aContentEncoding);
        /// <summary>
        /// Тип кодировки
        /// </summary>
        public StringField ContentEncoding
        {
            get
            {
                return (StringField)Fields[aContentEncoding];
            }
        }
        /// <summary>
        /// Дерево атрибутов входящего объекта
        /// </summary>
        public const string aInputAttributePaths = "InputAttributePaths";
        /// <summary>
        /// Дерево атрибутов входящего объекта
        /// </summary>
        public static readonly StepString siaInputAttributePaths = new StepString(aInputAttributePaths);
        /// <summary>
        /// Дерево атрибутов входящего объекта
        /// </summary>
        public StringField InputAttributePaths
        {
            get
            {
                return (StringField)Fields[aInputAttributePaths];
            }
        }
        /// <summary>
        /// Дерево атрибутов исходящего объекта
        /// </summary>
        public const string aOutputAttributePahs = "OutputAttributePahs";
        /// <summary>
        /// Дерево атрибутов исходящего объекта
        /// </summary>
        public static readonly StepString siaOutputAttributePahs = new StepString(aOutputAttributePahs);
        /// <summary>
        /// Дерево атрибутов исходящего объекта
        /// </summary>
        public StringField OutputAttributePahs
        {
            get
            {
                return (StringField)Fields[aOutputAttributePahs];
            }
        }
        #endregion

        #region Choices
        /// <summary>
        /// Тип метода
        /// </summary>
        public const string chMethodType = "MethodType";
        /// <summary>
        /// Тип метода
        /// </summary>
        public static readonly StepString sichMethodType = new StepString(chMethodType);
        /// <summary>
        /// Тип метода
        /// </summary>
        public ChoiceField MethodType
        {
            get
            {
                return (ChoiceField)Fields[chMethodType];
            }
        }
        /// <summary>
        /// Тип метода
        /// </summary>
        public static class _MethodType
        {
            /// <summary>
            /// GET
            /// </summary>
            public const int _0 = 0;
            /// <summary>
            /// POST
            /// </summary>
            public const int _1 = 1;
            /// <summary>
            /// HEAD
            /// </summary>
            public const int _2 = 2;
            /// <summary>
            /// PUT
            /// </summary>
            public const int _3 = 3;
            /// <summary>
            /// DELETE
            /// </summary>
            public const int _4 = 4;
            /// <summary>
            /// CONNECT
            /// </summary>
            public const int _5 = 5;
            /// <summary>
            /// OPTIONS
            /// </summary>
            public const int _6 = 6;
            /// <summary>
            /// TRACE
            /// </summary>
            public const int _7 = 7;
            /// <summary>
            /// PATCH
            /// </summary>
            public const int _8 = 8;
        }
        /// <summary>
        /// Формат обработки тела вызова
        /// </summary>
        public const string chBodyFormat = "BodyFormat";
        /// <summary>
        /// Формат обработки тела вызова
        /// </summary>
        public static readonly StepString sichBodyFormat = new StepString(chBodyFormat);
        /// <summary>
        /// Формат обработки тела вызова
        /// </summary>
        public ChoiceField BodyFormat
        {
            get
            {
                return (ChoiceField)Fields[chBodyFormat];
            }
        }
        /// <summary>
        /// Формат обработки тела вызова
        /// </summary>
        public static class _BodyFormat
        {
            /// <summary>
            /// string
            /// </summary>
            public const int _0 = 0;
            /// <summary>
            /// Dictionary
            /// </summary>
            public const int _1 = 1;
            /// <summary>
            /// BaseObject
            /// </summary>
            public const int _2 = 2;
        }
        #endregion

        #region Parents
        /// <summary>
        /// Настраиваемая веб-служба
        /// </summary>
        public const string pCustomWebservice = "CustomWebservice";
        /// <summary>
        /// Настраиваемая веб-служба
        /// </summary>
        public static readonly StepString sipCustomWebservice = new StepString(pCustomWebservice);
        /// <summary>
        /// Настраиваемая веб-служба
        /// </summary>
        public CUSTOM_WEBSERVICE CustomWebservice
        {
            get
            {
                return (CUSTOM_WEBSERVICE)Fields[pCustomWebservice].Value;
            }
            set
            {
                Fields[pCustomWebservice].Value = value;
            }
        }
        /// <summary>
        /// Сущность для вебсервисов
        /// </summary>
        public const string pInputWebServiceEntity = "InputWebServiceEntity";
        /// <summary>
        /// Сущность для вебсервисов
        /// </summary>
        public static readonly StepString sipInputWebServiceEntity = new StepString(pInputWebServiceEntity);
        /// <summary>
        /// Сущность для вебсервисов
        /// </summary>
        public CUSTOM_WEBSERVICE_ENTITY InputWebServiceEntity
        {
            get
            {
                return (CUSTOM_WEBSERVICE_ENTITY)Fields[pInputWebServiceEntity].Value;
            }
            set
            {
                Fields[pInputWebServiceEntity].Value = value;
            }
        }
        /// <summary>
        /// Сущность для вебсервисов
        /// </summary>
        public const string pOutputWebServiceEntity = "OutputWebServiceEntity";
        /// <summary>
        /// Сущность для вебсервисов
        /// </summary>
        public static readonly StepString sipOutputWebServiceEntity = new StepString(pOutputWebServiceEntity);
        /// <summary>
        /// Сущность для вебсервисов
        /// </summary>
        public CUSTOM_WEBSERVICE_ENTITY OutputWebServiceEntity
        {
            get
            {
                return (CUSTOM_WEBSERVICE_ENTITY)Fields[pOutputWebServiceEntity].Value;
            }
            set
            {
                Fields[pOutputWebServiceEntity].Value = value;
            }
        }
        #endregion

        #region Links
        #endregion

        #region Children
        /// <summary>
        /// Параметры для методов настраиваемых вебслужб
        /// </summary>
        public const string cCustomWebserviceMethodParameters = "CustomWebserviceMethodParameters";
        /// <summary>
        /// Параметры для методов настраиваемых вебслужб
        /// </summary>
        public static readonly StepString sicCustomWebserviceMethodParameters = new StepString(cCustomWebserviceMethodParameters);
        /// <summary>
        /// Параметры для методов настраиваемых вебслужб
        /// </summary>
        public ChildList CustomWebserviceMethodParameters
        {
            get
            {
                return (ChildList)Fields[cCustomWebserviceMethodParameters];
            }
        }
        #endregion

        #region Calculating Attributes
        #endregion

        #region Description
        /// <summary>
        /// Entity description
        /// </summary>
        public const string ObjectDescription = "Метод веб-службы";
        #endregion

        #region EntityName
        /// <summary>
        /// Entity name
        /// </summary>
        public const string _Entity = "VCLib.CUSTOM_WEBSERVICE_METHOD";
        #endregion

        protected override void Initialize()
        {
            base.Initialize();
            this.NeedAuth.Value = false;
            this.MethodType.Value = _MethodType._0;
        }
    }
}
