Class: Courier::Resources::Tenants::Templates::Versions
- Inherits:
-
Object
- Object
- Courier::Resources::Tenants::Templates::Versions
- 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
-
#initialize(client:) ⇒ Versions
constructor
private
A new instance of Versions.
-
#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.
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.
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.
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, = 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: ) end |