Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VendorModelRule" /> class.
 /// </summary>
 /// <param name="supplier">The available values are: Lusid, RefinitivQps, RefinitivTracsWeb, VolMaster, IsdaCds (required).</param>
 /// <param name="modelName">The vendor library model name (required).</param>
 /// <param name="instrumentType">The vendor library instrument type (required).</param>
 /// <param name="parameters">THIS FIELD IS DEPRECATED - use ModelOptions  The set of opaque model parameters, provided as a Json object, that is a string object which will internally be converted to a dictionary of string to object.  Note that this is not intended as the final form of this object. It will be replaced with a more structured object as the set of parameters that are possible is  better understood..</param>
 /// <param name="modelOptions">modelOptions.</param>
 /// <param name="instrumentId">This field should generally not be required. It indicates a specific case where there is a particular need to make a rule apply to only a single instrument  specified by an identifier on that instrument such as its LUID. One particular example would be to control the behaviour of a look-through portfolio scaling  methodology, such as where there is a mixture of indices and credit-debit portfolios where scaling on the sum of valuation would be deemed incorrectly for one  set but desired in general..</param>
 public VendorModelRule(SupplierEnum supplier = default(SupplierEnum), string modelName = default(string), string instrumentType = default(string), string parameters = default(string), ModelOptions modelOptions = default(ModelOptions), string instrumentId = default(string))
 {
     this.Supplier = supplier;
     // to ensure "modelName" is required (not null)
     this.ModelName = modelName ?? throw new ArgumentNullException("modelName is a required property for VendorModelRule and cannot be null");
     // to ensure "instrumentType" is required (not null)
     this.InstrumentType = instrumentType ?? throw new ArgumentNullException("instrumentType is a required property for VendorModelRule and cannot be null");
     this.Parameters     = parameters;
     this.ModelOptions   = modelOptions;
     this.InstrumentId   = instrumentId;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MarketDataKeyRule" /> class.
        /// </summary>
        /// <param name="key">The market data key pattern which this is a rule for. A dot separated string (A.B.C.D.*) (required).</param>
        /// <param name="supplier">The market data supplier (where the data comes from) (required).</param>
        /// <param name="dataScope">The scope in which the data should be found when using this rule. (required).</param>
        /// <param name="quoteType">Is the quote to be looked for a price, yield etc. (required).</param>
        /// <param name="field">The conceptual qualification for the field, such as bid, mid, or ask.   The field must be one of a defined set for the given supplier, in the same way as it  is for the Finbourne.WebApi.Interface.Dto.Quotes.QuoteSeriesId (required).</param>
        public MarketDataKeyRule(string key = default(string), SupplierEnum supplier = default(SupplierEnum), string dataScope = default(string), QuoteTypeEnum quoteType = default(QuoteTypeEnum), string field = default(string))
        {
            // to ensure "key" is required (not null)
            if (key == null)
            {
                throw new InvalidDataException("key is a required property for MarketDataKeyRule and cannot be null");
            }
            else
            {
                this.Key = key;
            }

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

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

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

            // to ensure "field" is required (not null)
            if (field == null)
            {
                throw new InvalidDataException("field is a required property for MarketDataKeyRule and cannot be null");
            }
            else
            {
                this.Field = field;
            }
        }
        public static ISupplierRepository Generate(SupplierEnum supplierType)
        {
            //因為A跟B的SupplierRepository都有實做ISupplierRepository
            //所以這邊可以直接回傳介面,也間接地規範以後新增SupplierRepository都要實作ISupplierRepository介面
            switch (supplierType)
            {
            case SupplierEnum.A:
                return(new ASupplierRepository());

            case SupplierEnum.B:
                return(new BSupplierRepository());
            }

            return(null);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VendorModelRule" /> class.
        /// </summary>
        /// <param name="supplier">The vendor library supplier (required).</param>
        /// <param name="modelName">The vendor library model name (required).</param>
        /// <param name="instrumentType">The vendor library instrument type (required).</param>
        /// <param name="parameters">The set of opaque model parameters, provided as a Json object, that is a string object which will internally be converted to a dictionary of string to object.  Note that this is not intended as the final form of this object. It will be replaced with a more structured object as the set of parameters that are possible is  better understood. (required).</param>
        public VendorModelRule(SupplierEnum supplier = default(SupplierEnum), string modelName = default(string), string instrumentType = default(string), string parameters = default(string))
        {
            // to ensure "supplier" is required (not null)
            if (supplier == null)
            {
                throw new InvalidDataException("supplier is a required property for VendorModelRule and cannot be null");
            }
            else
            {
                this.Supplier = supplier;
            }

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

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

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