final case class Policy(version: Int = 0, bindings: Seq[Binding] = _root_.scala.Seq.empty, etag: ByteString = ..., unknownFields: UnknownFieldSet = ...) extends GeneratedMessage with Updatable[Policy] with Product with Serializable

Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.

A Policy is a collection of bindings. A binding binds one or more members to a single role. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions (defined by IAM or configured by users). A binding can optionally specify a condition, which is a logic expression that further constrains the role binding based on attributes about the request and/or target resource.

**JSON Example**

{ "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ] }

**YAML Example**

bindings:

  • members:
    • user:mike@example.com
    • group:admins@example.com
    • domain:google.com
    • serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin
  • members:
    • user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')

For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs).

version

Specifies the format of the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Operations affecting conditional bindings must specify version 3. This can be either setting a conditional policy, modifying a conditional binding, or removing a conditional binding from the stored conditional policy. Operations on non-conditional policies may specify any valid value or leave the field unset. If no etag is provided in the call to setIamPolicy, any version compliance checks on the incoming and/or stored policy is skipped.

bindings

Associates a list of members to a role. Optionally may specify a condition that determines when binding is in effect. bindings with no members will result in an error.

etag

etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten. Due to blind-set semantics of an etag-less policy, 'setIamPolicy' will not fail even if either of incoming or stored policy does not meet the version requirements.

Annotations
@SerialVersionUID()
Linear Supertypes
Product, Equals, Updatable[Policy], GeneratedMessage, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Policy
  2. Product
  3. Equals
  4. Updatable
  5. GeneratedMessage
  6. Serializable
  7. Serializable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Policy(version: Int = 0, bindings: Seq[Binding] = _root_.scala.Seq.empty, etag: ByteString = ..., unknownFields: UnknownFieldSet = ...)

    version

    Specifies the format of the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Operations affecting conditional bindings must specify version 3. This can be either setting a conditional policy, modifying a conditional binding, or removing a conditional binding from the stored conditional policy. Operations on non-conditional policies may specify any valid value or leave the field unset. If no etag is provided in the call to setIamPolicy, any version compliance checks on the incoming and/or stored policy is skipped.

    bindings

    Associates a list of members to a role. Optionally may specify a condition that determines when binding is in effect. bindings with no members will result in an error.

    etag

    etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten. Due to blind-set semantics of an etag-less policy, 'setIamPolicy' will not fail even if either of incoming or stored policy does not meet the version requirements.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addAllBindings(__vs: Iterable[Binding]): Policy
  5. def addBindings(__vs: Binding*): Policy
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val bindings: Seq[Binding]
  8. def clearBindings: Policy
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  10. def companion: Policy.type
    Definition Classes
    Policy → GeneratedMessage
  11. def discardUnknownFields: Policy
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. val etag: ByteString
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def getField(__field: FieldDescriptor): PValue
    Definition Classes
    Policy → GeneratedMessage
  17. def getFieldByNumber(__fieldNumber: Int): Any
    Definition Classes
    Policy → GeneratedMessage
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def serializedSize: Int
    Definition Classes
    Policy → GeneratedMessage
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. final def toByteArray: Array[Byte]
    Definition Classes
    GeneratedMessage
  25. final def toByteString: ByteString
    Definition Classes
    GeneratedMessage
  26. final def toPMessage: PMessage
    Definition Classes
    GeneratedMessage
  27. def toProtoString: String
    Definition Classes
    Policy → GeneratedMessage
  28. val unknownFields: UnknownFieldSet
  29. def update(ms: (Lens[Policy, Policy]) ⇒ Mutation[Policy]*): Policy
    Definition Classes
    Updatable
  30. val version: Int
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  34. def withBindings(__v: Seq[Binding]): Policy
  35. def withEtag(__v: ByteString): Policy
  36. def withUnknownFields(__v: UnknownFieldSet): Policy
  37. def withVersion(__v: Int): Policy
  38. final def writeDelimitedTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage
  39. def writeTo(_output__: CodedOutputStream): Unit
    Definition Classes
    Policy → GeneratedMessage
  40. final def writeTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage

Inherited from Product

Inherited from Equals

Inherited from Updatable[Policy]

Inherited from GeneratedMessage

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped