use crate::parser::filter::{MatchTarget, ModifierMap};
use graph_core::resource::ResourceIdentity;

pub fn get_target_map_modifier(resource_identity: ResourceIdentity) -> ModifierMap {
    let mut modify_target = ModifierMap::default();
    match resource_identity {
        ResourceIdentity::Activities => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.ListActivities".to_string()),
                vec![
                    MatchTarget::OperationMap("activities".to_string()),
                    MatchTarget::OperationId("activities.ListActivities".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetActivities".to_string()),
                vec![
                    MatchTarget::OperationMap("activities".to_string()),
                    MatchTarget::OperationId("activities.GetActivities".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateActivities".to_string()),
                vec![
                    MatchTarget::OperationMap("activities".to_string()),
                    MatchTarget::OperationId("activities.UpdateActivities".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.CreateActivities".to_string()),
                vec![
                    MatchTarget::OperationMap("activities".to_string()),
                    MatchTarget::OperationId("activities.CreateActivities".to_string()),
                ],
            );
        },
        ResourceIdentity::AuditLogs => {
            modify_target.operation_map("auditLogs.auditLogRoot", "auditLogs");
        },
        ResourceIdentity::Attachments => {
            modify_target.map.insert(
                MatchTarget::OperationId("groups.calendar.events.ListAttachments".to_string()),
                vec![
                    MatchTarget::OperationMap("attachments".to_string()),
                    MatchTarget::OperationId("attachments.ListAttachments".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.calendar.events.GetAttachments".to_string()),
                vec![
                    MatchTarget::OperationMap("attachments".to_string()),
                    MatchTarget::OperationId("attachments.GetAttachments".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.calendar.events.CreateAttachments".to_string()),
                vec![
                    MatchTarget::OperationMap("attachments".to_string()),
                    MatchTarget::OperationId("attachments.CreateAttachment".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.calendar.events.UpdateAttachments".to_string()),
                vec![
                    MatchTarget::OperationMap("attachments".to_string()),
                    MatchTarget::OperationId("attachments.UpdateAttachments".to_string()),
                ],
            );
        },
        ResourceIdentity::Buckets => {
            modify_target.map.insert(
                MatchTarget::OperationId("planner.GetBuckets".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.buckets".to_string()),
                    MatchTarget::OperationId("planner.buckets.GetBuckets".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.UpdateBuckets".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.buckets".to_string()),
                    MatchTarget::OperationId("planner.buckets.UpdateBuckets".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.ListBuckets".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.buckets".to_string()),
                    MatchTarget::OperationId("planner.buckets.ListBuckets".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.plans.GetBuckets".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.buckets".to_string()),
                    MatchTarget::OperationId("planner.buckets.GetBuckets".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.plans.ListBuckets".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.buckets".to_string()),
                    MatchTarget::OperationId("planner.buckets.ListBuckets".to_string()),
                ],
            );
        },
        ResourceIdentity::Calendar => {
            modify_target.map.insert(
                MatchTarget::OperationId("users.ListCalendars".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendar.ListCalendars".to_string()),
                    MatchTarget::OperationMap("users.calendar".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.CreateCalendar".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendar.CreateCalendar".to_string()),
                    MatchTarget::OperationMap("users.calendar".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.GetCalendar".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendar.GetCalendar".to_string()),
                    MatchTarget::OperationMap("users.calendar".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.GetCalendars".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendars.GetCalendars".to_string()),
                    MatchTarget::OperationMap("users.calendars".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.UpdateCalendar".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendar.UpdateCalendar".to_string()),
                    MatchTarget::OperationMap("users.calendar".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.UpdateCalendars".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendars.UpdateCalendars".to_string()),
                    MatchTarget::OperationMap("users.calendars".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId(
                    "users.calendar.calendarView.calendar.getSchedule".to_string(),
                ),
                vec![
                    MatchTarget::OperationId("users.calendar.calendarView.getSchedule".to_string()),
                    MatchTarget::OperationMap("users.calendar.calendarView".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.calendar.events.calendar.getSchedule".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendar.events.getSchedule".to_string()),
                    MatchTarget::OperationMap("users.calendar.events".to_string()),
                ],
            );
        },
        ResourceIdentity::CalendarGroups => {
            modify_target.map.insert(
                MatchTarget::OperationId("users.GetCalendarGroups".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendarGroups.GetCalendarGroups".to_string()),
                    MatchTarget::OperationMap("users.calendarGroups".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.UpdateCalendarGroups".to_string()),
                vec![
                    MatchTarget::OperationId(
                        "users.calendarGroups.UpdateCalendarGroups".to_string(),
                    ),
                    MatchTarget::OperationMap("users.calendarGroups".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.ListCalendarGroups".to_string()),
                vec![
                    MatchTarget::OperationId("users.calendarGroups.ListCalendarGroups".to_string()),
                    MatchTarget::OperationMap("users.calendarGroups".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId(
                    "users.calendarGroups.calendars.events.calendar.getSchedule".to_string(),
                ),
                vec![
                    MatchTarget::OperationId(
                        "users.calendarGroups.calendars.events.getSchedule".to_string(),
                    ),
                    MatchTarget::OperationMap("users.calendarGroups.calendars.events".to_string()),
                ],
            );
        },
        ResourceIdentity::CalendarView => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.ListCalendarView".to_string()),
                vec![
                    MatchTarget::OperationMap("calendarViews".to_string()),
                    MatchTarget::OperationId("calendarViews.ListCalendarView".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetCalendarView".to_string()),
                vec![
                    MatchTarget::OperationMap("calendarView".to_string()),
                    MatchTarget::OperationId("calendarView.GetCalendarView".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateCalendarView".to_string()),
                vec![
                    MatchTarget::OperationMap("calendarView".to_string()),
                    MatchTarget::OperationId("calendarView.UpdateCalendarView".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.CreateCalendarView".to_string()),
                vec![
                    MatchTarget::OperationMap("calendarViews".to_string()),
                    MatchTarget::OperationId("calendarViews.CreateCalendarView".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.calendarView.delta.fa14".to_string()),
                vec![
                    MatchTarget::OperationMap("calendarViews".to_string()),
                    MatchTarget::OperationId("calendarViews.delta".to_string()),
                ],
            );
        },
        ResourceIdentity::Calls => {
            modify_target.map.insert(
                MatchTarget::OperationId("communications.GetCalls".to_string()),
                vec![
                    MatchTarget::OperationMap("calls".to_string()),
                    MatchTarget::OperationId("calls.GetCalls".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.UpdateCalls".to_string()),
                vec![
                    MatchTarget::OperationMap("calls".to_string()),
                    MatchTarget::OperationId("calls.UpdateCalls".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.ListCalls".to_string()),
                vec![
                    MatchTarget::OperationMap("calls".to_string()),
                    MatchTarget::OperationId("calls.ListCalls".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.CreateCalls".to_string()),
                vec![
                    MatchTarget::OperationMap("calls".to_string()),
                    MatchTarget::OperationId("calls.CreateCalls".to_string()),
                ],
            );
        },
        ResourceIdentity::CallRecords => {
            modify_target.map.insert(
                MatchTarget::OperationId("communications.GetCallRecords".to_string()),
                vec![
                    MatchTarget::OperationMap("callRecords".to_string()),
                    MatchTarget::OperationId("callRecords.GetCallRecords".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.UpdateCallRecords".to_string()),
                vec![
                    MatchTarget::OperationMap("callRecords".to_string()),
                    MatchTarget::OperationId("callRecords.UpdateCallRecords".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.calls.GetCallRecords".to_string()),
                vec![
                    MatchTarget::OperationMap("callRecords".to_string()),
                    MatchTarget::OperationId("callRecords.GetCallRecords".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.calls.UpdateCallRecords".to_string()),
                vec![
                    MatchTarget::OperationMap("callRecords".to_string()),
                    MatchTarget::OperationId("callRecords.UpdateCallRecords".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.ListCallRecords".to_string()),
                vec![
                    MatchTarget::OperationMap("callRecords".to_string()),
                    MatchTarget::OperationId("callRecords.ListCallRecords".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.CreateCallRecords".to_string()),
                vec![
                    MatchTarget::OperationMap("callRecords".to_string()),
                    MatchTarget::OperationId("callRecords.CreateCallRecords".to_string()),
                ],
            );
        },
        ResourceIdentity::ContactFolders => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetContactFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("contactFolders".to_string()),
                    MatchTarget::OperationId("contactFolders.GetContactFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateContactFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("contactFolders".to_string()),
                    MatchTarget::OperationId("contactFolders.UpdateContactFolders".to_string()),
                ],
            );
        },
        ResourceIdentity::Contacts => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetContacts".to_string()),
                vec![
                    MatchTarget::OperationMap("contacts".to_string()),
                    MatchTarget::OperationId("contacts.GetContacts".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateContacts".to_string()),
                vec![
                    MatchTarget::OperationMap("contacts".to_string()),
                    MatchTarget::OperationId("contacts.UpdateContacts".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.ListContacts".to_string()),
                vec![
                    MatchTarget::OperationMap("contacts".to_string()),
                    MatchTarget::OperationId("contacts.ListContacts".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.CreateContacts".to_string()),
                vec![
                    MatchTarget::OperationMap("contacts".to_string()),
                    MatchTarget::OperationId("contacts.CreateContacts".to_string()),
                ],
            );
        },
        ResourceIdentity::ContentTypes => {
            modify_target.map.insert(
                MatchTarget::OperationId("sites.ListContentTypes".to_string()),
                vec![
                    MatchTarget::OperationMap("sites.contentTypes".to_string()),
                    MatchTarget::OperationId("sites.contentTypes.ListContentTypes".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.GetContentTypes".to_string()),
                vec![
                    MatchTarget::OperationMap("sites.contentTypes".to_string()),
                    MatchTarget::OperationId("sites.contentTypes.GetContentTypes".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.UpdateContentTypes".to_string()),
                vec![
                    MatchTarget::OperationMap("sites.contentTypes".to_string()),
                    MatchTarget::OperationId("sites.contentTypes.UpdateContentTypes".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.CreateContentTypes".to_string()),
                vec![
                    MatchTarget::OperationMap("sites.contentTypes".to_string()),
                    MatchTarget::OperationId("sites.contentTypes.CreateContentTypes".to_string()),
                ],
            );
        },
        ResourceIdentity::Conversations => {
            modify_target.map.insert(
                MatchTarget::OperationId("groups.ListConversations".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.conversations".to_string()),
                    MatchTarget::OperationId("groups.conversations.ListConversations".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.CreateConversations".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.conversations".to_string()),
                    MatchTarget::OperationId(
                        "groups.conversations.CreateConversations".to_string(),
                    ),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.GetConversations".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.conversations".to_string()),
                    MatchTarget::OperationId("groups.conversations.GetConversations".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.UpdateConversations".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.conversations".to_string()),
                    MatchTarget::OperationId(
                        "groups.conversations.UpdateConversations".to_string(),
                    ),
                ],
            );
        },
        ResourceIdentity::ChildFolders => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.mailFolders.UpdateChildFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("childFolders".to_string()),
                    MatchTarget::OperationId("childFolders.UpdateChildFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.mailFolders.CreateChildFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("childFolders".to_string()),
                    MatchTarget::OperationId("childFolders.CreateChildFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.mailFolders.ListChildFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("childFolders".to_string()),
                    MatchTarget::OperationId("childFolders.ListChildFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.mailFolders.GetChildFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("childFolders".to_string()),
                    MatchTarget::OperationId("childFolders.GetChildFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.mailFolders.childFolders.move".to_string()),
                vec![
                    MatchTarget::OperationMap("childFolders".to_string()),
                    MatchTarget::OperationId("childFolders.MoveChildFolders".to_string()),
                ],
            );
        },
        ResourceIdentity::DeviceManagement => {
            modify_target.operation_map(
                "deviceManagement.detectedApps.managedDevices",
                "deviceManagement.detectedApps.appManagedDevices",
            );
        },
        ResourceIdentity::Directory => {
            modify_target.operation_map(
                "directoryObjects.microsoft.graph.administrativeUnit",
                "directoryObjects.administrativeUnits",
            );
            modify_target.map.insert(
                MatchTarget::OperationId("directory.administrativeUnits.delta.fa14".to_string()),
                vec![
                    MatchTarget::OperationId(
                        "directoryObjects.administrativeUnits.delta".to_string(),
                    ),
                    MatchTarget::OperationMap("directoryObjects.administrativeUnits".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("directoryRoles.delta.fa14".to_string()),
                vec![
                    MatchTarget::OperationId("directoryRoles.delta".to_string()),
                    MatchTarget::OperationMap("directoryRoles".to_string()),
                ],
            );
        },
        ResourceIdentity::Events => {
            modify_target.map.insert(
                MatchTarget::OperationId("calendar.events.UpdateInstances".to_string()),
                vec![MatchTarget::OperationMap(
                    "calendar.events.instances".to_string(),
                )],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("calendar.events.GetInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("calendar.events.instances".to_string()),
                    MatchTarget::OperationId("calendar.events.instances.GetInstances".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("calendar.events.ListInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("calendar.events.instances".to_string()),
                    MatchTarget::OperationId("calendar.events.instances.ListInstances".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("calendar.events.CreateInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("calendar.events.instances".to_string()),
                    MatchTarget::OperationId(
                        "calendar.events.instances.CreateInstances".to_string(),
                    ),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.ListEvents".to_string()),
                vec![
                    MatchTarget::OperationMap("users.event".to_string()),
                    MatchTarget::OperationId("users.event.ListEvents".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.CreateEvents".to_string()),
                vec![
                    MatchTarget::OperationMap("users.event".to_string()),
                    MatchTarget::OperationId("users.event.CreateEvents".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.UpdateEvents".to_string()),
                vec![
                    MatchTarget::OperationMap("users.events".to_string()),
                    MatchTarget::OperationId("users.events.UpdateEvents".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.GetEvents".to_string()),
                vec![
                    MatchTarget::OperationMap("users.events".to_string()),
                    MatchTarget::OperationId("users.events.GetEvents".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("users.events.delta.fa14".to_string()),
                vec![
                    MatchTarget::OperationMap("users.event".to_string()),
                    MatchTarget::OperationId("users.event.delta.fa14".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationMap("users.events.calendar.events".to_string()),
                vec![MatchTarget::OperationMap(
                    "users.events.calendar".to_string(),
                )],
            );
        },
        ResourceIdentity::GroupLifecyclePolicies => {
            modify_target.map.insert(
                MatchTarget::OperationMap(
                    "groupLifecyclePolicies.groupLifecyclePolicy".to_string(),
                ),
                vec![MatchTarget::OperationMap(
                    "groupLifecyclePolicies".to_string(),
                )],
            );
        },
        ResourceIdentity::Instances => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.calendarView.ListInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("instances".to_string()),
                    MatchTarget::OperationId("instances.ListInstances".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.calendarView.CreateInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("instances".to_string()),
                    MatchTarget::OperationId("instances.CreateInstances".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.calendarView.GetInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("instances".to_string()),
                    MatchTarget::OperationId("instances.GetInstances".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.calendarView.UpdateInstances".to_string()),
                vec![
                    MatchTarget::OperationMap("instances".to_string()),
                    MatchTarget::OperationId("instances.UpdateInstances".to_string()),
                ],
            );
        },
        ResourceIdentity::InferenceClassification => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetInferenceClassification".to_string()),
                vec![
                    MatchTarget::OperationMap("inferenceClassification".to_string()),
                    MatchTarget::OperationId(
                        "inferenceClassification.GetInferenceClassification".to_string(),
                    ),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateInferenceClassification".to_string()),
                vec![
                    MatchTarget::OperationMap("inferenceClassification".to_string()),
                    MatchTarget::OperationId(
                        "inferenceClassification.UpdateInferenceClassification".to_string(),
                    ),
                ],
            );
        },
        ResourceIdentity::Insights => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetInsights".to_string()),
                vec![
                    MatchTarget::OperationMap("insights".to_string()),
                    MatchTarget::OperationId("insights.GetInsights".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateInsights".to_string()),
                vec![
                    MatchTarget::OperationMap("insights".to_string()),
                    MatchTarget::OperationId("insights.UpdateInsights".to_string()),
                ],
            );
        },
        ResourceIdentity::Items => {
            modify_target.map.insert(
                MatchTarget::OperationId("sites.lists.ListItems".to_string()),
                vec![
                    MatchTarget::OperationMap("items".to_string()),
                    MatchTarget::OperationId("items.ListItems ".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.lists.CreateItems".to_string()),
                vec![
                    MatchTarget::OperationMap("items".to_string()),
                    MatchTarget::OperationId("items.CreateItems".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.lists.GetItems".to_string()),
                vec![
                    MatchTarget::OperationMap("items".to_string()),
                    MatchTarget::OperationId("items.GetItems".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.lists.UpdateItems".to_string()),
                vec![
                    MatchTarget::OperationMap("items".to_string()),
                    MatchTarget::OperationId("items.UpdateItems".to_string()),
                ],
            );
        },
        ResourceIdentity::Lists => {
            modify_target.map.insert(
                MatchTarget::OperationId("sites.GetLists".to_string()),
                vec![
                    MatchTarget::OperationMap("lists".to_string()),
                    MatchTarget::OperationId("lists.GetLists".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("sites.UpdateLists".to_string()),
                vec![
                    MatchTarget::OperationMap("lists".to_string()),
                    MatchTarget::OperationId("lists.UpdateLists".to_string()),
                ],
            );
        },
        ResourceIdentity::ManagedDevices => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetManagedDevices".to_string()),
                vec![
                    MatchTarget::OperationMap("managedDevices".to_string()),
                    MatchTarget::OperationId("managedDevices.GetManagedDevices".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateManagedDevices".to_string()),
                vec![
                    MatchTarget::OperationMap("managedDevices".to_string()),
                    MatchTarget::OperationId("managedDevices.UpdateManagedDevices".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetManagedDevices".to_string()),
                vec![
                    MatchTarget::OperationMap("managedDevices".to_string()),
                    MatchTarget::OperationId("managedDevices.GetManagedDevices".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateManagedDevices".to_string()),
                vec![
                    MatchTarget::OperationMap("managedDevices".to_string()),
                    MatchTarget::OperationId("managedDevices.UpdateManagedDevices".to_string()),
                ],
            );
        },
        ResourceIdentity::Messages => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.ListMessages".to_string()),
                vec![
                    MatchTarget::OperationMap("messages".to_string()),
                    MatchTarget::OperationId("messages.ListMessages".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetMessages".to_string()),
                vec![
                    MatchTarget::OperationMap("messages".to_string()),
                    MatchTarget::OperationId("messages.GetMessages".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.CreateMessages".to_string()),
                vec![
                    MatchTarget::OperationMap("messages".to_string()),
                    MatchTarget::OperationId("messages.CreateMessages".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateMessages".to_string()),
                vec![
                    MatchTarget::OperationMap("messages".to_string()),
                    MatchTarget::OperationId("messages.UpdateMessages".to_string()),
                ],
            );
        },
        ResourceIdentity::MailFolders => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.ListMailFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("mailFolders".to_string()),
                    MatchTarget::OperationId("mailFolders.ListMailFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetMailFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("mailFolders".to_string()),
                    MatchTarget::OperationId("mailFolders.GetMailFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.CreateMailFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("mailFolders".to_string()),
                    MatchTarget::OperationId("mailFolders.CreateMailFolders".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateMailFolders".to_string()),
                vec![
                    MatchTarget::OperationMap("mailFolders".to_string()),
                    MatchTarget::OperationId("mailFolders.UpdateMailFolders".to_string()),
                ],
            );
        },
        ResourceIdentity::Me => {
            // me.user.GetUser
            modify_target.map.insert(
                MatchTarget::OperationId("me.user.GetUser".to_string()),
                vec![
                    MatchTarget::OperationMap("me".to_string()),
                    MatchTarget::OperationId("me.GetUser".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.user.UpdateUser".to_string()),
                vec![
                    MatchTarget::OperationMap("me".to_string()),
                    MatchTarget::OperationId("me.UpdateUser".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationMap("me.user".to_string()),
                vec![MatchTarget::OperationMap("me".to_string())],
            );
        },
        ResourceIdentity::Notebooks => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.ListNotebooks".to_string()),
                vec![
                    MatchTarget::OperationMap("notebooks".to_string()),
                    MatchTarget::OperationId("notebooks.ListNotebooks".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.GetNotebooks".to_string()),
                vec![
                    MatchTarget::OperationMap("notebooks".to_string()),
                    MatchTarget::OperationId("notebooks.GetNotebooks".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.CreateNotebooks".to_string()),
                vec![
                    MatchTarget::OperationMap("notebooks".to_string()),
                    MatchTarget::OperationId("notebooks.CreateNotebooks".to_string()),
                ],
            );
        },
        ResourceIdentity::Onenote => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetOnenote".to_string()),
                vec![
                    MatchTarget::OperationMap("onenote".to_string()),
                    MatchTarget::OperationId("onenote.GetOnenote".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateOnenote".to_string()),
                vec![
                    MatchTarget::OperationMap("onenote".to_string()),
                    MatchTarget::OperationId("onenote.UpdateOnenote".to_string()),
                ],
            );
        },
        ResourceIdentity::SectionGroups => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.CreateSectionGroups".to_string()),
                vec![
                    MatchTarget::OperationMap("sectionGroups".to_string()),
                    MatchTarget::OperationId("sectionGroups.CreateSectionGroups".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.GetSectionGroups".to_string()),
                vec![
                    MatchTarget::OperationMap("sectionGroups".to_string()),
                    MatchTarget::OperationId("sectionGroups.GetSectionGroup".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.ListSectionGroups".to_string()),
                vec![
                    MatchTarget::OperationMap("sectionGroups".to_string()),
                    MatchTarget::OperationId("sectionGroups.ListSectionGroups".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.UpdateSectionGroups".to_string()),
                vec![
                    MatchTarget::OperationMap("sectionGroups".to_string()),
                    MatchTarget::OperationId("sectionGroups.UpdateSectionGroup".to_string()),
                ],
            );
        },
        ResourceIdentity::Pages => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.GetPages".to_string()),
                vec![
                    MatchTarget::OperationMap("pages".to_string()),
                    MatchTarget::OperationId("pages.GetPages".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.UpdatePages".to_string()),
                vec![
                    MatchTarget::OperationMap("pages".to_string()),
                    MatchTarget::OperationId("pages.UpdatePages".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.ListPages".to_string()),
                vec![
                    MatchTarget::OperationMap("pages".to_string()),
                    MatchTarget::OperationId("pages.ListPages".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.CreatePages".to_string()),
                vec![
                    MatchTarget::OperationMap("pages".to_string()),
                    MatchTarget::OperationId("pages.CreatePages".to_string()),
                ],
            );
        },
        ResourceIdentity::Sections => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.ListSections".to_string()),
                vec![
                    MatchTarget::OperationMap("sections".to_string()),
                    MatchTarget::OperationId("sections.ListSections".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.CreateSections".to_string()),
                vec![
                    MatchTarget::OperationMap("sections".to_string()),
                    MatchTarget::OperationId("sections.CreateSections".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.UpdateSections".to_string()),
                vec![
                    MatchTarget::OperationMap("sections".to_string()),
                    MatchTarget::OperationId("sections.UpdateSections".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.GetSections".to_string()),
                vec![
                    MatchTarget::OperationMap("sections".to_string()),
                    MatchTarget::OperationId("sections.GetSections".to_string()),
                ],
            );
        },
        ResourceIdentity::ParentSection => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.pages.GetParentSection".to_string()),
                vec![
                    MatchTarget::OperationMap("me.onenote.pages.parentSection".to_string()),
                    MatchTarget::OperationId(
                        "me.onenote.pages.parentSection.GetParentNotebook".to_string(),
                    ),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.pages.UpdateParentSection".to_string()),
                vec![
                    MatchTarget::OperationMap("me.onenote.pages.parentSection".to_string()),
                    MatchTarget::OperationId(
                        "me.onenote.pages.parentSection.UpdateParentNotebook".to_string(),
                    ),
                ],
            );
        },
        ResourceIdentity::ParentNotebook => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.sections.GetParentNotebook".to_string()),
                vec![
                    MatchTarget::OperationMap("me.onenote.sections.parentNotebook".to_string()),
                    MatchTarget::OperationId(
                        "me.onenote.sections.parentNotebook.GetParentNotebook".to_string(),
                    ),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.sections.UpdateParentNotebook".to_string()),
                vec![
                    MatchTarget::OperationMap("me.onenote.sections.parentNotebook".to_string()),
                    MatchTarget::OperationId(
                        "me.onenote.sections.parentNotebook.UpdateParentNotebook".to_string(),
                    ),
                ],
            );
        },
        ResourceIdentity::ParentSectionGroup => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.onenote.sections.GetParentSectionGroup".to_string()),
                vec![
                    MatchTarget::OperationMap("me.onenote.sections.parentSectionGroup".to_string()),
                    MatchTarget::OperationId(
                        "me.onenote.sections.parentSectionGroup.GetParentSectionGroup".to_string(),
                    ),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId(
                    "me.onenote.sections.UpdateParentSectionGroup".to_string(),
                ),
                vec![
                    MatchTarget::OperationMap("me.onenote.sections.parentSectionGroup".to_string()),
                    MatchTarget::OperationId(
                        "me.onenote.sections.parentSectionGroup.UpdateParentSectionGroup"
                            .to_string(),
                    ),
                ],
            );
        },
        ResourceIdentity::Outlook => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetOutlook".to_string()),
                vec![
                    MatchTarget::OperationMap("outlook".to_string()),
                    MatchTarget::OperationId("outlook.GetOutlook".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateOutlook".to_string()),
                vec![
                    MatchTarget::OperationMap("outlook".to_string()),
                    MatchTarget::OperationId("outlook.UpdateOutlook".to_string()),
                ],
            );
        },
        ResourceIdentity::Planner => {
            modify_target.map.insert(
                MatchTarget::OperationMap("users.planner.plans.tasks".to_string()),
                vec![MatchTarget::OperationMap(
                    "users.planner.plans.plannerTasks".to_string(),
                )],
            );
            modify_target.map.insert(
                MatchTarget::OperationMap("users.planner.plans.buckets.tasks".to_string()),
                vec![MatchTarget::OperationMap(
                    "users.planner.plans.buckets.bucketTasks".to_string(),
                )],
            );
        },
        ResourceIdentity::Policies => {
            modify_target.operation_map("policies.policyRoot", "policies");
        },
        ResourceIdentity::Posts => {
            modify_target.map.insert(
                MatchTarget::OperationId("groups.threads.UpdatePosts".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.threads.posts".to_string()),
                    MatchTarget::OperationId("groups.threads.posts.UpdatePosts".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.threads.GetPosts".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.threads.posts".to_string()),
                    MatchTarget::OperationId("groups.threads.posts.GetPosts".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.threads.ListPosts".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.threads.posts".to_string()),
                    MatchTarget::OperationId("groups.threads.posts.ListPosts".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.threads.CreatePosts".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.threads.posts".to_string()),
                    MatchTarget::OperationId("groups.threads.posts.CreatePosts".to_string()),
                ],
            );
        },
        ResourceIdentity::Plans => {
            modify_target.map.insert(
                MatchTarget::OperationId("planner.GetPlans".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.plans".to_string()),
                    MatchTarget::OperationId("planner.plans.GetPlans".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.UpdatePlans".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.plans".to_string()),
                    MatchTarget::OperationId("planner.plans.UpdatePlans".to_string()),
                ],
            );
        },
        ResourceIdentity::Settings => {
            modify_target.map.insert(
                MatchTarget::OperationId("me.GetSettings".to_string()),
                vec![
                    MatchTarget::OperationMap("settings".to_string()),
                    MatchTarget::OperationId("settings.GetSettings".to_string()),
                ],
            );

            modify_target.map.insert(
                MatchTarget::OperationId("me.UpdateSettings".to_string()),
                vec![
                    MatchTarget::OperationMap("settings".to_string()),
                    MatchTarget::OperationId("settings.UpdateSettings".to_string()),
                ],
            );
        },
        ResourceIdentity::Sessions => {
            modify_target.map.insert(
                MatchTarget::OperationId("communications.callRecords.GetSessions".to_string()),
                vec![
                    MatchTarget::OperationMap("sessions".to_string()),
                    MatchTarget::OperationId("sessions.GetSessions".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.callRecords.ListSessions".to_string()),
                vec![
                    MatchTarget::OperationMap("sessions".to_string()),
                    MatchTarget::OperationId("sessions.ListSessions".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.callRecords.UpdateSessions".to_string()),
                vec![
                    MatchTarget::OperationMap("sessions".to_string()),
                    MatchTarget::OperationId("sessions.UpdateSessions".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("communications.callRecords.CreateSessions".to_string()),
                vec![
                    MatchTarget::OperationMap("sessions".to_string()),
                    MatchTarget::OperationId("sessions.CreateSessions".to_string()),
                ],
            );
        },
        ResourceIdentity::Teams => {
            modify_target.map.insert(
                MatchTarget::OperationMap("teams.primaryChannel.messages".to_string()),
                vec![MatchTarget::OperationMap(
                    "teams.primaryChannel.primaryChannelMessages".to_string(),
                )],
            );
            modify_target.map.insert(
                MatchTarget::OperationMap("teams.primaryChannel.tabs".to_string()),
                vec![MatchTarget::OperationMap(
                    "teams.primaryChannel.primaryChannelTabs".to_string(),
                )],
            );
        },
        ResourceIdentity::Tasks => {
            modify_target.map.insert(
                MatchTarget::OperationId("planner.ListTasks".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.tasks".to_string()),
                    MatchTarget::OperationId("planner.tasks.ListTasks".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.UpdateTasks".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.tasks".to_string()),
                    MatchTarget::OperationId("planner.tasks.UpdateTasks".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("planner.GetTasks".to_string()),
                vec![
                    MatchTarget::OperationMap("planner.tasks".to_string()),
                    MatchTarget::OperationId("planner.tasks.GetTasks".to_string()),
                ],
            );
        },
        ResourceIdentity::Threads => {
            modify_target.map.insert(
                MatchTarget::OperationId("groups.UpdateThreads".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.threads".to_string()),
                    MatchTarget::OperationId("groups.threads.UpdateThreads".to_string()),
                ],
            );
            modify_target.map.insert(
                MatchTarget::OperationId("groups.GetThreads".to_string()),
                vec![
                    MatchTarget::OperationMap("groups.threads".to_string()),
                    MatchTarget::OperationId("groups.threads.GetThreads".to_string()),
                ],
            );
        },
        _ => {},
    }
    modify_target
}
