Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the Table class.
 /// </summary>
 /// <param name="id">Fully qualified resource ID for the resource. Ex -
 /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}</param>
 /// <param name="name">The name of the resource</param>
 /// <param name="type">The type of the resource. E.g.
 /// "Microsoft.Compute/virtualMachines" or
 /// "Microsoft.Storage/storageAccounts"</param>
 /// <param name="retentionInDays">The table retention in days, between
 /// 4 and 730. Setting this property to -1 will default to the
 /// workspace retention.</param>
 /// <param name="totalRetentionInDays">The table total retention in
 /// days, between 4 and 2555. Setting this property to -1 will default
 /// to table retention.</param>
 /// <param name="archiveRetentionInDays">The table data archive
 /// retention in days. Calculated as
 /// (totalRetentionInDays-retentionInDays)</param>
 /// <param name="searchResults">Parameters of the search job that
 /// initiated this table.</param>
 /// <param name="restoredLogs">Parameters of the restore operation that
 /// initiated this table.</param>
 /// <param name="resultStatistics">Search job execution
 /// statistics.</param>
 /// <param name="plan">Instruct the system how to handle and charge the
 /// logs ingested to this table. Possible values include: 'Basic',
 /// 'Analytics'</param>
 /// <param name="lastPlanModifiedDate">The timestamp that table plan
 /// was last modified (UTC).</param>
 /// <param name="schema">Table schema.</param>
 /// <param name="provisioningState">Table's current provisioning state.
 /// If set to 'updating', indicates a resource lock due to ongoing
 /// operation, forbidding any update to the table until the ongoing
 /// operation is concluded. Possible values include: 'Updating',
 /// 'InProgress', 'Succeeded'</param>
 public Table(string id = default(string), string name = default(string), string type = default(string), int?retentionInDays = default(int?), int?totalRetentionInDays = default(int?), int?archiveRetentionInDays = default(int?), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), string plan = default(string), string lastPlanModifiedDate = default(string), Schema schema = default(Schema), string provisioningState = default(string), SystemData systemData = default(SystemData))
     : base(id, name, type)
 {
     RetentionInDays        = retentionInDays;
     TotalRetentionInDays   = totalRetentionInDays;
     ArchiveRetentionInDays = archiveRetentionInDays;
     SearchResults          = searchResults;
     RestoredLogs           = restoredLogs;
     ResultStatistics       = resultStatistics;
     Plan = plan;
     LastPlanModifiedDate = lastPlanModifiedDate;
     Schema            = schema;
     ProvisioningState = provisioningState;
     SystemData        = systemData;
     CustomInit();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (RetentionInDays > 730)
     {
         throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730);
     }
     if (RetentionInDays < 4)
     {
         throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 4);
     }
     if (TotalRetentionInDays > 2555)
     {
         throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555);
     }
     if (TotalRetentionInDays < 4)
     {
         throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4);
     }
     if (ResultStatistics != null)
     {
         ResultStatistics.Validate();
     }
 }