예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataType" /> class.
        /// </summary>
        /// <param name="href">href.</param>
        /// <param name="typeValueRange">typeValueRange (required).</param>
        /// <param name="id">id (required).</param>
        /// <param name="displayName">displayName (required).</param>
        /// <param name="description">description (required).</param>
        /// <param name="valueType">valueType (required).</param>
        /// <param name="acceptableValues">acceptableValues.</param>
        /// <param name="unitSchema">unitSchema.</param>
        /// <param name="acceptableUnits">acceptableUnits.</param>
        /// <param name="links">links.</param>
        public DataType(string href = default(string), TypeValueRangeEnum typeValueRange = default(TypeValueRangeEnum), ResourceId id = default(ResourceId), string displayName = default(string), string description = default(string), ValueTypeEnum valueType = default(ValueTypeEnum), List <Object> acceptableValues = default(List <Object>), UnitSchemaEnum?unitSchema = default(UnitSchemaEnum?), List <IUnitDefinitionDto> acceptableUnits = default(List <IUnitDefinitionDto>), List <Link> links = default(List <Link>))
        {
            // to ensure "typeValueRange" is required (not null)
            if (typeValueRange == null)
            {
                throw new InvalidDataException("typeValueRange is a required property for DataType and cannot be null");
            }
            else
            {
                this.TypeValueRange = typeValueRange;
            }

            // to ensure "id" is required (not null)
            if (id == null)
            {
                throw new InvalidDataException("id is a required property for DataType and cannot be null");
            }
            else
            {
                this.Id = id;
            }

            // to ensure "displayName" is required (not null)
            if (displayName == null)
            {
                throw new InvalidDataException("displayName is a required property for DataType and cannot be null");
            }
            else
            {
                this.DisplayName = displayName;
            }

            // to ensure "description" is required (not null)
            if (description == null)
            {
                throw new InvalidDataException("description is a required property for DataType and cannot be null");
            }
            else
            {
                this.Description = description;
            }

            // to ensure "valueType" is required (not null)
            if (valueType == null)
            {
                throw new InvalidDataException("valueType is a required property for DataType and cannot be null");
            }
            else
            {
                this.ValueType = valueType;
            }

            this.Href             = href;
            this.AcceptableValues = acceptableValues;
            this.UnitSchema       = unitSchema;
            this.AcceptableUnits  = acceptableUnits;
            this.Links            = links;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UpdateDataTypeRequest" /> class.
        /// </summary>
        /// <param name="typeValueRange">The available values are: Open, Closed (required).</param>
        /// <param name="displayName">displayName (required).</param>
        /// <param name="description">description (required).</param>
        /// <param name="valueType">The available values are: String, Int, Decimal, DateTime, Boolean, Map, List, PropertyArray, Percentage, Code, Id, Uri, CurrencyAndAmount, TradePrice, Currency, MetricValue, ResourceId, ResultValue, CutLocalTime, DateOrCutLabel (required).</param>
        /// <param name="acceptableValues">acceptableValues.</param>
        /// <param name="unitSchema">The available values are: NoUnits, Basic, Iso4217Currency.</param>
        /// <param name="acceptableUnits">acceptableUnits.</param>
        public UpdateDataTypeRequest(TypeValueRangeEnum typeValueRange = default(TypeValueRangeEnum), string displayName = default(string), string description = default(string), ValueTypeEnum valueType = default(ValueTypeEnum), List <string> acceptableValues = default(List <string>), UnitSchemaEnum?unitSchema = default(UnitSchemaEnum?), List <CreateUnitDefinition> acceptableUnits = default(List <CreateUnitDefinition>))
        {
            // to ensure "typeValueRange" is required (not null)
            if (typeValueRange == null)
            {
                throw new InvalidDataException("typeValueRange is a required property for UpdateDataTypeRequest and cannot be null");
            }
            else
            {
                this.TypeValueRange = typeValueRange;
            }

            // to ensure "displayName" is required (not null)
            if (displayName == null)
            {
                throw new InvalidDataException("displayName is a required property for UpdateDataTypeRequest and cannot be null");
            }
            else
            {
                this.DisplayName = displayName;
            }

            // to ensure "description" is required (not null)
            if (description == null)
            {
                throw new InvalidDataException("description is a required property for UpdateDataTypeRequest and cannot be null");
            }
            else
            {
                this.Description = description;
            }

            // to ensure "valueType" is required (not null)
            if (valueType == null)
            {
                throw new InvalidDataException("valueType is a required property for UpdateDataTypeRequest and cannot be null");
            }
            else
            {
                this.ValueType = valueType;
            }

            this.AcceptableValues = acceptableValues;
            this.AcceptableUnits  = acceptableUnits;
            this.AcceptableValues = acceptableValues;
            this.UnitSchema       = unitSchema;
            this.AcceptableUnits  = acceptableUnits;
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataType" /> class.
 /// </summary>
 /// <param name="href">href.</param>
 /// <param name="typeValueRange">The available values are: Open, Closed (required).</param>
 /// <param name="id">id (required).</param>
 /// <param name="displayName">displayName (required).</param>
 /// <param name="description">description (required).</param>
 /// <param name="valueType">The available values are: String, Int, Decimal, DateTime, Boolean, Map, List, PropertyArray, Percentage, Code, Id, Uri, CurrencyAndAmount, TradePrice, Currency, MetricValue, ResourceId, ResultValue, CutLocalTime, DateOrCutLabel (required).</param>
 /// <param name="acceptableValues">acceptableValues.</param>
 /// <param name="unitSchema">The available values are: NoUnits, Basic, Iso4217Currency.</param>
 /// <param name="acceptableUnits">acceptableUnits.</param>
 /// <param name="referenceData">referenceData.</param>
 /// <param name="links">Collection of links..</param>
 public DataType(string href = default(string), TypeValueRangeEnum typeValueRange = default(TypeValueRangeEnum), ResourceId id = default(ResourceId), string displayName = default(string), string description = default(string), ValueTypeEnum valueType = default(ValueTypeEnum), List <string> acceptableValues = default(List <string>), UnitSchemaEnum?unitSchema = default(UnitSchemaEnum?), List <IUnitDefinitionDto> acceptableUnits = default(List <IUnitDefinitionDto>), ReferenceData referenceData = default(ReferenceData), List <Link> links = default(List <Link>))
 {
     this.TypeValueRange = typeValueRange;
     // to ensure "id" is required (not null)
     this.Id = id ?? throw new ArgumentNullException("id is a required property for DataType and cannot be null");
     // to ensure "displayName" is required (not null)
     this.DisplayName = displayName ?? throw new ArgumentNullException("displayName is a required property for DataType and cannot be null");
     // to ensure "description" is required (not null)
     this.Description      = description ?? throw new ArgumentNullException("description is a required property for DataType and cannot be null");
     this.ValueType        = valueType;
     this.Href             = href;
     this.AcceptableValues = acceptableValues;
     this.UnitSchema       = unitSchema;
     this.AcceptableUnits  = acceptableUnits;
     this.ReferenceData    = referenceData;
     this.Links            = links;
 }