<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/talent/v4beta1/profile.proto

namespace Google\Cloud\Talent\V4beta1;

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

/**
 * Resource that represents a address.
 *
 * Generated from protobuf message <code>google.cloud.talent.v4beta1.Address</code>
 */
class Address extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional.
     * The usage of the address. For example, SCHOOL, WORK, PERSONAL.
     *
     * Generated from protobuf field <code>.google.cloud.talent.v4beta1.ContactInfoUsage usage = 1;</code>
     */
    private $usage = 0;
    /**
     * Optional.
     * Indicates if it's the person's current address.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue current = 4;</code>
     */
    private $current = null;
    protected $address;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $usage
     *           Optional.
     *           The usage of the address. For example, SCHOOL, WORK, PERSONAL.
     *     @type string $unstructured_address
     *           Optional.
     *           Unstructured address.
     *           For example, "1600 Amphitheatre Pkwy, Mountain View, CA 94043",
     *           "Sunnyvale, California".
     *           Number of characters allowed is 100.
     *     @type \Google\Type\PostalAddress $structured_address
     *           Optional.
     *           Structured address that contains street address, city, state, country,
     *           etc.
     *     @type \Google\Protobuf\BoolValue $current
     *           Optional.
     *           Indicates if it's the person's current address.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Talent\V4Beta1\Profile::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional.
     * The usage of the address. For example, SCHOOL, WORK, PERSONAL.
     *
     * Generated from protobuf field <code>.google.cloud.talent.v4beta1.ContactInfoUsage usage = 1;</code>
     * @return int
     */
    public function getUsage()
    {
        return $this->usage;
    }

    /**
     * Optional.
     * The usage of the address. For example, SCHOOL, WORK, PERSONAL.
     *
     * Generated from protobuf field <code>.google.cloud.talent.v4beta1.ContactInfoUsage usage = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setUsage($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\ContactInfoUsage::class);
        $this->usage = $var;

        return $this;
    }

    /**
     * Optional.
     * Unstructured address.
     * For example, "1600 Amphitheatre Pkwy, Mountain View, CA 94043",
     * "Sunnyvale, California".
     * Number of characters allowed is 100.
     *
     * Generated from protobuf field <code>string unstructured_address = 2;</code>
     * @return string
     */
    public function getUnstructuredAddress()
    {
        return $this->readOneof(2);
    }

    /**
     * Optional.
     * Unstructured address.
     * For example, "1600 Amphitheatre Pkwy, Mountain View, CA 94043",
     * "Sunnyvale, California".
     * Number of characters allowed is 100.
     *
     * Generated from protobuf field <code>string unstructured_address = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setUnstructuredAddress($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional.
     * Structured address that contains street address, city, state, country,
     * etc.
     *
     * Generated from protobuf field <code>.google.type.PostalAddress structured_address = 3;</code>
     * @return \Google\Type\PostalAddress
     */
    public function getStructuredAddress()
    {
        return $this->readOneof(3);
    }

    /**
     * Optional.
     * Structured address that contains street address, city, state, country,
     * etc.
     *
     * Generated from protobuf field <code>.google.type.PostalAddress structured_address = 3;</code>
     * @param \Google\Type\PostalAddress $var
     * @return $this
     */
    public function setStructuredAddress($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\PostalAddress::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional.
     * Indicates if it's the person's current address.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue current = 4;</code>
     * @return \Google\Protobuf\BoolValue
     */
    public function getCurrent()
    {
        return $this->current;
    }

    /**
     * Returns the unboxed value from <code>getCurrent()</code>

     * Optional.
     * Indicates if it's the person's current address.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue current = 4;</code>
     * @return bool|null
     */
    public function getCurrentValue()
    {
        $wrapper = $this->getCurrent();
        return is_null($wrapper) ? null : $wrapper->getValue();
    }

    /**
     * Optional.
     * Indicates if it's the person's current address.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue current = 4;</code>
     * @param \Google\Protobuf\BoolValue $var
     * @return $this
     */
    public function setCurrent($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class);
        $this->current = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.

     * Optional.
     * Indicates if it's the person's current address.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue current = 4;</code>
     * @param bool|null $var
     * @return $this
     */
    public function setCurrentValue($var)
    {
        $wrappedVar = is_null($var) ? null : new \Google\Protobuf\BoolValue(['value' => $var]);
        return $this->setCurrent($wrappedVar);
    }

    /**
     * @return string
     */
    public function getAddress()
    {
        return $this->whichOneof("address");
    }

}

