Class AuditConfig.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
com.google.iam.v1.AuditConfig.Builder
All Implemented Interfaces:
AuditConfigOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
AuditConfig

public static final class AuditConfig.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<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

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • clear

      public AuditConfig.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • getDefaultInstanceForType

      public AuditConfig getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public AuditConfig build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public AuditConfig buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public AuditConfig.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • setField

      public AuditConfig.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • clearField

      public AuditConfig.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • clearOneof

      public AuditConfig.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • setRepeatedField

      public AuditConfig.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • addRepeatedField

      public AuditConfig.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • mergeFrom

      public AuditConfig.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AuditConfig.Builder>
    • mergeFrom

      public AuditConfig.Builder mergeFrom(AuditConfig other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • mergeFrom

      public AuditConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AuditConfig.Builder>
      Throws:
      IOException
    • 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;
      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;
      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;
      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;
      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;
      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;
      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;
      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;
      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;
    • 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;
    • 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;
    • 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;
    • 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;
    • 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;
    • 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;
    • clearAuditLogConfigs

      public AuditConfig.Builder clearAuditLogConfigs()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
    • 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;
    • getAuditLogConfigsBuilder

      public AuditLogConfig.Builder getAuditLogConfigsBuilder(int index)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
    • getAuditLogConfigsOrBuilder

      public AuditLogConfigOrBuilder getAuditLogConfigsOrBuilder(int index)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
      Specified by:
      getAuditLogConfigsOrBuilder in interface AuditConfigOrBuilder
    • getAuditLogConfigsOrBuilderList

      public List<? extends AuditLogConfigOrBuilder> getAuditLogConfigsOrBuilderList()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
      Specified by:
      getAuditLogConfigsOrBuilderList in interface AuditConfigOrBuilder
    • addAuditLogConfigsBuilder

      public AuditLogConfig.Builder addAuditLogConfigsBuilder()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
    • addAuditLogConfigsBuilder

      public AuditLogConfig.Builder addAuditLogConfigsBuilder(int index)
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
    • getAuditLogConfigsBuilderList

      public List<AuditLogConfig.Builder> getAuditLogConfigsBuilderList()
       The configuration for logging of each type of permission.
       
      repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3;
    • setUnknownFields

      public final AuditConfig.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>
    • mergeUnknownFields

      public final AuditConfig.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AuditConfig.Builder>