Toggles synchronisation settings.

 @param id id of the factory
 @param factory_sync_body
 @param [Hash] opts the optional parameters
 @return [FactorySync]
480294
def toggle_factory_sync(id, factory_sync_body, opts = {})
      data, _status_code, _headers = toggle_factory_sync_with_http_info(id, factory_sync_body, opts)
      return data
    end
889564
function _createSync(siteId) {
  const ttxSettings = config.getConfig('ttxSettings');
  const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;

  return {
    type: 'iframe',
    url: `${syncUrl}&id=${siteId}`
  }
}
1347915
def click_button_with_id(id, opts = {})
      if opts && opts[:index]
          wait_before_and_after { button(:id => id,  :index => opts[:index]).click  }
      else
          wait_before_and_after { button(:id, id).click }
      end
    end
1231455
public boolean sync(NewRelicCache cache)
    {
        if(cache == null)
            throw new IllegalArgumentException("null cache");

        checkInitialize(cache);
        boolean ret = isInitialized();
        if(!ret)
            throw new IllegalStateException("cache not initialized");

        clear(cache);

        if(ret)
            ret = syncApplications(cache);
        if(ret)
            ret = syncPlugins(cache);
        if(ret)
            ret = syncMonitors(cache);
        if(ret)
            ret = syncServers(cache);
        if(ret)
            ret = syncLabels(cache);
        if(ret)
            ret = syncAlerts(cache);
        if(ret)
            ret = syncDashboards(cache);

        return ret;
    }
1356921
function(options) {
      options = options ? _.clone(options) : {};
      if (options.parse === void 0) options.parse = true;
      var model = this;
      var success = options.success;
      options.success = function(resp) {
        if (!model.set(model.parse(resp, options), options)) return false;
        if (success) success(model, resp, options);
        model.trigger('sync', model, resp, options);
      };
      wrapError(this, options);
      return this.sync('read', this, options);
    }
1249402
def auto_sync(instance):
    """"""
    # this allows us to turn off sync temporarily - e.g. when doing bulk updates
    if not get_setting("auto_sync"):
        return False
    model_name = "{}.{}".format(instance._meta.app_label, instance._meta.model_name)
    if model_name in get_setting("never_auto_sync", []):
        return False
    return True
425163
def process_pull
      factory = "::#{object_type}".constantize
      syncer = factory.synchronizer
      syncer.pull_object(self.object_remote_id)
      
      self.state = 'done'
      self.save
    end
1130082
def update_repository_configuration(id, external_repository=None, prebuild_sync=None):
    
    to_update_id = id

    rc_to_update = pnc_api.repositories.get_specific(id=to_update_id).content

    if external_repository is None:
        external_repository = rc_to_update.external_url
    else:
        rc_to_update.external_url = external_repository

    if prebuild_sync is not None:
        rc_to_update.pre_build_sync_enabled = prebuild_sync

    if not external_repository and prebuild_sync:
        logging.error("You cannot enable prebuild sync without external repository")
        return

    response = utils.checked_api_call(pnc_api.repositories, 'update', id=to_update_id, body=rc_to_update)
    if response:
        return response.content
916150
function (rpc, id, opts) {
    if (!checkInterface(rpc, RPC_FUNCTIONS))
        throw new Error('the RPC interface is not fully defined');
    rpc.receive('ping', this._onPing.bind(this));
    rpc.receive('store', this._onStore.bind(this));
    rpc.receive('findNode', this._onFindNode.bind(this));
    rpc.receive('findValue', this._onFindValue.bind(this));
    Object.defineProperty(this, 'rpc', {value: rpc});
    this._cache = {};
    this._locals = {};
    this._routes = new RoutingTable(id, opts.bucketSize);
    this._opts = opts;
    this._pendingContact = null;
    this._lookupOpts = {
        size: opts.bucketSize,
        concurrency: opts.concurrency,
        findNode: this._findNode.bind(this)
    };
}
717363
def get_budget_settings_by_id(budget_id, opts = {})
      data, _status_code, _headers = get_budget_settings_by_id_with_http_info(budget_id, opts)
      data
    end
1062643
def bind(self, key, factory):
        
        if key in self.factories:
            raise AlreadyBoundError(key)
        else:
            self.factories[key] = factory
1040983
def transaction(force_sync = false, &block)
      # Ruby 1.9.3 does not support @mutex.owned?
      if @mutex.respond_to?(:owned?)
        force_sync = false if @mutex.locked? && @mutex.owned?
      else
        # If we allowed this in Ruby 1.9.3, it might possibly cause recursive
        # locking within the same thread.
        force_sync = false
      end
      if !force_sync && (@in_transaction || options[:without_mutex])
        block.call self
      else
        @mutex.synchronize do
          @in_transaction = true
          result = block.call
          @in_transaction = false
          result
        end
      end
    end
675341
def sync(self):
        
        LOGGER.debug("OSType.sync")
        params = None
        if self.id is not None:
            params = {'id': self.id}
        elif self.name is not None:
            params = {'name': self.name}

        if params is not None:
            args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}
            response = OSTypeService.requester.call(args)
            if response.rc != 0:
                LOGGER.warning(
                    'OSType.sync - Problem while syncing OS type (name:' + self.name + ', id: ' + str(self.id) +
                    '). Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                    " (" + str(response.rc) + ")"
                )
            else:
                json_obj = response.response_content
                self.id = json_obj['osTypeID']
                self.name = json_obj['osTypeName']
                self.architecture = json_obj['osTypeArchitecture']
                if json_obj['osTypeCompanyID'] == -1:
                    self.company_id = None
                else:
                    self.company_id = json_obj['osTypeCompanyID']
                self.osi_ids = json_obj['osTypeOSInstancesID']
567397
def method_missing(method_id, *args, &bl)
    @em_lock.synchronize{
      EventMachine.send method_id, *args, &bl
    }
  end
583686
function spawnNodeWithId (factory, callback) {
  waterfall([(cb) => factory.spawnNode(cb), identify], callback)
}
151100
private void updateLastSynchronizationDate(Date syncDate, Integer subscriptionId) {
        TokenSyncDate tokenSyncDate = ocpiRepository.getTokenSyncDate(subscriptionId);

        if (tokenSyncDate == null) {
            tokenSyncDate = new TokenSyncDate();
            tokenSyncDate.setSubscriptionId(subscriptionId);
        }
        tokenSyncDate.setSyncDate(syncDate);

        ocpiRepository.insertOrUpdate(tokenSyncDate);
    }
528317
function(syncIt) {
	/* global setInterval */
	this._syncIt = syncIt;
	this._instructions = [];
	this._current = null;
	setInterval(function() {
		var args, c;
		if ((this._current === null) && this._instructions.length) {
			this._current = this._instructions.shift();
			args = Array.prototype.slice.call(this._current.a);
			args.push(function(e) {
				if (e !== SyncItConstant.Error.UNABLE_TO_PROCESS_BECAUSE_LOCKED) {
					c = this._current.c;
					this._current = null;
					c.apply(
						this._syncIt,
						arguments
					);
				}
			}.bind(this));
			this._current.f.apply(this._syncIt, args);
		}
	}.bind(this), 50);
}