/// <summary>
 /// Initializes a new instance of the <see cref="CreateRuleRequest" /> class.
 /// </summary>
 /// <param name="OptimisationActionName">OptimisationActionName (required).</param>
 /// <param name="RuleName">The name of the rule (required).</param>
 /// <param name="ReportFilterId">The report filter to use for the rule (required).</param>
 /// <param name="StartUtcDate">The start validity utc date of the rule.</param>
 /// <param name="EndUtcDate">The end validity utc date of the rule.</param>
 public CreateRuleRequest(OptimisationActionName OptimisationActionName = default(OptimisationActionName), string RuleName = default(string), string ReportFilterId = default(string), DateTime?StartUtcDate = default(DateTime?), DateTime?EndUtcDate = default(DateTime?))
 {
     // to ensure "OptimisationActionName" is required (not null)
     if (OptimisationActionName == null)
     {
         throw new InvalidDataException("OptimisationActionName is a required property for CreateRuleRequest and cannot be null");
     }
     else
     {
         this.OptimisationActionName = OptimisationActionName;
     }
     // to ensure "RuleName" is required (not null)
     if (RuleName == null)
     {
         throw new InvalidDataException("RuleName is a required property for CreateRuleRequest and cannot be null");
     }
     else
     {
         this.RuleName = RuleName;
     }
     // to ensure "ReportFilterId" is required (not null)
     if (ReportFilterId == null)
     {
         throw new InvalidDataException("ReportFilterId is a required property for CreateRuleRequest and cannot be null");
     }
     else
     {
         this.ReportFilterId = ReportFilterId;
     }
     this.StartUtcDate = StartUtcDate;
     this.EndUtcDate   = EndUtcDate;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Rule" /> class.
 /// </summary>
 /// <param name="RuleId">The identifier of the rule (required).</param>
 /// <param name="RuleName">The name of the rule (required).</param>
 /// <param name="LastExecutionStatus">LastExecutionStatus.</param>
 /// <param name="LastExecutionUtcDate">The utc date of the last execution.</param>
 /// <param name="ActionName">ActionName (required).</param>
 /// <param name="ReportFilterId">Report filter identifier linked to the rule (required).</param>
 /// <param name="Position">Rule execution position (required).</param>
 /// <param name="Enabled">Is the rule enabled (required).</param>
 /// <param name="ValidityStartUtcDate">Rule validity start utc date.</param>
 /// <param name="ValidityEndUtcDate">Rule validity end utc date.</param>
 /// <param name="Links">Links (required).</param>
 public Rule(string RuleId = default(string), string RuleName = default(string), RuleLastExecutionStatus LastExecutionStatus = default(RuleLastExecutionStatus), DateTime?LastExecutionUtcDate = default(DateTime?), OptimisationActionName ActionName = default(OptimisationActionName), string ReportFilterId = default(string), int?Position = default(int?), bool?Enabled = default(bool?), DateTime?ValidityStartUtcDate = default(DateTime?), DateTime?ValidityEndUtcDate = default(DateTime?), RuleLinks Links = default(RuleLinks))
 {
     // to ensure "RuleId" is required (not null)
     if (RuleId == null)
     {
         throw new InvalidDataException("RuleId is a required property for Rule and cannot be null");
     }
     else
     {
         this.RuleId = RuleId;
     }
     // to ensure "RuleName" is required (not null)
     if (RuleName == null)
     {
         throw new InvalidDataException("RuleName is a required property for Rule and cannot be null");
     }
     else
     {
         this.RuleName = RuleName;
     }
     // to ensure "ActionName" is required (not null)
     if (ActionName == null)
     {
         throw new InvalidDataException("ActionName is a required property for Rule and cannot be null");
     }
     else
     {
         this.ActionName = ActionName;
     }
     // to ensure "ReportFilterId" is required (not null)
     if (ReportFilterId == null)
     {
         throw new InvalidDataException("ReportFilterId is a required property for Rule and cannot be null");
     }
     else
     {
         this.ReportFilterId = ReportFilterId;
     }
     // to ensure "Position" is required (not null)
     if (Position == null)
     {
         throw new InvalidDataException("Position is a required property for Rule and cannot be null");
     }
     else
     {
         this.Position = Position;
     }
     // to ensure "Enabled" is required (not null)
     if (Enabled == null)
     {
         throw new InvalidDataException("Enabled is a required property for Rule and cannot be null");
     }
     else
     {
         this.Enabled = Enabled;
     }
     // to ensure "Links" is required (not null)
     if (Links == null)
     {
         throw new InvalidDataException("Links is a required property for Rule and cannot be null");
     }
     else
     {
         this.Links = Links;
     }
     this.LastExecutionStatus  = LastExecutionStatus;
     this.LastExecutionUtcDate = LastExecutionUtcDate;
     this.ValidityStartUtcDate = ValidityStartUtcDate;
     this.ValidityEndUtcDate   = ValidityEndUtcDate;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleExecutionReporting" /> class.
 /// </summary>
 /// <param name="RuleId">The rule identifier (required).</param>
 /// <param name="RuleName">The name of the rule (required).</param>
 /// <param name="StartedUtcDate">The start utc date of the execution of the rule.</param>
 /// <param name="CompletedUtcDate">The completed utc date of the execution of the rule.</param>
 /// <param name="Status">Status (required).</param>
 /// <param name="ErrorType">ErrorType.</param>
 /// <param name="AffectedProductCount">The count of affected products, active or not.</param>
 /// <param name="ActiveAffectedProductCount">The count of affected active products.</param>
 /// <param name="AffectedChannelCount">The count of affected Channels across all products.</param>
 /// <param name="OptimisationActionName">OptimisationActionName.</param>
 /// <param name="UserId">The userId that executed the rule if any.</param>
 /// <param name="ExecutionSource">ExecutionSource (required).</param>
 /// <param name="ReportUrl">The url for the excel report for this execution.</param>
 /// <param name="Links">Links.</param>
 public RuleExecutionReporting(string RuleId = default(string), string RuleName = default(string), DateTime?StartedUtcDate = default(DateTime?), DateTime?CompletedUtcDate = default(DateTime?), RuleExecutionReportingStatus Status = default(RuleExecutionReportingStatus), RuleExecutionReportingErrorType ErrorType = default(RuleExecutionReportingErrorType), int?AffectedProductCount = default(int?), int?ActiveAffectedProductCount = default(int?), int?AffectedChannelCount = default(int?), OptimisationActionName OptimisationActionName = default(OptimisationActionName), string UserId = default(string), RuleExecutionReportingExecutionSource ExecutionSource = default(RuleExecutionReportingExecutionSource), string ReportUrl = default(string), RuleExecutionReportingLinks Links = default(RuleExecutionReportingLinks))
 {
     // to ensure "RuleId" is required (not null)
     if (RuleId == null)
     {
         throw new InvalidDataException("RuleId is a required property for RuleExecutionReporting and cannot be null");
     }
     else
     {
         this.RuleId = RuleId;
     }
     // to ensure "RuleName" is required (not null)
     if (RuleName == null)
     {
         throw new InvalidDataException("RuleName is a required property for RuleExecutionReporting and cannot be null");
     }
     else
     {
         this.RuleName = RuleName;
     }
     // to ensure "Status" is required (not null)
     if (Status == null)
     {
         throw new InvalidDataException("Status is a required property for RuleExecutionReporting and cannot be null");
     }
     else
     {
         this.Status = Status;
     }
     // to ensure "ExecutionSource" is required (not null)
     if (ExecutionSource == null)
     {
         throw new InvalidDataException("ExecutionSource is a required property for RuleExecutionReporting and cannot be null");
     }
     else
     {
         this.ExecutionSource = ExecutionSource;
     }
     this.StartedUtcDate             = StartedUtcDate;
     this.CompletedUtcDate           = CompletedUtcDate;
     this.ErrorType                  = ErrorType;
     this.AffectedProductCount       = AffectedProductCount;
     this.ActiveAffectedProductCount = ActiveAffectedProductCount;
     this.AffectedChannelCount       = AffectedChannelCount;
     this.OptimisationActionName     = OptimisationActionName;
     this.UserId    = UserId;
     this.ReportUrl = ReportUrl;
     this.Links     = Links;
 }