<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/securitycenter/v2/resource.proto

namespace Google\Cloud\SecurityCenter\V2;

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

/**
 * AWS metadata associated with the resource, only applicable if the finding's
 * cloud provider is Amazon Web Services.
 *
 * Generated from protobuf message <code>google.cloud.securitycenter.v2.AwsMetadata</code>
 */
class AwsMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The AWS organization associated with the resource.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1;</code>
     */
    protected $organization = null;
    /**
     * A list of AWS organizational units associated with the resource, ordered
     * from lowest level (closest to the account) to highest level.
     *
     * Generated from protobuf field <code>repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2;</code>
     */
    private $organizational_units;
    /**
     * The AWS account associated with the resource.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3;</code>
     */
    protected $account = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganization $organization
     *           The AWS organization associated with the resource.
     *     @type array<\Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganizationalUnit>|\Google\Protobuf\Internal\RepeatedField $organizational_units
     *           A list of AWS organizational units associated with the resource, ordered
     *           from lowest level (closest to the account) to highest level.
     *     @type \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsAccount $account
     *           The AWS account associated with the resource.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V2\Resource::initOnce();
        parent::__construct($data);
    }

    /**
     * The AWS organization associated with the resource.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1;</code>
     * @return \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganization|null
     */
    public function getOrganization()
    {
        return $this->organization;
    }

    public function hasOrganization()
    {
        return isset($this->organization);
    }

    public function clearOrganization()
    {
        unset($this->organization);
    }

    /**
     * The AWS organization associated with the resource.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1;</code>
     * @param \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganization $var
     * @return $this
     */
    public function setOrganization($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganization::class);
        $this->organization = $var;

        return $this;
    }

    /**
     * A list of AWS organizational units associated with the resource, ordered
     * from lowest level (closest to the account) to highest level.
     *
     * Generated from protobuf field <code>repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getOrganizationalUnits()
    {
        return $this->organizational_units;
    }

    /**
     * A list of AWS organizational units associated with the resource, ordered
     * from lowest level (closest to the account) to highest level.
     *
     * Generated from protobuf field <code>repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2;</code>
     * @param array<\Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganizationalUnit>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setOrganizationalUnits($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsOrganizationalUnit::class);
        $this->organizational_units = $arr;

        return $this;
    }

    /**
     * The AWS account associated with the resource.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3;</code>
     * @return \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsAccount|null
     */
    public function getAccount()
    {
        return $this->account;
    }

    public function hasAccount()
    {
        return isset($this->account);
    }

    public function clearAccount()
    {
        unset($this->account);
    }

    /**
     * The AWS account associated with the resource.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3;</code>
     * @param \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsAccount $var
     * @return $this
     */
    public function setAccount($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V2\AwsMetadata\AwsAccount::class);
        $this->account = $var;

        return $this;
    }

}

