/*
 * 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.sts.v1beta.model;

/**
 * An access boundary rule defines an upper bound of IAM permissions on a single resource.
 *
 * <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 Security Token Service 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 GoogleIdentityStsV1AccessBoundaryRule extends com.google.api.client.json.GenericJson {

  /**
   * The availability condition further constrains the access allowed by the access boundary rule.
   * If the condition evaluates to `true`, then this access boundary rule will provide access to the
   * specified resource, assuming the principal has the required permissions for the resource. If
   * the condition does not evaluate to `true`, then access to the specified resource will not be
   * available. Note that all access boundary rules in an access boundary are evaluated together as
   * a union. As such, another access boundary rule may allow access to the resource, even if this
   * access boundary rule does not allow access. To learn which resources support conditions in
   * their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions
   * /resource-policies). The maximum length of the `expression` field is 2048 characters.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleTypeExpr availabilityCondition;

  /**
   * A list of permissions that may be allowed for use on the specified resource. The only supported
   * values in the list are IAM roles, following the format of google.iam.v1.Binding.role. Example
   * value: `inRole:roles/logging.viewer` for predefined roles and
   * `inRole:organizations/{ORGANIZATION_ID}/roles/logging.viewer` for custom roles.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> availablePermissions;

  /**
   * The full resource name of a Google Cloud resource entity. The format definition is at
   * https://cloud.google.com/apis/design/resource_names. Example value:
   * `//cloudresourcemanager.googleapis.com/projects/my-project`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String availableResource;

  /**
   * The availability condition further constrains the access allowed by the access boundary rule.
   * If the condition evaluates to `true`, then this access boundary rule will provide access to the
   * specified resource, assuming the principal has the required permissions for the resource. If
   * the condition does not evaluate to `true`, then access to the specified resource will not be
   * available. Note that all access boundary rules in an access boundary are evaluated together as
   * a union. As such, another access boundary rule may allow access to the resource, even if this
   * access boundary rule does not allow access. To learn which resources support conditions in
   * their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions
   * /resource-policies). The maximum length of the `expression` field is 2048 characters.
   * @return value or {@code null} for none
   */
  public GoogleTypeExpr getAvailabilityCondition() {
    return availabilityCondition;
  }

  /**
   * The availability condition further constrains the access allowed by the access boundary rule.
   * If the condition evaluates to `true`, then this access boundary rule will provide access to the
   * specified resource, assuming the principal has the required permissions for the resource. If
   * the condition does not evaluate to `true`, then access to the specified resource will not be
   * available. Note that all access boundary rules in an access boundary are evaluated together as
   * a union. As such, another access boundary rule may allow access to the resource, even if this
   * access boundary rule does not allow access. To learn which resources support conditions in
   * their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions
   * /resource-policies). The maximum length of the `expression` field is 2048 characters.
   * @param availabilityCondition availabilityCondition or {@code null} for none
   */
  public GoogleIdentityStsV1AccessBoundaryRule setAvailabilityCondition(GoogleTypeExpr availabilityCondition) {
    this.availabilityCondition = availabilityCondition;
    return this;
  }

  /**
   * A list of permissions that may be allowed for use on the specified resource. The only supported
   * values in the list are IAM roles, following the format of google.iam.v1.Binding.role. Example
   * value: `inRole:roles/logging.viewer` for predefined roles and
   * `inRole:organizations/{ORGANIZATION_ID}/roles/logging.viewer` for custom roles.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getAvailablePermissions() {
    return availablePermissions;
  }

  /**
   * A list of permissions that may be allowed for use on the specified resource. The only supported
   * values in the list are IAM roles, following the format of google.iam.v1.Binding.role. Example
   * value: `inRole:roles/logging.viewer` for predefined roles and
   * `inRole:organizations/{ORGANIZATION_ID}/roles/logging.viewer` for custom roles.
   * @param availablePermissions availablePermissions or {@code null} for none
   */
  public GoogleIdentityStsV1AccessBoundaryRule setAvailablePermissions(java.util.List<java.lang.String> availablePermissions) {
    this.availablePermissions = availablePermissions;
    return this;
  }

  /**
   * The full resource name of a Google Cloud resource entity. The format definition is at
   * https://cloud.google.com/apis/design/resource_names. Example value:
   * `//cloudresourcemanager.googleapis.com/projects/my-project`.
   * @return value or {@code null} for none
   */
  public java.lang.String getAvailableResource() {
    return availableResource;
  }

  /**
   * The full resource name of a Google Cloud resource entity. The format definition is at
   * https://cloud.google.com/apis/design/resource_names. Example value:
   * `//cloudresourcemanager.googleapis.com/projects/my-project`.
   * @param availableResource availableResource or {@code null} for none
   */
  public GoogleIdentityStsV1AccessBoundaryRule setAvailableResource(java.lang.String availableResource) {
    this.availableResource = availableResource;
    return this;
  }

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

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

}
