# `GraphApi.Groups`
[🔗](https://github.com/keenmate/microsoft_graph/blob/v1.0.0-rc.1/lib/graph_api/resources/groups.ex#L1)

Operations on the `/groups` resource.

## Examples

    {:ok, %{"value" => groups}} = GraphApi.Groups.list()
    {:ok, group} = GraphApi.Groups.get("group-id")
    {:ok, %{"value" => members}} = GraphApi.Groups.list_members("group-id")

# `add_app_role_assignment`

```elixir
@spec add_app_role_assignment(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Adds an app role assignment to a group.

# `add_app_role_assignment_query`

```elixir
@spec add_app_role_assignment_query(String.t(), map(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `add_app_role_assignment/3`.

# `add_member`

```elixir
@spec add_member(String.t(), String.t(), keyword()) :: :ok | {:error, term()}
```

Adds a member to a group.

The `member_id` should be the directory object ID of the user or service principal.

# `add_member_query`

```elixir
@spec add_member_query(String.t(), String.t(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `add_member/3`.

# `add_owner`

```elixir
@spec add_owner(String.t(), String.t(), keyword()) :: :ok | {:error, term()}
```

Adds an owner to a group.

The `owner_id` should be the directory object ID of the user.

# `add_owner_query`

```elixir
@spec add_owner_query(String.t(), String.t(), keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `add_owner/3`.

# `assign_license`

```elixir
@spec assign_license(String.t(), map(), keyword()) :: {:ok, map()} | {:error, term()}
```

Assigns licenses to a group.

# `assign_license_query`

```elixir
@spec assign_license_query(String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `assign_license/3`.

# `check_member_groups`

```elixir
@spec check_member_groups(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Checks whether the group is a member of the specified groups.

# `check_member_groups_query`

```elixir
@spec check_member_groups_query(String.t(), map(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `check_member_groups/3`.

# `check_member_objects`

```elixir
@spec check_member_objects(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Checks whether the group is a member of the specified objects.

# `check_member_objects_query`

```elixir
@spec check_member_objects_query(String.t(), map(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `check_member_objects/3`.

# `create`

```elixir
@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Creates a new group.

# `create_query`

```elixir
@spec create_query(
  map(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `create/2`.

# `delete`

```elixir
@spec delete(
  String.t(),
  keyword()
) :: :ok | {:error, term()}
```

Deletes a group.

# `delete_query`

```elixir
@spec delete_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `delete/2`.

# `delta`

```elixir
@spec delta(keyword()) :: {:ok, GraphApi.Delta.delta_page()} | {:error, term()}
```

Delta query for groups. Returns changes since the last sync.

See `GraphApi.Delta` for details.

# `delta_query`

```elixir
@spec delta_query(keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `delta/1`.

# `get`

```elixir
@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Gets a group by ID.

# `get_member_groups`

```elixir
@spec get_member_groups(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Returns all group IDs the group is a member of (transitive).

# `get_member_groups_query`

```elixir
@spec get_member_groups_query(String.t(), map(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `get_member_groups/3`.

# `get_member_objects`

```elixir
@spec get_member_objects(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Returns all group and directory role IDs the group is a member of (transitive).

# `get_member_objects_query`

```elixir
@spec get_member_objects_query(String.t(), map(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `get_member_objects/3`.

# `get_query`

```elixir
@spec get_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `get/2`.

# `list`

```elixir
@spec list(keyword()) :: {:ok, map()} | {:error, term()}
```

Lists groups in the organization.

# `list_app_role_assignments`

```elixir
@spec list_app_role_assignments(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists app role assignments for a group.

# `list_app_role_assignments_query`

```elixir
@spec list_app_role_assignments_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_app_role_assignments/2`.

# `list_member_of`

```elixir
@spec list_member_of(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists groups and directory roles the group is a member of.

# `list_member_of_query`

```elixir
@spec list_member_of_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_member_of/2`.

# `list_members`

```elixir
@spec list_members(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists members of a group.

# `list_members_query`

```elixir
@spec list_members_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_members/2`.

# `list_owners`

```elixir
@spec list_owners(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists owners of a group.

# `list_owners_query`

```elixir
@spec list_owners_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_owners/2`.

# `list_permission_grants`

```elixir
@spec list_permission_grants(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists resource-specific permission grants on a group.

# `list_permission_grants_query`

```elixir
@spec list_permission_grants_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_permission_grants/2`.

# `list_query`

```elixir
@spec list_query(keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list/1`.

# `list_transitive_member_of`

```elixir
@spec list_transitive_member_of(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists groups and directory roles the group is a transitive member of.

# `list_transitive_member_of_query`

```elixir
@spec list_transitive_member_of_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_transitive_member_of/2`.

# `list_transitive_members`

```elixir
@spec list_transitive_members(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Lists transitive members of a group.

# `list_transitive_members_query`

```elixir
@spec list_transitive_members_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `list_transitive_members/2`.

# `members_delta`

```elixir
@spec members_delta(
  String.t(),
  keyword()
) :: {:ok, GraphApi.Delta.delta_page()} | {:error, term()}
```

Delta query for group membership. Returns member changes since the last sync.

# `members_delta_query`

```elixir
@spec members_delta_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `members_delta/2`.

# `remove_app_role_assignment`

```elixir
@spec remove_app_role_assignment(String.t(), String.t(), keyword()) ::
  :ok | {:error, term()}
```

Removes an app role assignment from a group.

# `remove_app_role_assignment_query`

```elixir
@spec remove_app_role_assignment_query(String.t(), String.t(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `remove_app_role_assignment/3`.

# `remove_member`

```elixir
@spec remove_member(String.t(), String.t(), keyword()) :: :ok | {:error, term()}
```

Removes a member from a group.

# `remove_member_query`

```elixir
@spec remove_member_query(String.t(), String.t(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `remove_member/3`.

# `remove_owner`

```elixir
@spec remove_owner(String.t(), String.t(), keyword()) :: :ok | {:error, term()}
```

Removes an owner from a group.

# `remove_owner_query`

```elixir
@spec remove_owner_query(String.t(), String.t(), keyword()) ::
  GraphApi.Batch.Request.t()
```

Batch query variant of `remove_owner/3`.

# `renew`

```elixir
@spec renew(
  String.t(),
  keyword()
) :: :ok | {:error, term()}
```

Renews a group's expiration.

# `renew_query`

```elixir
@spec renew_query(
  String.t(),
  keyword()
) :: GraphApi.Batch.Request.t()
```

Batch query variant of `renew/2`.

# `update`

```elixir
@spec update(String.t(), map(), keyword()) :: {:ok, map()} | :ok | {:error, term()}
```

Updates a group.

# `update_query`

```elixir
@spec update_query(String.t(), map(), keyword()) :: GraphApi.Batch.Request.t()
```

Batch query variant of `update/3`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
