Activate a one-time application charge

@link   https://help.shopify.com/api/reference/applicationcharge#activate
@param  ApplicationCharge $applicationCharge
@return void
766631
public function activate(ApplicationCharge &$applicationCharge)
    {
        $response = $this->request('/admin/application_charges/'.$applicationCharge->id.'/activate.json', 'POST');
        $applicationCharge->setData($response['application_charge']);
    }
301286
public function startApplication() : void
    {
        if ($this->hasApplicationBeenStarted()) {
            throw new ApplicationRunningException(sprintf('Application has already been started. Please stop the application, before invoking start!'));
        }

        $this->refreshApplication();

        if (!$this->factory) {
            $this->factory = $this->app->make(Factory::class);
        }
    }
317967
protected void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(tc, "activate", context);
        authDataServiceRef.activate(context);
        deferrableSchedXSvcRef.activate(context);
        execSvcRef.activate(context);
        nonDeferrableSchedXSvcRef.activate(context);
        rrsXAResFactorySvcRef.activate(context);
        variableRegistrySvcRef.activate(context);
    }
285429
public function get($recurringApplicationChargeId, array $params = array())
    {
        $endpoint = '/admin/recurring_application_charges/'.$recurringApplicationChargeId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(RecurringApplicationCharge::class, $response['recurring_application_charge']);
    }
145815
public function activate(): void
    {
        if ($this->stopBuffering) {
            $this->buffering = false;
        }
        if (!$this->handler instanceof HandlerInterface) {
            $record = end($this->buffer) ?: null;

            $this->handler = call_user_func($this->handler, $record, $this);
            if (!$this->handler instanceof HandlerInterface) {
                throw new \RuntimeException("The factory callable should return a HandlerInterface");
            }
        }
        $this->handler->handleBatch($this->buffer);
        $this->buffer = [];
    }
786980
protected void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(this, tc, "activate", context);
        configAdminRef.activate(context);
        variableRegistryRef.activate(context);
        metaTypeServiceRef.activate(context);
        wsConfigurationHelperRef.activate(context);
        bundleContext = priv.getBundleContext(context);

    }
900336
public void activate() {
        // Notify ActivationListeners
    	SipSessionEvent event = null;
    	if(sipSessionAttributeMap != null) {
	        Set<String> keySet = getAttributeMap().keySet();
	        for (String key : keySet) {
	        	Object attribute = getAttributeMap().get(key);
	            if (attribute instanceof SipSessionActivationListener) {
	                if (event == null)
	                	event = new SipSessionActivationEvent(this, SessionActivationNotificationCause.ACTIVATION);
	                try {
	                    ((SipSessionActivationListener)attribute)
	                        .sessionDidActivate(event);
	                } catch (Throwable t) {
	                    logger.error("SipSessionActivationListener threw exception", t);
	                }
	            }
			}
	    }
    }
1370728
public function onRegister()
    {
        try {
            if (!$this->canRegister()) {
                throw new ApplicationException(Lang::get(/*Registrations are currently disabled.*/'rainlab.user::lang.account.registration_disabled'));
            }

            /*
             * Validate input
             */
            $data = post();

            if (!array_key_exists('password_confirmation', $data)) {
                $data['password_confirmation'] = post('password');
            }

            $rules = [
                'email'    => 'required|email|between:6,255',
                'password' => 'required|between:4,255|confirmed'
            ];

            if ($this->loginAttribute() == UserSettings::LOGIN_USERNAME) {
                $rules['username'] = 'required|between:2,255';
            }

            $validation = Validator::make($data, $rules);
            if ($validation->fails()) {
                throw new ValidationException($validation);
            }

            /*
             * Register user
             */
            Event::fire('rainlab.user.beforeRegister', [&$data]);

            $requireActivation = UserSettings::get('require_activation', true);
            $automaticActivation = UserSettings::get('activate_mode') == UserSettings::ACTIVATE_AUTO;
            $userActivation = UserSettings::get('activate_mode') == UserSettings::ACTIVATE_USER;
            $user = Auth::register($data, $automaticActivation);

            Event::fire('rainlab.user.register', [$user, $data]);

            /*
             * Activation is by the user, send the email
             */
            if ($userActivation) {
                $this->sendActivationEmail($user);

                Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent'));
            }

            /*
             * Automatically activated or not required, log the user in
             */
            if ($automaticActivation || !$requireActivation) {
                Auth::login($user);
            }

            /*
             * Redirect to the intended page after successful sign in
             */
            if ($redirect = $this->makeRedirection(true)) {
                return $redirect;
            }
        }
        catch (Exception $ex) {
            if (Request::ajax()) throw $ex;
            else Flash::error($ex->getMessage());
        }
    }
1158015
public function activate( $args = array() ) {
		$theme = $this->fetcher->get_check( $args[0] );

		$errors = $theme->errors();
		if ( is_wp_error( $errors ) ) {
			$message = $errors->get_error_message();
			WP_CLI::error( $message );
		}

		$name = $theme->get( 'Name' );

		if ( 'active' === $this->get_status( $theme ) ) {
			WP_CLI::warning( "The '$name' theme is already active." );
			return;
		}

		if ( $theme->get_stylesheet() !== $theme->get_template() && ! $this->fetcher->get( $theme->get_template() ) ) {
			WP_CLI::error( "The '{$theme->get_stylesheet()}' theme cannot be activated without its parent, '{$theme->get_template()}'." );
		}

		switch_theme( $theme->get_template(), $theme->get_stylesheet() );

		if ( $this->is_active_theme( $theme ) ) {
			WP_CLI::success( "Switched to '$name' theme." );
		} else {
			WP_CLI::error( "Could not switch to '$name' theme." );
		}
	}
78261
public function activate(Model\InStore\Device $device, HandlerStack $stack = null)
    {
        try {
            $params = [
                'headers' => [
                    'Accept' => 'application/json',
                    'Content-Type' => 'application/json',
                ],
                'body' => $this->getSerializer()->serialize(
                    $device,
                    'json',
                    SerializationContext::create()->setGroups(['activateDevice'])
                ),
            ];
            if ($stack !== null) {
                $params['handler'] = $stack;
            }

            $result = $this->getClient()->post('devices/activate', $params);

            return $this->getSerializer()->deserialize(
                (string) $result->getBody(),
                Model\InStore\Device::class,
                'json'
            );
        } catch (BadResponseException $e) {
            throw new ApiException(
                $this->getSerializer()->deserialize(
                    (string) $e->getResponse()->getBody(),
                    Model\ErrorResponse::class,
                    'json'
                ),
                $e
            );
        }
    }
445331
@MainThread
	public void startSetup() {
		try {
			LOGGER.debug("Starting in-app billing setup.");

			billingClient = BillingClient.newBuilder(AbstractApplication.get()).setListener(this).build();
			
			Runnable runnable = new Runnable() {
				@Override
				public void run() {
					LOGGER.debug("In-app billing setup successful.");
					
					for (ProductType productType : InAppBillingAppModule.get().getInAppBillingContext().getManagedProductTypes()) {
						inventory.addProduct(new Product(productType));
					}

					if (isSubscriptionsSupported()) {
						for (ProductType productType : InAppBillingAppModule.get().getInAppBillingContext().getSubscriptionsProductTypes()) {
							inventory.addProduct(new Product(productType));
						}
					}
					
					if (listener != null) {
						listener.onSetupFinished();
					}
				}
			};

			if (isServiceConnected) {
				runnable.run();
			} else {
				startServiceConnection(runnable);
			}
			
		} catch (Exception e) {
			AbstractApplication.get().getExceptionHandler().logHandledException(e);
			if (listener != null) {
				listener.onSetupFailed(new UnexpectedException(e));
			}
		}
	}
940431
public function refreshApplication($app = null)
    {
        $this->app = $app instanceof Application ? $app : $this->createApplication();
    }
417993
def ActivateCard(self, card):
        """"""
        if not hasattr(card, 'connection'):
            card.connection = card.createConnection()
            if None != self.parent.apdutracerpanel:
                card.connection.addObserver(self.parent.apdutracerpanel)
            card.connection.connect()
        self.dialogpanel.OnActivateCard(card)
242527
public void activate() {
        // Notify ActivationListeners
    	SipApplicationSessionEvent event = null;
    	if(sipApplicationSessionAttributeMap != null) {
	        Set<String> keySet = sipApplicationSessionAttributeMap.keySet();
	        for (String key : keySet) {
	        	Object attribute = sipApplicationSessionAttributeMap.get(key);
	            if (attribute instanceof SipApplicationSessionActivationListener) {
	                if (event == null)
	                	event = new SipApplicationSessionActivationEvent(this, SessionActivationNotificationCause.ACTIVATION);
	                try {
	                    ((SipApplicationSessionActivationListener)attribute)
	                        .sessionDidActivate(event);
	                } catch (Throwable t) {
	                    logger.error("SipApplicationSessionActivationListener threw exception", t);
	                }
	            }
			}
	    }
    }
1147109
public function onSendActivationEmail()
    {
        try {
            if (!$user = $this->user()) {
                throw new ApplicationException(Lang::get(/*You must be logged in first!*/'rainlab.user::lang.account.login_first'));
            }

            if ($user->is_activated) {
                throw new ApplicationException(Lang::get(/*Your account is already activated!*/'rainlab.user::lang.account.already_active'));
            }

            Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent'));

            $this->sendActivationEmail($user);

        }
        catch (Exception $ex) {
            if (Request::ajax()) throw $ex;
            else Flash::error($ex->getMessage());
        }

        /*
         * Redirect
         */
        if ($redirect = $this->makeRedirection()) {
            return $redirect;
        }
    }
1362195
public void activate(final ApiConfiguration apiConfig) {
		Preconditions.checkNotNull(apiConfig);
		Preconditions.checkNotNull(apiConfig.getApiUrl());
		Preconditions.checkArgument(!apiConfig.getApiUrl().isEmpty());
		Preconditions.checkNotNull(apiConfig.getApiKey());
		Preconditions.checkArgument(!apiConfig.getApiKey().isEmpty());

		// Single JSON object mapper for all services

		ObjectMapper objectMapper = new ObjectMapper();

		// build the app identity service

		AppIdentityService appIdentityService = new AppIdentityService(apiConfig, objectMapper);

		// build the services for collecting and sending log messages

		this.collector = new LogCollector(logger, apiConfig.getEnvDetail(), appIdentityService);

		LogSender sender = new LogSender(apiConfig, objectMapper, this.masker, this.skipJson);

		// set allowComDotStackify
		
		if (Boolean.TRUE.equals(apiConfig.getAllowComDotStackify())) {
			this.allowComDotStackify = true;
		}
		
		// build the background service to asynchronously post errors to Stackify
		// startup the background service

		this.backgroundService = new LogBackgroundService(collector, sender);
		this.backgroundService.start();
	}
644507
public void activate() {
        super.activate();
        LOG.debug("Activating receipt of incoming messages");

        Class<?> serviceClass = endpointInfo.getProperty("serviceClass", Class.class);
        if (serviceClass != null && this.loader == null) {
            final ClassLoader cl = serviceClass.getClassLoader();
            LOG.debug("Using classloader {} obtained via endpointInfo serviceClass", cl);
            this.loader = cl;
        }

        if (engine != null) {
            UndertowHTTPHandler jhd = createJettyHTTPHandler(this, contextMatchOnExact());
            engine.addServant(nurl, jhd);
        }
    }