<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/oracledatabase/v1/exadata_infra.proto

namespace Google\Cloud\OracleDatabase\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Maintenance window as defined by Oracle.
 * https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/MaintenanceWindow
 *
 * Generated from protobuf message <code>google.cloud.oracledatabase.v1.MaintenanceWindow</code>
 */
class MaintenanceWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The maintenance window scheduling preference.
     *
     * Generated from protobuf field <code>.google.cloud.oracledatabase.v1.MaintenanceWindow.MaintenanceWindowPreference preference = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $preference = 0;
    /**
     * Optional. Months during the year when maintenance should be performed.
     *
     * Generated from protobuf field <code>repeated .google.type.Month months = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $months;
    /**
     * Optional. Weeks during the month when maintenance should be performed.
     * Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a
     * duration of 7 days. Weeks start and end based on calendar dates, not days
     * of the week.
     *
     * Generated from protobuf field <code>repeated int32 weeks_of_month = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $weeks_of_month;
    /**
     * Optional. Days during the week when maintenance should be performed.
     *
     * Generated from protobuf field <code>repeated .google.type.DayOfWeek days_of_week = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $days_of_week;
    /**
     * Optional. The window of hours during the day when maintenance should be
     * performed. The window is a 4 hour slot. Valid values are:
     *   0 - represents time slot 0:00 - 3:59 UTC
     *   4 - represents time slot 4:00 - 7:59 UTC
     *   8 - represents time slot 8:00 - 11:59 UTC
     *   12 - represents time slot 12:00 - 15:59 UTC
     *   16 - represents time slot 16:00 - 19:59 UTC
     *   20 - represents time slot 20:00 - 23:59 UTC
     *
     * Generated from protobuf field <code>repeated int32 hours_of_day = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $hours_of_day;
    /**
     * Optional. Lead time window allows user to set a lead time to prepare for a
     * down time. The lead time is in weeks and valid value is between 1 to 4.
     *
     * Generated from protobuf field <code>int32 lead_time_week = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $lead_time_week = 0;
    /**
     * Optional. Cloud CloudExadataInfrastructure node patching method, either
     * "ROLLING" or "NONROLLING". Default value is ROLLING.
     *
     * Generated from protobuf field <code>.google.cloud.oracledatabase.v1.MaintenanceWindow.PatchingMode patching_mode = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $patching_mode = 0;
    /**
     * Optional. Determines the amount of time the system will wait before the
     * start of each database server patching operation. Custom action timeout is
     * in minutes and valid value is between 15 to 120 (inclusive).
     *
     * Generated from protobuf field <code>int32 custom_action_timeout_mins = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $custom_action_timeout_mins = 0;
    /**
     * Optional. If true, enables the configuration of a custom action timeout
     * (waiting period) between database server patching operations.
     *
     * Generated from protobuf field <code>bool is_custom_action_timeout_enabled = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $is_custom_action_timeout_enabled = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $preference
     *           Optional. The maintenance window scheduling preference.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $months
     *           Optional. Months during the year when maintenance should be performed.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $weeks_of_month
     *           Optional. Weeks during the month when maintenance should be performed.
     *           Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a
     *           duration of 7 days. Weeks start and end based on calendar dates, not days
     *           of the week.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $days_of_week
     *           Optional. Days during the week when maintenance should be performed.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $hours_of_day
     *           Optional. The window of hours during the day when maintenance should be
     *           performed. The window is a 4 hour slot. Valid values are:
     *             0 - represents time slot 0:00 - 3:59 UTC
     *             4 - represents time slot 4:00 - 7:59 UTC
     *             8 - represents time slot 8:00 - 11:59 UTC
     *             12 - represents time slot 12:00 - 15:59 UTC
     *             16 - represents time slot 16:00 - 19:59 UTC
     *             20 - represents time slot 20:00 - 23:59 UTC
     *     @type int $lead_time_week
     *           Optional. Lead time window allows user to set a lead time to prepare for a
     *           down time. The lead time is in weeks and valid value is between 1 to 4.
     *     @type int $patching_mode
     *           Optional. Cloud CloudExadataInfrastructure node patching method, either
     *           "ROLLING" or "NONROLLING". Default value is ROLLING.
     *     @type int $custom_action_timeout_mins
     *           Optional. Determines the amount of time the system will wait before the
     *           start of each database server patching operation. Custom action timeout is
     *           in minutes and valid value is between 15 to 120 (inclusive).
     *     @type bool $is_custom_action_timeout_enabled
     *           Optional. If true, enables the configuration of a custom action timeout
     *           (waiting period) between database server patching operations.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Oracledatabase\V1\ExadataInfra::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The maintenance window scheduling preference.
     *
     * Generated from protobuf field <code>.google.cloud.oracledatabase.v1.MaintenanceWindow.MaintenanceWindowPreference preference = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getPreference()
    {
        return $this->preference;
    }

    /**
     * Optional. The maintenance window scheduling preference.
     *
     * Generated from protobuf field <code>.google.cloud.oracledatabase.v1.MaintenanceWindow.MaintenanceWindowPreference preference = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setPreference($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\OracleDatabase\V1\MaintenanceWindow\MaintenanceWindowPreference::class);
        $this->preference = $var;

        return $this;
    }

    /**
     * Optional. Months during the year when maintenance should be performed.
     *
     * Generated from protobuf field <code>repeated .google.type.Month months = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMonths()
    {
        return $this->months;
    }

    /**
     * Optional. Months during the year when maintenance should be performed.
     *
     * Generated from protobuf field <code>repeated .google.type.Month months = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMonths($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\Month::class);
        $this->months = $arr;

        return $this;
    }

    /**
     * Optional. Weeks during the month when maintenance should be performed.
     * Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a
     * duration of 7 days. Weeks start and end based on calendar dates, not days
     * of the week.
     *
     * Generated from protobuf field <code>repeated int32 weeks_of_month = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getWeeksOfMonth()
    {
        return $this->weeks_of_month;
    }

    /**
     * Optional. Weeks during the month when maintenance should be performed.
     * Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a
     * duration of 7 days. Weeks start and end based on calendar dates, not days
     * of the week.
     *
     * Generated from protobuf field <code>repeated int32 weeks_of_month = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setWeeksOfMonth($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->weeks_of_month = $arr;

        return $this;
    }

    /**
     * Optional. Days during the week when maintenance should be performed.
     *
     * Generated from protobuf field <code>repeated .google.type.DayOfWeek days_of_week = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDaysOfWeek()
    {
        return $this->days_of_week;
    }

    /**
     * Optional. Days during the week when maintenance should be performed.
     *
     * Generated from protobuf field <code>repeated .google.type.DayOfWeek days_of_week = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDaysOfWeek($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class);
        $this->days_of_week = $arr;

        return $this;
    }

    /**
     * Optional. The window of hours during the day when maintenance should be
     * performed. The window is a 4 hour slot. Valid values are:
     *   0 - represents time slot 0:00 - 3:59 UTC
     *   4 - represents time slot 4:00 - 7:59 UTC
     *   8 - represents time slot 8:00 - 11:59 UTC
     *   12 - represents time slot 12:00 - 15:59 UTC
     *   16 - represents time slot 16:00 - 19:59 UTC
     *   20 - represents time slot 20:00 - 23:59 UTC
     *
     * Generated from protobuf field <code>repeated int32 hours_of_day = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getHoursOfDay()
    {
        return $this->hours_of_day;
    }

    /**
     * Optional. The window of hours during the day when maintenance should be
     * performed. The window is a 4 hour slot. Valid values are:
     *   0 - represents time slot 0:00 - 3:59 UTC
     *   4 - represents time slot 4:00 - 7:59 UTC
     *   8 - represents time slot 8:00 - 11:59 UTC
     *   12 - represents time slot 12:00 - 15:59 UTC
     *   16 - represents time slot 16:00 - 19:59 UTC
     *   20 - represents time slot 20:00 - 23:59 UTC
     *
     * Generated from protobuf field <code>repeated int32 hours_of_day = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setHoursOfDay($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->hours_of_day = $arr;

        return $this;
    }

    /**
     * Optional. Lead time window allows user to set a lead time to prepare for a
     * down time. The lead time is in weeks and valid value is between 1 to 4.
     *
     * Generated from protobuf field <code>int32 lead_time_week = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getLeadTimeWeek()
    {
        return $this->lead_time_week;
    }

    /**
     * Optional. Lead time window allows user to set a lead time to prepare for a
     * down time. The lead time is in weeks and valid value is between 1 to 4.
     *
     * Generated from protobuf field <code>int32 lead_time_week = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setLeadTimeWeek($var)
    {
        GPBUtil::checkInt32($var);
        $this->lead_time_week = $var;

        return $this;
    }

    /**
     * Optional. Cloud CloudExadataInfrastructure node patching method, either
     * "ROLLING" or "NONROLLING". Default value is ROLLING.
     *
     * Generated from protobuf field <code>.google.cloud.oracledatabase.v1.MaintenanceWindow.PatchingMode patching_mode = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getPatchingMode()
    {
        return $this->patching_mode;
    }

    /**
     * Optional. Cloud CloudExadataInfrastructure node patching method, either
     * "ROLLING" or "NONROLLING". Default value is ROLLING.
     *
     * Generated from protobuf field <code>.google.cloud.oracledatabase.v1.MaintenanceWindow.PatchingMode patching_mode = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setPatchingMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\OracleDatabase\V1\MaintenanceWindow\PatchingMode::class);
        $this->patching_mode = $var;

        return $this;
    }

    /**
     * Optional. Determines the amount of time the system will wait before the
     * start of each database server patching operation. Custom action timeout is
     * in minutes and valid value is between 15 to 120 (inclusive).
     *
     * Generated from protobuf field <code>int32 custom_action_timeout_mins = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getCustomActionTimeoutMins()
    {
        return $this->custom_action_timeout_mins;
    }

    /**
     * Optional. Determines the amount of time the system will wait before the
     * start of each database server patching operation. Custom action timeout is
     * in minutes and valid value is between 15 to 120 (inclusive).
     *
     * Generated from protobuf field <code>int32 custom_action_timeout_mins = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setCustomActionTimeoutMins($var)
    {
        GPBUtil::checkInt32($var);
        $this->custom_action_timeout_mins = $var;

        return $this;
    }

    /**
     * Optional. If true, enables the configuration of a custom action timeout
     * (waiting period) between database server patching operations.
     *
     * Generated from protobuf field <code>bool is_custom_action_timeout_enabled = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getIsCustomActionTimeoutEnabled()
    {
        return $this->is_custom_action_timeout_enabled;
    }

    /**
     * Optional. If true, enables the configuration of a custom action timeout
     * (waiting period) between database server patching operations.
     *
     * Generated from protobuf field <code>bool is_custom_action_timeout_enabled = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setIsCustomActionTimeoutEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->is_custom_action_timeout_enabled = $var;

        return $this;
    }

}

