{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-workspace/json-schema/google-workspace-modify-membership-roles-request-schema.json",
  "title": "ModifyMembershipRolesRequest",
  "description": "The request message for MembershipsService.ModifyMembershipRoles.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-workspace-cloudidentity-groups-api-openapi.yml#/components/schemas/ModifyMembershipRolesRequest",
  "properties": {
    "removeRoles": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "The `name`s of the `MembershipRole`s to be removed. Adding or removing roles in the same request as updating roles is not supported. It is not possible to remove the `MEMBER` `MembershipRole`. If you wish to delete a `Membership`, call MembershipsService.DeleteMembership instead. Must not contain `MEMBER`. Must not be set if `update_roles_params` is set."
    },
    "updateRolesParams": {
      "items": {
        "$ref": "#/$defs/UpdateMembershipRolesParams"
      },
      "description": "The `MembershipRole`s to be updated. Updating roles in the same request as adding or removing roles is not supported. Must not be set if either `add_roles` or `remove_roles` is set.",
      "type": "array"
    },
    "addRoles": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MembershipRole"
      },
      "description": "The `MembershipRole`s to be added. Adding or removing roles in the same request as updating roles is not supported. Must not be set if `update_roles_params` is set."
    }
  },
  "type": "object",
  "$defs": {
    "ExpiryDetail": {
      "description": "The `MembershipRole` expiry details.",
      "type": "object",
      "properties": {
        "expireTime": {
          "format": "google-datetime",
          "type": "string",
          "description": "The time at which the `MembershipRole` will expire."
        }
      }
    },
    "MembershipRole": {
      "type": "object",
      "properties": {
        "name": {
          "description": "The name of the `MembershipRole`. Must be one of `OWNER`, `MANAGER`, `MEMBER`.",
          "type": "string"
        },
        "expiryDetail": {
          "$ref": "#/$defs/ExpiryDetail",
          "description": "The expiry details of the `MembershipRole`. Expiry details are only supported for `MEMBER` `MembershipRoles`. May be set if `name` is `MEMBER`. Must not be set if `name` is any other value."
        },
        "restrictionEvaluations": {
          "$ref": "#/$defs/RestrictionEvaluations",
          "description": "Evaluations of restrictions applied to parent group on this membership."
        }
      },
      "description": "A membership role within the Cloud Identity Groups API. A `MembershipRole` defines the privileges granted to a `Membership`."
    },
    "MembershipRoleRestrictionEvaluation": {
      "properties": {
        "state": {
          "enum": [
            "STATE_UNSPECIFIED",
            "COMPLIANT",
            "FORWARD_COMPLIANT",
            "NON_COMPLIANT",
            "EVALUATING"
          ],
          "description": "Output only. The current state of the restriction",
          "type": "string",
          "readOnly": true
        }
      },
      "type": "object",
      "description": "The evaluated state of this restriction."
    },
    "RestrictionEvaluations": {
      "description": "Evaluations of restrictions applied to parent group on this membership.",
      "type": "object",
      "properties": {
        "memberRestrictionEvaluation": {
          "$ref": "#/$defs/MembershipRoleRestrictionEvaluation",
          "description": "Evaluation of the member restriction applied to this membership. Empty if the user lacks permission to view the restriction evaluation."
        }
      }
    },
    "UpdateMembershipRolesParams": {
      "description": "The details of an update to a `MembershipRole`.",
      "properties": {
        "membershipRole": {
          "$ref": "#/$defs/MembershipRole",
          "description": "The `MembershipRole`s to be updated. Only `MEMBER` `MembershipRole` can currently be updated."
        },
        "fieldMask": {
          "format": "google-fieldmask",
          "description": "The fully-qualified names of fields to update. May only contain the field `expiry_detail.expire_time`.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}