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

package manager

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

func init() {
	policy.MapMethodTo("/chef.automate.api.nodes.manager.v1.NodeManagerService/Create", "infra:nodeManagers", "infra:nodeManagers:create", "POST", "/api/v0/nodemanagers", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*NodeManager); 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
				case "credential_id":
					return m.CredentialId
				case "status":
					return m.Status
				case "account_id":
					return m.AccountId
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.nodes.manager.v1.NodeManagerService/Read", "infra:nodeManagers:{id}", "infra:nodeManagers:get", "GET", "/api/v0/nodemanagers/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.nodes.manager.v1.NodeManagerService/Update", "infra:nodeManagers:{id}", "infra:nodeManagers:update", "PUT", "/api/v0/nodemanagers/id/{id}", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*NodeManager); 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
				case "credential_id":
					return m.CredentialId
				case "status":
					return m.Status
				case "account_id":
					return m.AccountId
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.nodes.manager.v1.NodeManagerService/Delete", "infra:nodeManagers:{id}", "infra:nodeManagers:delete", "DELETE", "/api/v0/nodemanagers/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.nodes.manager.v1.NodeManagerService/DeleteWithNodes", "infra:nodeManagers:{id}", "infra:nodeManagers:delete", "DELETE", "/api/v0/nodemanagers/id/{id}/with-nodes", 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.nodes.manager.v1.NodeManagerService/DeleteWithNodeStateStopped", "infra:nodeManagers:{id}", "infra:nodeManagers:delete", "DELETE", "/api/v0/nodemanagers/id/{id}/with-node-state/stopped", 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.nodes.manager.v1.NodeManagerService/DeleteWithNodeStateTerminated", "infra:nodeManagers:{id}", "infra:nodeManagers:delete", "DELETE", "/api/v0/nodemanagers/id/{id}/with-node-state/terminated", 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.nodes.manager.v1.NodeManagerService/List", "infra:nodeManagers", "infra:nodeManagers:list", "POST", "/api/v0/nodemanagers/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 ""
	})
	policy.MapMethodTo("/chef.automate.api.nodes.manager.v1.NodeManagerService/SearchNodeFields", "infra:nodeManagers:{node_manager_id}:fields", "infra:nodeManagers:list", "POST", "/api/v0/nodemanagers/id/{node_manager_id}/search-fields", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*FieldQuery); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "field":
					return m.Field
				case "node_manager_id":
					return m.NodeManagerId
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.nodes.manager.v1.NodeManagerService/SearchNodes", "infra:nodeManagers:{node_manager_id}:nodes", "infra:nodeManagers:list", "POST", "/api/v0/nodemanagers/id/{node_manager_id}/search-nodes", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*NodeQuery); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "node_manager_id":
					return m.NodeManagerId
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.nodes.manager.v1.NodeManagerService/Connect", "infra:nodeManagers:{id}:nodes", "infra:nodeManagers:rerun", "POST", "/api/v0/nodemanagers/rerun/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 ""
	})
}
