// AddCard takes a Card and Arguments and adds the card to the receiver list.
768433
func (l *List) AddCard(card *Card, extraArgs Arguments) error {
	path := fmt.Sprintf("lists/%s/cards", l.ID)
	args := Arguments{
		"name":      card.Name,
		"desc":      card.Desc,
		"idMembers": strings.Join(card.IDMembers, ","),
		"idLabels":  strings.Join(card.IDLabels, ","),
	}
	if card.Due != nil {
		args["due"] = card.Due.Format(time.RFC3339)
	}
	// Allow overwriting the creation position with 'top' or 'bottom'
	if pos, ok := extraArgs["pos"]; ok {
		args["pos"] = pos
	}
	err := l.client.Post(path, args, &card)
	if err == nil {
		card.client = l.client
	} else {
		err = errors.Wrapf(err, "Error adding card to list %s", l.ID)
	}
	return err
}
447168
func New(params *stripe.CardParams) (*stripe.Card, error) {
	return getC().New(params)
}
1052991
func (c Client) New(params *stripe.CardParams) (*stripe.Card, error) {
	if params == nil {
		return nil, errors.New("params should not be nil")
	}

	var path string
	if params.Account != nil {
		path = stripe.FormatURLPath("/v1/accounts/%s/external_accounts",
			stripe.StringValue(params.Account))
	} else if params.Customer != nil {
		path = stripe.FormatURLPath("/v1/customers/%s/sources",
			stripe.StringValue(params.Customer))
	} else if params.Recipient != nil {
		path = stripe.FormatURLPath("/v1/recipients/%s/cards",
			stripe.StringValue(params.Recipient))
	} else {
		return nil, errors.New("Invalid card params: either account, customer or recipient need to be set")
	}

	body := &form.Values{}

	// Note that we call this special append method instead of the standard one
	// from the form package. We should not use form's because doing so will
	// include some parameters that are undesirable here.
	params.AppendToAsCardSourceOrExternalAccount(body, nil)

	// Because card creation uses the custom append above, we have to make an
	// explicit call using a form and CallRaw instead of the standard Call
	// (which takes a set of parameters).
	card := &stripe.Card{}
	err := c.B.CallRaw(http.MethodPost, path, c.Key, body, &params.Params, card)
	return card, err
}
1284894
func (l *List) Add(values ...interface{}) {
	l.values = append(l.values, values...)
}
790283
func NewCard(title string, content *valente.Panel, actions []*valente.Link) *Card {
	card := &Card{}

	d := valente.Panel{}

	card.AddClass("card")
	d.AddClass("card-content")

	stitle := valente.Span{Text: title}
	stitle.AddClass("card-title")

	d.AddElement(stitle)
	d.AddElement(content)

	card.AddElement(d)

	if len(actions) > 0 {
		caction := valente.Panel{}
		caction.AddClass("card-action")

		for _, a := range actions {
			caction.AddElement(*a)
		}
		card.AddElement(caction)
	}

	return card
}
237857
func (s *Prompt) SetResponseCard(v string) *Prompt {
	s.ResponseCard = &v
	return s
}
326865
func (s *StreamEncoder) AddInt(value int) {
	s.buf = strconv.AppendInt(s.buf, int64(value), 10)
	s.Encoder.writeByte(s.delimiter)
}
223828
func (s *Slot) SetResponseCard(v string) *Slot {
	s.ResponseCard = &v
	return s
}
501128
func (sd *StandardDeck) NextCard() (*card.Card, error) {
	var ans *card.Card

	if sd.idx < sd.Size() { // ensure we're not at the end of the cards array
		ans = sd.cards[sd.idx]
		sd.idx += 1 // go to the next card
		return ans, nil
	}

	// otherwise
	return &card.Card{}, deck.EmptyDeck{}
}
353032
func (o Options) Add(key OptionCode, value encoding.BinaryMarshaler) error {
	// Special case: since OptionRapidCommit actually has zero length, it is
	// possible for an option key to appear with no value.
	if value == nil {
		o.AddRaw(key, nil)
		return nil
	}

	b, err := value.MarshalBinary()
	if err != nil {
		return err
	}

	o.AddRaw(key, b)
	return nil
}
936424
func (c CallList) Add(selector, ident string) {
	if _, ok := c[selector]; !ok {
		c[selector] = make(set)
	}
	c[selector][ident] = true
}
740827
func (cs callSet) Add(call *Call) {
	key := callSetKey{call.receiver, call.method}
	m := cs.expected
	if call.exhausted() {
		m = cs.exhausted
	}
	m[key] = append(m[key], call)
}
589463
func NewImageCard(title, fimg, icon, textcontent string) ImageCard {
	card := ImageCard{}

	card.AddClass("card")

	card.image.AddClass("card-image")

	img := valente.Image{Source: fimg}
	card.image.AddElement(img)

	stitle := valente.Span{Text: title}
	stitle.AddClass("card-title")
	stitle.SetStyle("background-color", "#22222299")
	stitle.SetStyle("padding", "3px")

	card.image.AddElement(stitle)

	if len(icon) != 0 {
		aicon := valente.Link{Text: "<i class='material-icons'>" + icon + "</i>"}
		aicon.AddClass("btn-floating halfway-fab waves-effect waves-light red")
		card.image.AddElement(aicon)
	}

	card.Content.AddClass("card-content")
	card.Content.Text = "<p>" + textcontent + "</p>"

	card.AddElement(card.image)
	card.AddElement(card.Content)

	return card
}
573653
func (r *Reporter) Add(format string, a ...interface{}) bool {

	if format == "" && len(a) == 0 {
		return false
	}

	//  usually used as:  "module: %v", err so
	// check if the first argument is error and if that error is empty then don't add it.
	if len(a) > 0 {
		f := a[0]
		if e, ok := f.(interface {
			Error() string
		}); ok {
			if e.Error() == "" {
				return false
			}
		}
	}

	r.mu.Lock()
	r.wrapper = r.wrapper.Append(format, a...)
	r.mu.Unlock()
	return true
}
1011330
func (i *Item) addType(value string) {
	i.Types = append(i.Types, value)
}
894697
func (c *Card) AddComment(text string) (*Action, error) {
	newAction := &Action{}

	payload := url.Values{}
	payload.Set("text", text)

	body, err := c.client.Post("/cards/"+c.Id+"/actions/comments", payload)
	if err != nil {
		return nil, err
	}
	if err = json.Unmarshal(body, newAction); err != nil {
		return nil, err
	}
	newAction.client = c.client
	return newAction, nil
}
283839
func (c *Card) Update(args Arguments) error {
	path := fmt.Sprintf("cards/%s", c.ID)
	return c.client.Put(path, args, c)
}