// Add adds the creation of a ResourceRecordSet in the Zone to the changeset
181893
func (c *resourceRecordChangeset) Add(rrs dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset {
	c.add = append(c.add, rrs)
	return c
}
917003
func (s *SeqSet) Add(set string) error {
	for _, sv := range strings.Split(set, ",") {
		v, err := parseSeq(sv)
		if err != nil {
			return err
		}
		s.insert(v)
	}
	return nil
}
156330
func (s *Set) Add(x uint32) {
	v := s.sparse[x]
	if v < uint32(len(s.dense)) && s.dense[v] == x {
		return
	}
	n := len(s.dense)
	s.sparse[x] = uint32(n)
	s.dense = append(s.dense, x)
}
1291119
func (t *Template) AddResource(name string, resource ResourceProperties) *Resource {
	templateResource := &Resource{Properties: resource}
	t.Resources[name] = templateResource
	return templateResource
}
672394
func (r *resourceRecordChangeset) Upsert(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset {
	r.upserts = append(r.upserts, rrset)
	return r
}
262806
func (s *Set) Add(item interface{}) {
	s.lock.Lock()
	defer s.lock.Unlock()
	s.items[item] = struct{}{}
}
274403
func (q *resourceTriggerQueue) Add(resource string, on []string) {
	q.lock.Lock()
	defer q.lock.Unlock()
	for _, key := range on {
		q.queue[key] = append(q.queue[key], resource)
	}
}
1307758
func (s *invocationIDSet) Add(c context.Context, ids []int64) error {
	items := make([]dsset.Item, len(ids))
	for i, id := range ids {
		items[i].ID = fmt.Sprintf("%d", id)
	}
	return s.Set.Add(c, items)
}
25965
func (p BalanceStrategyPlan) Add(memberID, topic string, partitions ...int32) {
	if len(partitions) == 0 {
		return
	}
	if _, ok := p[memberID]; !ok {
		p[memberID] = make(map[string][]int32, 1)
	}
	p[memberID][topic] = append(p[memberID][topic], partitions...)
}
439807
func (r *Resources) Add(delta *Resources) error {
	if delta == nil {
		return nil
	}
	r.CPU += delta.CPU
	r.MemoryMB += delta.MemoryMB
	r.DiskMB += delta.DiskMB

	for _, n := range delta.Networks {
		// Find the matching interface by IP or CIDR
		idx := r.NetIndex(n)
		if idx == -1 {
			r.Networks = append(r.Networks, n.Copy())
		} else {
			r.Networks[idx].Add(n)
		}
	}
	return nil
}
820476
func (r *Resource) Add(rl v1.ResourceList) {
	if r == nil {
		return
	}

	for rName, rQuant := range rl {
		switch rName {
		case v1.ResourceCPU:
			r.MilliCPU += rQuant.MilliValue()
		case v1.ResourceMemory:
			r.Memory += rQuant.Value()
		case v1.ResourcePods:
			r.AllowedPodNumber += int(rQuant.Value())
		case v1.ResourceEphemeralStorage:
			r.EphemeralStorage += rQuant.Value()
		default:
			if v1helper.IsScalarResourceName(rName) {
				r.AddScalar(rName, rQuant.Value())
			}
		}
	}
}
449200
func (s *OrderedSet) Add(i string) bool {
	if _, ok := s.m[i]; ok {
		return false
	}

	s.s = append(s.s, i)
	s.m[i] = len(s.s) - 1

	return true
}
445658
func (c *Client) ChangeResourceRecordSets(hostedZoneID string, input ChangeResourceRecordSetsRequest) (*ChangeResourceRecordSetsResponse, error) {
	requestURL := fmt.Sprintf("%s/%s/hostedzone/%s/rrset", c.BaseURL, apiVersion, hostedZoneID)

	body := &bytes.Buffer{}
	body.Write([]byte(xml.Header))
	err := xml.NewEncoder(body).Encode(input)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest(http.MethodPost, requestURL, body)
	if err != nil {
		return nil, err
	}

	req.Header.Set("Content-Type", "text/xml; charset=utf-8")

	err = c.sign(req)
	if err != nil {
		return nil, fmt.Errorf("an error occurred during the creation of the signature: %v", err)
	}

	res, err := c.HTTPClient.Do(req)
	if err != nil {
		return nil, err
	}
	if res.Body == nil {
		return nil, errors.New("the response body is nil")
	}

	defer res.Body.Close()

	if res.StatusCode != http.StatusOK {
		errResp := &ErrorResponse{}
		err = xml.NewDecoder(res.Body).Decode(errResp)
		if err != nil {
			return nil, fmt.Errorf("an error occurred while unmarshaling the error body to XML: %v", err)
		}

		return nil, fmt.Errorf("an error occurred: %s", errResp.Error.Message)
	}

	output := &ChangeResourceRecordSetsResponse{}
	err = xml.NewDecoder(res.Body).Decode(output)
	if err != nil {
		return nil, fmt.Errorf("an error occurred while unmarshaling the response body to XML: %v", err)
	}

	return output, err
}
332854
func (z *zones) Add(newZone dnsprovider.Zone) (dnsprovider.Zone, error) {
	domainCreateRequest := &godo.DomainCreateRequest{
		Name:      newZone.Name(),
		IPAddress: ipPlaceholder,
	}

	domain, err := createDomain(z.client, domainCreateRequest)
	if err != nil {
		return nil, err
	}

	return &zone{
		name:   domain.Name,
		client: z.client,
	}, nil
}
11406
func (s *SeriesIDSet) Add(id SeriesID) {
	s.Lock()
	defer s.Unlock()
	s.AddNoLock(id)
}
626474
func (z *Zones) Add(zo *file.Zone, name string) {
	z.Lock()

	if z.Z == nil {
		z.Z = make(map[string]*file.Zone)
	}

	z.Z[name] = zo
	z.names = append(z.names, name)
	zo.Reload()

	z.Unlock()
}
494463
func (b *Builder) Add(args ...string) error {
	for _, a := range args {
		if err := b.add(a); err != nil {
			return errwrap.Wrapf(fmt.Sprintf("invalid key/value pair %q: {{err}}", a), err)
		}
	}

	return nil
}