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

namespace Google\Cloud\OsConfig\V1;

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

/**
 * Represents one week day in a month. An example is "the 4th Sunday".
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.WeekDayOfMonth</code>
 */
class WeekDayOfMonth extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Week number in a month. 1-4 indicates the 1st to 4th week of the
     * month. -1 indicates the last week of the month.
     *
     * Generated from protobuf field <code>int32 week_ordinal = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $week_ordinal = 0;
    /**
     * Required. A day of the week.
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $day_of_week = 0;
    /**
     * Optional. Represents the number of days before or after the given week day
     * of month that the patch deployment is scheduled for. For example if
     * `week_ordinal` and `day_of_week` values point to the second day of the
     * month and this `day_offset` value is set to `3`, the patch deployment takes
     * place three days after the second Tuesday of the month. If this value is
     * negative, for example -5, the patches are deployed five days before before
     * the second Tuesday of the month. Allowed values are in range [-30, 30].
     *
     * Generated from protobuf field <code>int32 day_offset = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $day_offset = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $week_ordinal
     *           Required. Week number in a month. 1-4 indicates the 1st to 4th week of the
     *           month. -1 indicates the last week of the month.
     *     @type int $day_of_week
     *           Required. A day of the week.
     *     @type int $day_offset
     *           Optional. Represents the number of days before or after the given week day
     *           of month that the patch deployment is scheduled for. For example if
     *           `week_ordinal` and `day_of_week` values point to the second day of the
     *           month and this `day_offset` value is set to `3`, the patch deployment takes
     *           place three days after the second Tuesday of the month. If this value is
     *           negative, for example -5, the patches are deployed five days before before
     *           the second Tuesday of the month. Allowed values are in range [-30, 30].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\PatchDeployments::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Week number in a month. 1-4 indicates the 1st to 4th week of the
     * month. -1 indicates the last week of the month.
     *
     * Generated from protobuf field <code>int32 week_ordinal = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getWeekOrdinal()
    {
        return $this->week_ordinal;
    }

    /**
     * Required. Week number in a month. 1-4 indicates the 1st to 4th week of the
     * month. -1 indicates the last week of the month.
     *
     * Generated from protobuf field <code>int32 week_ordinal = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setWeekOrdinal($var)
    {
        GPBUtil::checkInt32($var);
        $this->week_ordinal = $var;

        return $this;
    }

    /**
     * Required. A day of the week.
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDayOfWeek()
    {
        return $this->day_of_week;
    }

    /**
     * Required. A day of the week.
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDayOfWeek($var)
    {
        GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class);
        $this->day_of_week = $var;

        return $this;
    }

    /**
     * Optional. Represents the number of days before or after the given week day
     * of month that the patch deployment is scheduled for. For example if
     * `week_ordinal` and `day_of_week` values point to the second day of the
     * month and this `day_offset` value is set to `3`, the patch deployment takes
     * place three days after the second Tuesday of the month. If this value is
     * negative, for example -5, the patches are deployed five days before before
     * the second Tuesday of the month. Allowed values are in range [-30, 30].
     *
     * Generated from protobuf field <code>int32 day_offset = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getDayOffset()
    {
        return $this->day_offset;
    }

    /**
     * Optional. Represents the number of days before or after the given week day
     * of month that the patch deployment is scheduled for. For example if
     * `week_ordinal` and `day_of_week` values point to the second day of the
     * month and this `day_offset` value is set to `3`, the patch deployment takes
     * place three days after the second Tuesday of the month. If this value is
     * negative, for example -5, the patches are deployed five days before before
     * the second Tuesday of the month. Allowed values are in range [-30, 30].
     *
     * Generated from protobuf field <code>int32 day_offset = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setDayOffset($var)
    {
        GPBUtil::checkInt32($var);
        $this->day_offset = $var;

        return $this;
    }

}

