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

Examples of com.google.api.ads.dfa.axis.v1_20.UserProfile


*/
public class GetActivityTypes {

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

    // Get activity types.
    SpotlightActivityType[] spotlightActivityTypes = service.getSpotlightActivityTypes();

    // Display activity type names and IDs.
    for (SpotlightActivityType result : spotlightActivityTypes) {
      System.out.println("Activity type with name \"" + result.getName()
          + "\" and ID \"" + result.getId() + "\" was found.");
View Full Code Here


      long networkId, long permissionOneId, long permissionTwoId) throws Exception {
    // Request the service.
    SubnetworkRemote service = dfaServices.get(session, SubnetworkRemote.class);

    // Create subnetwork structure.
    Subnetwork subnetwork = new Subnetwork();
    subnetwork.setId(0);
    subnetwork.setName(subnetworkName);
    subnetwork.setNetworkId(networkId);

    // Create an array of all permissions assigned to this subnetwork and add
    // it to the subnetwork structure. To get list of available permissions,
    // run GetAvailablePermissions.java.
    long[] permissions = new long[] {permissionOneId, permissionTwoId};
    subnetwork.setAvailablePermissions(permissions);

    // Create subnetwork.
    SubnetworkSaveResult subnetworkSaveResult = service.saveSubnetwork(subnetwork);

    // Display subnetwork ID.
View Full Code Here

  private static final String PERMISSION_TWO = "INSERT_SECOND_PERMISSION_ID_HERE";

  public static void runExample(DfaServices dfaServices, DfaSession session, String subnetworkName,
      long networkId, long permissionOneId, long permissionTwoId) throws Exception {
    // Request the service.
    SubnetworkRemote service = dfaServices.get(session, SubnetworkRemote.class);

    // Create subnetwork structure.
    Subnetwork subnetwork = new Subnetwork();
    subnetwork.setId(0);
    subnetwork.setName(subnetworkName);
    subnetwork.setNetworkId(networkId);

    // Create an array of all permissions assigned to this subnetwork and add
    // it to the subnetwork structure. To get list of available permissions,
    // run GetAvailablePermissions.java.
    long[] permissions = new long[] {permissionOneId, permissionTwoId};
    subnetwork.setAvailablePermissions(permissions);

    // Create subnetwork.
    SubnetworkSaveResult subnetworkSaveResult = service.saveSubnetwork(subnetwork);

    // Display subnetwork ID.
    System.out.printf("Subnetwork with ID \"%s\" was created.%n", subnetworkSaveResult.getId());
  }
View Full Code Here

    // run GetAvailablePermissions.java.
    long[] permissions = new long[] {permissionOneId, permissionTwoId};
    subnetwork.setAvailablePermissions(permissions);

    // Create subnetwork.
    SubnetworkSaveResult subnetworkSaveResult = service.saveSubnetwork(subnetwork);

    // Display subnetwork ID.
    System.out.printf("Subnetwork with ID \"%s\" was created.%n", subnetworkSaveResult.getId());
  }
View Full Code Here

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

    // Retrieve the user who is to be modified.
    User user = userService.getUser(userId);

    // Create and configure a user filter.
    UserFilter filterToAdd = new UserFilter();
    // The following field has been filled in to make a filter that allows a
    // user to access only the assigned objects.
    // This value was determined using GetUserFilterCriteriaTypes.java.
    filterToAdd.setUserFilterCriteriaId(2);
    // Because this filter used the criteria type "Assigned" it is necessary
    // to specify what advertisers this user has access to. This next step
    // would be skipped for the criteria types "All" and "None".

    // Create an object filter to represent each object the user has access
    // to. Since this is an advertiser filter, an object filter represents an
    // advertiser. The total of object filter objects will need to match the
    // total of advertisers the user is assigned.
    ObjectFilter allowedObject = new ObjectFilter();
    // Insert the advertiser ID of an advertiser assigned to this user.
    allowedObject.setId(advertiserId);
    // Create any additional object filters that are needed, then create an
    // array of all of the object filters for this filter.
    ObjectFilter[] objectFilters = {allowedObject};
    // Add these settings to the user filter
    filterToAdd.setObjectFilters(objectFilters);

    // Add the filter to the user. The following method is specific to
    // 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

    // Retrieve the user who is to be modified.
    User user = userService.getUser(userId);

    // Create and configure a user filter.
    UserFilter filterToAdd = new UserFilter();
    // The following field has been filled in to make a filter that allows a
    // user to access only the assigned objects.
    // This value was determined using GetUserFilterCriteriaTypes.java.
    filterToAdd.setUserFilterCriteriaId(2);
    // Because this filter used the criteria type "Assigned" it is necessary
    // to specify what advertisers this user has access to. This next step
    // would be skipped for the criteria types "All" and "None".

    // Create an object filter to represent each object the user has access
    // to. Since this is an advertiser filter, an object filter represents an
    // advertiser. The total of object filter objects will need to match the
    // total of advertisers the user is assigned.
    ObjectFilter allowedObject = new ObjectFilter();
    // Insert the advertiser ID of an advertiser assigned to this user.
    allowedObject.setId(advertiserId);
    // Create any additional object filters that are needed, then create an
    // array of all of the object filters for this filter.
    ObjectFilter[] objectFilters = {allowedObject};
    // Add these settings to the user filter
    filterToAdd.setObjectFilters(objectFilters);

    // Add the filter to the user. The following method is specific to
    // advertiser filters. See the User class documentation for the names of
    // methods for other filters.
    user.setAdvertiserUserFilter(filterToAdd);
View Full Code Here

    // Request the login service from the service client factory.
    LoginRemote loginService = dfaServices.get(session, LoginRemote.class);

    // Authenticate.
    UserProfile userProfile = loginService.authenticate(username, password);

    // Display user profile token, DFA account name and ID.
    System.out.printf("User profile token is \"%s\", DFA account name is \"%s\", and DFA " +
        "account ID is \"%s\".%n", userProfile.getToken(), userProfile.getNetworkName(),
        userProfile.getNetworkId());
  }
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, long userId, long advertiserId)
          throws Exception {
    // Request the user service.
    UserRemote userService = dfaServices.get(session, UserRemote.class);

    // Retrieve the user who is to be modified.
    User user = userService.getUser(userId);

    // Create and configure a user filter.
    UserFilter filterToAdd = new UserFilter();
    // The following field has been filled in to make a filter that allows a
    // user to access only the assigned objects.
    // This value was determined using GetUserFilterCriteriaTypes.java.
    filterToAdd.setUserFilterCriteriaId(2);
    // Because this filter used the criteria type "Assigned" it is necessary
    // to specify what advertisers this user has access to. This next step
    // would be skipped for the criteria types "All" and "None".

    // Create an object filter to represent each object the user has access
    // to. Since this is an advertiser filter, an object filter represents an
    // advertiser. The total of object filter objects will need to match the
    // total of advertisers the user is assigned.
    ObjectFilter allowedObject = new ObjectFilter();
    // Insert the advertiser ID of an advertiser assigned to this user.
    allowedObject.setId(advertiserId);
    // Create any additional object filters that are needed, then create an
    // array of all of the object filters for this filter.
    ObjectFilter[] objectFilters = {allowedObject};
    // Add these settings to the user filter
    filterToAdd.setObjectFilters(objectFilters);

    // Add the filter to the user. The following method is specific to
    // 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

    // 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

TOP

Related Classes of com.google.api.ads.dfa.axis.v1_20.UserProfile

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.