Class: Infrawrench::LinearNamespace
- Inherits:
-
Object
- Object
- Infrawrench::LinearNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.linear
Instance Method Summary collapse
-
#delete(org_id: nil, request_options: nil) ⇒ Hash
Disconnect Linear.
-
#get(org_id: nil, request_options: nil) ⇒ Hash
Get the org's Linear connection.
-
#initialize(transport) ⇒ LinearNamespace
constructor
private
A new instance of LinearNamespace.
-
#issues(body:, org_id: nil, request_options: nil) ⇒ Hash
File a finding as a Linear issue.
-
#links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil) ⇒ Array<Hash>
Look up filed issues for a set of findings.
-
#teams(org_id: nil, request_options: nil) ⇒ Array<Hash>
List Linear teams.
-
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Connect Linear, or update the connection.
-
#verify(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Check Linear credentials.
Constructor Details
#initialize(transport) ⇒ LinearNamespace
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 LinearNamespace.
8926 8927 8928 |
# File 'lib/infrawrench/client.rb', line 8926 def initialize(transport) @transport = transport end |
Instance Method Details
#delete(org_id: nil, request_options: nil) ⇒ Hash
Disconnect Linear
Issue links already recorded are kept, so filed findings stay marked as filed.
Requires permission: linear:write.
DELETE /api/org/orgId/linear
Raises on 404: Not found
8946 8947 8948 8949 8950 8951 8952 8953 |
# File 'lib/infrawrench/client.rb', line 8946 def delete(org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/linear", path_params: { "orgId" => org_id }, request_options: ) end |
#get(org_id: nil, request_options: nil) ⇒ Hash
Get the org's Linear connection
The stored API key is never returned; keyHint stands in for it.
Requires permission: linear:read.
GET /api/org/orgId/linear
8968 8969 8970 8971 8972 8973 8974 8975 |
# File 'lib/infrawrench/client.rb', line 8968 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/linear", path_params: { "orgId" => org_id }, request_options: ) end |
#issues(body:, org_id: nil, request_options: nil) ⇒ Hash
File a finding as a Linear issue
Creates the issue via the issueCreate mutation, then records the link between it and the finding. The link is what lets a list view show "already filed" instead of offering the button again.
Requires permission: linear:write.
POST /api/org/orgId/linear/issues
Raises on 400: Bad request
Raises on 502: Linear refused to create the issue, or was unreachable
8998 8999 9000 9001 9002 9003 9004 9005 9006 |
# File 'lib/infrawrench/client.rb', line 8998 def issues(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/linear/issues", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil) ⇒ Array<Hash>
Look up filed issues for a set of findings
Requires permission: linear:read.
GET /api/org/orgId/linear/links
Raises on 400: Bad request
9026 9027 9028 9029 9030 9031 9032 9033 9034 |
# File 'lib/infrawrench/client.rb', line 9026 def links(org_id: nil, source_kind: nil, source_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/linear/links", path_params: { "orgId" => org_id }, query: { "sourceKind" => source_kind, "sourceId" => source_id }, request_options: ) end |
#teams(org_id: nil, request_options: nil) ⇒ Array<Hash>
List Linear teams
Backs the team picker, so nobody has to know a team id by hand — issueCreate requires one, and every issue belongs to exactly one team.
Requires permission: linear:read.
GET /api/org/orgId/linear/teams
Raises on 400: Bad request
9053 9054 9055 9056 9057 9058 9059 9060 |
# File 'lib/infrawrench/client.rb', line 9053 def teams(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/linear/teams", path_params: { "orgId" => org_id }, request_options: ) end |
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Connect Linear, or update the connection
Requires permission: linear:write.
PUT /api/org/orgId/linear
Raises on 400: Bad request
9077 9078 9079 9080 9081 9082 9083 9084 9085 |
# File 'lib/infrawrench/client.rb', line 9077 def update(body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/linear", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#verify(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Check Linear credentials
Runs the viewer query against the Linear GraphQL API, so a mistyped or
revoked key is reported on the settings form rather than on the first
attempt to file an issue.
Requires permission: linear:write.
POST /api/org/orgId/linear/verify
Raises on 400: Bad request
Raises on 502: Linear rejected the key or was unreachable
9108 9109 9110 9111 9112 9113 9114 9115 9116 |
# File 'lib/infrawrench/client.rb', line 9108 def verify(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/linear/verify", path_params: { "orgId" => org_id }, body: body, request_options: ) end |