Class: Courier::Resources::Tenants::Templates::Versions

Inherits:
Object
  • Object
show all
Defined in:
lib/courier/resources/tenants/templates/versions.rb,
sig/courier/resources/tenants/templates/versions.rbs

Overview

Manage the templates and template versions scoped to a single tenant, including the ones authored in the embedded designer.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Versions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Versions.

Parameters:



50
51
52
# File 'lib/courier/resources/tenants/templates/versions.rb', line 50

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(version, tenant_id:, template_id:, request_options: {}) ⇒ Courier::Models::BaseTemplateTenantAssociation

Some parameter documentations has been truncated, see Models::Tenants::Templates::VersionRetrieveParams for more details.

Returns one version of a tenant template, addressed by version number or by latest, with its content and publish timestamp.

Parameters:

  • version (String)

    Version of the template to retrieve. Accepts "latest", "published", or a specifi

  • tenant_id (String)

    Id of the tenant for which to retrieve the template.

  • template_id (String)

    Id of the template to be retrieved.

  • request_options (Courier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/courier/resources/tenants/templates/versions.rb', line 29

def retrieve(version, params)
  parsed, options = Courier::Tenants::Templates::VersionRetrieveParams.dump_request(params)
  tenant_id =
    parsed.delete(:tenant_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  template_id =
    parsed.delete(:template_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["tenants/%1$s/templates/%2$s/versions/%3$s", tenant_id, template_id, version],
    model: Courier::BaseTemplateTenantAssociation,
    options: options
  )
end