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

package secrets

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

func init() {
	policy.MapMethodTo("/chef.automate.api.secrets.SecretsService/Create", "secrets:secrets", "secrets:secrets:create", "POST", "/api/v0/secrets", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*Secret); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "id":
					return m.Id
				case "name":
					return m.Name
				case "type":
					return m.Type
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.secrets.SecretsService/Read", "secrets:secrets:{id}", "secrets:secrets:get", "GET", "/api/v0/secrets/id/{id}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*Id); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "id":
					return m.Id
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.secrets.SecretsService/Update", "secrets:secrets:{id}", "secrets:secrets:update", "PATCH", "/api/v0/secrets/id/{id}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*Secret); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "id":
					return m.Id
				case "name":
					return m.Name
				case "type":
					return m.Type
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.secrets.SecretsService/Delete", "secrets:secrets:{id}", "secrets:secrets:delete", "DELETE", "/api/v0/secrets/id/{id}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*Id); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "id":
					return m.Id
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.secrets.SecretsService/List", "secrets:secrets", "secrets:secrets:list", "POST", "/api/v0/secrets/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
				default:
					return ""
				}
			})
		}
		return ""
	})
}
