// bindTags binds and validates array parameter Tags from query.
//
// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty).
185674
func (o *FindPetsByTagsParams) bindTags(rawData []string, hasKey bool, formats strfmt.Registry) error {

	// CollectionFormat: multi
	tagsIC := rawData

	if len(tagsIC) == 0 {
		return nil
	}

	var tagsIR []string
	for _, tagsIV := range tagsIC {
		tagsI := tagsIV

		tagsIR = append(tagsIR, tagsI)
	}

	o.Tags = tagsIR

	return nil
}
988371
func WithTags(tags []string) Option {
	return func(o *Options) error {
		o.Tags = tags
		return nil
	}
}
100152
func (o *ListTasksParams) WithTags(tags []string) *ListTasksParams {
	o.SetTags(tags)
	return o
}
345838
func (c *awsCloudImplementation) DeleteTags(resourceId string, tags map[string]string) error {
	return deleteTags(c, resourceId, tags)
}
941753
func MarshalTags(tags map[string]string) []byte {
	// Empty maps marshal to empty bytes.
	if len(tags) == 0 {
		return nil
	}

	// Extract keys and determine final size.
	sz := (len(tags) * 2) - 1 // separators
	keys := make([]string, 0, len(tags))
	for k, v := range tags {
		keys = append(keys, k)
		sz += len(k) + len(v)
	}
	sort.Strings(keys)

	// Generate marshaled bytes.
	b := make([]byte, sz)
	buf := b
	for _, k := range keys {
		copy(buf, k)
		buf[len(k)] = '|'
		buf = buf[len(k)+1:]
	}
	for i, k := range keys {
		v := tags[k]
		copy(buf, v)
		if i < len(keys)-1 {
			buf[len(v)] = '|'
			buf = buf[len(v)+1:]
		}
	}
	return b
}
233244
func (c *Client) DeleteTags(p *DeleteTagsParameter) (*Result, error) {
	obj, err := c.Request("deleteTags", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
976776
func (s *DescribedServer) SetTags(v []*Tag) *DescribedServer {
	s.Tags = v
	return s
}
996694
func SortTags(tags map[string]string) [][]string {
	keys := make([]string, len(tags))
	result := make([][]string, len(tags))
	i := 0
	for k := range tags {
		keys[i] = k
		i++
	}
	sort.Strings(keys)
	for i, k := range keys {
		result[i] = []string{k, tags[k]}
	}
	return result
}
284032
func (c *Manager) ListTags(ctx context.Context) ([]string, error) {
	url := internal.URL(c, internal.TagPath)
	var res []string
	return res, c.Do(ctx, url.Request(http.MethodGet), &res)
}
412393
func ValidateTags(tags ...Trytes) Validatable {
	return func() error {
		for i := range tags {
			if !IsTag(tags[i]) {
				return errors.Wrapf(ErrInvalidTag, "%s at index %d", tags[i], i)
			}
		}
		return nil
	}
}
304592
func (s *CreateConfigurationRequest) SetTags(v map[string]*string) *CreateConfigurationRequest {
	s.Tags = v
	return s
}
1266815
func (s *CreateDatasetInput) SetTags(v []*Tag) *CreateDatasetInput {
	s.Tags = v
	return s
}
1252423
func (client *Client) RemoveTags(args *RemoveTagsArgs) error {
	response := RemoveTagsResponse{}
	err := client.Invoke("RemoveTags", args, &response)
	return err
}
407546
func ClientTags(tags map[string]string) ClientOption {
	return func(c *Client) {
		c.defaultTags = tags
	}
}
53542
func (d *Dataset) Tags(index int) ([]string, error) {
	if index < 0 || index >= d.rows {
		return nil, ErrInvalidRowIndex
	}

	return d.tags[index], nil
}
590657
func (s *GetFunctionDefinitionOutput) SetTags(v map[string]*string) *GetFunctionDefinitionOutput {
	s.Tags = v
	return s
}
633616
func (s *Resource) SetTags(v map[string]*string) *Resource {
	s.Tags = v
	return s
}