Skip to content

Commit 4394479

Browse files
committed
Lint
1 parent 39533e7 commit 4394479

File tree

1 file changed

+82
-73
lines changed

1 file changed

+82
-73
lines changed

app/app_client.go

Lines changed: 82 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -726,13 +726,13 @@ func (c *AppClient) GetOrganizationNamespaceAvailability(ctx context.Context, na
726726
//
727727
// UpdateOrganization example:
728728
//
729-
// name := "tests-name"
730-
// organization, err := cloud.UpdateOrganization(
731-
// context.Background(),
732-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
733-
// &UpdateOrganizationOptions{
734-
// Name: &name,
735-
// })
729+
// name := "tests-name"
730+
// organization, err := cloud.UpdateOrganization(
731+
// context.Background(),
732+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
733+
// &UpdateOrganizationOptions{
734+
// Name: &name,
735+
// })
736736
//
737737
// For more information, see the [UpdateOrganization method docs].
738738
//
@@ -777,7 +777,7 @@ func (c *AppClient) DeleteOrganization(ctx context.Context, orgID string) error
777777
//
778778
// metadata, err := cloud.GetOrganizationMetadata(
779779
// context.Background(),
780-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
780+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
781781
//
782782
// For more information, see the [GetOrganizationMetadata method docs].
783783
//
@@ -798,7 +798,7 @@ func (c *AppClient) GetOrganizationMetadata(ctx context.Context, organizationID
798798
//
799799
// err := cloud.UpdateOrganizationMetadata(
800800
// context.Background(),
801-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
801+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
802802
// map[string]interface{}{
803803
// "key": "value",
804804
// },
@@ -897,7 +897,7 @@ func (c *AppClient) CreateOrganizationInvite(
897897
// invite, err := cloud.UpdateOrganizationInviteAuthorizations(
898898
// context.Background(),
899899
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
900-
900+
901901
// []*app.Authorization{
902902
// AuthorizationType: "role",
903903
// AuthorizationID: "location_owner",
@@ -911,6 +911,10 @@ func (c *AppClient) CreateOrganizationInvite(
911911
// For more information, see the [UpdateOrganizationInviteAuthorizations method docs].
912912
//
913913
// [UpdateOrganizationInviteAuthorizations method docs]: https://docs.viam.com/dev/reference/apis/fleet/#updateorganizationinviteauthorizations
914+
//
915+
// [UpdateOrganizationInviteAuthorizations method docs]: https://docs.viam.com/dev/reference/apis/fleet/#updateorganizationinviteauthorizations
916+
//
917+
//nolint:lll
914918
func (c *AppClient) UpdateOrganizationInviteAuthorizations(
915919
ctx context.Context, orgID, email string, addAuthorizations, removeAuthorizations []*Authorization,
916920
) (*OrganizationInvite, error) {
@@ -1092,7 +1096,7 @@ func (c *AppClient) GetBillingServiceConfig(ctx context.Context, orgID string) (
10921096
// logoData, err := os.ReadFile("logo.png")
10931097
// err := cloud.OrganizationSetLogo(
10941098
// context.Background(),
1095-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
1099+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
10961100
// logoData)
10971101
// )
10981102
//
@@ -1113,7 +1117,7 @@ func (c *AppClient) OrganizationSetLogo(ctx context.Context, orgID string, logo
11131117
//
11141118
// logoURL, err := cloud.OrganizationGetLogo(
11151119
// context.Background(),
1116-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
1120+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
11171121
// )
11181122
//
11191123
// For more information, see the [OrganizationGetLogo method docs].
@@ -1135,7 +1139,7 @@ func (c *AppClient) OrganizationGetLogo(ctx context.Context, orgID string) (stri
11351139
//
11361140
// apps, err := cloud.ListOAuthApps(
11371141
// context.Background(),
1138-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
1142+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
11391143
// )
11401144
//
11411145
// For more information, see the [ListOAuthApps method docs].
@@ -1155,14 +1159,14 @@ func (c *AppClient) ListOAuthApps(ctx context.Context, orgID string) ([]string,
11551159
//
11561160
// CreateLocation example:
11571161
//
1158-
// locationID := "ab1c2d3e45"
1159-
// err := cloud.CreateLocation(
1160-
// context.Background(),
1161-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
1162-
// "test-location",
1163-
// &app.CreateLocationOptions{
1164-
// ParentLocationID: &locationID,
1165-
// })
1162+
// locationID := "ab1c2d3e45"
1163+
// err := cloud.CreateLocation(
1164+
// context.Background(),
1165+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
1166+
// "test-location",
1167+
// &app.CreateLocationOptions{
1168+
// ParentLocationID: &locationID,
1169+
// })
11661170
//
11671171
// For more information, see the [CreateLocation method docs].
11681172
//
@@ -1206,15 +1210,15 @@ func (c *AppClient) GetLocation(ctx context.Context, locationID string) (*Locati
12061210
//
12071211
// UpdateLocation example:
12081212
//
1209-
// locationID := "ab1c2d3e45"
1210-
// name := "test-name"
1211-
// err := cloud.UpdateLocation(
1212-
// context.Background(),
1213-
// "ab1c2d3e45",
1214-
// &app.UpdateLocationOptions{
1215-
// Name: &name,
1216-
// ParentLocationID: &locationID,
1217-
// })
1213+
// locationID := "ab1c2d3e45"
1214+
// name := "test-name"
1215+
// err := cloud.UpdateLocation(
1216+
// context.Background(),
1217+
// "ab1c2d3e45",
1218+
// &app.UpdateLocationOptions{
1219+
// Name: &name,
1220+
// ParentLocationID: &locationID,
1221+
// })
12181222
//
12191223
// For more information, see the [UpdateLocation method docs].
12201224
//
@@ -1354,8 +1358,8 @@ func (c *AppClient) CreateLocationSecret(ctx context.Context, locationID string)
13541358
//
13551359
// err := cloud.DeleteLocationSecret(
13561360
// context.Background(),
1357-
// "ab1c2d3e45",
1358-
// "a12bcd3e-a12b-1234-1ab2-abc123d4e5f6")
1361+
// "ab1c2d3e45",
1362+
// "a12bcd3e-a12b-1234-1ab2-abc123d4e5f6")
13591363
// )
13601364
//
13611365
// For more information, see the [DeleteLocationSecret method docs].
@@ -1394,7 +1398,7 @@ func (c *AppClient) GetLocationMetadata(ctx context.Context, locationID string)
13941398
//
13951399
// err := cloud.UpdateLocationMetadata(
13961400
// context.Background(),
1397-
// "ab1c2d3e45",
1401+
// "ab1c2d3e45",
13981402
// map[string]interface{}{
13991403
// "key": "value",
14001404
// },
@@ -1440,7 +1444,7 @@ func (c *AppClient) GetRobot(ctx context.Context, id string) (*Robot, error) {
14401444
//
14411445
// metadata, err := cloud.GetRobotMetadata(
14421446
// context.Background(),
1443-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12")
1447+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12")
14441448
//
14451449
// For more information, see the [GetRobotMetadata method docs].
14461450
//
@@ -1461,7 +1465,7 @@ func (c *AppClient) GetRobotMetadata(ctx context.Context, robotID string) (map[s
14611465
//
14621466
// err := cloud.UpdateRobotMetadata(
14631467
// context.Background(),
1464-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1468+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
14651469
// map[string]interface{}{
14661470
// "key": "value",
14671471
// },
@@ -1546,25 +1550,25 @@ func (c *AppClient) GetRobotPart(ctx context.Context, id string) (*RobotPart, st
15461550
//
15471551
// GetRobotPartLogs example:
15481552
//
1549-
// filter := ""
1550-
// pageToken := ""
1551-
// startTime := time.Now().Add(-720 * time.Hour)
1552-
// endTime := time.Now()
1553-
// limit := 5
1554-
// source := ""
1555-
// partLogs, _, err := cloud.GetRobotPartLogs(
1556-
// ctx,
1557-
// PART_ID,
1558-
// &GetRobotPartLogsOptions{
1559-
// Filter: &filter,
1560-
// PageToken: &pageToken,
1561-
// Levels: []string{"INFO", "WARN", "ERROR"},
1562-
// Start: &startTime,
1563-
// End: &endTime,
1564-
// Limit: &limit,
1565-
// Source: &source,
1566-
// },
1567-
// )
1553+
// filter := ""
1554+
// pageToken := ""
1555+
// startTime := time.Now().Add(-720 * time.Hour)
1556+
// endTime := time.Now()
1557+
// limit := 5
1558+
// source := ""
1559+
// partLogs, _, err := cloud.GetRobotPartLogs(
1560+
// ctx,
1561+
// PART_ID,
1562+
// &GetRobotPartLogsOptions{
1563+
// Filter: &filter,
1564+
// PageToken: &pageToken,
1565+
// Levels: []string{"INFO", "WARN", "ERROR"},
1566+
// Start: &startTime,
1567+
// End: &endTime,
1568+
// Limit: &limit,
1569+
// Source: &source,
1570+
// },
1571+
// )
15681572
//
15691573
// For more information, see the [GetRobotPartLogs method docs].
15701574
//
@@ -1631,7 +1635,7 @@ func (s *RobotPartLogStream) Next() ([]*LogEntry, error) {
16311635
// TailRobotPartLogs example:
16321636
//
16331637
// logFilter := "error"
1634-
// stream, err := cloud.TailRobotPartLogs(
1638+
// stream, err := cloud.TailRobotPartLogs(
16351639
// context.Background(),
16361640
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
16371641
// true,
@@ -1703,8 +1707,8 @@ func (c *AppClient) GetRobotPartHistory(ctx context.Context, id string) ([]*Robo
17031707
//
17041708
// part, err := cloud.UpdateRobotPart(
17051709
// context.Background(),
1706-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1707-
// "part_name",
1710+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1711+
// "part_name",
17081712
// map[string]interface{}{
17091713
// "key": "value",
17101714
// },
@@ -1734,9 +1738,9 @@ func (c *AppClient) UpdateRobotPart(ctx context.Context, id, name string, robotC
17341738
// NewRobotPart example:
17351739
//
17361740
// partID, err := cloud.NewRobotPart(
1737-
// context.Background(),
1738-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1739-
// "part_name")
1741+
// context.Background(),
1742+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1743+
// "part_name")
17401744
//
17411745
// For more information, see the [NewRobotPart method docs].
17421746
//
@@ -1774,7 +1778,7 @@ func (c *AppClient) DeleteRobotPart(ctx context.Context, partID string) error {
17741778
//
17751779
// metadata, err := cloud.GetRobotPartMetadata(
17761780
// context.Background(),
1777-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12")
1781+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12")
17781782
//
17791783
// For more information, see the [GetRobotPartMetadata method docs].
17801784
//
@@ -1795,7 +1799,7 @@ func (c *AppClient) GetRobotPartMetadata(ctx context.Context, robotID string) (m
17951799
//
17961800
// err := cloud.UpdateRobotPartMetadata(
17971801
// context.Background(),
1798-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1802+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
17991803
// map[string]interface{}{
18001804
// "key": "value",
18011805
// },
@@ -1901,8 +1905,8 @@ func (c *AppClient) CreateRobotPartSecret(ctx context.Context, partID string) (*
19011905
//
19021906
// err := cloud.DeleteRobotPartSecret(
19031907
// context.Background(),
1904-
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1905-
// "a12bcd34-1234-12ab-1ab2-123a4567890b")
1908+
// "1ab2345c-a123-1ab2-1abc-1ab234567a12",
1909+
// "a12bcd34-1234-12ab-1ab2-123a4567890b")
19061910
//
19071911
// For more information, see the [DeleteRobotPartSecret method docs].
19081912
//
@@ -2203,11 +2207,11 @@ func (c *AppClient) ListMachineFragments(ctx context.Context, machineID string,
22032207
//
22042208
// GetFragmentHistory example:
22052209
//
2206-
// limit := 10
2207-
// history, token, err := cloud.GetFragmentHistory(
2208-
// context.Background(),
2209-
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
2210-
// &app.GetFragmentHistoryOptions{PageLimit: &limit})
2210+
// limit := 10
2211+
// history, token, err := cloud.GetFragmentHistory(
2212+
// context.Background(),
2213+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
2214+
// &app.GetFragmentHistoryOptions{PageLimit: &limit})
22112215
//
22122216
// For more information, see the [GetFragmentHistory method docs].
22132217
//
@@ -2369,7 +2373,11 @@ func (c *AppClient) GetRegistryItem(ctx context.Context, itemID string) (*Regist
23692373
//
23702374
// CreateRegistryItem example:
23712375
//
2372-
// err := cloud.CreateRegistryItem(context.Background(), "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2", "registry_item_name", app.PackageTypeMLModel)
2376+
// err := cloud.CreateRegistryItem(
2377+
// context.Background(),
2378+
// "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2",
2379+
// "registry_item_name",
2380+
// app.PackageTypeMLModel)
23732381
//
23742382
// For more information, see the [CreateRegistryItem method docs].
23752383
//
@@ -2494,8 +2502,8 @@ func (c *AppClient) ListRegistryItems(
24942502
return items, nil
24952503
}
24962504

2497-
// DeleteRegistryItem deletes a registry item given an ID that is formatted as `prefix:name
2498-
// where `prefix is the owner's organization ID or namespace.
2505+
// DeleteRegistryItem deletes a registry item given an ID that is formatted as `prefix:name"
2506+
// where `prefix" is the owner's organization ID or namespace.
24992507
//
25002508
// DeleteRegistryItem example:
25012509
//
@@ -2762,7 +2770,6 @@ func (c *AppClient) DeleteKey(ctx context.Context, id string) error {
27622770
return err
27632771
}
27642772

2765-
//
27662773
// ListKeys example:
27672774
//
27682775
// keys, err := cloud.ListKeys(context.Background(), "a1b2c345-abcd-1a2b-abc1-a1b23cd4561e2")
@@ -2833,6 +2840,8 @@ func (c *AppClient) RotateKey(ctx context.Context, id string) (string, string, e
28332840
// For more information, see the [CreateKeyFromExistingKeyAuthorizations method docs].
28342841
//
28352842
// [CreateKeyFromExistingKeyAuthorizations method docs]: https://docs.viam.com/dev/reference/apis/fleet/#createkeyfromexistingkeyauthorizations
2843+
//
2844+
//nolint:lll
28362845
func (c *AppClient) CreateKeyFromExistingKeyAuthorizations(ctx context.Context, id string) (string, string, error) {
28372846
resp, err := c.client.CreateKeyFromExistingKeyAuthorizations(ctx, &pb.CreateKeyFromExistingKeyAuthorizationsRequest{
28382847
Id: id,

0 commit comments

Comments
 (0)