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

package event_feed

import (
	request "github.com/chef/automate/api/external/event_feed/request"
	policy "github.com/chef/automate/api/external/iam/v2/policy"
)

func init() {
	policy.MapMethodTo("/chef.automate.api.event_feed.EventFeedService/GetEventFeed", "event:events", "event:events:list", "GET", "/api/v0/eventfeed", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*request.GetEventFeedRequest); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "cursor":
					return m.Cursor
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.event_feed.EventFeedService/GetEventTypeCounts", "event:events", "event:events:list", "GET", "/api/v0/event_type_counts", func(unexpandedResource string, input interface{}) string {
		return unexpandedResource
	})
	policy.MapMethodTo("/chef.automate.api.event_feed.EventFeedService/GetEventTaskCounts", "event:events", "event:events:list", "GET", "/api/v0/event_task_counts", func(unexpandedResource string, input interface{}) string {
		return unexpandedResource
	})
	policy.MapMethodTo("/chef.automate.api.event_feed.EventFeedService/GetEventStringBuckets", "event:events", "event:events:list", "GET", "/api/v0/eventstrings", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*request.GetEventStringBucketsRequest); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "start":
					return m.Start
				case "end":
					return m.End
				case "timezone":
					return m.Timezone
				default:
					return ""
				}
			})
		}
		return ""
	})
	policy.MapMethodTo("/chef.automate.api.event_feed.EventFeedService/EventExport", "event:events", "event:events:list", "GET", "/api/v0/eventexport", func(unexpandedResource string, input interface{}) string {
		if m, ok := input.(*request.EventExportRequest); ok {
			return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string {
				switch want {
				case "output_type":
					return m.OutputType
				default:
					return ""
				}
			})
		}
		return ""
	})
}
