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.
6468 6469 6470 |
# File 'lib/infrawrench/client.rb', line 6468 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
6484 6485 6486 6487 6488 6489 6490 6491 6492 |
# File 'lib/infrawrench/client.rb', line 6484 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
6512 6513 6514 6515 6516 6517 6518 6519 |
# File 'lib/infrawrench/client.rb', line 6512 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
6533 6534 6535 6536 6537 6538 6539 6540 |
# File 'lib/infrawrench/client.rb', line 6533 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
6559 6560 6561 6562 6563 6564 6565 6566 6567 |
# File 'lib/infrawrench/client.rb', line 6559 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 |