Search in sources :

Example 1 with MarketplaceCommentPage

use of com.google.api.ads.admanager.axis.v202111.MarketplaceCommentPage in project googleads-java-lib by googleads.

the class GetMarketplaceComments method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @param proposalId the proposal ID.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long proposalId) throws RemoteException {
    ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class);
    // Create a statement to select marketplace comments.
    StatementBuilder statementBuilder = new StatementBuilder().where("proposalId = :proposalId").withBindVariableValue("proposalId", proposalId);
    MarketplaceCommentPage page = proposalService.getMarketplaceCommentsByStatement(statementBuilder.toStatement());
    if (page.getResults() != null) {
        // Print out some information for each marketplace comment.
        int i = page.getStartIndex();
        for (MarketplaceComment marketplaceComment : page.getResults()) {
            System.out.printf("%d) Marketplace comment with creation time '%s' and comment '%s' was found.%n", i++, DateTimes.toString(marketplaceComment.getCreationTime()), marketplaceComment.getComment());
        }
    } else {
        System.out.println("No marketplace comments found.");
    }
}
Also used : MarketplaceCommentPage(com.google.api.ads.admanager.axis.v202111.MarketplaceCommentPage) ProposalServiceInterface(com.google.api.ads.admanager.axis.v202111.ProposalServiceInterface) StatementBuilder(com.google.api.ads.admanager.axis.utils.v202111.StatementBuilder) MarketplaceComment(com.google.api.ads.admanager.axis.v202111.MarketplaceComment)

Example 2 with MarketplaceCommentPage

use of com.google.api.ads.admanager.axis.v202111.MarketplaceCommentPage in project googleads-java-lib by googleads.

the class GetMarketplaceComments method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @param proposalId the proposal ID.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long proposalId) throws RemoteException {
    ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class);
    // Create a statement to select marketplace comments.
    StatementBuilder statementBuilder = new StatementBuilder().where("proposalId = :proposalId").withBindVariableValue("proposalId", proposalId);
    MarketplaceCommentPage page = proposalService.getMarketplaceCommentsByStatement(statementBuilder.toStatement());
    if (page.getResults() != null) {
        // Print out some information for each marketplace comment.
        int i = page.getStartIndex();
        for (MarketplaceComment marketplaceComment : page.getResults()) {
            System.out.printf("%d) Marketplace comment with creation time '%s' and comment '%s' was found.%n", i++, DateTimes.toString(marketplaceComment.getCreationTime()), marketplaceComment.getComment());
        }
    } else {
        System.out.println("No marketplace comments found.");
    }
}
Also used : MarketplaceCommentPage(com.google.api.ads.admanager.axis.v202202.MarketplaceCommentPage) ProposalServiceInterface(com.google.api.ads.admanager.axis.v202202.ProposalServiceInterface) StatementBuilder(com.google.api.ads.admanager.axis.utils.v202202.StatementBuilder) MarketplaceComment(com.google.api.ads.admanager.axis.v202202.MarketplaceComment)

Example 3 with MarketplaceCommentPage

use of com.google.api.ads.admanager.axis.v202111.MarketplaceCommentPage in project googleads-java-lib by googleads.

the class GetMarketplaceComments method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @param proposalId the proposal ID.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 */
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long proposalId) throws RemoteException {
    ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class);
    // Create a statement to select marketplace comments.
    StatementBuilder statementBuilder = new StatementBuilder().where("proposalId = :proposalId").withBindVariableValue("proposalId", proposalId);
    MarketplaceCommentPage page = proposalService.getMarketplaceCommentsByStatement(statementBuilder.toStatement());
    if (page.getResults() != null) {
        // Print out some information for each marketplace comment.
        int i = page.getStartIndex();
        for (MarketplaceComment marketplaceComment : page.getResults()) {
            System.out.printf("%d) Marketplace comment with creation time '%s' and comment '%s' was found.%n", i++, DateTimes.toString(marketplaceComment.getCreationTime()), marketplaceComment.getComment());
        }
    } else {
        System.out.println("No marketplace comments found.");
    }
}
Also used : MarketplaceCommentPage(com.google.api.ads.admanager.axis.v202108.MarketplaceCommentPage) ProposalServiceInterface(com.google.api.ads.admanager.axis.v202108.ProposalServiceInterface) StatementBuilder(com.google.api.ads.admanager.axis.utils.v202108.StatementBuilder) MarketplaceComment(com.google.api.ads.admanager.axis.v202108.MarketplaceComment)

Aggregations

StatementBuilder (com.google.api.ads.admanager.axis.utils.v202108.StatementBuilder)1 StatementBuilder (com.google.api.ads.admanager.axis.utils.v202111.StatementBuilder)1 StatementBuilder (com.google.api.ads.admanager.axis.utils.v202202.StatementBuilder)1 MarketplaceComment (com.google.api.ads.admanager.axis.v202108.MarketplaceComment)1 MarketplaceCommentPage (com.google.api.ads.admanager.axis.v202108.MarketplaceCommentPage)1 ProposalServiceInterface (com.google.api.ads.admanager.axis.v202108.ProposalServiceInterface)1 MarketplaceComment (com.google.api.ads.admanager.axis.v202111.MarketplaceComment)1 MarketplaceCommentPage (com.google.api.ads.admanager.axis.v202111.MarketplaceCommentPage)1 ProposalServiceInterface (com.google.api.ads.admanager.axis.v202111.ProposalServiceInterface)1 MarketplaceComment (com.google.api.ads.admanager.axis.v202202.MarketplaceComment)1 MarketplaceCommentPage (com.google.api.ads.admanager.axis.v202202.MarketplaceCommentPage)1 ProposalServiceInterface (com.google.api.ads.admanager.axis.v202202.ProposalServiceInterface)1