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

namespace Google\Cloud\EssentialContacts\V1;

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

/**
 * Request message for the UpdateContact method.
 *
 * Generated from protobuf message <code>google.cloud.essentialcontacts.v1.UpdateContactRequest</code>
 */
class UpdateContactRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The contact resource to replace the existing saved contact. Note:
     * the email address of the contact cannot be modified.
     *
     * Generated from protobuf field <code>.google.cloud.essentialcontacts.v1.Contact contact = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $contact = null;
    /**
     * Optional. The update mask applied to the resource. For the `FieldMask`
     * definition, see
     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $update_mask = null;

    /**
     * @param \Google\Cloud\EssentialContacts\V1\Contact $contact    Required. The contact resource to replace the existing saved contact. Note:
     *                                                               the email address of the contact cannot be modified.
     * @param \Google\Protobuf\FieldMask                 $updateMask Optional. The update mask applied to the resource. For the `FieldMask`
     *                                                               definition, see
     *                                                               https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
     *
     * @return \Google\Cloud\EssentialContacts\V1\UpdateContactRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\EssentialContacts\V1\Contact $contact, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setContact($contact)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\EssentialContacts\V1\Contact $contact
     *           Required. The contact resource to replace the existing saved contact. Note:
     *           the email address of the contact cannot be modified.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Optional. The update mask applied to the resource. For the `FieldMask`
     *           definition, see
     *           https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Essentialcontacts\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The contact resource to replace the existing saved contact. Note:
     * the email address of the contact cannot be modified.
     *
     * Generated from protobuf field <code>.google.cloud.essentialcontacts.v1.Contact contact = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\EssentialContacts\V1\Contact|null
     */
    public function getContact()
    {
        return $this->contact;
    }

    public function hasContact()
    {
        return isset($this->contact);
    }

    public function clearContact()
    {
        unset($this->contact);
    }

    /**
     * Required. The contact resource to replace the existing saved contact. Note:
     * the email address of the contact cannot be modified.
     *
     * Generated from protobuf field <code>.google.cloud.essentialcontacts.v1.Contact contact = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\EssentialContacts\V1\Contact $var
     * @return $this
     */
    public function setContact($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\EssentialContacts\V1\Contact::class);
        $this->contact = $var;

        return $this;
    }

    /**
     * Optional. The update mask applied to the resource. For the `FieldMask`
     * definition, see
     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Optional. The update mask applied to the resource. For the `FieldMask`
     * definition, see
     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

