Package com.google.api.ads.dfa.axis.v1_19

Examples of com.google.api.ads.dfa.axis.v1_19.UserRoleRemote


    // Get user roles that match the search criteria.
    UserRoleSearchCriteria userRoleSearchCriteria = new UserRoleSearchCriteria();
    userRoleSearchCriteria.setSearchString(searchString);
    userRoleSearchCriteria.setPageSize(10);
    UserRoleRecordSet userRoleRecordSet = userRoleService.getUserRoles(userRoleSearchCriteria);

    // Display user role names, IDs, subnetwork IDs, number of assigned users, and
    // assigned permissions.
    if (userRoleRecordSet.getUserRoles().length > 0) {
      for (UserRole userRole: userRoleRecordSet.getUserRoles()) {
        System.out.printf("User role with name \"%s\", ID \"%s\", subnetwork ID \"%s\", and " +
            "assigned to \"%s\" users was found.%n", userRole.getName(), userRole.getId(),
            userRole.getSubnetworkId(), userRole.getTotalAssignedUsers());
        if (userRole.getPermissions().length > 0) {
          System.out.printf("/tThe above user role has the following permissions:%n");
View Full Code Here


  private static final String SEARCH_STRING = "INSERT_SEARCH_CRITERIA_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the user role service.
    UserRoleRemote userRoleService = dfaServices.get(session, UserRoleRemote.class);

    // Get user roles that match the search criteria.
    UserRoleSearchCriteria userRoleSearchCriteria = new UserRoleSearchCriteria();
    userRoleSearchCriteria.setSearchString(searchString);
    userRoleSearchCriteria.setPageSize(10);
    UserRoleRecordSet userRoleRecordSet = userRoleService.getUserRoles(userRoleSearchCriteria);

    // Display user role names, IDs, subnetwork IDs, number of assigned users, and
    // assigned permissions.
    if (userRoleRecordSet.getUserRoles().length > 0) {
      for (UserRole userRole: userRoleRecordSet.getUserRoles()) {
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String userRoleName, long subnetworkId,
      long parentUserRoleId, long permission1Id, long permission2Id) throws Exception {
    // Request the service.
    UserRoleRemote service = dfaServices.get(session, UserRoleRemote.class);

    // Create user role structure.
    UserRole userRole = new UserRole();
    userRole.setId(0);
    userRole.setName(userRoleName);
    userRole.setSubnetworkId(subnetworkId);
    userRole.setParentUserRoleId(parentUserRoleId);

    // Create a permission object to represent each permission this user role
    // has.
    Permission permission1 = new Permission();
    permission1.setId(permission1Id);
    Permission permission2 = new Permission();
    permission2.setId(permission2Id);
    Permission[] permissions = new Permission[] {permission1, permission2};

    // Add the permissions to the user role.
    userRole.setPermissions(permissions);

    // Create user role.
    UserRoleSaveResult userRoleSaveResult = service.saveUserRole(userRole);

    // Display user role ID.
    System.out.println("User role with ID \"" + userRoleSaveResult.getId()
        "\" was created.");
  }
View Full Code Here

  private static final String SUBNETWORK_ID = "INSERT_SUBNETWORK_ID_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, long subnetworkId) throws Exception {
    // Request the service.
    UserRoleRemote service = dfaServices.get(session, UserRoleRemote.class);

    // Get available permissions.
    Permission[] permissions = service.getAvailablePermissions(subnetworkId);

    // Display permission name and its ID.
    for (Permission result : permissions) {
      System.out.println("Permission with name \"" + result.getName()
          + "\" and ID \"" + result.getId() + "\" was found.");
View Full Code Here

      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the user role service.
    UserRoleRemote userRoleService = dfaServices.get(session, UserRoleRemote.class);

    // Get user roles that match the search criteria.
    UserRoleSearchCriteria userRoleSearchCriteria = new UserRoleSearchCriteria();
    userRoleSearchCriteria.setSearchString(searchString);
    userRoleSearchCriteria.setPageSize(10);
    UserRoleRecordSet userRoleRecordSet = userRoleService.getUserRoles(userRoleSearchCriteria);

    // Display user role names, IDs, subnetwork IDs, number of assigned users, and
    // assigned permissions.
    if (userRoleRecordSet.getUserRoles().length > 0) {
View Full Code Here

    // advertiser filters. See the User class documentation for the names of
    // methods for other filters.
    user.setAdvertiserUserFilter(filterToAdd);

    // Save the changes made and display a success message.
    UserSaveResult userSaveResult = userService.saveUser(user);
    System.out.printf("User with ID \"%s\" was modified.", userSaveResult.getId());
  }
View Full Code Here

      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the user service.
    UserRemote userService = dfaServices.get(session, UserRemote.class);

    // Get users that match the search criteria.
    UserSearchCriteria userSearchCriteria = new UserSearchCriteria();
    userSearchCriteria.setSearchString(searchString);
    userSearchCriteria.setPageSize(10);
    UserRecordSet userRecordSet = userService.getUsersByCriteria(userSearchCriteria);

    // Display user names, IDs, network IDs, subnetwork IDs, and group IDs.
    if (userRecordSet.getRecords().length > 0) {
      for (User user: userRecordSet.getRecords()) {
View Full Code Here

  private static final String SEARCH_STRING = "INSERT_SEARCH_CRITERIA_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the user role service.
    UserRoleRemote userRoleService = dfaServices.get(session, UserRoleRemote.class);

    // Get user roles that match the search criteria.
    UserRoleSearchCriteria userRoleSearchCriteria = new UserRoleSearchCriteria();
    userRoleSearchCriteria.setSearchString(searchString);
    userRoleSearchCriteria.setPageSize(10);
    UserRoleRecordSet userRoleRecordSet = userRoleService.getUserRoles(userRoleSearchCriteria);

    // Display user role names, IDs, subnetwork IDs, number of assigned users, and
    // assigned permissions.
    if (userRoleRecordSet.getUserRoles().length > 0) {
      for (UserRole userRole: userRoleRecordSet.getUserRoles()) {
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String userRoleName, long subnetworkId,
      long parentUserRoleId, long permission1Id, long permission2Id) throws Exception {
    // Request the service.
    UserRoleRemote service = dfaServices.get(session, UserRoleRemote.class);

    // Create user role structure.
    UserRole userRole = new UserRole();
    userRole.setId(0);
    userRole.setName(userRoleName);
    userRole.setSubnetworkId(subnetworkId);
    userRole.setParentUserRoleId(parentUserRoleId);

    // Create a permission object to represent each permission this user role
    // has.
    Permission permission1 = new Permission();
    permission1.setId(permission1Id);
    Permission permission2 = new Permission();
    permission2.setId(permission2Id);
    Permission[] permissions = new Permission[] {permission1, permission2};

    // Add the permissions to the user role.
    userRole.setPermissions(permissions);

    // Create user role.
    UserRoleSaveResult userRoleSaveResult = service.saveUserRole(userRole);

    // Display user role ID.
    System.out.println("User role with ID \"" + userRoleSaveResult.getId()
        "\" was created.");
  }
View Full Code Here

  private static final String SUBNETWORK_ID = "INSERT_SUBNETWORK_ID_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, long subnetworkId) throws Exception {
    // Request the service.
    UserRoleRemote service = dfaServices.get(session, UserRoleRemote.class);

    // Get available permissions.
    Permission[] permissions = service.getAvailablePermissions(subnetworkId);

    // Display permission name and its ID.
    for (Permission result : permissions) {
      System.out.println("Permission with name \"" + result.getName()
          + "\" and ID \"" + result.getId() + "\" was found.");
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfa.axis.v1_19.UserRoleRemote

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.