// Code generated by go generate; DO NOT EDIT.
package sendgrid

import "errors"

type Permission int

const (
    Invalid Permission = iota
    AccessSettingsActivityRead Permission = iota
    AccessSettingsWhitelistCreate Permission = iota
    AccessSettingsWhitelistDelete Permission = iota
    AccessSettingsWhitelistRead Permission = iota
    AccessSettingsWhitelistUpdate Permission = iota
    AlertsCreate Permission = iota
    AlertsDelete Permission = iota
    AlertsRead Permission = iota
    AlertsUpdate Permission = iota
    ApiKeysCreate Permission = iota
    ApiKeysDelete Permission = iota
    ApiKeysRead Permission = iota
    ApiKeysUpdate Permission = iota
    AsmGroupsCreate Permission = iota
    AsmGroupsDelete Permission = iota
    AsmGroupsRead Permission = iota
    AsmGroupsUpdate Permission = iota
    BillingCreate Permission = iota
    BillingDelete Permission = iota
    BillingRead Permission = iota
    BillingUpdate Permission = iota
    BrowsersStatsRead Permission = iota
    CategoriesCreate Permission = iota
    CategoriesDelete Permission = iota
    CategoriesRead Permission = iota
    CategoriesStatsRead Permission = iota
    CategoriesStatsSumsRead Permission = iota
    CategoriesUpdate Permission = iota
    ClientsDesktopStatsRead Permission = iota
    ClientsPhoneStatsRead Permission = iota
    ClientsStatsRead Permission = iota
    ClientsTabletStatsRead Permission = iota
    ClientsWebmailStatsRead Permission = iota
    DevicesStatsRead Permission = iota
    EmailActivityRead Permission = iota
    GeoStatsRead Permission = iota
    IpsAssignedRead Permission = iota
    IpsPoolsCreate Permission = iota
    IpsPoolsDelete Permission = iota
    IpsPoolsIpsCreate Permission = iota
    IpsPoolsIpsDelete Permission = iota
    IpsPoolsIpsRead Permission = iota
    IpsPoolsIpsUpdate Permission = iota
    IpsPoolsRead Permission = iota
    IpsPoolsUpdate Permission = iota
    IpsRead Permission = iota
    IpsWarmupCreate Permission = iota
    IpsWarmupDelete Permission = iota
    IpsWarmupRead Permission = iota
    IpsWarmupUpdate Permission = iota
    MailSettingsAddressWhitelistRead Permission = iota
    MailSettingsAddressWhitelistUpdate Permission = iota
    MailSettingsBouncePurgeRead Permission = iota
    MailSettingsBouncePurgeUpdate Permission = iota
    MailSettingsFooterRead Permission = iota
    MailSettingsFooterUpdate Permission = iota
    MailSettingsForwardBounceRead Permission = iota
    MailSettingsForwardBounceUpdate Permission = iota
    MailSettingsForwardSpamRead Permission = iota
    MailSettingsForwardSpamUpdate Permission = iota
    MailSettingsPlainContentRead Permission = iota
    MailSettingsPlainContentUpdate Permission = iota
    MailSettingsRead Permission = iota
    MailSettingsTemplateRead Permission = iota
    MailSettingsTemplateUpdate Permission = iota
    MailBatchCreate Permission = iota
    MailBatchDelete Permission = iota
    MailBatchRead Permission = iota
    MailBatchUpdate Permission = iota
    MailSend Permission = iota
    MailboxProvidersStatsRead Permission = iota
    MarketingCampaignsCreate Permission = iota
    MarketingCampaignsDelete Permission = iota
    MarketingCampaignsRead Permission = iota
    MarketingCampaignsUpdate Permission = iota
    PartnerSettingsNewRelicRead Permission = iota
    PartnerSettingsNewRelicUpdate Permission = iota
    PartnerSettingsRead Permission = iota
    StatsGlobalRead Permission = iota
    StatsRead Permission = iota
    SubusersCreate Permission = iota
    SubusersCreditsCreate Permission = iota
    SubusersCreditsDelete Permission = iota
    SubusersCreditsRead Permission = iota
    SubusersCreditsRemainingCreate Permission = iota
    SubusersCreditsRemainingDelete Permission = iota
    SubusersCreditsRemainingRead Permission = iota
    SubusersCreditsRemainingUpdate Permission = iota
    SubusersCreditsUpdate Permission = iota
    SubusersDelete Permission = iota
    SubusersMonitorCreate Permission = iota
    SubusersMonitorDelete Permission = iota
    SubusersMonitorRead Permission = iota
    SubusersMonitorUpdate Permission = iota
    SubusersRead Permission = iota
    SubusersReputationsRead Permission = iota
    SubusersStatsMonthlyRead Permission = iota
    SubusersStatsRead Permission = iota
    SubusersStatsSumsRead Permission = iota
    SubusersSummaryRead Permission = iota
    SubusersUpdate Permission = iota
    SuppressionBlocksCreate Permission = iota
    SuppressionBlocksDelete Permission = iota
    SuppressionBlocksRead Permission = iota
    SuppressionBlocksUpdate Permission = iota
    SuppressionBouncesCreate Permission = iota
    SuppressionBouncesDelete Permission = iota
    SuppressionBouncesRead Permission = iota
    SuppressionBouncesUpdate Permission = iota
    SuppressionCreate Permission = iota
    SuppressionDelete Permission = iota
    SuppressionInvalidEmailsCreate Permission = iota
    SuppressionInvalidEmailsDelete Permission = iota
    SuppressionInvalidEmailsRead Permission = iota
    SuppressionInvalidEmailsUpdate Permission = iota
    SuppressionRead Permission = iota
    SuppressionSpamReportsCreate Permission = iota
    SuppressionSpamReportsDelete Permission = iota
    SuppressionSpamReportsRead Permission = iota
    SuppressionSpamReportsUpdate Permission = iota
    SuppressionUnsubscribesCreate Permission = iota
    SuppressionUnsubscribesDelete Permission = iota
    SuppressionUnsubscribesRead Permission = iota
    SuppressionUnsubscribesUpdate Permission = iota
    SuppressionUpdate Permission = iota
    TeammatesCreate Permission = iota
    TeammatesRead Permission = iota
    TeammatesUpdate Permission = iota
    TeammatesDelete Permission = iota
    TemplatesCreate Permission = iota
    TemplatesDelete Permission = iota
    TemplatesRead Permission = iota
    TemplatesUpdate Permission = iota
    TemplatesVersionsActivateCreate Permission = iota
    TemplatesVersionsActivateDelete Permission = iota
    TemplatesVersionsActivateRead Permission = iota
    TemplatesVersionsActivateUpdate Permission = iota
    TemplatesVersionsCreate Permission = iota
    TemplatesVersionsDelete Permission = iota
    TemplatesVersionsRead Permission = iota
    TemplatesVersionsUpdate Permission = iota
    TrackingSettingsClickRead Permission = iota
    TrackingSettingsClickUpdate Permission = iota
    TrackingSettingsGoogleAnalyticsRead Permission = iota
    TrackingSettingsGoogleAnalyticsUpdate Permission = iota
    TrackingSettingsOpenRead Permission = iota
    TrackingSettingsOpenUpdate Permission = iota
    TrackingSettingsRead Permission = iota
    TrackingSettingsSubscriptionRead Permission = iota
    TrackingSettingsSubscriptionUpdate Permission = iota
    UserAccountRead Permission = iota
    UserCreditsRead Permission = iota
    UserEmailCreate Permission = iota
    UserEmailDelete Permission = iota
    UserEmailRead Permission = iota
    UserEmailUpdate Permission = iota
    UserMultifactorAuthenticationCreate Permission = iota
    UserMultifactorAuthenticationDelete Permission = iota
    UserMultifactorAuthenticationRead Permission = iota
    UserMultifactorAuthenticationUpdate Permission = iota
    UserPasswordRead Permission = iota
    UserPasswordUpdate Permission = iota
    UserProfileRead Permission = iota
    UserProfileUpdate Permission = iota
    UserScheduledSendsCreate Permission = iota
    UserScheduledSendsDelete Permission = iota
    UserScheduledSendsRead Permission = iota
    UserScheduledSendsUpdate Permission = iota
    UserSettingsEnforcedTlsRead Permission = iota
    UserSettingsEnforcedTlsUpdate Permission = iota
    UserTimezoneRead Permission = iota
    UserUsernameRead Permission = iota
    UserUsernameUpdate Permission = iota
    UserWebhooksEventSettingsRead Permission = iota
    UserWebhooksEventSettingsUpdate Permission = iota
    UserWebhooksEventTestCreate Permission = iota
    UserWebhooksEventTestRead Permission = iota
    UserWebhooksEventTestUpdate Permission = iota
    UserWebhooksParseSettingsCreate Permission = iota
    UserWebhooksParseSettingsDelete Permission = iota
    UserWebhooksParseSettingsRead Permission = iota
    UserWebhooksParseSettingsUpdate Permission = iota
    UserWebhooksParseStatsRead Permission = iota
    WhitelabelCreate Permission = iota
    WhitelabelDelete Permission = iota
    WhitelabelRead Permission = iota
    WhitelabelUpdate Permission = iota
)

var (
    PermissionStrings = map[Permission]string{
        AccessSettingsActivityRead: "access_settings.activity.read",
        AccessSettingsWhitelistCreate: "access_settings.whitelist.create",
        AccessSettingsWhitelistDelete: "access_settings.whitelist.delete",
        AccessSettingsWhitelistRead: "access_settings.whitelist.read",
        AccessSettingsWhitelistUpdate: "access_settings.whitelist.update",
        AlertsCreate: "alerts.create",
        AlertsDelete: "alerts.delete",
        AlertsRead: "alerts.read",
        AlertsUpdate: "alerts.update",
        ApiKeysCreate: "api_keys.create",
        ApiKeysDelete: "api_keys.delete",
        ApiKeysRead: "api_keys.read",
        ApiKeysUpdate: "api_keys.update",
        AsmGroupsCreate: "asm.groups.create",
        AsmGroupsDelete: "asm.groups.delete",
        AsmGroupsRead: "asm.groups.read",
        AsmGroupsUpdate: "asm.groups.update",
        BillingCreate: "billing.create",
        BillingDelete: "billing.delete",
        BillingRead: "billing.read",
        BillingUpdate: "billing.update",
        BrowsersStatsRead: "browsers.stats.read",
        CategoriesCreate: "categories.create",
        CategoriesDelete: "categories.delete",
        CategoriesRead: "categories.read",
        CategoriesStatsRead: "categories.stats.read",
        CategoriesStatsSumsRead: "categories.stats.sums.read",
        CategoriesUpdate: "categories.update",
        ClientsDesktopStatsRead: "clients.desktop.stats.read",
        ClientsPhoneStatsRead: "clients.phone.stats.read",
        ClientsStatsRead: "clients.stats.read",
        ClientsTabletStatsRead: "clients.tablet.stats.read",
        ClientsWebmailStatsRead: "clients.webmail.stats.read",
        DevicesStatsRead: "devices.stats.read",
        EmailActivityRead: "email_activity.read",
        GeoStatsRead: "geo.stats.read",
        IpsAssignedRead: "ips.assigned.read",
        IpsPoolsCreate: "ips.pools.create",
        IpsPoolsDelete: "ips.pools.delete",
        IpsPoolsIpsCreate: "ips.pools.ips.create",
        IpsPoolsIpsDelete: "ips.pools.ips.delete",
        IpsPoolsIpsRead: "ips.pools.ips.read",
        IpsPoolsIpsUpdate: "ips.pools.ips.update",
        IpsPoolsRead: "ips.pools.read",
        IpsPoolsUpdate: "ips.pools.update",
        IpsRead: "ips.read",
        IpsWarmupCreate: "ips.warmup.create",
        IpsWarmupDelete: "ips.warmup.delete",
        IpsWarmupRead: "ips.warmup.read",
        IpsWarmupUpdate: "ips.warmup.update",
        MailSettingsAddressWhitelistRead: "mail_settings.address_whitelist.read",
        MailSettingsAddressWhitelistUpdate: "mail_settings.address_whitelist.update",
        MailSettingsBouncePurgeRead: "mail_settings.bounce_purge.read",
        MailSettingsBouncePurgeUpdate: "mail_settings.bounce_purge.update",
        MailSettingsFooterRead: "mail_settings.footer.read",
        MailSettingsFooterUpdate: "mail_settings.footer.update",
        MailSettingsForwardBounceRead: "mail_settings.forward_bounce.read",
        MailSettingsForwardBounceUpdate: "mail_settings.forward_bounce.update",
        MailSettingsForwardSpamRead: "mail_settings.forward_spam.read",
        MailSettingsForwardSpamUpdate: "mail_settings.forward_spam.update",
        MailSettingsPlainContentRead: "mail_settings.plain_content.read",
        MailSettingsPlainContentUpdate: "mail_settings.plain_content.update",
        MailSettingsRead: "mail_settings.read",
        MailSettingsTemplateRead: "mail_settings.template.read",
        MailSettingsTemplateUpdate: "mail_settings.template.update",
        MailBatchCreate: "mail.batch.create",
        MailBatchDelete: "mail.batch.delete",
        MailBatchRead: "mail.batch.read",
        MailBatchUpdate: "mail.batch.update",
        MailSend: "mail.send",
        MailboxProvidersStatsRead: "mailbox_providers.stats.read",
        MarketingCampaignsCreate: "marketing_campaigns.create",
        MarketingCampaignsDelete: "marketing_campaigns.delete",
        MarketingCampaignsRead: "marketing_campaigns.read",
        MarketingCampaignsUpdate: "marketing_campaigns.update",
        PartnerSettingsNewRelicRead: "partner_settings.new_relic.read",
        PartnerSettingsNewRelicUpdate: "partner_settings.new_relic.update",
        PartnerSettingsRead: "partner_settings.read",
        StatsGlobalRead: "stats.global.read",
        StatsRead: "stats.read",
        SubusersCreate: "subusers.create",
        SubusersCreditsCreate: "subusers.credits.create",
        SubusersCreditsDelete: "subusers.credits.delete",
        SubusersCreditsRead: "subusers.credits.read",
        SubusersCreditsRemainingCreate: "subusers.credits.remaining.create",
        SubusersCreditsRemainingDelete: "subusers.credits.remaining.delete",
        SubusersCreditsRemainingRead: "subusers.credits.remaining.read",
        SubusersCreditsRemainingUpdate: "subusers.credits.remaining.update",
        SubusersCreditsUpdate: "subusers.credits.update",
        SubusersDelete: "subusers.delete",
        SubusersMonitorCreate: "subusers.monitor.create",
        SubusersMonitorDelete: "subusers.monitor.delete",
        SubusersMonitorRead: "subusers.monitor.read",
        SubusersMonitorUpdate: "subusers.monitor.update",
        SubusersRead: "subusers.read",
        SubusersReputationsRead: "subusers.reputations.read",
        SubusersStatsMonthlyRead: "subusers.stats.monthly.read",
        SubusersStatsRead: "subusers.stats.read",
        SubusersStatsSumsRead: "subusers.stats.sums.read",
        SubusersSummaryRead: "subusers.summary.read",
        SubusersUpdate: "subusers.update",
        SuppressionBlocksCreate: "suppression.blocks.create",
        SuppressionBlocksDelete: "suppression.blocks.delete",
        SuppressionBlocksRead: "suppression.blocks.read",
        SuppressionBlocksUpdate: "suppression.blocks.update",
        SuppressionBouncesCreate: "suppression.bounces.create",
        SuppressionBouncesDelete: "suppression.bounces.delete",
        SuppressionBouncesRead: "suppression.bounces.read",
        SuppressionBouncesUpdate: "suppression.bounces.update",
        SuppressionCreate: "suppression.create",
        SuppressionDelete: "suppression.delete",
        SuppressionInvalidEmailsCreate: "suppression.invalid_emails.create",
        SuppressionInvalidEmailsDelete: "suppression.invalid_emails.delete",
        SuppressionInvalidEmailsRead: "suppression.invalid_emails.read",
        SuppressionInvalidEmailsUpdate: "suppression.invalid_emails.update",
        SuppressionRead: "suppression.read",
        SuppressionSpamReportsCreate: "suppression.spam_reports.create",
        SuppressionSpamReportsDelete: "suppression.spam_reports.delete",
        SuppressionSpamReportsRead: "suppression.spam_reports.read",
        SuppressionSpamReportsUpdate: "suppression.spam_reports.update",
        SuppressionUnsubscribesCreate: "suppression.unsubscribes.create",
        SuppressionUnsubscribesDelete: "suppression.unsubscribes.delete",
        SuppressionUnsubscribesRead: "suppression.unsubscribes.read",
        SuppressionUnsubscribesUpdate: "suppression.unsubscribes.update",
        SuppressionUpdate: "suppression.update",
        TeammatesCreate: "teammates.create",
        TeammatesRead: "teammates.read",
        TeammatesUpdate: "teammates.update",
        TeammatesDelete: "teammates.delete",
        TemplatesCreate: "templates.create",
        TemplatesDelete: "templates.delete",
        TemplatesRead: "templates.read",
        TemplatesUpdate: "templates.update",
        TemplatesVersionsActivateCreate: "templates.versions.activate.create",
        TemplatesVersionsActivateDelete: "templates.versions.activate.delete",
        TemplatesVersionsActivateRead: "templates.versions.activate.read",
        TemplatesVersionsActivateUpdate: "templates.versions.activate.update",
        TemplatesVersionsCreate: "templates.versions.create",
        TemplatesVersionsDelete: "templates.versions.delete",
        TemplatesVersionsRead: "templates.versions.read",
        TemplatesVersionsUpdate: "templates.versions.update",
        TrackingSettingsClickRead: "tracking_settings.click.read",
        TrackingSettingsClickUpdate: "tracking_settings.click.update",
        TrackingSettingsGoogleAnalyticsRead: "tracking_settings.google_analytics.read",
        TrackingSettingsGoogleAnalyticsUpdate: "tracking_settings.google_analytics.update",
        TrackingSettingsOpenRead: "tracking_settings.open.read",
        TrackingSettingsOpenUpdate: "tracking_settings.open.update",
        TrackingSettingsRead: "tracking_settings.read",
        TrackingSettingsSubscriptionRead: "tracking_settings.subscription.read",
        TrackingSettingsSubscriptionUpdate: "tracking_settings.subscription.update",
        UserAccountRead: "user.account.read",
        UserCreditsRead: "user.credits.read",
        UserEmailCreate: "user.email.create",
        UserEmailDelete: "user.email.delete",
        UserEmailRead: "user.email.read",
        UserEmailUpdate: "user.email.update",
        UserMultifactorAuthenticationCreate: "user.multifactor_authentication.create",
        UserMultifactorAuthenticationDelete: "user.multifactor_authentication.delete",
        UserMultifactorAuthenticationRead: "user.multifactor_authentication.read",
        UserMultifactorAuthenticationUpdate: "user.multifactor_authentication.update",
        UserPasswordRead: "user.password.read",
        UserPasswordUpdate: "user.password.update",
        UserProfileRead: "user.profile.read",
        UserProfileUpdate: "user.profile.update",
        UserScheduledSendsCreate: "user.scheduled_sends.create",
        UserScheduledSendsDelete: "user.scheduled_sends.delete",
        UserScheduledSendsRead: "user.scheduled_sends.read",
        UserScheduledSendsUpdate: "user.scheduled_sends.update",
        UserSettingsEnforcedTlsRead: "user.settings.enforced_tls.read",
        UserSettingsEnforcedTlsUpdate: "user.settings.enforced_tls.update",
        UserTimezoneRead: "user.timezone.read",
        UserUsernameRead: "user.username.read",
        UserUsernameUpdate: "user.username.update",
        UserWebhooksEventSettingsRead: "user.webhooks.event.settings.read",
        UserWebhooksEventSettingsUpdate: "user.webhooks.event.settings.update",
        UserWebhooksEventTestCreate: "user.webhooks.event.test.create",
        UserWebhooksEventTestRead: "user.webhooks.event.test.read",
        UserWebhooksEventTestUpdate: "user.webhooks.event.test.update",
        UserWebhooksParseSettingsCreate: "user.webhooks.parse.settings.create",
        UserWebhooksParseSettingsDelete: "user.webhooks.parse.settings.delete",
        UserWebhooksParseSettingsRead: "user.webhooks.parse.settings.read",
        UserWebhooksParseSettingsUpdate: "user.webhooks.parse.settings.update",
        UserWebhooksParseStatsRead: "user.webhooks.parse.stats.read",
        WhitelabelCreate: "whitelabel.create",
        WhitelabelDelete: "whitelabel.delete",
        WhitelabelRead: "whitelabel.read",
        WhitelabelUpdate: "whitelabel.update",
    }

    StringToPermission = map[string]Permission{
        "access_settings.activity.read": AccessSettingsActivityRead,
        "access_settings.whitelist.create": AccessSettingsWhitelistCreate,
        "access_settings.whitelist.delete": AccessSettingsWhitelistDelete,
        "access_settings.whitelist.read": AccessSettingsWhitelistRead,
        "access_settings.whitelist.update": AccessSettingsWhitelistUpdate,
        "alerts.create": AlertsCreate,
        "alerts.delete": AlertsDelete,
        "alerts.read": AlertsRead,
        "alerts.update": AlertsUpdate,
        "api_keys.create": ApiKeysCreate,
        "api_keys.delete": ApiKeysDelete,
        "api_keys.read": ApiKeysRead,
        "api_keys.update": ApiKeysUpdate,
        "asm.groups.create": AsmGroupsCreate,
        "asm.groups.delete": AsmGroupsDelete,
        "asm.groups.read": AsmGroupsRead,
        "asm.groups.update": AsmGroupsUpdate,
        "billing.create": BillingCreate,
        "billing.delete": BillingDelete,
        "billing.read": BillingRead,
        "billing.update": BillingUpdate,
        "browsers.stats.read": BrowsersStatsRead,
        "categories.create": CategoriesCreate,
        "categories.delete": CategoriesDelete,
        "categories.read": CategoriesRead,
        "categories.stats.read": CategoriesStatsRead,
        "categories.stats.sums.read": CategoriesStatsSumsRead,
        "categories.update": CategoriesUpdate,
        "clients.desktop.stats.read": ClientsDesktopStatsRead,
        "clients.phone.stats.read": ClientsPhoneStatsRead,
        "clients.stats.read": ClientsStatsRead,
        "clients.tablet.stats.read": ClientsTabletStatsRead,
        "clients.webmail.stats.read": ClientsWebmailStatsRead,
        "devices.stats.read": DevicesStatsRead,
        "email_activity.read": EmailActivityRead,
        "geo.stats.read": GeoStatsRead,
        "ips.assigned.read": IpsAssignedRead,
        "ips.pools.create": IpsPoolsCreate,
        "ips.pools.delete": IpsPoolsDelete,
        "ips.pools.ips.create": IpsPoolsIpsCreate,
        "ips.pools.ips.delete": IpsPoolsIpsDelete,
        "ips.pools.ips.read": IpsPoolsIpsRead,
        "ips.pools.ips.update": IpsPoolsIpsUpdate,
        "ips.pools.read": IpsPoolsRead,
        "ips.pools.update": IpsPoolsUpdate,
        "ips.read": IpsRead,
        "ips.warmup.create": IpsWarmupCreate,
        "ips.warmup.delete": IpsWarmupDelete,
        "ips.warmup.read": IpsWarmupRead,
        "ips.warmup.update": IpsWarmupUpdate,
        "mail_settings.address_whitelist.read": MailSettingsAddressWhitelistRead,
        "mail_settings.address_whitelist.update": MailSettingsAddressWhitelistUpdate,
        "mail_settings.bounce_purge.read": MailSettingsBouncePurgeRead,
        "mail_settings.bounce_purge.update": MailSettingsBouncePurgeUpdate,
        "mail_settings.footer.read": MailSettingsFooterRead,
        "mail_settings.footer.update": MailSettingsFooterUpdate,
        "mail_settings.forward_bounce.read": MailSettingsForwardBounceRead,
        "mail_settings.forward_bounce.update": MailSettingsForwardBounceUpdate,
        "mail_settings.forward_spam.read": MailSettingsForwardSpamRead,
        "mail_settings.forward_spam.update": MailSettingsForwardSpamUpdate,
        "mail_settings.plain_content.read": MailSettingsPlainContentRead,
        "mail_settings.plain_content.update": MailSettingsPlainContentUpdate,
        "mail_settings.read": MailSettingsRead,
        "mail_settings.template.read": MailSettingsTemplateRead,
        "mail_settings.template.update": MailSettingsTemplateUpdate,
        "mail.batch.create": MailBatchCreate,
        "mail.batch.delete": MailBatchDelete,
        "mail.batch.read": MailBatchRead,
        "mail.batch.update": MailBatchUpdate,
        "mail.send": MailSend,
        "mailbox_providers.stats.read": MailboxProvidersStatsRead,
        "marketing_campaigns.create": MarketingCampaignsCreate,
        "marketing_campaigns.delete": MarketingCampaignsDelete,
        "marketing_campaigns.read": MarketingCampaignsRead,
        "marketing_campaigns.update": MarketingCampaignsUpdate,
        "partner_settings.new_relic.read": PartnerSettingsNewRelicRead,
        "partner_settings.new_relic.update": PartnerSettingsNewRelicUpdate,
        "partner_settings.read": PartnerSettingsRead,
        "stats.global.read": StatsGlobalRead,
        "stats.read": StatsRead,
        "subusers.create": SubusersCreate,
        "subusers.credits.create": SubusersCreditsCreate,
        "subusers.credits.delete": SubusersCreditsDelete,
        "subusers.credits.read": SubusersCreditsRead,
        "subusers.credits.remaining.create": SubusersCreditsRemainingCreate,
        "subusers.credits.remaining.delete": SubusersCreditsRemainingDelete,
        "subusers.credits.remaining.read": SubusersCreditsRemainingRead,
        "subusers.credits.remaining.update": SubusersCreditsRemainingUpdate,
        "subusers.credits.update": SubusersCreditsUpdate,
        "subusers.delete": SubusersDelete,
        "subusers.monitor.create": SubusersMonitorCreate,
        "subusers.monitor.delete": SubusersMonitorDelete,
        "subusers.monitor.read": SubusersMonitorRead,
        "subusers.monitor.update": SubusersMonitorUpdate,
        "subusers.read": SubusersRead,
        "subusers.reputations.read": SubusersReputationsRead,
        "subusers.stats.monthly.read": SubusersStatsMonthlyRead,
        "subusers.stats.read": SubusersStatsRead,
        "subusers.stats.sums.read": SubusersStatsSumsRead,
        "subusers.summary.read": SubusersSummaryRead,
        "subusers.update": SubusersUpdate,
        "suppression.blocks.create": SuppressionBlocksCreate,
        "suppression.blocks.delete": SuppressionBlocksDelete,
        "suppression.blocks.read": SuppressionBlocksRead,
        "suppression.blocks.update": SuppressionBlocksUpdate,
        "suppression.bounces.create": SuppressionBouncesCreate,
        "suppression.bounces.delete": SuppressionBouncesDelete,
        "suppression.bounces.read": SuppressionBouncesRead,
        "suppression.bounces.update": SuppressionBouncesUpdate,
        "suppression.create": SuppressionCreate,
        "suppression.delete": SuppressionDelete,
        "suppression.invalid_emails.create": SuppressionInvalidEmailsCreate,
        "suppression.invalid_emails.delete": SuppressionInvalidEmailsDelete,
        "suppression.invalid_emails.read": SuppressionInvalidEmailsRead,
        "suppression.invalid_emails.update": SuppressionInvalidEmailsUpdate,
        "suppression.read": SuppressionRead,
        "suppression.spam_reports.create": SuppressionSpamReportsCreate,
        "suppression.spam_reports.delete": SuppressionSpamReportsDelete,
        "suppression.spam_reports.read": SuppressionSpamReportsRead,
        "suppression.spam_reports.update": SuppressionSpamReportsUpdate,
        "suppression.unsubscribes.create": SuppressionUnsubscribesCreate,
        "suppression.unsubscribes.delete": SuppressionUnsubscribesDelete,
        "suppression.unsubscribes.read": SuppressionUnsubscribesRead,
        "suppression.unsubscribes.update": SuppressionUnsubscribesUpdate,
        "suppression.update": SuppressionUpdate,
        "teammates.create": TeammatesCreate,
        "teammates.read": TeammatesRead,
        "teammates.update": TeammatesUpdate,
        "teammates.delete": TeammatesDelete,
        "templates.create": TemplatesCreate,
        "templates.delete": TemplatesDelete,
        "templates.read": TemplatesRead,
        "templates.update": TemplatesUpdate,
        "templates.versions.activate.create": TemplatesVersionsActivateCreate,
        "templates.versions.activate.delete": TemplatesVersionsActivateDelete,
        "templates.versions.activate.read": TemplatesVersionsActivateRead,
        "templates.versions.activate.update": TemplatesVersionsActivateUpdate,
        "templates.versions.create": TemplatesVersionsCreate,
        "templates.versions.delete": TemplatesVersionsDelete,
        "templates.versions.read": TemplatesVersionsRead,
        "templates.versions.update": TemplatesVersionsUpdate,
        "tracking_settings.click.read": TrackingSettingsClickRead,
        "tracking_settings.click.update": TrackingSettingsClickUpdate,
        "tracking_settings.google_analytics.read": TrackingSettingsGoogleAnalyticsRead,
        "tracking_settings.google_analytics.update": TrackingSettingsGoogleAnalyticsUpdate,
        "tracking_settings.open.read": TrackingSettingsOpenRead,
        "tracking_settings.open.update": TrackingSettingsOpenUpdate,
        "tracking_settings.read": TrackingSettingsRead,
        "tracking_settings.subscription.read": TrackingSettingsSubscriptionRead,
        "tracking_settings.subscription.update": TrackingSettingsSubscriptionUpdate,
        "user.account.read": UserAccountRead,
        "user.credits.read": UserCreditsRead,
        "user.email.create": UserEmailCreate,
        "user.email.delete": UserEmailDelete,
        "user.email.read": UserEmailRead,
        "user.email.update": UserEmailUpdate,
        "user.multifactor_authentication.create": UserMultifactorAuthenticationCreate,
        "user.multifactor_authentication.delete": UserMultifactorAuthenticationDelete,
        "user.multifactor_authentication.read": UserMultifactorAuthenticationRead,
        "user.multifactor_authentication.update": UserMultifactorAuthenticationUpdate,
        "user.password.read": UserPasswordRead,
        "user.password.update": UserPasswordUpdate,
        "user.profile.read": UserProfileRead,
        "user.profile.update": UserProfileUpdate,
        "user.scheduled_sends.create": UserScheduledSendsCreate,
        "user.scheduled_sends.delete": UserScheduledSendsDelete,
        "user.scheduled_sends.read": UserScheduledSendsRead,
        "user.scheduled_sends.update": UserScheduledSendsUpdate,
        "user.settings.enforced_tls.read": UserSettingsEnforcedTlsRead,
        "user.settings.enforced_tls.update": UserSettingsEnforcedTlsUpdate,
        "user.timezone.read": UserTimezoneRead,
        "user.username.read": UserUsernameRead,
        "user.username.update": UserUsernameUpdate,
        "user.webhooks.event.settings.read": UserWebhooksEventSettingsRead,
        "user.webhooks.event.settings.update": UserWebhooksEventSettingsUpdate,
        "user.webhooks.event.test.create": UserWebhooksEventTestCreate,
        "user.webhooks.event.test.read": UserWebhooksEventTestRead,
        "user.webhooks.event.test.update": UserWebhooksEventTestUpdate,
        "user.webhooks.parse.settings.create": UserWebhooksParseSettingsCreate,
        "user.webhooks.parse.settings.delete": UserWebhooksParseSettingsDelete,
        "user.webhooks.parse.settings.read": UserWebhooksParseSettingsRead,
        "user.webhooks.parse.settings.update": UserWebhooksParseSettingsUpdate,
        "user.webhooks.parse.stats.read": UserWebhooksParseStatsRead,
        "whitelabel.create": WhitelabelCreate,
        "whitelabel.delete": WhitelabelDelete,
        "whitelabel.read": WhitelabelRead,
        "whitelabel.update": WhitelabelUpdate,
    }

    PermissionIDs = map[Permission]int{
        AccessSettingsActivityRead: 1,
        AccessSettingsWhitelistCreate: 2,
        AccessSettingsWhitelistDelete: 3,
        AccessSettingsWhitelistRead: 4,
        AccessSettingsWhitelistUpdate: 5,
        AlertsCreate: 6,
        AlertsDelete: 7,
        AlertsRead: 8,
        AlertsUpdate: 9,
        ApiKeysCreate: 10,
        ApiKeysDelete: 11,
        ApiKeysRead: 12,
        ApiKeysUpdate: 13,
        AsmGroupsCreate: 14,
        AsmGroupsDelete: 15,
        AsmGroupsRead: 16,
        AsmGroupsUpdate: 17,
        BillingCreate: 18,
        BillingDelete: 19,
        BillingRead: 20,
        BillingUpdate: 21,
        BrowsersStatsRead: 22,
        CategoriesCreate: 23,
        CategoriesDelete: 24,
        CategoriesRead: 25,
        CategoriesStatsRead: 26,
        CategoriesStatsSumsRead: 27,
        CategoriesUpdate: 28,
        ClientsDesktopStatsRead: 29,
        ClientsPhoneStatsRead: 30,
        ClientsStatsRead: 31,
        ClientsTabletStatsRead: 32,
        ClientsWebmailStatsRead: 33,
        DevicesStatsRead: 34,
        EmailActivityRead: 35,
        GeoStatsRead: 36,
        IpsAssignedRead: 37,
        IpsPoolsCreate: 38,
        IpsPoolsDelete: 39,
        IpsPoolsIpsCreate: 40,
        IpsPoolsIpsDelete: 41,
        IpsPoolsIpsRead: 42,
        IpsPoolsIpsUpdate: 43,
        IpsPoolsRead: 44,
        IpsPoolsUpdate: 45,
        IpsRead: 46,
        IpsWarmupCreate: 47,
        IpsWarmupDelete: 48,
        IpsWarmupRead: 49,
        IpsWarmupUpdate: 50,
        MailSettingsAddressWhitelistRead: 51,
        MailSettingsAddressWhitelistUpdate: 52,
        MailSettingsBouncePurgeRead: 53,
        MailSettingsBouncePurgeUpdate: 54,
        MailSettingsFooterRead: 55,
        MailSettingsFooterUpdate: 56,
        MailSettingsForwardBounceRead: 57,
        MailSettingsForwardBounceUpdate: 58,
        MailSettingsForwardSpamRead: 59,
        MailSettingsForwardSpamUpdate: 60,
        MailSettingsPlainContentRead: 61,
        MailSettingsPlainContentUpdate: 62,
        MailSettingsRead: 63,
        MailSettingsTemplateRead: 64,
        MailSettingsTemplateUpdate: 65,
        MailBatchCreate: 66,
        MailBatchDelete: 67,
        MailBatchRead: 68,
        MailBatchUpdate: 69,
        MailSend: 70,
        MailboxProvidersStatsRead: 71,
        MarketingCampaignsCreate: 72,
        MarketingCampaignsDelete: 73,
        MarketingCampaignsRead: 74,
        MarketingCampaignsUpdate: 75,
        PartnerSettingsNewRelicRead: 76,
        PartnerSettingsNewRelicUpdate: 77,
        PartnerSettingsRead: 78,
        StatsGlobalRead: 79,
        StatsRead: 80,
        SubusersCreate: 81,
        SubusersCreditsCreate: 82,
        SubusersCreditsDelete: 83,
        SubusersCreditsRead: 84,
        SubusersCreditsRemainingCreate: 85,
        SubusersCreditsRemainingDelete: 86,
        SubusersCreditsRemainingRead: 87,
        SubusersCreditsRemainingUpdate: 88,
        SubusersCreditsUpdate: 89,
        SubusersDelete: 90,
        SubusersMonitorCreate: 91,
        SubusersMonitorDelete: 92,
        SubusersMonitorRead: 93,
        SubusersMonitorUpdate: 94,
        SubusersRead: 95,
        SubusersReputationsRead: 96,
        SubusersStatsMonthlyRead: 97,
        SubusersStatsRead: 98,
        SubusersStatsSumsRead: 99,
        SubusersSummaryRead: 100,
        SubusersUpdate: 101,
        SuppressionBlocksCreate: 102,
        SuppressionBlocksDelete: 103,
        SuppressionBlocksRead: 104,
        SuppressionBlocksUpdate: 105,
        SuppressionBouncesCreate: 106,
        SuppressionBouncesDelete: 107,
        SuppressionBouncesRead: 108,
        SuppressionBouncesUpdate: 109,
        SuppressionCreate: 110,
        SuppressionDelete: 111,
        SuppressionInvalidEmailsCreate: 112,
        SuppressionInvalidEmailsDelete: 113,
        SuppressionInvalidEmailsRead: 114,
        SuppressionInvalidEmailsUpdate: 115,
        SuppressionRead: 116,
        SuppressionSpamReportsCreate: 117,
        SuppressionSpamReportsDelete: 118,
        SuppressionSpamReportsRead: 119,
        SuppressionSpamReportsUpdate: 120,
        SuppressionUnsubscribesCreate: 121,
        SuppressionUnsubscribesDelete: 122,
        SuppressionUnsubscribesRead: 123,
        SuppressionUnsubscribesUpdate: 124,
        SuppressionUpdate: 125,
        TeammatesCreate: 126,
        TeammatesRead: 127,
        TeammatesUpdate: 128,
        TeammatesDelete: 129,
        TemplatesCreate: 130,
        TemplatesDelete: 131,
        TemplatesRead: 132,
        TemplatesUpdate: 133,
        TemplatesVersionsActivateCreate: 134,
        TemplatesVersionsActivateDelete: 135,
        TemplatesVersionsActivateRead: 136,
        TemplatesVersionsActivateUpdate: 137,
        TemplatesVersionsCreate: 138,
        TemplatesVersionsDelete: 139,
        TemplatesVersionsRead: 140,
        TemplatesVersionsUpdate: 141,
        TrackingSettingsClickRead: 142,
        TrackingSettingsClickUpdate: 143,
        TrackingSettingsGoogleAnalyticsRead: 144,
        TrackingSettingsGoogleAnalyticsUpdate: 145,
        TrackingSettingsOpenRead: 146,
        TrackingSettingsOpenUpdate: 147,
        TrackingSettingsRead: 148,
        TrackingSettingsSubscriptionRead: 149,
        TrackingSettingsSubscriptionUpdate: 150,
        UserAccountRead: 151,
        UserCreditsRead: 152,
        UserEmailCreate: 153,
        UserEmailDelete: 154,
        UserEmailRead: 155,
        UserEmailUpdate: 156,
        UserMultifactorAuthenticationCreate: 157,
        UserMultifactorAuthenticationDelete: 158,
        UserMultifactorAuthenticationRead: 159,
        UserMultifactorAuthenticationUpdate: 160,
        UserPasswordRead: 161,
        UserPasswordUpdate: 162,
        UserProfileRead: 163,
        UserProfileUpdate: 164,
        UserScheduledSendsCreate: 165,
        UserScheduledSendsDelete: 166,
        UserScheduledSendsRead: 167,
        UserScheduledSendsUpdate: 168,
        UserSettingsEnforcedTlsRead: 169,
        UserSettingsEnforcedTlsUpdate: 170,
        UserTimezoneRead: 171,
        UserUsernameRead: 172,
        UserUsernameUpdate: 173,
        UserWebhooksEventSettingsRead: 174,
        UserWebhooksEventSettingsUpdate: 175,
        UserWebhooksEventTestCreate: 176,
        UserWebhooksEventTestRead: 177,
        UserWebhooksEventTestUpdate: 178,
        UserWebhooksParseSettingsCreate: 179,
        UserWebhooksParseSettingsDelete: 180,
        UserWebhooksParseSettingsRead: 181,
        UserWebhooksParseSettingsUpdate: 182,
        UserWebhooksParseStatsRead: 183,
        WhitelabelCreate: 184,
        WhitelabelDelete: 185,
        WhitelabelRead: 186,
        WhitelabelUpdate: 187,
    }

    IdToPermission = map[int]Permission{
        1: AccessSettingsActivityRead,
        2: AccessSettingsWhitelistCreate,
        3: AccessSettingsWhitelistDelete,
        4: AccessSettingsWhitelistRead,
        5: AccessSettingsWhitelistUpdate,
        6: AlertsCreate,
        7: AlertsDelete,
        8: AlertsRead,
        9: AlertsUpdate,
        10: ApiKeysCreate,
        11: ApiKeysDelete,
        12: ApiKeysRead,
        13: ApiKeysUpdate,
        14: AsmGroupsCreate,
        15: AsmGroupsDelete,
        16: AsmGroupsRead,
        17: AsmGroupsUpdate,
        18: BillingCreate,
        19: BillingDelete,
        20: BillingRead,
        21: BillingUpdate,
        22: BrowsersStatsRead,
        23: CategoriesCreate,
        24: CategoriesDelete,
        25: CategoriesRead,
        26: CategoriesStatsRead,
        27: CategoriesStatsSumsRead,
        28: CategoriesUpdate,
        29: ClientsDesktopStatsRead,
        30: ClientsPhoneStatsRead,
        31: ClientsStatsRead,
        32: ClientsTabletStatsRead,
        33: ClientsWebmailStatsRead,
        34: DevicesStatsRead,
        35: EmailActivityRead,
        36: GeoStatsRead,
        37: IpsAssignedRead,
        38: IpsPoolsCreate,
        39: IpsPoolsDelete,
        40: IpsPoolsIpsCreate,
        41: IpsPoolsIpsDelete,
        42: IpsPoolsIpsRead,
        43: IpsPoolsIpsUpdate,
        44: IpsPoolsRead,
        45: IpsPoolsUpdate,
        46: IpsRead,
        47: IpsWarmupCreate,
        48: IpsWarmupDelete,
        49: IpsWarmupRead,
        50: IpsWarmupUpdate,
        51: MailSettingsAddressWhitelistRead,
        52: MailSettingsAddressWhitelistUpdate,
        53: MailSettingsBouncePurgeRead,
        54: MailSettingsBouncePurgeUpdate,
        55: MailSettingsFooterRead,
        56: MailSettingsFooterUpdate,
        57: MailSettingsForwardBounceRead,
        58: MailSettingsForwardBounceUpdate,
        59: MailSettingsForwardSpamRead,
        60: MailSettingsForwardSpamUpdate,
        61: MailSettingsPlainContentRead,
        62: MailSettingsPlainContentUpdate,
        63: MailSettingsRead,
        64: MailSettingsTemplateRead,
        65: MailSettingsTemplateUpdate,
        66: MailBatchCreate,
        67: MailBatchDelete,
        68: MailBatchRead,
        69: MailBatchUpdate,
        70: MailSend,
        71: MailboxProvidersStatsRead,
        72: MarketingCampaignsCreate,
        73: MarketingCampaignsDelete,
        74: MarketingCampaignsRead,
        75: MarketingCampaignsUpdate,
        76: PartnerSettingsNewRelicRead,
        77: PartnerSettingsNewRelicUpdate,
        78: PartnerSettingsRead,
        79: StatsGlobalRead,
        80: StatsRead,
        81: SubusersCreate,
        82: SubusersCreditsCreate,
        83: SubusersCreditsDelete,
        84: SubusersCreditsRead,
        85: SubusersCreditsRemainingCreate,
        86: SubusersCreditsRemainingDelete,
        87: SubusersCreditsRemainingRead,
        88: SubusersCreditsRemainingUpdate,
        89: SubusersCreditsUpdate,
        90: SubusersDelete,
        91: SubusersMonitorCreate,
        92: SubusersMonitorDelete,
        93: SubusersMonitorRead,
        94: SubusersMonitorUpdate,
        95: SubusersRead,
        96: SubusersReputationsRead,
        97: SubusersStatsMonthlyRead,
        98: SubusersStatsRead,
        99: SubusersStatsSumsRead,
        100: SubusersSummaryRead,
        101: SubusersUpdate,
        102: SuppressionBlocksCreate,
        103: SuppressionBlocksDelete,
        104: SuppressionBlocksRead,
        105: SuppressionBlocksUpdate,
        106: SuppressionBouncesCreate,
        107: SuppressionBouncesDelete,
        108: SuppressionBouncesRead,
        109: SuppressionBouncesUpdate,
        110: SuppressionCreate,
        111: SuppressionDelete,
        112: SuppressionInvalidEmailsCreate,
        113: SuppressionInvalidEmailsDelete,
        114: SuppressionInvalidEmailsRead,
        115: SuppressionInvalidEmailsUpdate,
        116: SuppressionRead,
        117: SuppressionSpamReportsCreate,
        118: SuppressionSpamReportsDelete,
        119: SuppressionSpamReportsRead,
        120: SuppressionSpamReportsUpdate,
        121: SuppressionUnsubscribesCreate,
        122: SuppressionUnsubscribesDelete,
        123: SuppressionUnsubscribesRead,
        124: SuppressionUnsubscribesUpdate,
        125: SuppressionUpdate,
        126: TeammatesCreate,
        127: TeammatesRead,
        128: TeammatesUpdate,
        129: TeammatesDelete,
        130: TemplatesCreate,
        131: TemplatesDelete,
        132: TemplatesRead,
        133: TemplatesUpdate,
        134: TemplatesVersionsActivateCreate,
        135: TemplatesVersionsActivateDelete,
        136: TemplatesVersionsActivateRead,
        137: TemplatesVersionsActivateUpdate,
        138: TemplatesVersionsCreate,
        139: TemplatesVersionsDelete,
        140: TemplatesVersionsRead,
        141: TemplatesVersionsUpdate,
        142: TrackingSettingsClickRead,
        143: TrackingSettingsClickUpdate,
        144: TrackingSettingsGoogleAnalyticsRead,
        145: TrackingSettingsGoogleAnalyticsUpdate,
        146: TrackingSettingsOpenRead,
        147: TrackingSettingsOpenUpdate,
        148: TrackingSettingsRead,
        149: TrackingSettingsSubscriptionRead,
        150: TrackingSettingsSubscriptionUpdate,
        151: UserAccountRead,
        152: UserCreditsRead,
        153: UserEmailCreate,
        154: UserEmailDelete,
        155: UserEmailRead,
        156: UserEmailUpdate,
        157: UserMultifactorAuthenticationCreate,
        158: UserMultifactorAuthenticationDelete,
        159: UserMultifactorAuthenticationRead,
        160: UserMultifactorAuthenticationUpdate,
        161: UserPasswordRead,
        162: UserPasswordUpdate,
        163: UserProfileRead,
        164: UserProfileUpdate,
        165: UserScheduledSendsCreate,
        166: UserScheduledSendsDelete,
        167: UserScheduledSendsRead,
        168: UserScheduledSendsUpdate,
        169: UserSettingsEnforcedTlsRead,
        170: UserSettingsEnforcedTlsUpdate,
        171: UserTimezoneRead,
        172: UserUsernameRead,
        173: UserUsernameUpdate,
        174: UserWebhooksEventSettingsRead,
        175: UserWebhooksEventSettingsUpdate,
        176: UserWebhooksEventTestCreate,
        177: UserWebhooksEventTestRead,
        178: UserWebhooksEventTestUpdate,
        179: UserWebhooksParseSettingsCreate,
        180: UserWebhooksParseSettingsDelete,
        181: UserWebhooksParseSettingsRead,
        182: UserWebhooksParseSettingsUpdate,
        183: UserWebhooksParseStatsRead,
        184: WhitelabelCreate,
        185: WhitelabelDelete,
        186: WhitelabelRead,
        187: WhitelabelUpdate,
    }
)

// ToString converts a Permission enum to its string representation
func (p Permission) ToString() (string, error) {
    if str, ok := PermissionStrings[p]; ok {
        return str, nil
    }
    return "", errors.New("invalid permission")
}

// ToID converts a Permission enum to its ID
func (p Permission) ToID() (int, error) {
    if id, ok := PermissionIDs[p]; ok {
        return id, nil
    }
    return 0, errors.New("invalid permission")
}

// PermissionFromString converts a string representation to its Permission enum
func PermissionFromString(s string) (Permission, error) {
    if p, ok := StringToPermission[s]; ok {
        return p, nil
    }
    return 0, errors.New("invalid permission string")
}

// PermissionFromID converts an ID to its Permission enum
func PermissionFromID(id int) (Permission, error) {
    if p, ok := IdToPermission[id]; ok {
        return p, nil
    }
    return 0, errors.New("invalid permission ID")
}
