Class AuditConfig.Builder (1.19.0)

public static final class AuditConfig.Builder extends 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.cloud.compute.v1.AuditConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllAuditLogConfigs(Iterable<? extends AuditLogConfig> values)

public AuditConfig.Builder addAllAuditLogConfigs(Iterable<? extends AuditLogConfig> values)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.compute.v1.AuditLogConfig>
Returns
TypeDescription
AuditConfig.Builder

addAllExemptedMembers(Iterable<String> values)

public AuditConfig.Builder addAllExemptedMembers(Iterable<String> values)

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Parameter
NameDescription
valuesIterable<String>

The exemptedMembers to add.

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

addAuditLogConfigs(AuditLogConfig value)

public AuditConfig.Builder addAuditLogConfigs(AuditLogConfig value)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
valueAuditLogConfig
Returns
TypeDescription
AuditConfig.Builder

addAuditLogConfigs(AuditLogConfig.Builder builderForValue)

public AuditConfig.Builder addAuditLogConfigs(AuditLogConfig.Builder builderForValue)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
builderForValueAuditLogConfig.Builder
Returns
TypeDescription
AuditConfig.Builder

addAuditLogConfigs(int index, AuditLogConfig value)

public AuditConfig.Builder addAuditLogConfigs(int index, AuditLogConfig value)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameters
NameDescription
indexint
valueAuditLogConfig
Returns
TypeDescription
AuditConfig.Builder

addAuditLogConfigs(int index, AuditLogConfig.Builder builderForValue)

public AuditConfig.Builder addAuditLogConfigs(int index, AuditLogConfig.Builder builderForValue)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameters
NameDescription
indexint
builderForValueAuditLogConfig.Builder
Returns
TypeDescription
AuditConfig.Builder

addAuditLogConfigsBuilder()

public AuditLogConfig.Builder addAuditLogConfigsBuilder()

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Returns
TypeDescription
AuditLogConfig.Builder

addAuditLogConfigsBuilder(int index)

public AuditLogConfig.Builder addAuditLogConfigsBuilder(int index)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuditLogConfig.Builder

addExemptedMembers(String value)

public AuditConfig.Builder addExemptedMembers(String value)

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Parameter
NameDescription
valueString

The exemptedMembers to add.

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

addExemptedMembersBytes(ByteString value)

public AuditConfig.Builder addExemptedMembersBytes(ByteString value)

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Parameter
NameDescription
valueByteString

The bytes of the exemptedMembers to add.

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AuditConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AuditConfig.Builder
Overrides

build()

public AuditConfig build()
Returns
TypeDescription
AuditConfig

buildPartial()

public AuditConfig buildPartial()
Returns
TypeDescription
AuditConfig

clear()

public AuditConfig.Builder clear()
Returns
TypeDescription
AuditConfig.Builder
Overrides

clearAuditLogConfigs()

public AuditConfig.Builder clearAuditLogConfigs()

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Returns
TypeDescription
AuditConfig.Builder

clearExemptedMembers()

public AuditConfig.Builder clearExemptedMembers()

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AuditConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
AuditConfig.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public AuditConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
AuditConfig.Builder
Overrides

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.

optional string service = 373540533;

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

clone()

public AuditConfig.Builder clone()
Returns
TypeDescription
AuditConfig.Builder
Overrides

getAuditLogConfigs(int index)

public AuditLogConfig getAuditLogConfigs(int index)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuditLogConfig

getAuditLogConfigsBuilder(int index)

public AuditLogConfig.Builder getAuditLogConfigsBuilder(int index)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuditLogConfig.Builder

getAuditLogConfigsBuilderList()

public List<AuditLogConfig.Builder> getAuditLogConfigsBuilderList()

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Returns
TypeDescription
List<Builder>

getAuditLogConfigsCount()

public int getAuditLogConfigsCount()

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Returns
TypeDescription
int

getAuditLogConfigsList()

public List<AuditLogConfig> getAuditLogConfigsList()

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Returns
TypeDescription
List<AuditLogConfig>

getAuditLogConfigsOrBuilder(int index)

public AuditLogConfigOrBuilder getAuditLogConfigsOrBuilder(int index)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuditLogConfigOrBuilder

getAuditLogConfigsOrBuilderList()

public List<? extends AuditLogConfigOrBuilder> getAuditLogConfigsOrBuilderList()

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Returns
TypeDescription
List<? extends com.google.cloud.compute.v1.AuditLogConfigOrBuilder>

getDefaultInstanceForType()

public AuditConfig getDefaultInstanceForType()
Returns
TypeDescription
AuditConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getExemptedMembers(int index)

public String getExemptedMembers(int index)

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The exemptedMembers at the given index.

getExemptedMembersBytes(int index)

public ByteString getExemptedMembersBytes(int index)

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the exemptedMembers at the given index.

getExemptedMembersCount()

public int getExemptedMembersCount()

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Returns
TypeDescription
int

The count of exemptedMembers.

getExemptedMembersList()

public ProtocolStringList getExemptedMembersList()

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Returns
TypeDescription
ProtocolStringList

A list containing the exemptedMembers.

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.

optional string service = 373540533;

Returns
TypeDescription
String

The service.

getServiceBytes()

public 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.

optional string service = 373540533;

Returns
TypeDescription
ByteString

The bytes for service.

hasService()

public boolean hasService()

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.

optional string service = 373540533;

Returns
TypeDescription
boolean

Whether the service field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(AuditConfig other)

public AuditConfig.Builder mergeFrom(AuditConfig other)
Parameter
NameDescription
otherAuditConfig
Returns
TypeDescription
AuditConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AuditConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AuditConfig.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public AuditConfig.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
AuditConfig.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AuditConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AuditConfig.Builder
Overrides

removeAuditLogConfigs(int index)

public AuditConfig.Builder removeAuditLogConfigs(int index)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameter
NameDescription
indexint
Returns
TypeDescription
AuditConfig.Builder

setAuditLogConfigs(int index, AuditLogConfig value)

public AuditConfig.Builder setAuditLogConfigs(int index, AuditLogConfig value)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameters
NameDescription
indexint
valueAuditLogConfig
Returns
TypeDescription
AuditConfig.Builder

setAuditLogConfigs(int index, AuditLogConfig.Builder builderForValue)

public AuditConfig.Builder setAuditLogConfigs(int index, AuditLogConfig.Builder builderForValue)

The configuration for logging of each type of permission.

repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626;

Parameters
NameDescription
indexint
builderForValueAuditLogConfig.Builder
Returns
TypeDescription
AuditConfig.Builder

setExemptedMembers(int index, String value)

public AuditConfig.Builder setExemptedMembers(int index, String value)

This is deprecated and has no effect. Do not use.

repeated string exempted_members = 232615576;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The exemptedMembers to set.

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public AuditConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AuditConfig.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AuditConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
AuditConfig.Builder
Overrides

setService(String value)

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.

optional string service = 373540533;

Parameter
NameDescription
valueString

The service to set.

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

setServiceBytes(ByteString value)

public AuditConfig.Builder setServiceBytes(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.

optional string service = 373540533;

Parameter
NameDescription
valueByteString

The bytes for service to set.

Returns
TypeDescription
AuditConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AuditConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AuditConfig.Builder
Overrides