Creates an ad group in the Shopping campaign.
2314
private static function createAdGroup(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        Campaign $campaign
    ) {
        $adGroupService = $adWordsServices->get($session, AdGroupService::class);

        // Create ad group.
        $adGroup = new AdGroup();
        $adGroup->setCampaignId($campaign->getId());
        $adGroup->setName('Ad Group #' . uniqid());

        // Required: Set the ad group type to SHOPPING_SHOWCASE_ADS.
        $adGroup->setAdGroupType(AdGroupType::SHOPPING_SHOWCASE_ADS);

        // Required: Set the ad group's bidding strategy configuration.
        // Note: Showcase ads require that the campaign has a ManualCpc
        // BiddingStrategyConfiguration.
        $biddingStrategyConfiguration = new BiddingStrategyConfiguration();

        // Optional: Set the bids.
        $bidAmount = new Money();
        $bidAmount->setMicroAmount(100000);
        $cpcBid = new CpcBid();
        $cpcBid->setBid($bidAmount);
        $biddingStrategyConfiguration->setBids([$cpcBid]);

        $adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration);

        // Create operation.
        $adGroupOperation = new AdGroupOperation();
        $adGroupOperation->setOperand($adGroup);
        $adGroupOperation->setOperator(Operator::ADD);

        // Make the mutate request.
        $adGroupAddResult = $adGroupService->mutate([$adGroupOperation]);
        $adGroup = $adGroupAddResult->getValue()[0];

        return $adGroup;
    }
783140
private static void addCampaignsToGroup(
      AdWordsServicesInterface adWordsServices,
      AdWordsSession session,
      CampaignGroup campaignGroup,
      List<Long> campaignIds)
      throws ApiException, RemoteException {
    // Get the CampaignService.
    CampaignServiceInterface campaignService =
        adWordsServices.get(session, CampaignServiceInterface.class);

    List<CampaignOperation> operations = new ArrayList<>();
    for (Long campaignId : campaignIds) {
      Campaign campaign = new Campaign();
      campaign.setId(campaignId);
      campaign.setCampaignGroupId(campaignGroup.getId());

      CampaignOperation operation = new CampaignOperation();
      operation.setOperand(campaign);
      operation.setOperator(Operator.SET);
      operations.add(operation);
    }

    CampaignReturnValue returnValue =
        campaignService.mutate(operations.toArray(new CampaignOperation[operations.size()]));
    System.out.printf(
        "The following campaign IDs were added to the campaign group with ID %d:%n",
        campaignGroup.getId());
    for (Campaign campaign : returnValue.getValue()) {
      System.out.printf("\t%d%n", campaign.getId());
    }
  }
58322
def CreateUnit(self, parent=None, value=None, bid_amount=None):
    
    unit = {
        'xsi_type': 'ProductPartition',
        'partitionType': 'UNIT'
    }

    # The root node has neither a parent nor a value.
    if parent is not None:
      unit['parentCriterionId'] = parent['id']
      unit['caseValue'] = value

    if bid_amount is not None and bid_amount > 0:
      # Note: Showcase ads require that the campaign has a ManualCpc
      # BiddingStrategyConfiguration.
      bidding_strategy_configuration = {
          'bids': [{
              'xsi_type': 'CpcBid',
              'bid': {
                  'xsi_type': 'Money',
                  'microAmount': str(bid_amount)
              }
          }]
      }

      adgroup_criterion = {
          'xsi_type': 'BiddableAdGroupCriterion',
          'biddingStrategyConfiguration': bidding_strategy_configuration
      }
    else:
      adgroup_criterion = {
          'xsi_type': 'NegativeAdGroupCriterion'
      }

    adgroup_criterion['adGroupId'] = self.adgroup_id
    adgroup_criterion['criterion'] = unit

    self.CreateAddOperation(adgroup_criterion)

    return unit
400577
def update(self, adgroup_id, default_price, nonsearch_max_price, is_nonsearch_default_price, online_status, campaign_id, nick=None):
        ''''''
        request = TOPRequest('xxxxx.xxxxx.adgroup.update')
        request['adgroup_id'] = adgroup_id
        request['default_price'] = default_price
        request['nonsearch_max_price'] = nonsearch_max_price
        request['is_nonsearch_default_price'] = is_nonsearch_default_price
        request['online_status'] = online_status
        request['campaign_id'] = campaign_id
        if nick!=None: request['nick'] = nick
        self.create(self.execute(request), fields=['success','result','success','result_code','result_message'], models={'result':ADGroup})
        return self.result
236083
def addtoreadergroup(self, groupname):
        """"""

        hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
        if 0 != hresult:
            raise EstablishContextException(hresult)
        try:
            hresult = SCardIntroduceReader(hcontext, self.name, self.name)
            if 0 != hresult and SCARD_E_DUPLICATE_READER != hresult:
                raise IntroduceReaderException(hresult, self.name)
            hresult = SCardAddReaderToGroup(hcontext, self.name, groupname)
            if 0 != hresult:
                raise AddReaderToGroupException(hresult, self.name, groupname)
        finally:
            hresult = SCardReleaseContext(hcontext)
            if 0 != hresult:
                raise ReleaseContextException(hresult)
33482
protected function createSiteAdminGroup()
    {
        $sitePerimeter = $this->createPerimeter(SiteInterface::ENTITY_TYPE, array(
            $this->getReference('site2')->getSiteId()
        ));

        $sadmin2 = new Group();
        $sadmin2->addLabel('en', 'Site admin demo');
        $sadmin2->addLabel('fr', 'Admin site demo');
        $sadmin2->setSite($this->getReference('site2'));
        $sadmin2->addRole(ContributionRoleInterface::SITE_ADMIN);
        $sadmin2->addPerimeter($sitePerimeter);

        return $sadmin2;
    }
399574
public void setAdGroupLabel(com.google.api.ads.adwords.axis.v201809.cm.AdGroupLabel adGroupLabel) {
        this.adGroupLabel = adGroupLabel;
    }
530975
def create_group(self, name):
        
        self.service.create_group(
            name, self.url_prefix, self.auth, self.session,
            self.session_send_opts)
474971
private static CampaignGroup createCampaignGroup(
      AdWordsServicesInterface adWordsServices, AdWordsSession session)
      throws RemoteException {
    // Get the CampaignGroupService.
    CampaignGroupServiceInterface campaignGroupService =
        adWordsServices.get(session, CampaignGroupServiceInterface.class);

    // Create the campaign group.
    CampaignGroup campaignGroup = new CampaignGroup();
    campaignGroup.setName("Mars campaign group #" + System.currentTimeMillis());

    // Create the operation.
    CampaignGroupOperation operation = new CampaignGroupOperation();
    operation.setOperand(campaignGroup);
    operation.setOperator(Operator.ADD);

    CampaignGroup newCampaignGroup =
        campaignGroupService.mutate(new CampaignGroupOperation[] {operation}).getValue(0);
    System.out.printf(
        "Campaign group with ID %d and name '%s' was created.%n",
        newCampaignGroup.getId(), newCampaignGroup.getName());

    return newCampaignGroup;
  }
949675
protected function wizardAddCategoryGroup()
    {
        $this->validatePrompt('title', $this->text('Name'), 'category_group');
        $this->validatePrompt('store_id', $this->text('Store ID'), 'category_group');
        $this->validateMenu('type', $this->text('Type'), 'category_group', $this->category_group->getTypes());

        $this->validateComponent('category_group');
        $this->addCategoryGroup();
    }
239942
private static function createExpandedDSA(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        AdGroup $adGroup
    ) {
        $adGroupAdService = $adWordsServices->get($session, AdGroupAdService::class);

        // Create the expanded Dynamic Search Ad. This ad will have its headline
        // and final URL auto-generated at serving time according to domain name
        // specific information provided by DynamicSearchAdsSetting at the
        // campaign level.
        $expandedDSA = new ExpandedDynamicSearchAd();
        // Set the ad description.
        $expandedDSA->setDescription('Buy your tickets now!');
        $expandedDSA->setDescription2('Discount ends soon');

        // Create the ad group ad.
        $adGroupAd = new AdGroupAd();
        $adGroupAd->setAdGroupId($adGroup->getId());
        $adGroupAd->setAd($expandedDSA);

        // Optional: Set the status.
        $adGroupAd->setStatus(AdGroupAdStatus::PAUSED);

        // Create the operation.
        $operation = new AdGroupAdOperation();
        $operation->setOperator(Operator::ADD);
        $operation->setOperand($adGroupAd);

        // Create the ad on the server and print some information.
        $result = $adGroupAdService->mutate([$operation]);
        $newAdGroupAd = $result->getValue()[0];
        $expandedDSA = $newAdGroupAd->getAd();
        printf(
            "Expanded Dynamic Search Ad with ID %d, description '%s', and"
            . " description 2 '%s' was added.%s",
            $expandedDSA->getId(),
            $expandedDSA->getDescription(),
            $expandedDSA->getDescription2(),
            PHP_EOL
        );
    }
381590
def ad_group(name = nil, &block)
      save
      ad_group = AdGroup.new(self, name, &block)
      ad_group.save
      @ad_groups ||= []
      @ad_groups.push(ad_group)
      ad_group
    end
1093554
private static void createCustomizerFeedItems(AdWordsServicesInterface adWordsServices,
      AdWordsSession session, List<Long> adGroupIds, AdCustomizerFeed adCustomizerFeed)
      throws RemoteException {
    // Get the FeedItemService.
    FeedItemServiceInterface feedItemService =
        adWordsServices.get(session, FeedItemServiceInterface.class);

    List<FeedItemOperation> feedItemOperations = new ArrayList<>();

    DateTime now = new DateTime();

    DateTime marsDate = new DateTime(now.getYear(), now.getMonthOfYear(), 1, 0, 0);
    feedItemOperations.add(
        createFeedItemAddOperation(
            "Mars", "$1234.56", marsDate.toString("yyyyMMdd HHmmss"), adCustomizerFeed));

    DateTime venusDate = new DateTime(now.getYear(), now.getMonthOfYear(), 15, 0, 0);
    feedItemOperations.add(
        createFeedItemAddOperation(
            "Venus", "$1450.00", venusDate.toString("yyyyMMdd HHmmss"), adCustomizerFeed));

    FeedItemReturnValue feedItemReturnValue = feedItemService.mutate(
        feedItemOperations.toArray(new FeedItemOperation[feedItemOperations.size()]));

    for (FeedItem addedFeedItem : feedItemReturnValue.getValue()) {
      System.out.printf("Added feed item with ID %d.%n", addedFeedItem.getFeedItemId());
    }

    // Add feed item targeting to restrict the feed item to specific ad groups.
    restrictFeedItemToAdGroup(
        adWordsServices, session, feedItemReturnValue.getValue(0), adGroupIds.get(0));
    restrictFeedItemToAdGroup(
        adWordsServices, session, feedItemReturnValue.getValue(1), adGroupIds.get(1));
  }
837286
def create_secgroups(self):
        """"""
        utils.banner("Creating Security Group")
        sgobj = securitygroup.SpinnakerSecurityGroup(
            app=self.app, env=self.env, region=self.region, prop_path=self.json_path)
        sgobj.create_security_group()
238713
def create_grupo_equipamento(self):
        """"""
        return GrupoEquipamento(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
146773
public function addGroupToVoucher()
    {
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $aChosenCat = $this->_getActionIds('oxgroups.oxid');
        $soxId = $oConfig->getRequestParameter('synchoxid');

        if ($oConfig->getRequestParameter('all')) {
            $sGroupTable = $this->_getViewName('oxgroups');
            $aChosenCat = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
        }
        if ($soxId && $soxId != "-1" && is_array($aChosenCat)) {
            foreach ($aChosenCat as $sChosenCat) {
                $oNewGroup = oxNew(\OxidEsales\Eshop\Application\Model\Object2Group::class);
                $oNewGroup->oxobject2group__oxobjectid = new \OxidEsales\Eshop\Core\Field($soxId);
                $oNewGroup->oxobject2group__oxgroupsid = new \OxidEsales\Eshop\Core\Field($sChosenCat);
                $oNewGroup->save();
            }
        }
    }
188729
def CreateAdGroup(client, campaign_id):
  
  ad_group_service = client.GetService('AdGroupService', 'v201809')

  ad_group = {
      'name': 'Dynamic remarketing ad group',
      'campaignId': campaign_id,
      'status': 'ENABLED'
  }

  operations = [{
      'operator': 'ADD',
      'operand': ad_group
  }]

  return ad_group_service.mutate(operations)['value'][0]