Gets a client given a session and the class of the desired stub interface.

@param adsSession the session associated with the desired
client
@param interfaceClass the class type of the desired client
@return a client for the specified ads service
423431
public <T> T getServiceClientAsInterface(S adsSession, Class<T> interfaceClass)
      throws ServiceException {
    return adsServiceClientFactory.getServiceClient(adsSession, interfaceClass);
  }
317261
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201811.UserTeamAssociationServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201811.UserTeamAssociationServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201811.UserTeamAssociationServiceSoapBindingStub(new java.net.URL(UserTeamAssociationServiceInterfacePort_address), this);
                _stub.setPortName(getUserTeamAssociationServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
172450
public static long getClientCustomerId(AdWordsSession session) {
    String accountIdStr = session.getClientCustomerId();

    // clientCustomerId might be absent from AdWordsSession, e.g., for
    // ReportDefinitionService.getReportFields() and CustomerService.getCustomers().
    // In this case, use ONE virtual account to handle rate limit of ALL unknown accounts combined.
    if (accountIdStr == null) {
      return VIRTUAL_CID;
    }

    try {
      return Long.parseLong(accountIdStr.replace("-", ""));
    } catch (NumberFormatException e) {
      throw new RateLimiterException("Encountered invalid CID: " + accountIdStr, e);
    }
  }
77525
@Override
  public ICCASessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientCCASession.class)) {
      ClientCCASessionDataReplicatedImpl data =
          new ClientCCASessionDataReplicatedImpl(sessionId, this.mobicentsCluster, this.replicatedSessionDataSource.getContainer());
      return data;
    }
    else if (clazz.equals(ServerCCASession.class)) {
      ServerCCASessionDataReplicatedImpl data = new ServerCCASessionDataReplicatedImpl(sessionId, this.mobicentsCluster);
      return data;
    }
    throw new IllegalArgumentException();
  }
193156
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.rm.CustomAffinityServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.rm.CustomAffinityServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.rm.CustomAffinityServiceSoapBindingStub(new java.net.URL(CustomAffinityServiceInterfacePort_address), this);
                _stub.setPortName(getCustomAffinityServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
578474
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.CampaignGroupServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.CampaignGroupServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.CampaignGroupServiceSoapBindingStub(new java.net.URL(CampaignGroupServiceInterfacePort_address), this);
                _stub.setPortName(getCampaignGroupServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1252646
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.AdGroupFeedServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.AdGroupFeedServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.AdGroupFeedServiceSoapBindingStub(new java.net.URL(AdGroupFeedServiceInterfacePort_address), this);
                _stub.setPortName(getAdGroupFeedServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1230456
protected <T> T createProxy(Class<T> interfaceClass) throws Exception {
        return createProxy(interfaceClass, getSession());
    }
1259132
@Override
  public ICxDxSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientCxDxSession.class)) {
      ClientCxDxSessionDataLocalImpl data = new ClientCxDxSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerCxDxSession.class)) {
      ServerCxDxSessionDataLocalImpl data = new ServerCxDxSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }
282103
@Override
  public IShSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientShSession.class)) {
      ShClientSessionDataLocalImpl data = new ShClientSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerShSession.class)) {
      ShServerSessionDataLocalImpl data = new ShServerSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }
699398
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.CampaignGroupPerformanceTargetServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.CampaignGroupPerformanceTargetServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.CampaignGroupPerformanceTargetServiceSoapBindingStub(new java.net.URL(CampaignGroupPerformanceTargetServiceInterfacePort_address), this);
                _stub.setPortName(getCampaignGroupPerformanceTargetServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
307055
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.AdCustomizerFeedServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.AdCustomizerFeedServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.AdCustomizerFeedServiceSoapBindingStub(new java.net.URL(AdCustomizerFeedServiceInterfacePort_address), this);
                _stub.setPortName(getAdCustomizerFeedServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
442763
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201808.ContentBundleServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201808.ContentBundleServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201808.ContentBundleServiceSoapBindingStub(new java.net.URL(ContentBundleServiceInterfacePort_address), this);
                _stub.setPortName(getContentBundleServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1048537
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.CampaignCriterionServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.CampaignCriterionServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.CampaignCriterionServiceSoapBindingStub(new java.net.URL(CampaignCriterionServiceInterfacePort_address), this);
                _stub.setPortName(getCampaignCriterionServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
173166
def get_session_class(cls, interface_type, resource_class):
        
        try:
            return cls._session_classes[(interface_type, resource_class)]
        except KeyError:
            raise ValueError('No class registered for %s, %s' % (interface_type, resource_class))
911972
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.AssetServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.AssetServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.AssetServiceSoapBindingStub(new java.net.URL(AssetServiceInterfacePort_address), this);
                _stub.setPortName(getAssetServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
790258
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.mcm.CustomerServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.mcm.CustomerServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.mcm.CustomerServiceSoapBindingStub(new java.net.URL(CustomerServiceInterfacePort_address), this);
                _stub.setPortName(getCustomerServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }