| 1 | // # Copyright (C) 2025 Francois Marier |
| 2 | // |
| 3 | // Email-Reminder is free software; you can redistribute it and/or |
| 4 | // modify it under the terms of the GNU General Public License as |
| 5 | // published by the Free Software Foundation; either version 3 of the |
| 6 | // License, or (at your option) any later version. |
| 7 | // |
| 8 | // Email-Reminder is distributed in the hope that it will be useful, |
| 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | // General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with Email-Reminder; if not, write to the Free Software |
| 15 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 16 | // 02110-1301, USA. |
| 17 | package eventsscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ |
| 18 | |
| 19 | import ( |
| 20 | "encoding/xmlscip-go gomod github.com/golang/go/src go1.25.0 `encoding/xml`/" |
| 21 | "stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/" |
| 22 | ) |
| 23 | |
| 24 | type ReminderTypescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType# string |
| 25 | |
| 26 | const ( |
| 27 | ReminderTypeSameDayscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderTypeSameDay. ReminderTypescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType# = "same day" |
| 28 | ReminderTypeDaysBeforescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderTypeDaysBefore. ReminderTypescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType# = "days before" |
| 29 | ) |
| 30 | |
| 31 | func (rt *ReminderTypescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType#) UnmarshalTextscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType#UnmarshalText().(text []byte) error { |
| 32 | v := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.TrimSpacescip-go gomod github.com/golang/go/src go1.25.0 strings/TrimSpace().(stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.ToLowerscip-go gomod github.com/golang/go/src go1.25.0 strings/ToLower().(string(text))) |
| 33 | switch v { |
| 34 | case string(ReminderTypeSameDayscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderTypeSameDay.): |
| 35 | *rt = ReminderTypeSameDayscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderTypeSameDay. |
| 36 | case string(ReminderTypeDaysBeforescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderTypeDaysBefore.): |
| 37 | *rt = ReminderTypeDaysBeforescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderTypeDaysBefore. |
| 38 | default: |
| 39 | *rt = ReminderTypescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType#(v) |
| 40 | } |
| 41 | return nil |
| 42 | } |
| 43 | |
| 44 | type Reminderscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/Reminder# struct { |
| 45 | XMLNamescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/Reminder#XMLName. xmlscip-go gomod github.com/golang/go/src go1.25.0 `encoding/xml`/.Namescip-go gomod github.com/golang/go/src go1.25.0 `encoding/xml`/Name# `xml:"reminder"` |
| 46 | Typescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/Reminder#Type. ReminderTypescip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/ReminderType# `xml:"type,attr"` |
| 47 | Daysscip-go gomod launchpad.net/email-reminder . `launchpad.net/email-reminder/internal/events`/Reminder#Days. int `xml:",chardata"` |
| 48 | } |