Class: Courier::Resources::Tenants::Templates::Versions
- Inherits:
-
Object
- Object
- Courier::Resources::Tenants::Templates::Versions
- Defined in:
- lib/courier/resources/tenants/templates/versions.rb
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.
53 54 55 |
# File 'lib/courier/resources/tenants/templates/versions.rb', line 53 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.
Fetches a specific version of a tenant template.
Supports the following version formats:
-
‘latest` - The most recent version of the template
-
‘published` - The currently published version
-
‘vversion` - A specific version (e.g., “v1”, “v2”, “v1.0.0”)
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/courier/resources/tenants/templates/versions.rb', line 32 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 |