コード例 #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (RecurrencePattern != null)
     {
         RecurrencePattern.Validate();
     }
     if (TimeZoneId != null)
     {
         if (TimeZoneId.Length > 50)
         {
             throw new ValidationException(ValidationRules.MaxLength, "TimeZoneId", 50);
         }
     }
     if (Notes != null)
     {
         if (Notes.Length > 1000)
         {
             throw new ValidationException(ValidationRules.MaxLength, "Notes", 1000);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the Schedule 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="systemData">Metadata pertaining to creation and last
 /// modification of the schedule.</param>
 /// <param name="startAt">When lab user virtual machines will be
 /// started. Timestamp offsets will be ignored and timeZoneId is used
 /// instead.</param>
 /// <param name="stopAt">When lab user virtual machines will be
 /// stopped. Timestamp offsets will be ignored and timeZoneId is used
 /// instead.</param>
 /// <param name="recurrencePattern">The recurrence pattern of the
 /// scheduled actions.</param>
 /// <param name="timeZoneId">The IANA timezone id for the
 /// schedule.</param>
 /// <param name="notes">Notes for this schedule.</param>
 /// <param name="provisioningState">Current provisioning state of the
 /// schedule. Possible values include: 'Creating', 'Updating',
 /// 'Deleting', 'Succeeded', 'Failed', 'Locked'</param>
 public Schedule(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.DateTime?startAt = default(System.DateTime?), System.DateTime?stopAt = default(System.DateTime?), RecurrencePattern recurrencePattern = default(RecurrencePattern), string timeZoneId = default(string), string notes = default(string), ProvisioningState?provisioningState = default(ProvisioningState?))
     : base(id, name, type)
 {
     SystemData        = systemData;
     StartAt           = startAt;
     StopAt            = stopAt;
     RecurrencePattern = recurrencePattern;
     TimeZoneId        = timeZoneId;
     Notes             = notes;
     ProvisioningState = provisioningState;
     CustomInit();
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the ScheduleUpdate class.
 /// </summary>
 /// <param name="startAt">When lab user virtual machines will be
 /// started. Timestamp offsets will be ignored and timeZoneId is used
 /// instead.</param>
 /// <param name="stopAt">When lab user virtual machines will be
 /// stopped. Timestamp offsets will be ignored and timeZoneId is used
 /// instead.</param>
 /// <param name="recurrencePattern">The recurrence pattern of the
 /// scheduled actions.</param>
 /// <param name="timeZoneId">The IANA timezone id for the
 /// schedule.</param>
 /// <param name="notes">Notes for this schedule.</param>
 public ScheduleUpdate(System.DateTime?startAt = default(System.DateTime?), System.DateTime?stopAt = default(System.DateTime?), RecurrencePattern recurrencePattern = default(RecurrencePattern), string timeZoneId = default(string), string notes = default(string))
 {
     StartAt           = startAt;
     StopAt            = stopAt;
     RecurrencePattern = recurrencePattern;
     TimeZoneId        = timeZoneId;
     Notes             = notes;
     CustomInit();
 }