<?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;

    /**
     * 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.
     * }
     */
    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;
    }

}

