Skip to content

Commit

Permalink
Merge pull request #43 from theapsgroup/issue/42
Browse files Browse the repository at this point in the history
* fixes issue with null values in department_ids on freshservice_requester table.
* updates steampipe-plugin-sdk
  • Loading branch information
graza-io authored Feb 14, 2023
2 parents a726dad + 1b215f4 commit c35d692
Show file tree
Hide file tree
Showing 45 changed files with 267 additions and 208 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v0.0.3 [2023-02-14]

_Enhancements_

- Recompiled with steampipe-plugin-sdk v5.1.2

_Bug fixes_

- Fixed issue where `department_ids` column on `freshservice_requester` table was erroneously returning null [#42](https://github.com/theapsgroup/steampipe-plugin-freshservice/issues/42)

## v0.0.2 [2022-10-07]

_Enhancements_
Expand Down
4 changes: 2 additions & 2 deletions freshservice/connection_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package freshservice

import (
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/schema"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/schema"
)

type PluginConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions freshservice/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package freshservice

import (
"context"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func Plugin(ctx context.Context) *plugin.Plugin {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableAgent() *plugin.Table {
Expand Down Expand Up @@ -165,7 +165,7 @@ func agentColumns() []*plugin.Column {

// Hydrate Functions
func getAgent(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down Expand Up @@ -204,7 +204,7 @@ func listAgents(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData)
}
}

q := d.KeyColumnQuals
q := d.EqualsQuals

if q["email"] != nil {
e := q["email"].GetStringValue()
Expand Down
6 changes: 3 additions & 3 deletions freshservice/table_agent_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableAgentRole() *plugin.Table {
Expand Down Expand Up @@ -59,7 +59,7 @@ func agentRoleColumns() []*plugin.Column {
}

func getAgentRole(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_announcement.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableAnnouncement() *plugin.Table {
Expand Down Expand Up @@ -116,7 +116,7 @@ func announcementColumns() []*plugin.Column {

// Hydrate Functions
func getAnnouncement(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down Expand Up @@ -154,7 +154,7 @@ func listAnnouncements(ctx context.Context, d *plugin.QueryData, h *plugin.Hydra
}
}

q := d.KeyColumnQuals
q := d.EqualsQuals
if q["state"] != nil {
filter.State = q["state"].GetStringValue()
}
Expand Down
6 changes: 3 additions & 3 deletions freshservice/table_asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableAsset() *plugin.Table {
Expand Down Expand Up @@ -115,7 +115,7 @@ func assetColumns() []*plugin.Column {

// Hydrate Functions
func getAsset(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["display_id"].GetInt64Value())
id := int(d.EqualsQuals["display_id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_asset_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package freshservice
import (
"context"
"fmt"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableAssetComponent() *plugin.Table {
Expand Down Expand Up @@ -58,7 +58,7 @@ func assetComponentColumns() []*plugin.Column {

// Hydrate Functions
func listAssetComponents(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
q := d.KeyColumnQuals
q := d.EqualsQuals
displayId := int(q["asset_display_id"].GetInt64Value())

if displayId == 0 {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_asset_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package freshservice
import (
"context"
"fmt"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableAssetContract() *plugin.Table {
Expand Down Expand Up @@ -58,7 +58,7 @@ func assetContractColumns() []*plugin.Column {

// Hydrate Functions
func listAssetContracts(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
q := d.KeyColumnQuals
q := d.EqualsQuals
displayId := int(q["asset_display_id"].GetInt64Value())

if displayId == 0 {
Expand Down
6 changes: 3 additions & 3 deletions freshservice/table_asset_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableAssetType() *plugin.Table {
Expand Down Expand Up @@ -65,7 +65,7 @@ func assetTypeColumns() []*plugin.Column {

// Hydrate Functions
func getAssetType(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions freshservice/table_business_hour.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableBusinessHour() *plugin.Table {
Expand Down Expand Up @@ -75,7 +75,7 @@ func businessHoursColumns() []*plugin.Column {

// Hydrate Functions
func getBusinessHours(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions freshservice/table_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableChange() *plugin.Table {
Expand Down Expand Up @@ -172,7 +172,7 @@ func changeColumns() []*plugin.Column {

// Hydrate Functions
func getChange(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand All @@ -196,7 +196,7 @@ func listChanges(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData
return nil, fmt.Errorf("unable to create FreshService client: %v", err)
}

q := d.KeyColumnQuals
q := d.EqualsQuals
filter := fs.ListChangesOptions{
ListOptions: fs.ListOptions{
Page: 1,
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_change_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package freshservice
import (
"context"
"fmt"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableChangeNote() *plugin.Table {
Expand Down Expand Up @@ -73,7 +73,7 @@ func changeNoteColumns() []*plugin.Column {

// Hydrate Functions
func listChangeNotes(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
changeId := int(d.KeyColumnQuals["change_id"].GetInt64Value())
changeId := int(d.EqualsQuals["change_id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions freshservice/table_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableContract() *plugin.Table {
Expand Down Expand Up @@ -138,7 +138,7 @@ func contractColumns() []*plugin.Column {

// Hydrate Functions
func getContract(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["display_id"].GetInt64Value())
id := int(d.EqualsQuals["display_id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions freshservice/table_contract_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package freshservice
import (
"context"
"fmt"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableContractType() *plugin.Table {
Expand Down
6 changes: 3 additions & 3 deletions freshservice/table_department.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)

func tableDepartment() *plugin.Table {
Expand Down Expand Up @@ -70,7 +70,7 @@ func departmentColumns() []*plugin.Column {

// Hydrate Functions
func getDepartment(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableLocation() *plugin.Table {
Expand Down Expand Up @@ -97,7 +97,7 @@ func locationColumns() []*plugin.Column {

// Hydrate Functions
func getLocation(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_problem.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"
fs "github.com/theapsgroup/go-freshservice/freshservice"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableProblem() *plugin.Table {
Expand Down Expand Up @@ -162,7 +162,7 @@ func problemColumns() []*plugin.Column {

// Hydrate Functions
func getProblem(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
id := int(d.KeyColumnQuals["id"].GetInt64Value())
id := int(d.EqualsQuals["id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions freshservice/table_problem_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package freshservice
import (
"context"
"fmt"
"github.com/turbot/steampipe-plugin-sdk/v4/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin"
"github.com/turbot/steampipe-plugin-sdk/v4/plugin/transform"
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
)

func tableProblemNote() *plugin.Table {
Expand Down Expand Up @@ -73,7 +73,7 @@ func problemNoteColumns() []*plugin.Column {

// Hydrate Functions
func listProblemNotes(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
problemId := int(d.KeyColumnQuals["problem_id"].GetInt64Value())
problemId := int(d.EqualsQuals["problem_id"].GetInt64Value())

client, err := connect(ctx, d)
if err != nil {
Expand Down
Loading

0 comments on commit c35d692

Please sign in to comment.