Class AuditConfig.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<AuditConfig,AuditConfig.Builder>
com.google.iam.v1.AuditConfig.Builder
All Implemented Interfaces:
AuditConfigOrBuilder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, Cloneable
Enclosing class:
AuditConfig

public static final class AuditConfig.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<AuditConfig,AuditConfig.Builder> implements AuditConfigOrBuilder
 Specifies the audit configuration for a service.
 The configuration determines which permission types are logged, and what
 identities, if any, are exempted from logging.
 An AuditConfig must have one or more AuditLogConfigs.

 If there are AuditConfigs for both `allServices` and a specific service,
 the union of the two AuditConfigs is used for that service: the log_types
 specified in each AuditConfig are enabled, and the exempted_members in each
 AuditLogConfig are exempted.

 Example Policy with multiple AuditConfigs:

 {
 "audit_configs": [
 {
 "service": "allServices",
 "audit_log_configs": [
 {
 "log_type": "DATA_READ",
 "exempted_members": [
 "user:jose@example.com"
 ]
 },
 {
 "log_type": "DATA_WRITE"
 },
 {
 "log_type": "ADMIN_READ"
 }
 ]
 },
 {
 "service": "sampleservice.googleapis.com",
 "audit_log_configs": [
 {
 "log_type": "DATA_READ"
 },
 {
 "log_type": "DATA_WRITE",
 "exempted_members": [
 "user:aliya@example.com"
 ]
 }
 ]
 }
 ]
 }

 For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
 logging. It also exempts `jose@example.com` from DATA_READ logging, and
 `aliya@example.com` from DATA_WRITE logging.
 
Protobuf type google.iam.v1.AuditConfig
  • Method Details

    • getService

      public String getService()
       Specifies a service that will be enabled for audit logging.
       For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
       `allServices` is a special value that covers all services.
       
      string service = 1 [json_name = "service"];
      Specified by:
      getService in interface AuditConfigOrBuilder
      Returns:
      The service.
    • getServiceBytes

      public com.google.protobuf.ByteString getServiceBytes()
       Specifies a service that will be enabled for audit logging.
       For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
       `allServices` is a special value that covers all services.
       
      string service = 1 [json_name = "service"];
      Specified by:
      getServiceBytes in interface AuditConfigOrBuilder
      Returns:
      The bytes for service.
    • setService

      public AuditConfig.Builder setService(String value)
       Specifies a service that will be enabled for audit logging.
       For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
       `allServices` is a special value that covers all services.
       
      string service = 1 [json_name = "service"];
      Parameters:
      value - The service to set.
      Returns:
      This builder for chaining.
    • clearService

      public AuditConfig.Builder clearService()
       Specifies a service that will be enabled for audit logging.
       For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
       `allServices` is a special value that covers all services.
       
      string service = 1 [json_name = "service"];
      Returns:
      This builder for chaining.
    • setServiceBytes

      public AuditConfig.Builder setServiceBytes(com.google.protobuf.ByteString value)
       Specifies a service that will be enabled for audit logging.
       For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
       `allServices` is a special value that covers all services.
       
      string service = 1 [json_name = "service"];
      Parameters:
      value - The bytes for service to set.
      Returns:
      This builder for chaining.
    • getAuditLogConfigsList

      public List<AuditLogConfig> getAuditLogConfigsList()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
      Specified by:
      getAuditLogConfigsList in interface AuditConfigOrBuilder
    • getAuditLogConfigsCount

      public int getAuditLogConfigsCount()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
      Specified by:
      getAuditLogConfigsCount in interface AuditConfigOrBuilder
    • getAuditLogConfigs

      public AuditLogConfig getAuditLogConfigs(int index)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
      Specified by:
      getAuditLogConfigs in interface AuditConfigOrBuilder
    • setAuditLogConfigs

      public AuditConfig.Builder setAuditLogConfigs(int index, AuditLogConfig value)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • setAuditLogConfigs

      public AuditConfig.Builder setAuditLogConfigs(int index, AuditLogConfig.Builder builderForValue)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • addAuditLogConfigs

      public AuditConfig.Builder addAuditLogConfigs(AuditLogConfig value)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • addAuditLogConfigs

      public AuditConfig.Builder addAuditLogConfigs(int index, AuditLogConfig value)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • addAuditLogConfigs

      public AuditConfig.Builder addAuditLogConfigs(AuditLogConfig.Builder builderForValue)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • addAuditLogConfigs

      public AuditConfig.Builder addAuditLogConfigs(int index, AuditLogConfig.Builder builderForValue)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • addAllAuditLogConfigs

      public AuditConfig.Builder addAllAuditLogConfigs(Iterable<? extends AuditLogConfig> values)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • clearAuditLogConfigs

      public AuditConfig.Builder clearAuditLogConfigs()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];
    • removeAuditLogConfigs

      public AuditConfig.Builder removeAuditLogConfigs(int index)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3 [json_name = "auditLogConfigs"];