TemplateControllerAPI

All URIs are relative to https://api.mailslurp.com

MethodHTTP requestDescription
createTemplatePOST /templatesCreate a Template
deleteTemplateDELETE /templates/{templateId}Delete Template
getAllTemplatesGET /templates/paginatedGet all Templates in paginated format
getTemplateGET /templates/{templateId}Get Template
getTemplatesGET /templatesGet all Templates
updateTemplatePUT /templates/{templateId}Update a Template

createTemplate

    open class func createTemplate( createTemplateOptions: CreateTemplateOptions) -> Promise<TemplateDto>

Create a Template

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let createTemplateOptions = CreateTemplateOptions(name: "name_example", content: "content_example") // CreateTemplateOptions | createTemplateOptions

// Create a Template
TemplateControllerAPI.createTemplate(createTemplateOptions: createTemplateOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
createTemplateOptionsCreateTemplateOptionscreateTemplateOptions

Return type

TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

deleteTemplate

    open class func deleteTemplate( templateId: UUID) -> Promise<Void>

Delete Template

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let templateId = 987 // UUID | templateId

// Delete Template
TemplateControllerAPI.deleteTemplate(templateId: templateId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
templateIdUUIDtemplateId

Return type

Void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getAllTemplates

    open class func getAllTemplates( before: Date? = nil,  page: Int? = nil,  since: Date? = nil,  size: Int? = nil,  sort: Sort_getAllTemplates? = nil) -> Promise<PageTemplateProjection>

Get all Templates in paginated format

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let before = Date() // Date | Filter by created at before the given timestamp (optional)
let page = 987 // Int | Optional page  in list pagination (optional) (default to 0)
let since = Date() // Date | Filter by created at after the given timestamp (optional)
let size = 987 // Int | Optional page size in list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)

// Get all Templates in paginated format
TemplateControllerAPI.getAllTemplates(before: before, page: page, since: since, size: size, sort: sort).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
beforeDateFilter by created at before the given timestamp[optional]
pageIntOptional page in list pagination[optional] [default to 0]
sinceDateFilter by created at after the given timestamp[optional]
sizeIntOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to .asc]

Return type

PageTemplateProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getTemplate

    open class func getTemplate( templateId: UUID) -> Promise<TemplateDto>

Get Template

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let templateId = 987 // UUID | templateId

// Get Template
TemplateControllerAPI.getTemplate(templateId: templateId).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
templateIdUUIDtemplateId

Return type

TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

getTemplates

    open class func getTemplates() -> Promise<[TemplateProjection]>

Get all Templates

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp


// Get all Templates
TemplateControllerAPI.getTemplates().then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

This endpoint does not need any parameter.

Return type

**[TemplateProjection]**

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]

updateTemplate

    open class func updateTemplate( templateId: UUID,  createTemplateOptions: CreateTemplateOptions) -> Promise<TemplateDto>

Update a Template

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp

let templateId = 987 // UUID | templateId
let createTemplateOptions = CreateTemplateOptions(name: "name_example", content: "content_example") // CreateTemplateOptions | createTemplateOptions

// Update a Template
TemplateControllerAPI.updateTemplate(templateId: templateId, createTemplateOptions: createTemplateOptions).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

NameTypeDescriptionNotes
templateIdUUIDtemplateId
createTemplateOptionsCreateTemplateOptionscreateTemplateOptions

Return type

TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to ]