Current section

Files

Jump to
google_api_spanner lib google_api spanner v1 model audit_config.ex
Raw

lib/google_api/spanner/v1/model/audit_config.ex

# Copyright 2017 Google Inc.
#
# 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.
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule GoogleApi.Spanner.V1.Model.AuditConfig do
@moduledoc """
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 AuditConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\" \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:foo@gmail.com\" ] }, { \"log_type\": \"DATA_WRITE\", }, { \"log_type\": \"ADMIN_READ\", } ] }, { \"service\": \"fooservice.googleapis.com\" \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:bar@gmail.com\" ] } ] } ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging.
## Attributes
- auditLogConfigs (List[AuditLogConfig]): The configuration for logging of each type of permission. Next ID: 4 Defaults to: `null`.
- exemptedMembers (List[String]): Defaults to: `null`.
- service (String): 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. Defaults to: `null`.
"""
defstruct [
:"auditLogConfigs",
:"exemptedMembers",
:"service"
]
end
defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.AuditConfig do
import GoogleApi.Spanner.V1.Deserializer
def decode(value, options) do
value
|> deserialize(:"auditLogConfigs", :list, GoogleApi.Spanner.V1.Model.AuditLogConfig, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.AuditConfig do
def encode(value, options) do
GoogleApi.Spanner.V1.Deserializer.serialize_non_nil(value, options)
end
end