diff --git a/courier/email_templates.go b/courier/email_templates.go index e82858636869..c175cf25f8ae 100644 --- a/courier/email_templates.go +++ b/courier/email_templates.go @@ -12,8 +12,6 @@ import ( ) type ( - TemplateType string - EmailTemplate interface { json.Marshaler EmailSubject(context.Context) (string, error) @@ -23,6 +21,11 @@ type ( } ) +// A Template's type +// +// swagger:enum TemplateType +type TemplateType string + const ( TypeRecoveryInvalid TemplateType = "recovery_invalid" TypeRecoveryValid TemplateType = "recovery_valid" diff --git a/internal/httpclient/api/openapi.yaml b/internal/httpclient/api/openapi.yaml index 49a66cad1008..5110a579adfb 100644 --- a/internal/httpclient/api/openapi.yaml +++ b/internal/httpclient/api/openapi.yaml @@ -3649,8 +3649,6 @@ components: title: RecoveryAddressType must not exceed 16 characters as that is the limitation in the SQL Schema. type: string - TemplateType: - type: string Time: format: date-time type: string @@ -4297,7 +4295,7 @@ components: recipient: recipient created_at: 2000-01-23T04:56:07.000+00:00 send_count: 0 - template_type: template_type + template_type: recovery_invalid id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 body: body properties: @@ -4320,7 +4318,25 @@ components: subject: type: string template_type: + enum: + - recovery_invalid + - recovery_valid + - recovery_code_invalid + - recovery_code_valid + - verification_invalid + - verification_valid + - otp + - stub type: string + x-go-enum-desc: |- + recovery_invalid TypeRecoveryInvalid + recovery_valid TypeRecoveryValid + recovery_code_invalid TypeRecoveryCodeInvalid + recovery_code_valid TypeRecoveryCodeValid + verification_invalid TypeVerificationInvalid + verification_valid TypeVerificationValid + otp TypeOTP + stub TypeTestStub type: $ref: '#/components/schemas/courierMessageType' updated_at: diff --git a/spec/api.json b/spec/api.json index f4a859096a4f..5a8c6af24b40 100755 --- a/spec/api.json +++ b/spec/api.json @@ -330,9 +330,6 @@ "title": "RecoveryAddressType must not exceed 16 characters as that is the limitation in the SQL Schema.", "type": "string" }, - "TemplateType": { - "type": "string" - }, "Time": { "format": "date-time", "type": "string" @@ -940,7 +937,18 @@ "type": "string" }, "template_type": { - "$ref": "#/components/schemas/TemplateType" + "enum": [ + "recovery_invalid", + "recovery_valid", + "recovery_code_invalid", + "recovery_code_valid", + "verification_invalid", + "verification_valid", + "otp", + "stub" + ], + "type": "string", + "x-go-enum-desc": "recovery_invalid TypeRecoveryInvalid\nrecovery_valid TypeRecoveryValid\nrecovery_code_invalid TypeRecoveryCodeInvalid\nrecovery_code_valid TypeRecoveryCodeValid\nverification_invalid TypeVerificationInvalid\nverification_valid TypeVerificationValid\notp TypeOTP\nstub TypeTestStub" }, "type": { "$ref": "#/components/schemas/courierMessageType" diff --git a/spec/swagger.json b/spec/swagger.json index 966f7db95cf1..e7d73c38305c 100755 --- a/spec/swagger.json +++ b/spec/swagger.json @@ -3059,9 +3059,6 @@ "type": "string", "title": "RecoveryAddressType must not exceed 16 characters as that is the limitation in the SQL Schema." }, - "TemplateType": { - "type": "string" - }, "UUID": {"type": "string", "format": "uuid4"}, "adminCreateIdentityBody": { "type": "object", @@ -3641,7 +3638,18 @@ "type": "string" }, "template_type": { - "$ref": "#/definitions/TemplateType" + "type": "string", + "enum": [ + "recovery_invalid", + "recovery_valid", + "recovery_code_invalid", + "recovery_code_valid", + "verification_invalid", + "verification_valid", + "otp", + "stub" + ], + "x-go-enum-desc": "recovery_invalid TypeRecoveryInvalid\nrecovery_valid TypeRecoveryValid\nrecovery_code_invalid TypeRecoveryCodeInvalid\nrecovery_code_valid TypeRecoveryCodeValid\nverification_invalid TypeVerificationInvalid\nverification_valid TypeVerificationValid\notp TypeOTP\nstub TypeTestStub" }, "type": { "$ref": "#/definitions/courierMessageType"