com.amazonaws.auth.policy

## クラス Principal

- java.lang.Object
- - com.amazonaws.auth.policy.Principal

-     public class Principal
      extends java.lang.Object

  A principal is an AWS account or AWS web serivce, which is being allowed or denied access to a resource through an access control policy. The principal is a property of the `Statement` object, not directly the `Policy` object.

  The principal is A in the statement "A has permission to do B to C where D applies."

  In an access control policy statement, you can set the principal to all authenticated AWS users through the `AllUsers` member. This is useful when you don't want to restrict access based on the identity of the requester, but instead on other identifying characteristics such as the requester's IP address.

- - ### ネストされたクラスの概要

    ネストされたクラス
    修飾子とタイプ | クラスと説明
    --- | ---
    `static class` | `Principal.Services` The services who have the right to do the assume the role action.
    `static class` | `Principal.WebIdentityProviders` Web identity providers, such as Login with Amazon, Facebook, or Google.

  - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `static Principal` | `AllUsers` Principal instance that includes all users, including anonymous users.

  - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `Principal(Principal.Services service)` Constructs a new principal with the specified AWS web service which is being allowed or denied access to a resource through an access control policy.
    `Principal(Principal.WebIdentityProviders webIdentityProvider)` Constructs a new principal with the specified web identity provider.
    `Principal(java.lang.String accountId)` Constructs a new principal with the specified AWS account ID.

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `java.lang.String` | `getId()` Returns the unique ID for this principal.
    `java.lang.String` | `getProvider()` Returns the provider for this principal, which indicates in what group of users this principal resides.

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### フィールドの詳細

    - #### AllUsers

          public static final Principal AllUsers

      Principal instance that includes all users, including anonymous users.

      This is useful when you don't want to restrict access based on the identity of the requester, but instead on other identifying characteristics such as the requester's IP address.

  - ### コンストラクタの詳細

    - #### Principal

          public Principal(Principal.Services service)

      Constructs a new principal with the specified AWS web service which is being allowed or denied access to a resource through an access control policy.
      パラメータ:
        `service` - An AWS service.

    - #### Principal

          public Principal(java.lang.String accountId)

      Constructs a new principal with the specified AWS account ID.
      パラメータ:
        `accountId` - An AWS account ID.

    - #### Principal

          public Principal(Principal.WebIdentityProviders webIdentityProvider)

      Constructs a new principal with the specified web identity provider.
      パラメータ:
        `webIdentityProvider` - An web identity provider.

  - ### メソッドの詳細

    - #### getProvider

          public java.lang.String getProvider()

      Returns the provider for this principal, which indicates in what group of users this principal resides.
      戻り値:
        The provider for this principal.

    - #### getId

          public java.lang.String getId()

      Returns the unique ID for this principal.
      戻り値:
        The unique ID for this principal.