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


Java DfpSession类代码示例

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


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

示例1: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final InventoryServiceInterface inventoryService =
      dfpServices.get(session, InventoryServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return inventoryService.getAdUnitsByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:AdUnitFetcher.java

示例2: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final CreativeServiceInterface creativeService =
      dfpServices.get(session, CreativeServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return creativeService.getCreativesByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:CreativeFetcher.java

示例3: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final CreativeTemplateServiceInterface creativeTemplateService =
      dfpServices.get(session, CreativeTemplateServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return creativeTemplateService.getCreativeTemplatesByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:CreativeTemplateFetcher.java

示例4: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final LineItemCreativeAssociationServiceInterface lineItemCreativeAssociationService =
      dfpServices.get(session, LineItemCreativeAssociationServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return lineItemCreativeAssociationService.getLineItemCreativeAssociationsByStatement(
          statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:18,代码来源:LineItemCreativeAssociationFetcher.java

示例5: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final LineItemServiceInterface lineItemService =
      dfpServices.get(session, LineItemServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return lineItemService.getLineItemsByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:LineItemFetcher.java

示例6: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final CompanyServiceInterface companyService =
      dfpServices.get(session, CompanyServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return companyService.getCompaniesByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:CompanyFetcher.java

示例7: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final OrderServiceInterface orderService =
      dfpServices.get(session, OrderServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return orderService.getOrdersByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:OrderFetcher.java

示例8: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final CustomTargetingServiceInterface customTargetingService =
      dfpServices.get(session, CustomTargetingServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return customTargetingService.getCustomTargetingKeysByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:CustomTargetingKeyFetcher.java

示例9: fetch

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public void fetch(String filterText, String channelKey, String tag, String requestId,
    DfpSession session) {
  // Create the service.
  final CustomTargetingServiceInterface customTargetingService =
      dfpServices.get(session, CustomTargetingServiceInterface.class);

  // Create the page fetcher.
  PageFetcher pageFetcher = new PageFetcher() {

    public Object getByStatement(Statement statement) throws ApiException_Exception {
      return customTargetingService.getCustomTargetingValuesByStatement(statement);
    }
  };
  // Fetch the objects.
  fetchObjects(filterText, channelKey, tag, requestId, pageFetcher);
}
 
开发者ID:googleads,项目名称:googleads-dfp-java-dfp-playground,代码行数:17,代码来源:CustomTargetingValueFetcher.java

示例10: main

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  // Generate a refreshable OAuth2 credential for authentication.
  Credential oAuth2Credential = new OfflineCredentials.Builder()
      .forApi(Api.DFP)
      .fromFile()
      .build()
      .generateCredential();

  // Construct an API session configured from a properties file and the OAuth2
  // credentials above.
  DfpSession session = new DfpSession.Builder()
      .fromFile()
      .withOAuth2Credential(oAuth2Credential)
      .build();

  DfpServices dfpServices = new DfpServices();

  runExample(dfpServices, session);
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:20,代码来源:GetActiveCreativeWrappers.java

示例11: DfpServiceClientFactoryHelper

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param adsServiceClientFactory the ads service client factory
 * @param adsServiceDescriptorFactory the ads service descriptor factory
 * @param soapClientHandler the SOAP client handler
 * @param adsLibConfiguration the lib configuration
 */
@SuppressWarnings("unchecked") /* See comments on soapClientHandler argument. */
@Inject
public DfpServiceClientFactoryHelper(
    AdsServiceClientFactoryInterface<DfpServiceClient,
                                     DfpSession,
                                     DfpServiceDescriptor> adsServiceClientFactory,
    AdsServiceDescriptorFactoryInterface<DfpServiceDescriptor> adsServiceDescriptorFactory,
    @SuppressWarnings("rawtypes") /* Guice binding for SoapClientHandlerInterface does not include
                                   * the type argument T because it is bound in the SOAP
                                   * toolkit-agnostic configuration module. Therefore, must use
                                   * the raw type here. */
    SoapClientHandlerInterface soapClientHandler,
    AdsLibConfiguration adsLibConfiguration) {
  super(adsServiceClientFactory, adsServiceDescriptorFactory, soapClientHandler);
  this.adsLibConfiguration = adsLibConfiguration;
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:25,代码来源:DfpServiceClientFactoryHelper.java

示例12: main

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  // Generate a refreshable OAuth2 credential.
  Credential oAuth2Credential = new OfflineCredentials.Builder()
      .forApi(Api.DFP)
      .fromFile()
      .build()
      .generateCredential();

  // Construct a DfpSession.
  DfpSession session = new DfpSession.Builder()
      .fromFile()
      .withOAuth2Credential(oAuth2Credential)
      .build();

  DfpServices dfpServices = new DfpServices();

  CreateContactsParams params = new CreateContactsParams();
  if (!params.parseArguments(args)) {
    // Either pass the required parameters for this example on the command line, or insert them
    // into the code here. See the parameter class definition above for descriptions.
    params.advertiserId = Long.parseLong("INSERT_ADVERTISER_ID_HERE");
    params.agencyId = Long.parseLong("INSERT_AGENCY_ID_HERE");
  }

  runExample(dfpServices, session, params.advertiserId, params.agencyId);
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:27,代码来源:CreateContacts.java

示例13: main

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  // Generate a refreshable OAuth2 credential.
  Credential oAuth2Credential = new OfflineCredentials.Builder()
      .forApi(Api.DFP)
      .fromFile()
      .build()
      .generateCredential();

  // Construct a DfpSession.
  DfpSession session = new DfpSession.Builder()
      .fromFile()
      .withOAuth2Credential(oAuth2Credential)
      .build();

  DfpServices dfpServices = new DfpServices();

  UpdateActivitiesParams params = new UpdateActivitiesParams();
  if (!params.parseArguments(args)) {
    // Either pass the required parameters for this example on the command line, or insert them
    // into the code here. See the parameter class definition above for descriptions.
    params.activityId = Integer.valueOf("INSERT_ACTIVITY_ID_HERE");
  }

  runExample(dfpServices, session, params.activityId);
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:26,代码来源:UpdateActivities.java

示例14: createDfpSession

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
private static DfpSession createDfpSession(String jsonKeyFilePath, String applicationName,
    String networkCode) throws OAuthException, ValidationException {
  // Create a valid OAuth2 credential without using a properties file.
  Credential credential = new OfflineCredentials.Builder()
      .forApi(Api.DFP)
      .withJsonKeyFilePath(jsonKeyFilePath)
      .build()
      .generateCredential();

  // Create a new DfpSession without using a properties file.
  return new DfpSession.Builder()
      .withOAuth2Credential(credential)
      .withApplicationName(applicationName)
      .withNetworkCode(networkCode)
      .build();
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:17,代码来源:CreateDfpSessionWithoutPropertiesFile.java

示例15: main

import com.google.api.ads.dfp.lib.client.DfpSession; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  // Generate a refreshable OAuth2 credential.
  Credential oAuth2Credential = new OfflineCredentials.Builder()
      .forApi(Api.DFP)
      .fromFile()
      .build()
      .generateCredential();

  // Construct a DfpSession.
  DfpSession session = new DfpSession.Builder()
      .fromFile()
      .withOAuth2Credential(oAuth2Credential)
      .build();

  DfpServices dfpServices = new DfpServices();

  DeleteUserTeamAssociationsParams params = new DeleteUserTeamAssociationsParams();
  if (!params.parseArguments(args)) {
    // Either pass the required parameters for this example on the command line, or insert them
    // into the code here. See the parameter class definition above for descriptions.
    params.userId = Long.parseLong("INSERT_USER_ID_HERE");
  }

  runExample(dfpServices, session, params.userId);
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:26,代码来源:DeleteUserTeamAssociations.java


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