当前位置: 首页>>代码示例>>Java>>正文


Java AbstractGoogleJsonClient类代码示例

本文整理汇总了Java中com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient的典型用法代码示例。如果您正苦于以下问题:Java AbstractGoogleJsonClient类的具体用法?Java AbstractGoogleJsonClient怎么用?Java AbstractGoogleJsonClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AbstractGoogleJsonClient类属于com.google.api.client.googleapis.services.json包,在下文中一共展示了AbstractGoogleJsonClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  String clientAccountId = getStringInput("ClientAccountId", "Enter the Client Account ID");
  List<ClientUser> allClients = adXClient.accounts().clients().users().list(accountId,
      clientAccountId).execute().getUsers();

  if (allClients != null && allClients.size() > 0) {
    System.out.printf("========================================\n");
    System.out.printf("Listing of Client Users associated with Client Account ID \"%s\"%n",
        clientAccountId);
    System.out.printf("========================================\n");
    for (ClientUser clientUser : allClients) {
      System.out.printf("User ID: %s%n", clientUser.getUserId());
      System.out.printf("\tEmail: %s%n", clientUser.getEmail());
      System.out.printf("\tStatus: %s%n", clientUser.getStatus());
    }
  } else {
    System.out.println("No Client Users were found associated to this Client Buyer.");
  }
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:23,代码来源:GetAllClientUsers.java

示例2: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  long clientAccountId = getIntInput("ClientAccountId", "Enter the Client Account ID");
  String email = getStringInput("Email", "Enter the email address");

  ClientUserInvitation invite = new ClientUserInvitation();
  invite.setEmail(email);

  invite = adXClient.accounts().clients().invitations().create(accountId, clientAccountId,
      invite).execute();

  System.out.printf("========================================\n");
  System.out.printf("Created new Invitation for Client Account ID \"%s\"%n",
      clientAccountId);
  System.out.printf("========================================\n");
  System.out.printf("Invitations ID: %s%n", invite.getInvitationId());
  System.out.printf("\tEmail: %s%n", invite.getEmail());
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:21,代码来源:CreateInvitation.java

示例3: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  List<Client> allClients = adXClient.accounts().clients().list(accountId).execute().getClients();

  if (allClients != null && allClients.size() > 0) {
    System.out.printf("========================================\n");
    System.out.printf("Listing of Client Buyers associated with AdX Account \"%s\"%n",
        accountId);
    System.out.printf("========================================\n");
    for (Client clientBuyer : allClients) {
      System.out.printf("Client Account ID: %s%n", clientBuyer.getClientAccountId());
      System.out.printf("\tClient Name: %s%n", clientBuyer.getClientName());
      System.out.printf("\tEntity ID: %s%n", clientBuyer.getEntityId());
      System.out.printf("\tEntity Name: %s%n", clientBuyer.getEntityName());
      System.out.printf("\tEntity Type: %s%n", clientBuyer.getEntityType());
      System.out.printf("\tRole: %s%n", clientBuyer.getRole());
      System.out.printf("\tStatus: %s%n", clientBuyer.getStatus());
    }
  } else {
    System.out.println("No Client Buyers were found associated to this Account.");
  }
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:25,代码来源:GetAllClientBuyers.java

示例4: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  String clientAccountId = getStringInput("ClientAccountId", "Enter the Client Account ID");
  List<ClientUserInvitation> allInvites = adXClient.accounts().clients().invitations().list(
      accountId, clientAccountId).execute().getInvitations();

  if (allInvites != null && allInvites.size() > 0) {
    System.out.printf("========================================\n");
    System.out.printf("Listing of Invitations associated with Client Account ID \"%s\"%n",
        clientAccountId);
    System.out.printf("========================================\n");
    for (ClientUserInvitation invite : allInvites) {
      System.out.printf("Invitations ID: %s%n", invite.getInvitationId());
      System.out.printf("\tEmail: %s%n", invite.getEmail());
    }
  } else {
    System.out.println("No Invitations were found associated to this Account.");
  }
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:22,代码来源:GetAllInvitations.java

示例5: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  long clientAccountId = getIntInput("ClientAccountId", "Enter the Client Account ID");
  long userId = getIntInput("userId", "Enter the User ID");
  String status = getStringInput("Status", "Enter the Status");

  ClientUser clientUser = new ClientUser();
  clientUser.setStatus(status);
  clientUser = adXClient.accounts().clients().users().update(accountId, clientAccountId, userId,
      clientUser).execute();

  System.out.printf("========================================\n");
  System.out.printf("Updated Client User with Client Account ID \"%s\" and User ID \"%s\"%n",
      clientAccountId, clientUser.getUserId());
  System.out.printf("========================================\n");
  System.out.printf("User ID: %s%n", clientUser.getUserId());
  System.out.printf("\tEmail: %s%n", clientUser.getEmail());
  System.out.printf("\tStatus: %s%n", clientUser.getStatus());
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:22,代码来源:UpdateClientUser.java

示例6: prepareBuilder

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
private <T extends AbstractGoogleJsonClient.Builder> T prepareBuilder(T builder,
    final HttpRequestInitializer delegate,
    GoogleClientRequestInitializer googleClientRequestInitializer) {
  builder
      .setHttpRequestInitializer(getHttpRequestInitializer(delegate))
      .setApplicationName(applicationName)
      .setGoogleClientRequestInitializer(googleClientRequestInitializer);

  if (rootUrl.isPresent()) {
    builder.setRootUrl(rootUrl.get());
  }
  if (servicePath.isPresent()) {
    builder.setServicePath(servicePath.get());
  }
  return builder;
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:17,代码来源:GenomicsFactory.java

示例7: setupLocalApi

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
private void setupLocalApi(AbstractGoogleJsonClient.Builder builder) {
    builder.setApplicationName(appName)
            .setRootUrl(rootUrl)
            .setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
                @Override
                public void initialize(AbstractGoogleClientRequest<?> request) throws IOException {
                    request.setDisableGZipContent(true);
                }
            });
}
 
开发者ID:AndrewJack,项目名称:moment-for-android-wear,代码行数:11,代码来源:EndpointModule.java

示例8: updateCredential

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
public static AbstractGoogleJsonClient updateCredential(AbstractGoogleJsonClient.Builder builder, String accountName) {
    GoogleAccountCredential credential = (GoogleAccountCredential) builder.getHttpRequestInitializer();
    String selectedAccountName = credential.getSelectedAccountName();
    if (selectedAccountName == null || !selectedAccountName.equals(accountName)) {
        credential.setSelectedAccountName(accountName);
        builder.setHttpRequestInitializer(credential);
    }
    return builder.build();
}
 
开发者ID:AndrewJack,项目名称:moment-for-android-wear,代码行数:10,代码来源:CredentialUtil.java

示例9: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyer adXClient = (AdExchangeBuyer) client;
  int accountId = getIntInput("AccountId", "Enter the account ID");
  String cookieMatchingUrl =
      getStringInput("CookieMatchingUrl", "Enter new cookie matching URL for the account");
  Account account = new Account();
  account.setId(accountId);
  account.setCookieMatchingUrl(cookieMatchingUrl);
  account = adXClient.accounts().patch(accountId, account).execute();

  System.out.printf("Account updated!");
  System.out.printf("Account ID: %d\n", account.getId());
  System.out.printf("- Max. total Qps: %d\n", account.getMaximumTotalQps());
  System.out.printf("- Cookie matching Nid: %s\n", account.getCookieMatchingNid());
  System.out.printf("- Cookie Matching Url: %s\n", account.getCookieMatchingUrl());
  List<BidderLocation> bidderLocations = account.getBidderLocation();
  if (bidderLocations != null && bidderLocations.size() > 0) {
    System.out.printf("- Bidder locations:\n");
    for (BidderLocation bidderLocation : bidderLocations) {
      System.out.printf("  - Bidder location Url: %s\n", bidderLocation.getUrl());
      System.out.printf("  - Bidder location Max. Qps: %d\n", bidderLocation.getMaximumQps());
    }
  } else {
    System.out.printf("- With no configured bidder locations\n");
  }
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:28,代码来源:PatchAccount.java

示例10: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyer adXClient = (AdExchangeBuyer) client;
  long accountId = getIntInput("AccountId", "Enter the creative account ID");
  String startDate = getStringInput("endDateTime",
      "The end date of the report (older date) - mm/dd/yyyy format");
  String endDate = getStringInput("startDateTime",
      "The start date of the report (end date) - mm/dd/yyyy format");
  List<PerformanceReport> allReports = adXClient.
      performanceReport().
      list(accountId, endDate, startDate).
      execute().
      getPerformanceReport();

  if (allReports != null && allReports.size() > 0) {
    System.out.printf("========================================%n");
    System.out.printf("List of performance reports for account ID \"%s\"%n",
        accountId);
    System.out.printf("========================================%n");
    for (PerformanceReport report : allReports) {
      System.out.printf("Region: %s%n", report.getRegion());
      System.out.printf("\tTime Stamp: %s%n", report.getTimestamp());
      System.out.printf("\tPixel Match Requests: %s%n",
          report.getPixelMatchRequests());
      System.out.printf("\tPixel Match Responses: %s%n",
          report.getPixelMatchResponses());
    }
  } else {
    System.out.printf("No performance reports for account ID \"%s\"%n", accountId);
  }

}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:33,代码来源:GetAllPerformanceReports.java

示例11: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyer adXClient = (AdExchangeBuyer) client;
  long accountId = getLongInput("AccountId", "Enter the account id");
  String configName = getStringInput("configName",
      "Enter the name for the pretargetConfig");
  long width = getLongInput("AdWidth", "Enter the width to target", 300L);
  long height = getLongInput("AdHeight", "Enter the height to target", 250L);

  PretargetingConfig newConfig = new PretargetingConfig();
  newConfig.setConfigName(configName);
  newConfig.setIsActive(true);
  newConfig.setCreativeType(Arrays.asList("PRETARGETING_CREATIVE_TYPE_HTML"));

  Dimensions targetDimensions = new Dimensions();
  targetDimensions.setWidth(width);
  targetDimensions.setHeight(height);
  newConfig.setDimensions(Arrays.asList(targetDimensions));

  PretargetingConfig config = adXClient.pretargetingConfig().
      insert(accountId, newConfig).execute();

  System.out.println("========================================");
  System.out.println("Inserted pretargeting config");
  System.out.println("========================================");
  System.out.println("Config Name: " + config.getConfigName());
  System.out.println("Config Id: " + config.getConfigId());
  System.out.println("Is Active: " + config.getIsActive());
  System.out.println("CreativeType: " + config.getCreativeType());
  System.out.println("Dimensions: ");
  for (Dimensions d : config.getDimensions()) {
    System.out.printf("\r%s\t%s%n", d.getWidth(), d.getHeight());
  }
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:35,代码来源:InsertPretargetingConfig.java

示例12: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyer adXClient = (AdExchangeBuyer) client;
  List<Account> allAccounts = adXClient.accounts().list().execute().getItems();

  if (allAccounts != null && allAccounts.size() > 0) {
    System.out.printf("========================================\n");
    System.out.printf("Listing of user associated accounts\n");
    System.out.printf("========================================\n");
    for (Account account : allAccounts) {
      System.out.printf("Account id: %d\n", account.getId());
      System.out.printf("- Max. total Qps: %d\n", account.getMaximumTotalQps());
      System.out.printf("- Cookie matching Nid: %s\n", account.getCookieMatchingNid());
      System.out.printf("- Cookie Matching Url: %s\n", account.getCookieMatchingUrl());
      List<BidderLocation> bidderLocations = account.getBidderLocation();
      if (bidderLocations != null && bidderLocations.size() > 0) {
        System.out.printf("- Bidder locations:\n");
        for (BidderLocation bidderLocation : bidderLocations) {
          System.out.printf("  - Bidder location Url: %s\n", bidderLocation.getUrl());
          System.out.printf(
              "  - Bidder location Max. Qps: %d\n", bidderLocation.getMaximumQps());
        }
      } else {
        System.out.printf("- With no configured bidder locations\n");
      }
    }
  } else {
    System.out.printf("No accounts were found associated to this user\n");
  }
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:31,代码来源:GetAllAccounts.java

示例13: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  long clientAccountId = getIntInput("ClientAccountId", "Enter the Client Account ID");
  String clientName = getStringInput("ClientName", "Enter the Client Name");
  long entityId = getIntInput("EntityId", "Enter the Entity ID");
  String entityName = getStringInput("EntityName", "Enter the Entity Name");
  String entityType = getStringInput("Entity Type", "Enter the Entity Type");
  String role = getStringInput("Role", "Enter the Role");
  String status = getStringInput("Status", "Enter the Status");
  boolean visibleToSeller = getBooleanInput("VisibleToSeller",
      "Is this account visible to seller? (true/false)", false);

  Client clientBuyer = new Client();
  clientBuyer.setClientName(clientName);
  clientBuyer.setEntityId(entityId);
  clientBuyer.setEntityName(entityName);
  clientBuyer.setEntityType(entityType);
  clientBuyer.setRole(role);
  clientBuyer.setStatus(status);
  clientBuyer.setVisibleToSeller(visibleToSeller);

  clientBuyer = adXClient.accounts().clients().update(accountId, clientAccountId,
      clientBuyer).execute();

  System.out.printf("========================================\n");
  System.out.printf("Updated Client Buyer with Client Account ID \"%s\"%n",
      clientAccountId);
  System.out.printf("========================================\n");
  System.out.printf("Client Account ID: %s%n", clientBuyer.getClientAccountId());
  System.out.printf("\tClient Name: %s%n", clientBuyer.getClientName());
  System.out.printf("\tEntity ID: %s%n", clientBuyer.getEntityId());
  System.out.printf("\tEntity Name: %s%n", clientBuyer.getEntityName());
  System.out.printf("\tEntity Type: %s%n", clientBuyer.getEntityType());
  System.out.printf("\tRole: %s%n", clientBuyer.getRole());
  System.out.printf("\tStatus: %s%n", clientBuyer.getStatus());  }
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:38,代码来源:UpdateClientBuyer.java

示例14: execute

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
@Override
public void execute(AbstractGoogleJsonClient client) throws IOException {
  AdExchangeBuyerII adXClient = (AdExchangeBuyerII) client;
  long accountId = getIntInput("AccountId", "Enter the Account ID");
  String clientName = getStringInput("ClientName", "Enter the Client Name");
  long entityId = getIntInput("EntityId", "Enter the Entity ID");
  String entityName = getStringInput("EntityName", "Enter the Entity Name");
  String entityType = getStringInput("Entity Type", "Enter the Entity Type");
  String role = getStringInput("Role", "Enter the Role");
  String status = getStringInput("Status", "Enter the Status");
  boolean visibleToSeller = getBooleanInput("VisibleToSeller", "Enter VisibleToSeller", false);

  Client clientBuyer = new Client();
  clientBuyer.setClientName(clientName);
  clientBuyer.setEntityId(entityId);
  clientBuyer.setEntityName(entityName);
  clientBuyer.setEntityType(entityType);
  clientBuyer.setRole(role);
  clientBuyer.setStatus(status);
  clientBuyer.setVisibleToSeller(visibleToSeller);

  clientBuyer = adXClient.accounts().clients().create(accountId, clientBuyer).execute();

  System.out.printf("========================================\n");
  System.out.printf("Created Client Buyer for Account ID \"%s\"%n",
      accountId);
  System.out.printf("========================================\n");
  System.out.printf("Client Account ID: %s%n", clientBuyer.getClientAccountId());
  System.out.printf("\tClient Name: %s%n", clientBuyer.getClientName());
  System.out.printf("\tEntity ID: %s%n", clientBuyer.getEntityId());
  System.out.printf("\tEntity Name: %s%n", clientBuyer.getEntityName());
  System.out.printf("\tEntity Type: %s%n", clientBuyer.getEntityType());
  System.out.printf("\tRole: %s%n", clientBuyer.getRole());
  System.out.printf("\tStatus: %s%n", clientBuyer.getStatus());
}
 
开发者ID:googleads,项目名称:googleads-adxbuyer-examples,代码行数:36,代码来源:CreateClientBuyer.java

示例15: fromClientSecretsFile

import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; //导入依赖的package包/类
/**
 * Prepare an AbstractGoogleJsonClient.Builder using a {@code client_secrets.json} {@link File}.
 *
 * @param builder The builder to be prepared.
 * @param clientSecretsJson {@code client_secrets.json} file.
 * @return The passed in builder, for easy chaining.
 */
public <T extends AbstractGoogleJsonClient.Builder> T fromClientSecretsFile(T builder,
    File clientSecretsJson) {
  Preconditions.checkNotNull(builder);
  Preconditions.checkNotNull(clientSecretsJson);
  return prepareBuilder(builder,
      CredentialFactory.getCredentialFromClientSecrets(clientSecretsJson.getAbsolutePath(),
          applicationName),
      null);
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:17,代码来源:GenomicsFactory.java


注:本文中的com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。