// Code generated by protoc-gen-policy. DO NOT EDIT.
// source: external/compliance/profiles/profiles.proto

package profiles

import policy "github.com/chef/automate/api/external/iam/v2/policy"

func init() {
	policy.MapMethodTo("/chef.automate.api.compliance.profiles.v1.ProfilesService/Read", "compliance:profiles:{owner}", "compliance:profiles:get", "GET", "/api/v0/compliance/profiles/read/{owner}/{name}/version/{version}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*ProfileDetails); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "owner":
					return m.Owner
				case "name":
					return m.Name
				case "version":
					return m.Version
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.compliance.profiles.v1.ProfilesService/ReadFromMarket", "compliance:profiles:market", "compliance:marketProfiles:get", "GET", "/api/v0/compliance/market/read/{name}/version/{version}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*ProfileDetails); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "owner":
					return m.Owner
				case "name":
					return m.Name
				case "version":
					return m.Version
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.compliance.profiles.v1.ProfilesService/Delete", "compliance:profiles:{owner}", "compliance:profiles:delete", "DELETE", "/api/v0/compliance/profiles/{owner}/{name}/version/{version}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*ProfileDetails); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "owner":
					return m.Owner
				case "name":
					return m.Name
				case "version":
					return m.Version
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.compliance.profiles.v1.ProfilesService/List", "compliance:profiles", "compliance:profiles:list", "POST", "/api/v0/compliance/profiles/search", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*Query); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "sort":
					return m.Sort
				case "owner":
					return m.Owner
				case "name":
					return m.Name
				case "version":
					return m.Version
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.compliance.profiles.v1.ProfilesService/MetaSearch", "compliance:profiles", "compliance:profiles:list", "POST", "/api/v0/compliance/profiles/metasearch", func(unexpandedResource string, input interface{}) string {
		return unexpandedResource
	})
}
