code: public static void runExample(
        AdManagerServices adManagerServices, AdManagerSession session, long userId, long teamId)
        throws RemoteException {
      // Get the UserTeamAssociationService.
      UserTeamAssociationServiceInterface userTeamAssociationService =
          adManagerServices.get(session, UserTeamAssociationServiceInterface.class);
  
      // Create a statement to only select a single user team association by ID.
      StatementBuilder statementBuilder = new StatementBuilder()
          .where("userId = :userId AND teamId = :teamId")
          .orderBy("userId, teamId ASC")
          .limit(1)
          .withBindVariableValue("userId", userId)
          .withBindVariableValue("teamId", teamId);
  
      // Get the user team association.
      UserTeamAssociationPage page = userTeamAssociationService
          .getUserTeamAssociationsByStatement(statementBuilder.toStatement());
  
      UserTeamAssociation userTeamAssociation =
          Iterables.getOnlyElement(Arrays.asList(page.getResults()));
  
      // Update the user's access type on the team.
      userTeamAssociation.setOverriddenTeamAccessType(TeamAccessType.READ_ONLY);
  
      // Update the user team associations on the server.
      UserTeamAssociation[] userTeamAssociations = userTeamAssociationService
          .updateUserTeamAssociations(new UserTeamAssociation[] {userTeamAssociation});
  
      for (UserTeamAssociation updatedUserTeamAssociation : userTeamAssociations) {
        System.out.printf(
            "User team association with user ID %d and team ID %d was updated.%n",
            updatedUserTeamAssociation.getUserId(), updatedUserTeamAssociation.getTeamId());
      }
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @param userId the user ID of the user team association to update.
  @param teamId the team ID of the user team association to update.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.