Class TemplateControllerApi
Represents a collection of functions to interact with the API endpoints
Implements
Inherited Members
Namespace: mailslurp.Api
Assembly: mailslurp.dll
Syntax
public class TemplateControllerApi : ITemplateControllerApi, ITemplateControllerApiSync, ITemplateControllerApiAsync, IApiAccessor
Constructors
View SourceTemplateControllerApi()
Initializes a new instance of the TemplateControllerApi class.
Declaration
public TemplateControllerApi()
TemplateControllerApi(Configuration)
Initializes a new instance of the TemplateControllerApi class using Configuration object
Declaration
public TemplateControllerApi(Configuration configuration)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | An instance of Configuration |
TemplateControllerApi(ISynchronousClient, IAsynchronousClient, IReadableConfiguration)
Initializes a new instance of the TemplateControllerApi class using a Configuration object and client instance.
Declaration
public TemplateControllerApi(ISynchronousClient client, IAsynchronousClient asyncClient, IReadableConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ISynchronousClient | client | The client interface for synchronous API access. |
IAsynchronousClient | asyncClient | The client interface for asynchronous API access. |
IReadableConfiguration | configuration | The configuration object. |
TemplateControllerApi(string)
Initializes a new instance of the TemplateControllerApi class.
Declaration
public TemplateControllerApi(string basePath)
Parameters
Type | Name | Description |
---|---|---|
string | basePath |
Properties
View SourceAsynchronousClient
The client for accessing this underlying API asynchronously.
Declaration
public IAsynchronousClient AsynchronousClient { get; set; }
Property Value
Type | Description |
---|---|
IAsynchronousClient |
Client
The client for accessing this underlying API synchronously.
Declaration
public ISynchronousClient Client { get; set; }
Property Value
Type | Description |
---|---|
ISynchronousClient |
Configuration
Gets or sets the configuration object
Declaration
public IReadableConfiguration Configuration { get; set; }
Property Value
Type | Description |
---|---|
IReadableConfiguration | An instance of the Configuration |
ExceptionFactory
Provides a factory method hook for the creation of exceptions.
Declaration
public ExceptionFactory ExceptionFactory { get; set; }
Property Value
Type | Description |
---|---|
ExceptionFactory |
Methods
View SourceCreateTemplate(CreateTemplateOptions, int)
Create a Template Create an email template with variables for use with templated transactional emails.
Declaration
public TemplateDto CreateTemplate(CreateTemplateOptions createTemplateOptions, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
TemplateDto | TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
CreateTemplateAsync(CreateTemplateOptions, int, CancellationToken)
Create a Template Create an email template with variables for use with templated transactional emails.
Declaration
public Task<TemplateDto> CreateTemplateAsync(CreateTemplateOptions createTemplateOptions, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<TemplateDto> | Task of TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
CreateTemplateWithHttpInfo(CreateTemplateOptions, int)
Create a Template Create an email template with variables for use with templated transactional emails.
Declaration
public ApiResponse<TemplateDto> CreateTemplateWithHttpInfo(CreateTemplateOptions createTemplateOptions, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<TemplateDto> | ApiResponse of TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
CreateTemplateWithHttpInfoAsync(CreateTemplateOptions, int, CancellationToken)
Create a Template Create an email template with variables for use with templated transactional emails.
Declaration
public Task<ApiResponse<TemplateDto>> CreateTemplateWithHttpInfoAsync(CreateTemplateOptions createTemplateOptions, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<TemplateDto>> | Task of ApiResponse (TemplateDto) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteTemplate(Guid, int)
Delete email template Delete template
Declaration
public void DeleteTemplate(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteTemplateAsync(Guid, int, CancellationToken)
Delete email template Delete template
Declaration
public Task DeleteTemplateAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task | Task of void |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteTemplateWithHttpInfo(Guid, int)
Delete email template Delete template
Declaration
public ApiResponse<object> DeleteTemplateWithHttpInfo(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<object> | ApiResponse of Object(void) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteTemplateWithHttpInfoAsync(Guid, int, CancellationToken)
Delete email template Delete template
Declaration
public Task<ApiResponse<object>> DeleteTemplateWithHttpInfoAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<object>> | Task of ApiResponse |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAllTemplates(int?, int?, string, DateTime?, DateTime?, int)
List templates Get all templates in paginated format
Declaration
public PageTemplateProjection GetAllTemplates(int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = null, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
int? | page | Optional page index in list pagination (optional, default to 0) |
int? | size | Optional page size in list pagination (optional, default to 20) |
string | sort | Optional createdAt sort direction ASC or DESC (optional, default to ASC) |
DateTime? | since | Filter by created at after the given timestamp (optional) |
DateTime? | before | Filter by created at before the given timestamp (optional) |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
PageTemplateProjection | PageTemplateProjection |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAllTemplatesAsync(int?, int?, string, DateTime?, DateTime?, int, CancellationToken)
List templates Get all templates in paginated format
Declaration
public Task<PageTemplateProjection> GetAllTemplatesAsync(int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int? | page | Optional page index in list pagination (optional, default to 0) |
int? | size | Optional page size in list pagination (optional, default to 20) |
string | sort | Optional createdAt sort direction ASC or DESC (optional, default to ASC) |
DateTime? | since | Filter by created at after the given timestamp (optional) |
DateTime? | before | Filter by created at before the given timestamp (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<PageTemplateProjection> | Task of PageTemplateProjection |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAllTemplatesWithHttpInfo(int?, int?, string, DateTime?, DateTime?, int)
List templates Get all templates in paginated format
Declaration
public ApiResponse<PageTemplateProjection> GetAllTemplatesWithHttpInfo(int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = null, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
int? | page | Optional page index in list pagination (optional, default to 0) |
int? | size | Optional page size in list pagination (optional, default to 20) |
string | sort | Optional createdAt sort direction ASC or DESC (optional, default to ASC) |
DateTime? | since | Filter by created at after the given timestamp (optional) |
DateTime? | before | Filter by created at before the given timestamp (optional) |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<PageTemplateProjection> | ApiResponse of PageTemplateProjection |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAllTemplatesWithHttpInfoAsync(int?, int?, string, DateTime?, DateTime?, int, CancellationToken)
List templates Get all templates in paginated format
Declaration
public Task<ApiResponse<PageTemplateProjection>> GetAllTemplatesWithHttpInfoAsync(int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int? | page | Optional page index in list pagination (optional, default to 0) |
int? | size | Optional page size in list pagination (optional, default to 20) |
string | sort | Optional createdAt sort direction ASC or DESC (optional, default to ASC) |
DateTime? | since | Filter by created at after the given timestamp (optional) |
DateTime? | before | Filter by created at before the given timestamp (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<PageTemplateProjection>> | Task of ApiResponse (PageTemplateProjection) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
GetTemplate(Guid, int)
Get template Get email template
Declaration
public TemplateDto GetTemplate(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
TemplateDto | TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplateAsync(Guid, int, CancellationToken)
Get template Get email template
Declaration
public Task<TemplateDto> GetTemplateAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<TemplateDto> | Task of TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewHtml(Guid, int)
Get template preview HTML Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
Declaration
public string GetTemplatePreviewHtml(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
string | string |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewHtmlAsync(Guid, int, CancellationToken)
Get template preview HTML Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
Declaration
public Task<string> GetTemplatePreviewHtmlAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | Task of string |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewHtmlWithHttpInfo(Guid, int)
Get template preview HTML Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
Declaration
public ApiResponse<string> GetTemplatePreviewHtmlWithHttpInfo(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<string> | ApiResponse of string |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewHtmlWithHttpInfoAsync(Guid, int, CancellationToken)
Get template preview HTML Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
Declaration
public Task<ApiResponse<string>> GetTemplatePreviewHtmlWithHttpInfoAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<string>> | Task of ApiResponse (string) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewJson(Guid, int)
Get template preview Json Get email template preview with passed template variables in JSON format. Pass template variables as query params.
Declaration
public TemplatePreview GetTemplatePreviewJson(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
TemplatePreview | TemplatePreview |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewJsonAsync(Guid, int, CancellationToken)
Get template preview Json Get email template preview with passed template variables in JSON format. Pass template variables as query params.
Declaration
public Task<TemplatePreview> GetTemplatePreviewJsonAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<TemplatePreview> | Task of TemplatePreview |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewJsonWithHttpInfo(Guid, int)
Get template preview Json Get email template preview with passed template variables in JSON format. Pass template variables as query params.
Declaration
public ApiResponse<TemplatePreview> GetTemplatePreviewJsonWithHttpInfo(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<TemplatePreview> | ApiResponse of TemplatePreview |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatePreviewJsonWithHttpInfoAsync(Guid, int, CancellationToken)
Get template preview Json Get email template preview with passed template variables in JSON format. Pass template variables as query params.
Declaration
public Task<ApiResponse<TemplatePreview>> GetTemplatePreviewJsonWithHttpInfoAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<TemplatePreview>> | Task of ApiResponse (TemplatePreview) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplates(int)
List templates Get all templates
Declaration
public List<TemplateProjection> GetTemplates(int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T><TemplateProjection> | List<TemplateProjection> |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatesAsync(int, CancellationToken)
List templates Get all templates
Declaration
public Task<List<TemplateProjection>> GetTemplatesAsync(int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<System.Collections.Generic.List<T><TemplateProjection>> | Task of List<TemplateProjection> |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatesWithHttpInfo(int)
List templates Get all templates
Declaration
public ApiResponse<List<TemplateProjection>> GetTemplatesWithHttpInfo(int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<System.Collections.Generic.List<T><TemplateProjection>> | ApiResponse of List<TemplateProjection> |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplatesWithHttpInfoAsync(int, CancellationToken)
List templates Get all templates
Declaration
public Task<ApiResponse<List<TemplateProjection>>> GetTemplatesWithHttpInfoAsync(int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<System.Collections.Generic.List<T><TemplateProjection>>> | Task of ApiResponse (List<TemplateProjection>) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplateWithHttpInfo(Guid, int)
Get template Get email template
Declaration
public ApiResponse<TemplateDto> GetTemplateWithHttpInfo(Guid templateId, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<TemplateDto> | ApiResponse of TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetTemplateWithHttpInfoAsync(Guid, int, CancellationToken)
Get template Get email template
Declaration
public Task<ApiResponse<TemplateDto>> GetTemplateWithHttpInfoAsync(Guid templateId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<TemplateDto>> | Task of ApiResponse (TemplateDto) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UpdateTemplate(Guid, CreateTemplateOptions, int)
Update template Update email template
Declaration
public TemplateDto UpdateTemplate(Guid templateId, CreateTemplateOptions createTemplateOptions, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
TemplateDto | TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UpdateTemplateAsync(Guid, CreateTemplateOptions, int, CancellationToken)
Update template Update email template
Declaration
public Task<TemplateDto> UpdateTemplateAsync(Guid templateId, CreateTemplateOptions createTemplateOptions, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<TemplateDto> | Task of TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UpdateTemplateWithHttpInfo(Guid, CreateTemplateOptions, int)
Update template Update email template
Declaration
public ApiResponse<TemplateDto> UpdateTemplateWithHttpInfo(Guid templateId, CreateTemplateOptions createTemplateOptions, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<TemplateDto> | ApiResponse of TemplateDto |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UpdateTemplateWithHttpInfoAsync(Guid, CreateTemplateOptions, int, CancellationToken)
Update template Update email template
Declaration
public Task<ApiResponse<TemplateDto>> UpdateTemplateWithHttpInfoAsync(Guid templateId, CreateTemplateOptions createTemplateOptions, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | templateId | Template ID |
CreateTemplateOptions | createTemplateOptions | |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<TemplateDto>> | Task of ApiResponse (TemplateDto) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |