// ListRegionForwardingRules lists all RegionalForwardingRules in the project & region.
496312
func (g *Cloud) ListRegionForwardingRules(region string) ([]*compute.ForwardingRule, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newForwardingRuleMetricContext("list", region)
	v, err := g.c.ForwardingRules().List(ctx, region, filter.None)
	return v, mc.Observe(err)
}
1101809
func (s *TemplateService) ListTemplatePermissions(p *ListTemplatePermissionsParams) (*ListTemplatePermissionsResponse, error) {
	resp, err := s.cs.newRequest("listTemplatePermissions", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListTemplatePermissionsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
271682
func (api *API) ListUserAgentRules(zoneID string, page int) (*UserAgentRuleListResponse, error) {
	v := url.Values{}
	if page <= 0 {
		page = 1
	}

	v.Set("page", strconv.Itoa(page))
	v.Set("per_page", strconv.Itoa(100))
	query := "?" + v.Encode()

	uri := "/zones/" + zoneID + "/firewall/ua_rules" + query
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return nil, errors.Wrap(err, errMakeRequestError)
	}

	response := &UserAgentRuleListResponse{}
	err = json.Unmarshal(res, &response)
	if err != nil {
		return nil, errors.Wrap(err, errUnmarshalError)
	}

	return response, nil
}
1160922
func ListProjectPaths(projectDir string, include, exclude matcher.Matcher) ([]string, error) {
	wd, err := os.Getwd()
	if err != nil {
		return nil, errors.Wrapf(err, "failed to determine working directory")
	}
	if !filepath.IsAbs(projectDir) {
		projectDir = path.Join(wd, projectDir)
	}
	relPathPrefix, err := filepath.Rel(wd, projectDir)
	if err != nil {
		return nil, errors.Wrapf(err, "failed to determine relative path")
	}

	files, err := matcher.ListFiles(projectDir, include, exclude)
	if err != nil {
		return nil, err
	}
	if relPathPrefix != "" {
		for i, file := range files {
			files[i] = path.Join(relPathPrefix, file)
		}
	}
	return files, nil
}
756749
func (c *Client) ListProjects(p *ListProjectsParameter) ([]*Project, error) {
	obj, err := c.Request("listProjects", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Project), err
}
895011
func (s *NATService) NewListIpForwardingRulesParams() *ListIpForwardingRulesParams {
	p := &ListIpForwardingRulesParams{}
	p.p = make(map[string]interface{})
	return p
}
966846
func (c *Client) ListTemplatePermissions(p *ListTemplatePermissionsParameter) (*TemplatePermission, error) {
	obj, err := c.Request("listTemplatePermissions", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*TemplatePermission), err
}
644074
func (g *Cloud) ListGlobalForwardingRules() ([]*compute.ForwardingRule, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newForwardingRuleMetricContext("list", "")
	v, err := g.c.GlobalForwardingRules().List(ctx, filter.None)
	return v, mc.Observe(err)
}
179961
func (c *Client) CreateIpForwardingRule(p *CreateIpForwardingRuleParameter) (*IpForwardingRule, error) {
	obj, err := c.Request("createIpForwardingRule", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*IpForwardingRule), err
}
531468
func (s *ProjectService) ListProjectInvitations(p *ListProjectInvitationsParams) (*ListProjectInvitationsResponse, error) {
	resp, err := s.cs.newRequest("listProjectInvitations", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListProjectInvitationsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
161114
func (g *Cloud) DeleteGlobalForwardingRule(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newForwardingRuleMetricContext("delete", "")
	return mc.Observe(g.c.GlobalForwardingRules().Delete(ctx, meta.GlobalKey(name)))
}
663311
func (firewalls *Firewalls) List(ctx context.Context, zone string) ([]*Firewall, error) {
	return firewalls.listPages(ctx, zone, 1)
}
1268938
func (v *VPCRouter) HasPortForwarding() bool {
	return v.HasSetting() && v.Settings.Router.HasPortForwarding()
}
1090922
func (s *NATService) ListIpForwardingRules(p *ListIpForwardingRulesParams) (*ListIpForwardingRulesResponse, error) {
	resp, err := s.cs.newRequest("listIpForwardingRules", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListIpForwardingRulesResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
1114844
func (c *Client) UpdatePortForwardingRule(p *UpdatePortForwardingRuleParameter) (*PortForwardingRule, error) {
	obj, err := c.Request("updatePortForwardingRule", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*PortForwardingRule), err
}
878778
func (g *Cloud) SetProxyForGlobalForwardingRule(forwardingRuleName, targetProxyLink string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newForwardingRuleMetricContext("set_proxy", "")
	target := &compute.TargetReference{Target: targetProxyLink}
	return mc.Observe(g.c.GlobalForwardingRules().SetTarget(ctx, meta.GlobalKey(forwardingRuleName), target))
}
421218
func (t *Template) GetAllAWSWAFRegionalRuleResources() map[string]*resources.AWSWAFRegionalRule {
	results := map[string]*resources.AWSWAFRegionalRule{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSWAFRegionalRule:
			results[name] = resource
		}
	}
	return results
}