// getTags is a helper to get the tags for a resource. It expects the
// tags field to be named "tags" and the ARN field to be named "arn".
323692
func getTagsRoute53Resolver(conn *route53resolver.Route53Resolver, d *schema.ResourceData) error {
	tags := make([]*route53resolver.Tag, 0)
	req := &route53resolver.ListTagsForResourceInput{
		ResourceArn: aws.String(d.Get("arn").(string)),
	}
	for {
		resp, err := conn.ListTagsForResource(req)
		if err != nil {
			return err
		}

		tags = append(tags, resp.Tags...)

		if resp.NextToken == nil {
			break
		}
		req.NextToken = resp.NextToken
	}

	if err := d.Set("tags", tagsToMapRoute53Resolver(tags)); err != nil {
		return err
	}

	return nil
}
1339570
func (c *Client) GetQueryTags(ctx context.Context, options *QueryTagsOptions) (*QueryTags, error) {
	var queryTags QueryTags

	req, err := c.NewRequest("GET", queryTagsPath, options, nil)
	if err != nil {
		return nil, err
	}

	if err := c.Do(ctx, req, &queryTags); err != nil {
		return nil, err
	}

	return &queryTags, nil
}
318439
func (entry *Entry) GetTag() (Tag, error) {
	var t C.acl_tag_t
	rv, _ := C.acl_get_tag_type(entry.e, &t)
	if rv < 0 {
		return TagUndefined, fmt.Errorf("unable to get tag")
	}
	return Tag(t), nil
}
944974
func (c *TasksRequestsCall) Tags(tags ...string) *TasksRequestsCall {
	c.urlParams_.SetMulti("tags", append([]string{}, tags...))
	return c
}
577030
func (r *Registry) Tags(ctx context.Context, repository string) ([]string, error) {
	url := r.url("/v2/%s/tags/list", repository)
	r.Logf("registry.tags url=%s repository=%s", url, repository)

	var response tagsResponse
	if _, err := r.getJSON(ctx, url, &response); err != nil {
		return nil, err
	}

	return response.Tags, nil
}
959876
func (blog *BLog) Tags() map[string]string {
	blog.lock.RLock()
	defer blog.lock.RUnlock()
	return blog.tags
}
1080657
func (a *Client) GetTags(params *GetTagsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTagsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetTagsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetTags",
		Method:             "GET",
		PathPattern:        "/tags",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetTagsReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetTagsOK), nil
}
304315
func (api userApi) GetPersonalTags(args map[string]interface{}) (result UserGetPersonalTags, err error) {
	defer func() { appendCaller(err, "lastfm.User.GetPersonalTags") }()
	err = callGet("user.getPersonalTags", api.params, args, &result, P{
		"plain": []string{"user", "tag", "taggingtype", "limit", "page"},
	})
	return
}
1027560
func (vm *VM) getTags() *compute.Tags {
	if len(vm.Attributes.GetTag()) == 0 {
		return nil
	}
	tags := &compute.Tags{
		Items: make([]string, len(vm.Attributes.Tag)),
	}
	for i, tag := range vm.Attributes.Tag {
		tags.Items[i] = tag
	}
	return tags
}
1006319
func (client *Client) AddTags(args *AddTagsArgs) error {
	response := AddTagsResponse{}
	err := client.Invoke("AddTags", args, &response)
	return err
}
168704
func (t *tags) Get(ctx context.Context, tag string) (distribution.Descriptor, error) {
	ref, err := reference.WithTag(t.name, tag)
	if err != nil {
		return distribution.Descriptor{}, err
	}
	u, err := t.ub.BuildManifestURL(ref)
	if err != nil {
		return distribution.Descriptor{}, err
	}

	newRequest := func(method string) (*http.Response, error) {
		req, err := http.NewRequest(method, u, nil)
		if err != nil {
			return nil, err
		}

		for _, t := range distribution.ManifestMediaTypes() {
			req.Header.Add("Accept", t)
		}
		resp, err := t.client.Do(req)
		return resp, err
	}

	resp, err := newRequest("HEAD")
	if err != nil {
		return distribution.Descriptor{}, err
	}
	defer resp.Body.Close()

	switch {
	case resp.StatusCode >= 200 && resp.StatusCode < 400 && len(resp.Header.Get("Docker-Content-Digest")) > 0:
		// if the response is a success AND a Docker-Content-Digest can be retrieved from the headers
		return descriptorFromResponse(resp)
	default:
		// if the response is an error - there will be no body to decode.
		// Issue a GET request:
		//   - for data from a server that does not handle HEAD
		//   - to get error details in case of a failure
		resp, err = newRequest("GET")
		if err != nil {
			return distribution.Descriptor{}, err
		}
		defer resp.Body.Close()

		if resp.StatusCode >= 200 && resp.StatusCode < 400 {
			return descriptorFromResponse(resp)
		}
		return distribution.Descriptor{}, HandleErrorResponse(resp)
	}
}
615500
func (c *Manager) GetTagsForCategory(ctx context.Context, id string) ([]Tag, error) {
	ids, err := c.ListTagsForCategory(ctx, id)
	if err != nil {
		return nil, err
	}

	var tags []Tag
	for _, id := range ids {
		tag, err := c.GetTag(ctx, id)
		if err != nil {
			return nil, fmt.Errorf("get tag %s: %s", id, err)
		}

		tags = append(tags, *tag)
	}
	return tags, nil
}
681788
func (t *Tag) GetTag() string {
	if t == nil || t.Tag == nil {
		return ""
	}
	return *t.Tag
}
415089
func (c *PackageFile) GetStrings(header, tag int) []string {
	if c == nil || header >= len(c.Headers) {
		return nil
	}
	return c.Headers[header].Indexes.StringsByTag(tag)
}
219450
func GetFieldTag(obj interface{}, fieldName, tagKey string) (string, error) {
	if !hasValidType(obj, []reflect.Kind{reflect.Struct, reflect.Ptr}) {
		return "", errors.New("Cannot use GetField on a non-struct interface")
	}

	objValue := reflectValue(obj)
	objType := objValue.Type()

	field, ok := objType.FieldByName(fieldName)
	if !ok {
		return "", fmt.Errorf("No such field: %s in obj", fieldName)
	}

	if !isExportableField(field) {
		return "", errors.New("Cannot GetFieldTag on a non-exported struct field")
	}

	return field.Tag.Get(tagKey), nil
}
174006
func ResourceTags(modelTag names.ModelTag, controllerTag names.ControllerTag, taggers ...ResourceTagger) map[string]string {
	allTags := make(map[string]string)
	for _, tagger := range taggers {
		tags, ok := tagger.ResourceTags()
		if !ok {
			continue
		}
		for k, v := range tags {
			allTags[k] = v
		}
	}
	allTags[JujuModel] = modelTag.Id()
	allTags[JujuController] = controllerTag.Id()
	return allTags
}
731278
func (search *Search) Tags(tag string) (*SearchResult, error) {
	insta := search.inst
	body, err := insta.sendRequest(
		&reqOptions{
			Endpoint: urlSearchTag,
			Query: map[string]string{
				"is_typeahead": "true",
				"rank_token":   insta.rankToken,
				"q":            tag,
			},
		},
	)
	if err != nil {
		return nil, err
	}

	res := &SearchResult{}
	err = json.Unmarshal(body, res)
	return res, err
}