Creates a Showcase ad.
335016
private static function createShowcaseAd(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        AdGroup $adGroup
    ) {
        // Create the Showcase ad.
        $adGroupAdService = $adWordsServices->get($session, AdGroupAdService::class);

        $showcaseAd = new ShowcaseAd();
        $showcaseAd->setName('Showcase ad #' . uniqid());
        $showcaseAd->setFinalUrls(['http://example.com/showcase']);
        $showcaseAd->setDisplayUrl('example.com');

        // Required: Set the ad's expanded image.
        $expandedImage = new Image();
        $expandedImage->setMediaId(
            self::uploadImage(
                $adWordsServices,
                $session,
                'https://goo.gl/IfVlpF'
            )
        );
        $showcaseAd->setExpandedImage($expandedImage);

        // Optional: Set the collapsed image.
        $collapsedImage = new Image();
        $collapsedImage->setMediaId(
            self::uploadImage(
                $adWordsServices,
                $session,
                'https://goo.gl/NqTxAE'
            )
        );
        $showcaseAd->setCollapsedImage($collapsedImage);

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

        // Create an ad group ad operation.
        $adGroupAdOperation = new AdGroupAdOperation();
        $adGroupAdOperation->setOperand($adGroupAd);
        $adGroupAdOperation->setOperator(Operator::ADD);

        // Creates an ad group ad on the server.
        $adGroupAdAddResult = $adGroupAdService->mutate([$adGroupAdOperation]);
        $adGroupAd = $adGroupAdAddResult->getValue()[0];

        return $adGroupAd;
    }
971850
function outstreamRender(bid) {
  bid.renderer.push(() => {
    window.VOutstreamAPI.initOutstreams([{
      width: bid.width,
      height: bid.height,
      vastUrl: bid.vastUrl,
      elId: bid.adUnitCode
    }]);
  });
}
102605
private static function createAdGroup(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        Campaign $campaign
    ) {
        $adGroupService = $adWordsServices->get($session, AdGroupService::class);

        // Create the ad group.
        $adGroup = new AdGroup();

        // Required: Set the ad group's type to Dynamic Search Ads.
        $adGroup->setAdGroupType(AdGroupType::SEARCH_DYNAMIC_ADS);

        $adGroup->setName('Interplanetary Cruise #' . uniqid());
        $adGroup->setCampaignId($campaign->getId());
        $adGroup->setStatus(AdGroupStatus::PAUSED);

        // Recommended: Set a tracking URL template for your ad group if you want to
        // use URL tracking software.
        $adGroup->setTrackingUrlTemplate(
            'http://tracker.example.com/traveltracker/{escapedlpurl}'
        );

        // Set the ad group bids.
        $biddingStrategyConfiguration = new BiddingStrategyConfiguration();

        $cpcBid = new CpcBid();
        $money = new Money();
        $money->setMicroAmount(3000000);
        $cpcBid->setBid($money);
        $biddingStrategyConfiguration->setBids([$cpcBid]);

        $adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration);

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

        // Create the ad group on the server and print out some information.
        $result = $adGroupService->mutate([$operation]);
        $adGroup = $result->getValue()[0];
        printf(
            "Ad group with name '%s' and ID %d was added.\n",
            $adGroup->getName(),
            $adGroup->getId()
        );

        return $adGroup;
    }
306330
private void registerSamples() {

		SamplePanelRegistry.registerFactory(CATEGORY_WFS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WfsCapabilitiesPanel();
			}

			public String getTitle() {
				return MESSAGES.capabilitiesTitle();
			}

			public String getShortDescription() {
				return MESSAGES.capabilitiesShort();
			}

			public String getDescription() {
				return MESSAGES.capabilitiesDescription();
			}

			public String getCategory() {
				return CATEGORY_WFS;
			}

			@Override
			public String getKey() {
				return "wfscapabilities";
			}
		});
	}
316788
def _CreateExpandedDSA(client, ad_group_id):
  
  # Get the AdGroupAdService.
  ad_group_ad_service = client.GetService('AdGroupAdService')

  # Create the operation
  operations = [{
      'operator': 'ADD',
      'operand': {
          'xsi_type': 'AdGroupAd',
          'adGroupId': ad_group_id,
          # 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.
          'ad': {
              'xsi_type': 'ExpandedDynamicSearchAd',
              # Set the ad description.
              'description': 'Buy your tickets now!',
              'description2': 'Discount ends soon'
          },
          # Optional: Set the status.
          'status': 'PAUSED',
      }
  }]

  # Create the ad.
  ad = ad_group_ad_service.mutate(operations)['value'][0]['ad']

  # Display the results.
  print ('Expanded dynamic search ad with ID "%d", description "%s", and '
         'description 2 "%s" was added'
         % (ad['id'], ad['description'], ad['description2']))
792712
function create(type, detail = null) {
    return new window.CustomEvent(type, { bubbles: true, cancelable: true, detail });
}
48076
private static void createAndShowGUI() {

    // Create and set up the window.
    JFrame frame = new JFrame("XChart Demo");
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    // Add content to the window.
    frame.add(new XChartDemo());

    // Display the window.
    frame.pack();
    frame.setVisible(true);
  }
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]
1140635
def _create_show_definitions_action(self):
        """"""
        icon = resources_path('img', 'icons', 'show-inasafe-help.svg')
        self.action_show_definitions = QAction(
            QIcon(icon),
            self.tr('InaSAFE Help'),
            self.iface.mainWindow())
        self.action_show_definitions.setStatusTip(self.tr(
            'Show InaSAFE Help'))
        self.action_show_definitions.setWhatsThis(self.tr(
            'Use this to show a document describing all InaSAFE concepts.'))
        self.action_show_definitions.triggered.connect(
            self.show_definitions)
        self.add_action(
            self.action_show_definitions,
            add_to_toolbar=True)
155130
def post(self):
    """"""
    client_customer_id = self.request.get('clientCustomerId')
    campaign_id = self.request.get('campaignId')
    if not client_customer_id or not campaign_id:
      self.redirect('/')
    else:
      self.redirect('/showAdGroups?clientCustomerId=%s&campaignId=%s'
                    % (client_customer_id, campaign_id))
477139
function makeGraphics(agent) {
    return function (id) {
        if (id === undefined) {
            return agent.request('get_universe_graphics', undefined);
        }
        else {
            return new GraphicImpl(agent, id);
        }
    };
}
1266100
private static AdGroup createAdGroup(
      AdWordsServicesInterface adWordsServices, AdWordsSession session, Campaign campaign)
      throws RemoteException {
    // Get the AdGroupService.
    AdGroupServiceInterface adGroupService =
        adWordsServices.get(session, AdGroupServiceInterface.class);

    // Create ad group.
    AdGroup adGroup = new AdGroup();
    adGroup.setCampaignId(campaign.getId());
    adGroup.setName("Ad Group #" + System.currentTimeMillis());

    // 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 biddingStrategyConfiguration = new BiddingStrategyConfiguration();

    // Optional: Set the bids.
    Money bidAmount = new Money();
    bidAmount.setMicroAmount(100000L);
    CpcBid cpcBid = new CpcBid();
    cpcBid.setBid(bidAmount);
    biddingStrategyConfiguration.setBids(new Bids[] {cpcBid});

    adGroup.setBiddingStrategyConfiguration(biddingStrategyConfiguration);

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

    // Make the mutate request.
    AdGroupReturnValue adGroupAddResult =
        adGroupService.mutate(new AdGroupOperation[] {adGroupOperation});

    return adGroupAddResult.getValue(0);
  }
189153
function() {
      var ad = React.findDOMNode(this.refs.fakeAd)

      if (ad) {
        if (window.document.body.getAttribute('abp') !== null ||
        ad.offsetParent === null || ad.offsetHeight === 0 ||
        ad.offsetLeft === 0 || ad.offsetTop === 0 ||
        ad.offsetWidth === 0 || ad.clientHeight === 0 ||
        ad.clientWidth === 0) {
          this.setState({ adBlock: true })
        }

        if (window.getComputedStyle !== undefined) {
          var adStyles = window.getComputedStyle(ad, null)

          if (adStyles.getPropertyValue('display') == 'none' ||
          adStyles.getPropertyValue('visibility') == 'hidden') {
            this.setState({ adBlock: true })
          }
        }
      }
    }
1329133
def CreateAdGroup(client, campaign_id):
  
  ad_group_service = client.GetService('AdGroupService', 'v201809')

  adgroup = {
      # Required: Set the ad group type to SHOPPING_SHOWCASE_ADS
      'adGroupType': 'SHOPPING_SHOWCASE_ADS',
      'campaignId': campaign_id,
      'name': 'AdGroup #%s' % uuid.uuid4(),
      # REQUIRED: Set the ad group's bidding strategy configuration.
      'biddingStrategyConfiguration': {
          # Showcase ads require either ManualCpc or EnhancedCpc.
          'biddingStrategyType': 'MANUAL_CPC',
          # Optional: Set the bids
          'bids': [{
              'xsi_type': 'CpcBid',
              'bid': {
                  'microAmount': 100000
              }
          }]
      }
  }

  adgroup_operations = {
      'operator': 'ADD',
      'operand': adgroup
  }

  # Make the mutate request to add the AdGroup to the Shopping Campaign
  adgroup = ad_group_service.mutate(adgroup_operations)['value'][0]

  print ('AdGroup with name "%s" and ID "%s" was added.'
         % (adgroup['name'], adgroup['id']))

  return adgroup
830694
function(bid) {
    return !!(bid.params.slot && bid.params.adkey && bid.params.ad_size);
  }
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;
    }
11812
function createAdPodRequest(tags, adPodBid) {
  const { durationRangeSec, requireExactDuration } = adPodBid.mediaTypes.video;

  const numberOfPlacements = getAdPodPlacementNumber(adPodBid.mediaTypes.video);
  const maxDuration = utils.getMaxValueFromArray(durationRangeSec);

  const tagToDuplicate = tags.filter(tag => tag.uuid === adPodBid.bidId);
  let request = utils.fill(...tagToDuplicate, numberOfPlacements);

  if (requireExactDuration) {
    const divider = Math.ceil(numberOfPlacements / durationRangeSec.length);
    const chunked = utils.chunk(request, divider);

    // each configured duration is set as min/maxduration for a subset of requests
    durationRangeSec.forEach((duration, index) => {
      chunked[index].map(tag => {
        setVideoProperty(tag, 'minduration', duration);
        setVideoProperty(tag, 'maxduration', duration);
      });
    });
  } else {
    // all maxdurations should be the same
    request.map(tag => setVideoProperty(tag, 'maxduration', maxDuration));
  }

  return request;
}