Class: Infrawrench::TeamRolesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::TeamRolesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.team.roles
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a custom role.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a custom role (must have no members or pending invitations).
-
#initialize(transport) ⇒ TeamRolesNamespace
constructor
private
A new instance of TeamRolesNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List roles (system + custom).
-
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Edit a custom role.
Constructor Details
#initialize(transport) ⇒ TeamRolesNamespace
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 TeamRolesNamespace.
4344 4345 4346 |
# File 'lib/infrawrench/client.rb', line 4344 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a custom role
Requires permission: team:role:write.
POST /api/org/orgId/team/roles
4360 4361 4362 4363 4364 4365 4366 4367 4368 |
# File 'lib/infrawrench/client.rb', line 4360 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/team/roles", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a custom role (must have no members or pending invitations)
Requires permission: team:role:write.
DELETE /api/org/orgId/team/roles/id
Raises on 404: Not found
Raises on 409: Conflict
Raises on 422: Bad request
4388 4389 4390 4391 4392 4393 4394 4395 |
# File 'lib/infrawrench/client.rb', line 4388 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/team/roles/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List roles (system + custom)
Requires permission: team:read.
GET /api/org/orgId/team/roles
4409 4410 4411 4412 4413 4414 4415 4416 |
# File 'lib/infrawrench/client.rb', line 4409 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/team/roles", path_params: { "orgId" => org_id }, request_options: ) end |
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Edit a custom role
Requires permission: team:role:write.
PATCH /api/org/orgId/team/roles/id
Raises on 404: Not found
Raises on 422: Bad request
4435 4436 4437 4438 4439 4440 4441 4442 4443 |
# File 'lib/infrawrench/client.rb', line 4435 def update(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/org/{orgId}/team/roles/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |