Search in sources :

Example 1 with SalespersonSplit

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

the class CreateProposals method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @param primarySalespersonId the ID of the primary salesperson.
 * @param primaryTraffickerId the ID of the primary trafficker.
 * @param programmaticBuyerId the ID of the programmatic buyer. This can be obtained through the
 *     Programmatic_Buyer PQL table.
 * @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 primarySalespersonId, long primaryTraffickerId, long programmaticBuyerId) throws RemoteException {
    ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class);
    Proposal proposal = new Proposal();
    // Setting required Marketplace information.
    ProposalMarketplaceInfo proposalMarketplaceInfo = new ProposalMarketplaceInfo();
    proposalMarketplaceInfo.setBuyerAccountId(programmaticBuyerId);
    // Set common required fields for a proposal.
    proposal.setName("Proposal #" + new Random().nextInt(Integer.MAX_VALUE));
    proposal.setPrimaryTraffickerId(primaryTraffickerId);
    proposal.setMarketplaceInfo(proposalMarketplaceInfo);
    SalespersonSplit primarySalesperson = new SalespersonSplit();
    primarySalesperson.setUserId(primarySalespersonId);
    primarySalesperson.setSplit(100000);
    proposal.setPrimarySalesperson(primarySalesperson);
    // Create the proposal on the server.
    Proposal[] proposals = proposalService.createProposals(new Proposal[] { proposal });
    for (Proposal createdProposal : proposals) {
        System.out.printf("A proposal with ID %d and name '%s' " + "was created.%n", createdProposal.getId(), createdProposal.getName());
    }
}
Also used : ProposalServiceInterface(com.google.api.ads.admanager.axis.v202202.ProposalServiceInterface) Random(java.util.Random) ProposalMarketplaceInfo(com.google.api.ads.admanager.axis.v202202.ProposalMarketplaceInfo) SalespersonSplit(com.google.api.ads.admanager.axis.v202202.SalespersonSplit) Proposal(com.google.api.ads.admanager.axis.v202202.Proposal)

Example 2 with SalespersonSplit

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

the class CreateProposals method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @param primarySalespersonId the ID of the primary salesperson.
 * @param primaryTraffickerId the ID of the primary trafficker.
 * @param programmaticBuyerId the ID of the programmatic buyer. This can be obtained through the
 *     Programmatic_Buyer PQL table.
 * @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 primarySalespersonId, long primaryTraffickerId, long programmaticBuyerId) throws RemoteException {
    ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class);
    Proposal proposal = new Proposal();
    // Setting required Marketplace information.
    ProposalMarketplaceInfo proposalMarketplaceInfo = new ProposalMarketplaceInfo();
    proposalMarketplaceInfo.setBuyerAccountId(programmaticBuyerId);
    // Set common required fields for a proposal.
    proposal.setName("Proposal #" + new Random().nextInt(Integer.MAX_VALUE));
    proposal.setPrimaryTraffickerId(primaryTraffickerId);
    proposal.setMarketplaceInfo(proposalMarketplaceInfo);
    SalespersonSplit primarySalesperson = new SalespersonSplit();
    primarySalesperson.setUserId(primarySalespersonId);
    primarySalesperson.setSplit(100000);
    proposal.setPrimarySalesperson(primarySalesperson);
    // Create the proposal on the server.
    Proposal[] proposals = proposalService.createProposals(new Proposal[] { proposal });
    for (Proposal createdProposal : proposals) {
        System.out.printf("A proposal with ID %d and name '%s' " + "was created.%n", createdProposal.getId(), createdProposal.getName());
    }
}
Also used : ProposalServiceInterface(com.google.api.ads.admanager.axis.v202108.ProposalServiceInterface) Random(java.util.Random) ProposalMarketplaceInfo(com.google.api.ads.admanager.axis.v202108.ProposalMarketplaceInfo) SalespersonSplit(com.google.api.ads.admanager.axis.v202108.SalespersonSplit) Proposal(com.google.api.ads.admanager.axis.v202108.Proposal)

Example 3 with SalespersonSplit

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

the class CreateProposals method runExample.

/**
 * Runs the example.
 *
 * @param adManagerServices the services factory.
 * @param session the session.
 * @param primarySalespersonId the ID of the primary salesperson.
 * @param primaryTraffickerId the ID of the primary trafficker.
 * @param programmaticBuyerId the ID of the programmatic buyer. This can be obtained through the
 *     Programmatic_Buyer PQL table.
 * @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 primarySalespersonId, long primaryTraffickerId, long programmaticBuyerId) throws RemoteException {
    ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class);
    Proposal proposal = new Proposal();
    // Setting required Marketplace information.
    ProposalMarketplaceInfo proposalMarketplaceInfo = new ProposalMarketplaceInfo();
    proposalMarketplaceInfo.setBuyerAccountId(programmaticBuyerId);
    // Set common required fields for a proposal.
    proposal.setName("Proposal #" + new Random().nextInt(Integer.MAX_VALUE));
    proposal.setPrimaryTraffickerId(primaryTraffickerId);
    proposal.setMarketplaceInfo(proposalMarketplaceInfo);
    SalespersonSplit primarySalesperson = new SalespersonSplit();
    primarySalesperson.setUserId(primarySalespersonId);
    primarySalesperson.setSplit(100000);
    proposal.setPrimarySalesperson(primarySalesperson);
    // Create the proposal on the server.
    Proposal[] proposals = proposalService.createProposals(new Proposal[] { proposal });
    for (Proposal createdProposal : proposals) {
        System.out.printf("A proposal with ID %d and name '%s' " + "was created.%n", createdProposal.getId(), createdProposal.getName());
    }
}
Also used : ProposalServiceInterface(com.google.api.ads.admanager.axis.v202111.ProposalServiceInterface) Random(java.util.Random) ProposalMarketplaceInfo(com.google.api.ads.admanager.axis.v202111.ProposalMarketplaceInfo) SalespersonSplit(com.google.api.ads.admanager.axis.v202111.SalespersonSplit) Proposal(com.google.api.ads.admanager.axis.v202111.Proposal)

Aggregations

Random (java.util.Random)3 Proposal (com.google.api.ads.admanager.axis.v202108.Proposal)1 ProposalMarketplaceInfo (com.google.api.ads.admanager.axis.v202108.ProposalMarketplaceInfo)1 ProposalServiceInterface (com.google.api.ads.admanager.axis.v202108.ProposalServiceInterface)1 SalespersonSplit (com.google.api.ads.admanager.axis.v202108.SalespersonSplit)1 Proposal (com.google.api.ads.admanager.axis.v202111.Proposal)1 ProposalMarketplaceInfo (com.google.api.ads.admanager.axis.v202111.ProposalMarketplaceInfo)1 ProposalServiceInterface (com.google.api.ads.admanager.axis.v202111.ProposalServiceInterface)1 SalespersonSplit (com.google.api.ads.admanager.axis.v202111.SalespersonSplit)1 Proposal (com.google.api.ads.admanager.axis.v202202.Proposal)1 ProposalMarketplaceInfo (com.google.api.ads.admanager.axis.v202202.ProposalMarketplaceInfo)1 ProposalServiceInterface (com.google.api.ads.admanager.axis.v202202.ProposalServiceInterface)1 SalespersonSplit (com.google.api.ads.admanager.axis.v202202.SalespersonSplit)1