Class: Trycourier::Resources::Tenants
- Inherits:
-
Object
- Object
- Trycourier::Resources::Tenants
- Defined in:
- lib/trycourier/resources/tenants.rb,
lib/trycourier/resources/tenants/templates.rb,
lib/trycourier/resources/tenants/preferences.rb,
lib/trycourier/resources/tenants/preferences/items.rb
Defined Under Namespace
Classes: Preferences, Templates
Instance Attribute Summary collapse
- #preferences ⇒ Trycourier::Resources::Tenants::Preferences readonly
- #templates ⇒ Trycourier::Resources::Tenants::Templates readonly
Instance Method Summary collapse
-
#delete(tenant_id, request_options: {}) ⇒ nil
Delete a Tenant.
-
#initialize(client:) ⇒ Tenants
constructor
private
A new instance of Tenants.
-
#list(cursor: nil, limit: nil, parent_tenant_id: nil, request_options: {}) ⇒ Trycourier::Models::TenantListResponse
Some parameter documentations has been truncated, see Models::TenantListParams for more details.
-
#list_users(tenant_id, cursor: nil, limit: nil, request_options: {}) ⇒ Trycourier::Models::TenantListUsersResponse
Some parameter documentations has been truncated, see Models::TenantListUsersParams for more details.
-
#retrieve(tenant_id, request_options: {}) ⇒ Trycourier::Models::Tenant
Get a Tenant.
-
#update(tenant_id, name: , brand_id: nil, default_preferences: nil, parent_tenant_id: nil, properties: nil, user_profile: nil, request_options: {}) ⇒ Trycourier::Models::Tenant
Some parameter documentations has been truncated, see Models::TenantUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Tenants
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 Tenants.
150 151 152 153 154 |
# File 'lib/trycourier/resources/tenants.rb', line 150 def initialize(client:) @client = client @preferences = Trycourier::Resources::Tenants::Preferences.new(client: client) @templates = Trycourier::Resources::Tenants::Templates.new(client: client) end |
Instance Attribute Details
#preferences ⇒ Trycourier::Resources::Tenants::Preferences (readonly)
7 8 9 |
# File 'lib/trycourier/resources/tenants.rb', line 7 def preferences @preferences end |
#templates ⇒ Trycourier::Resources::Tenants::Templates (readonly)
10 11 12 |
# File 'lib/trycourier/resources/tenants.rb', line 10 def templates @templates end |
Instance Method Details
#delete(tenant_id, request_options: {}) ⇒ nil
Delete a Tenant
109 110 111 112 113 114 115 116 |
# File 'lib/trycourier/resources/tenants.rb', line 109 def delete(tenant_id, params = {}) @client.request( method: :delete, path: ["tenants/%1$s", tenant_id], model: NilClass, options: params[:request_options] ) end |
#list(cursor: nil, limit: nil, parent_tenant_id: nil, request_options: {}) ⇒ Trycourier::Models::TenantListResponse
Some parameter documentations has been truncated, see Models::TenantListParams for more details.
Get a List of Tenants
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/trycourier/resources/tenants.rb', line 87 def list(params = {}) parsed, = Trycourier::TenantListParams.dump_request(params) @client.request( method: :get, path: "tenants", query: parsed, model: Trycourier::Models::TenantListResponse, options: ) end |
#list_users(tenant_id, cursor: nil, limit: nil, request_options: {}) ⇒ Trycourier::Models::TenantListUsersResponse
Some parameter documentations has been truncated, see Models::TenantListUsersParams for more details.
Get Users in Tenant
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/trycourier/resources/tenants.rb', line 136 def list_users(tenant_id, params = {}) parsed, = Trycourier::TenantListUsersParams.dump_request(params) @client.request( method: :get, path: ["tenants/%1$s/users", tenant_id], query: parsed, model: Trycourier::Models::TenantListUsersResponse, options: ) end |
#retrieve(tenant_id, request_options: {}) ⇒ Trycourier::Models::Tenant
Get a Tenant
23 24 25 26 27 28 29 30 |
# File 'lib/trycourier/resources/tenants.rb', line 23 def retrieve(tenant_id, params = {}) @client.request( method: :get, path: ["tenants/%1$s", tenant_id], model: Trycourier::Tenant, options: params[:request_options] ) end |
#update(tenant_id, name: , brand_id: nil, default_preferences: nil, parent_tenant_id: nil, properties: nil, user_profile: nil, request_options: {}) ⇒ Trycourier::Models::Tenant
Some parameter documentations has been truncated, see Models::TenantUpdateParams for more details.
Create or Replace a Tenant
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/trycourier/resources/tenants.rb', line 58 def update(tenant_id, params) parsed, = Trycourier::TenantUpdateParams.dump_request(params) @client.request( method: :put, path: ["tenants/%1$s", tenant_id], body: parsed, model: Trycourier::Tenant, options: ) end |