/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudasset.v1.model;

/**
 * The organization policy result to the query.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Asset API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OrgPolicyResult extends com.google.api.client.json.GenericJson {

  /**
   * The consolidated organization policy for the analyzed resource. The consolidated organization
   * policy is computed by merging and evaluating AnalyzeOrgPoliciesResponse.policy_bundle. The
   * evaluation will respect the organization policy [hierarchy rules](https://cloud.google.com
   * /resource-manager/docs/organization-policy/understanding-hierarchy).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private AnalyzerOrgPolicy consolidatedPolicy;

  /**
   * The ordered list of all organization policies from the
   * AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource. to the scope
   * specified in the request. If the constraint is defined with default policy, it will also appear
   * in the list.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<AnalyzerOrgPolicy> policyBundle;

  static {
    // hack to force ProGuard to consider AnalyzerOrgPolicy used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(AnalyzerOrgPolicy.class);
  }

  /**
   * The consolidated organization policy for the analyzed resource. The consolidated organization
   * policy is computed by merging and evaluating AnalyzeOrgPoliciesResponse.policy_bundle. The
   * evaluation will respect the organization policy [hierarchy rules](https://cloud.google.com
   * /resource-manager/docs/organization-policy/understanding-hierarchy).
   * @return value or {@code null} for none
   */
  public AnalyzerOrgPolicy getConsolidatedPolicy() {
    return consolidatedPolicy;
  }

  /**
   * The consolidated organization policy for the analyzed resource. The consolidated organization
   * policy is computed by merging and evaluating AnalyzeOrgPoliciesResponse.policy_bundle. The
   * evaluation will respect the organization policy [hierarchy rules](https://cloud.google.com
   * /resource-manager/docs/organization-policy/understanding-hierarchy).
   * @param consolidatedPolicy consolidatedPolicy or {@code null} for none
   */
  public OrgPolicyResult setConsolidatedPolicy(AnalyzerOrgPolicy consolidatedPolicy) {
    this.consolidatedPolicy = consolidatedPolicy;
    return this;
  }

  /**
   * The ordered list of all organization policies from the
   * AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource. to the scope
   * specified in the request. If the constraint is defined with default policy, it will also appear
   * in the list.
   * @return value or {@code null} for none
   */
  public java.util.List<AnalyzerOrgPolicy> getPolicyBundle() {
    return policyBundle;
  }

  /**
   * The ordered list of all organization policies from the
   * AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource. to the scope
   * specified in the request. If the constraint is defined with default policy, it will also appear
   * in the list.
   * @param policyBundle policyBundle or {@code null} for none
   */
  public OrgPolicyResult setPolicyBundle(java.util.List<AnalyzerOrgPolicy> policyBundle) {
    this.policyBundle = policyBundle;
    return this;
  }

  @Override
  public OrgPolicyResult set(String fieldName, Object value) {
    return (OrgPolicyResult) super.set(fieldName, value);
  }

  @Override
  public OrgPolicyResult clone() {
    return (OrgPolicyResult) super.clone();
  }

}
