Class: Trycourier::Resources::Tenants::Templates
- Inherits:
-
Object
- Object
- Trycourier::Resources::Tenants::Templates
- Defined in:
- lib/trycourier/resources/tenants/templates.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Templates
constructor
private
A new instance of Templates.
-
#list(tenant_id, cursor: nil, limit: nil, request_options: {}) ⇒ Trycourier::Models::Tenants::TemplateListResponse
List Templates in Tenant.
-
#retrieve(template_id, tenant_id: , request_options: {}) ⇒ Trycourier::Models::BaseTemplateTenantAssociation
Get a Template in Tenant.
Constructor Details
#initialize(client:) ⇒ Templates
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 Templates.
63 64 65 |
# File 'lib/trycourier/resources/tenants/templates.rb', line 63 def initialize(client:) @client = client end |
Instance Method Details
#list(tenant_id, cursor: nil, limit: nil, request_options: {}) ⇒ Trycourier::Models::Tenants::TemplateListResponse
List Templates in Tenant
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/trycourier/resources/tenants/templates.rb', line 49 def list(tenant_id, params = {}) parsed, = Trycourier::Tenants::TemplateListParams.dump_request(params) @client.request( method: :get, path: ["tenants/%1$s/templates", tenant_id], query: parsed, model: Trycourier::Models::Tenants::TemplateListResponse, options: ) end |
#retrieve(template_id, tenant_id: , request_options: {}) ⇒ Trycourier::Models::BaseTemplateTenantAssociation
Get a Template in Tenant
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/trycourier/resources/tenants/templates.rb', line 20 def retrieve(template_id, params) parsed, = Trycourier::Tenants::TemplateRetrieveParams.dump_request(params) tenant_id = parsed.delete(:tenant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["tenants/%1$s/templates/%2$s", tenant_id, template_id], model: Trycourier::BaseTemplateTenantAssociation, options: ) end |