Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  // Copyright 2012 Google Inc. All Rights Reserved.
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //       http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
 package com.google.api.ads.adwords.axis.utility.extension.delegates;
 
 
 import java.util.List;

Specific AbstractGetMutateDelegate for com.google.api.ads.adwords.axis.v201409.mcm.ManagedCustomer.

Implementation is not thread-safe, because AdWordsSession and Apache Axis service objects are not thread-safe.

Author(s):
Julian Toledo
 
 public final class ManagedCustomerDelegate extends AbstractGetMutateDelegate
Default Constructor.

Parameters:
adWordsSession the adWordsSession to use with the delegate/service
 
   public ManagedCustomerDelegate(AdWordsSession adWordsSession) {
     // Fields are not necessary for Services that do not use Generic Selectors
     super(adWordsSession, SelectorFields.ManagedCustomer.all(), ManagedCustomer.class,
   }

  
Constructor with custom service.

Parameters:
adWordsSession the adWordsSession to use with the delegate/service
service the custom service class for the SOAP service
 
       ManagedCustomerServiceInterface service) {
     // Fields are not necessary for Services that do not use Generic Selectors
     super(adWordsSession, SelectorFields.ManagedCustomer.all(), ManagedCustomer.class,
         ManagedCustomerOperation.classservice);
   }

  
Constructor with custom fields.

Parameters:
adWordsSession the adWordsSession to use with the delegate/service
selectorFields for the Generic Selectors using the SelectorField class
 
   public ManagedCustomerDelegate(AdWordsSession adWordsSession,
       List<SelectorFields.ManagedCustomerselectorFields) {
     super(adWordsSessionselectorFieldsManagedCustomer.classManagedCustomerOperation.class,
         ManagedCustomerServiceInterface.class);
   }

  
Retrieves ManagedCustomers by customerIds.

Parameters:
customerIds
Returns:
a list of ManagedCustomers matching the customerIds
Throws:
java.rmi.RemoteException for communication-related exceptions
 
   public List<ManagedCustomergetByCustomerId(List<LongcustomerIdsthrows RemoteException {
     return getByField(..customerIds);
   }

  
Retrieves ManagedCustomers by customerId.

Parameters:
customerId
Returns:
a list of ManagedCustomers matching the customerId
Throws:
java.rmi.RemoteException for communication-related exceptions
  public ManagedCustomer getByCustomerId(Long customerIdthrows RemoteException {
    return getByCustomerId(String.valueOf(customerId));
  }

  
Retrieves ManagedCustomers by customerId.

Parameters:
customerId this String parameter is for support for the format 123-123-1234
Returns:
a list of ManagedCustomers matching the customerId
Throws:
java.rmi.RemoteException for communication-related exceptions
java.lang.NullPointerException if customerId is null
  public ManagedCustomer getByCustomerId(String customerIdthrows RemoteException {
    Preconditions.checkNotNull(customerId"Null customer ID");
    String customerIdWithoutDashes = customerId.replace("-""");
        Long.valueOf(customerIdWithoutDashes));
  }

  
Retrieves ManagedCustomers by canManageClients.

Parameters:
canManageClients
Returns:
a list of ManagedCustomers matching the canManageClients
Throws:
java.rmi.RemoteException for communication-related exceptions
  public List<ManagedCustomergetByCanManageClients(boolean canManageClients)
      throws RemoteException {
    return getByField(..canManageClients);
  }

  
Retrieves ManagedCustomers by customerIds and canManageClients.

Parameters:
customerIds
canManageClients
Returns:
a list of ManagedCustomers matching the customerIds and canManageClients
Throws:
java.rmi.RemoteException for communication-related exceptions
      boolean canManageClientsthrows RemoteException {
    if (customerIds != null && !customerIds.isEmpty()) {
          ListUtil.asStringArray(customerIds));
    }
        String.valueOf(canManageClients));
    return get(builder.build());
  }

  
Retrieves PendingInvitations for the account.

Parameters:
selector the manager customer id (inviter) or the client customer id (invitee)
Returns:
a list of PendingInvitations matching the customerIds
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      throws ApiExceptionRemoteException {
    return ListUtil.asList(getService().getPendingInvitations(selector));
  }

  
Retrieves PendingInvitations for the account.

Returns:
a list of PendingInvitations matching the customerIds
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      throws ApiExceptionRemoteException {
  }

  
Modifies the ManagedCustomer forest.

Returns:
MutateLinkResults
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
  public MutateLinkResults mutateLink(LinkOperation[] operations)
      throws ApiExceptionRemoteException {
    return getService().mutateLink(operations);
  }

  
Extends Invitations. Sets operations to Operator.ADD and LinkStatus.PENDING as required.

Parameters:
managedCustomerLinks a list of ManagedCustomerLink
Returns:
the resulting List<ManagedCustomerLink> from the operations
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      throws ApiExceptionRemoteException {
    LinkOperation[] listOperations = new LinkOperation[managedCustomerLinks.size()];
    for (int i = 0; i < managedCustomerLinks.size(); i++) {
      managedCustomerLinks.get(i).setLinkStatus(.);
      listOperations[i] = new LinkOperation(.nullmanagedCustomerLinks.get(i));
    }
    return ListUtil.asList(getService().mutateLink(listOperations).getLinks());
  }

  
Rescinds Invitations. Sets operations to Operator.SET and LinkStatus.CANCELLED as required.

Parameters:
managedCustomerLinks a list of ManagedCustomerLink
Returns:
the resulting List<ManagedCustomerLink> from the operations
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      List<ManagedCustomerLinkmanagedCustomerLinksthrows ApiExceptionRemoteException {
    LinkOperation[] listOperations = new LinkOperation[managedCustomerLinks.size()];
    for (int i = 0; i < managedCustomerLinks.size(); i++) {
      managedCustomerLinks.get(i).setLinkStatus(.);
      listOperations[i] = new LinkOperation(.nullmanagedCustomerLinks.get(i));
    }
    return ListUtil.asList(getService().mutateLink(listOperations).getLinks());
  }

  
Accepts Invitations. Sets operations to Operator.SET and LinkStatus.ACTIVE as required.

Parameters:
managedCustomerLinks a list of ManagedCustomerLink
Returns:
the resulting List<ManagedCustomerLink> from the operations
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      throws ApiExceptionRemoteException {
    LinkOperation[] listOperations = new LinkOperation[managedCustomerLinks.size()];
    for (int i = 0; i < managedCustomerLinks.size(); i++) {
      managedCustomerLinks.get(i).setLinkStatus(.);
      listOperations[i] = new LinkOperation(.nullmanagedCustomerLinks.get(i));
    }
    return ListUtil.asList(getService().mutateLink(listOperations).getLinks());
  }

  
Declines Invitations. Sets operations to Operator.SET and LinkStatus.REFUSED as required.

Parameters:
managedCustomerLinks a list of ManagedCustomerLink
Returns:
the resulting List<ManagedCustomerLink> from the operations
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      List<ManagedCustomerLinkmanagedCustomerLinksthrows ApiExceptionRemoteException {
    LinkOperation[] listOperations = new LinkOperation[managedCustomerLinks.size()];
    for (int i = 0; i < managedCustomerLinks.size(); i++) {
      managedCustomerLinks.get(i).setLinkStatus(.);
      listOperations[i] = new LinkOperation(.nullmanagedCustomerLinks.get(i));
    }
    return ListUtil.asList(getService().mutateLink(listOperations).getLinks());
  }

  
Terminates Links. Sets operations to Operator.SET and LinkStatus.INACTIVE as required.

Parameters:
managedCustomerLinks a list of ManagedCustomerLink
Returns:
the resulting List<ManagedCustomerLink> from the operations
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
  public List<ManagedCustomerLinkterminateLink(List<ManagedCustomerLinkmanagedCustomerLinks)
      throws ApiExceptionRemoteException {
    LinkOperation[] listOperations = new LinkOperation[managedCustomerLinks.size()];
    for (int i = 0; i < managedCustomerLinks.size(); i++) {
      managedCustomerLinks.get(i).setLinkStatus(.);
      listOperations[i] = new LinkOperation(.nullmanagedCustomerLinks.get(i));
    }
    return ListUtil.asList(getService().mutateLink(listOperations).getLinks());
  }

  
Moves client customers to new managers (moving links).

Returns:
MutateManagerResults
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
      throws ApiExceptionRemoteException {
    return getService().mutateManager(operations);
  }

  
Moves client customers to new managers (moving links). oldManagerCustomerId restricts the moves from a single MCC.

Parameters:
oldManagerCustomerId from where the accounts are being moved
Returns:
the resulting List<ManagedCustomerLink> from the operations
Throws:
java.rmi.RemoteException for communication-related exceptions
com.google.api.ads.adwords.axis.v201409.cm.ApiException holding a list of service errors
  public List<ManagedCustomerLinkmoveManager(List<ManagedCustomerLinkmanagedCustomerLinks,
      Long oldManagerCustomerIdthrows ApiExceptionRemoteException {
    MoveOperation[] listOperations = new MoveOperation[managedCustomerLinks.size()];
    for (int i = 0; i < managedCustomerLinks.size(); i++) {
      managedCustomerLinks.get(i).setLinkStatus(.);
      listOperations[i] = new MoveOperation(
          .nullmanagedCustomerLinks.get(i), oldManagerCustomerId);
    }
    return ListUtil.asList(getService().mutateManager(listOperations).getLinks());
  }
New to GrepCode? Check out our FAQ X