Helper method to add offer to save card.

@param offerSaveCard
@return HppRequest
512446
public HppRequest addOfferSaveCard(boolean offerSaveCard) {
		this.offerSaveCard = offerSaveCard ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag();
		return this;
	}
1194499
@Override
	public com.liferay.commerce.model.CommerceAvailabilityEstimate addCommerceAvailabilityEstimate(
		com.liferay.commerce.model.CommerceAvailabilityEstimate commerceAvailabilityEstimate) {
		return _commerceAvailabilityEstimateLocalService.addCommerceAvailabilityEstimate(commerceAvailabilityEstimate);
	}
1221931
public static byte[] saveHq(Bitmap src) throws ImageSaveException {
        return save(src, Bitmap.CompressFormat.JPEG, JPEG_QUALITY_HQ);
    }
170673
def add_coupon(self, coupon, idempotency_key=None):
		
		if isinstance(coupon, StripeModel):
			coupon = coupon.id

		stripe_customer = self.api_retrieve()
		stripe_customer["coupon"] = coupon
		stripe_customer.save(idempotency_key=idempotency_key)
		return self.__class__.sync_from_stripe_data(stripe_customer)
1227710
@Override
    public final boolean offer(T e, long timeout, TimeUnit unit) throws InterruptedException {
        final Queue<T> queue = this.getOrCreateQueue(e);

        final long start = getWriteLockWithOptionalWait(timeout, unit);
        if (start == Long.MIN_VALUE) {
            // Min value signals a timeout while waiting
            return false;
        }
        final long maxWait = start >= 0 ? unit.toMillis(timeout) : -1;

        try {
            if (!this.waitForRemove(start, maxWait)) {
                return false;
            }

            final boolean added = queue.add(e);
            if (added) {
                this.size++;
                this.notEmpty.signal();
            }
            return added;
        } finally {
            this.writeLock.unlock();
        }
    }
236860
public String discount(Discount discount) {
        Card card = new Card();
        card.setCardType("DISCOUNT");
        card.setDiscount(discount);

        return createCard(card);
    }
616189
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceAvailabilityEstimate addCommerceAvailabilityEstimate(
		CommerceAvailabilityEstimate commerceAvailabilityEstimate) {
		commerceAvailabilityEstimate.setNew(true);

		return commerceAvailabilityEstimatePersistence.update(commerceAvailabilityEstimate);
	}
996516
public function execute()
    {
        parent::execute();

        $addValueSvc = new HpsGiftCardService($this->service->servicesConfig());
        if ($this->token != null && ($this->token instanceof HpsTokenData)) {
            if ($this->card == null) {
                $this->card = new HpsGiftCard();
            }
            $this->card->tokenValue = $this->token->tokenValue;
        }
        return $addValueSvc->addValue(
            $this->amount,
            $this->currency,
            $this->card
        );
    }
428767
public CmsAliasEditValidationReply saveAliases(CmsAliasSaveValidationRequest saveRequest) throws CmsException {

        CmsAliasEditValidationReply reply = validateAliases(saveRequest);
        if (m_hasErrors) {
            return reply;
        } else {
            List<CmsRewriteAliasTableRow> rewriteData = saveRequest.getRewriteData();
            OpenCms.getAliasManager().saveRewriteAliases(
                m_cms,
                m_cms.getRequestContext().getSiteRoot(),
                convertRewriteData(rewriteData));
            Set<CmsUUID> allTouchedIds = new HashSet<CmsUUID>();
            List<CmsAliasTableRow> rows = saveRequest.getEditedData();
            for (CmsAliasTableRow row : rows) {
                if (row.isEdited()) {
                    allTouchedIds.add(row.getStructureId());
                    if (row.getOriginalStructureId() != null) {
                        allTouchedIds.add(row.getOriginalStructureId());
                    }
                }
            }
            allTouchedIds.addAll(saveRequest.getDeletedIds());
            CmsAliasManager aliasManager = OpenCms.getAliasManager();
            String siteRoot = saveRequest.getSiteRoot();
            List<CmsAlias> aliases = aliasManager.getAliasesForSite(m_cms, siteRoot);
            Set<CmsAlias> aliasSet = new HashSet<CmsAlias>();
            Set<CmsAlias> editedAliasSet = new HashSet<CmsAlias>();
            aliasSet.addAll(aliases);
            for (CmsAliasTableRow row : rows) {
                CmsAlias editedAlias = new CmsAlias(row.getStructureId(), siteRoot, row.getAliasPath(), row.getMode());
                editedAliasSet.add(editedAlias);
            }
            Set<CmsAlias> toDelete = Sets.difference(aliasSet, editedAliasSet);
            toDelete = filterStructureId(toDelete, allTouchedIds);
            Set<CmsAlias> toAdd = Sets.difference(editedAliasSet, aliasSet);
            toAdd = filterStructureId(toAdd, allTouchedIds);

            aliasManager.updateAliases(m_cms, toDelete, toAdd);
            return null;
        }
    }
1104168
def mark_offer_as_lose(self, offer_id):
        
        return self._create_put_request(
            resource=OFFERS,
            billomat_id=offer_id,
            command=LOSE,
        )
746231
@Override
	public boolean offer(E e) {
		if (sizeLimit > 0 && size() >= sizeLimit){
			return false;
		}else{
			return queue.offer(e);
		}
	}
865710
def save_assessment_offered(self, assessment_offered_form, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.update_resource
        if assessment_offered_form.is_for_update():
            return self.update_assessment_offered(assessment_offered_form, *args, **kwargs)
        else:
            return self.create_assessment_offered(assessment_offered_form, *args, **kwargs)
1094964
public boolean offer(E e) {
        if(e == null)
            throw new NullPointerException("null objects are not allowed");
        AddNodeAction<K, E> addAction = new AddNodeAction<K, E>(_key, e);
        try {
            return _storeClient.applyUpdate(addAction);
        } catch(IndexOutOfBoundsException ex) {
            // over-capacity
            return false;
        }
    }
397618
synchronized void offer(Dag<JobExecutionPlan> dag) throws IOException {
    //Persist the dag
    this.dagStateStore.writeCheckpoint(dag);
    //Add it to the queue of dags
    if (!this.queue.offer(dag)) {
      throw new IOException("Could not add dag" + DagManagerUtils.generateDagId(dag) + "to queue");
    }
  }
1060658
function updateCard(card, options) {
  return webdav.updateObject(card.url, card.addressData, card.etag, options);
}
819662
function save(options) {
    const self = this
    options = options || {}

    if (self.options.polymorph) return this.callParent(options)

    return Promise.all(
      this.map(function(record) {
        // validate all records at once.
        return record.validate()
      })
    )
      .then(function() {
        // if validation succeeded, start the transaction
        return self.store.startTransaction(options, function() {
          return self
            ._runLazyOperation(options)
            .then(function() {
              // inside the transaction create all new records and afterwards save all the others
              return self._create(options)
            })
            .then(function() {
              // will save all existing records with changes...
              return self.callParent(options, save)
            })
        })
      })
      .then(function() {
        return self
      })
  }
412622
public void offer(StreamBlock streamBlock) throws IOException {
        m_persistentDeque.offer(streamBlock.asBBContainer());
        long unreleasedSeqNo = streamBlock.unreleasedSequenceNumber();
        if (m_memoryDeque.size() < 2) {
            StreamBlock fromPBD = pollPersistentDeque(false);
            if ((streamBlock.startSequenceNumber() == fromPBD.startSequenceNumber()) &&
                    (unreleasedSeqNo > streamBlock.startSequenceNumber())) {
                fromPBD.releaseTo(unreleasedSeqNo - 1);
            }
        }
    }