-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New resource:
dataset_outbound_share
(#54)
- Loading branch information
1 parent
f5fd2b8
commit 0106d37
Showing
9 changed files
with
947 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
client/internal/meta/operation/dataset_outbound_share.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
fragment DatasetOutboundShare on DatasetOutboundShare { | ||
id | ||
name | ||
description | ||
workspaceId | ||
folderId | ||
|
||
datasetID | ||
outboundShareID | ||
|
||
schemaName | ||
viewName | ||
freshnessGoal | ||
|
||
status { | ||
state | ||
error | ||
} | ||
} | ||
|
||
query getDatasetOutboundShare($id: ObjectId!) { | ||
# @genqlient(flatten: true) | ||
datasetOutboundShare(id: $id) { | ||
...DatasetOutboundShare | ||
} | ||
} | ||
|
||
mutation createDatasetOutboundShare( | ||
$workspaceId: ObjectId!, | ||
$datasetID: ObjectId!, | ||
$outboundShareID: ObjectId!, | ||
$input: DatasetOutboundShareInput! | ||
) { | ||
# @genqlient(flatten: true) | ||
datasetOutboundShare: createDatasetOutboundShare( | ||
workspaceId: $workspaceId, | ||
datasetID: $datasetID, | ||
outboundShareID: $outboundShareID, | ||
input: $input | ||
) { | ||
...DatasetOutboundShare | ||
} | ||
} | ||
|
||
mutation updateDatasetOutboundShare( | ||
$id: ObjectId!, | ||
$input: DatasetOutboundShareInput! | ||
) { | ||
# @genqlient(flatten: true) | ||
datasetOutboundShare: updateDatasetOutboundShare( | ||
id: $id, | ||
input: $input | ||
) { | ||
...DatasetOutboundShare | ||
} | ||
} | ||
|
||
mutation deleteDatasetOutboundShare($id: ObjectId!) { | ||
# @genqlient(flatten: true) | ||
resultStatus: deleteDatasetOutboundShare(id: $id) { | ||
...ResultStatus | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package meta | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/observeinc/terraform-provider-observe/client/oid" | ||
) | ||
|
||
type datasetOutboundShareResponse interface { | ||
GetDatasetOutboundShare() DatasetOutboundShare | ||
} | ||
|
||
func datasetOutboundShareOrError(r datasetOutboundShareResponse, err error) (*DatasetOutboundShare, error) { | ||
if err != nil { | ||
return nil, err | ||
} | ||
result := r.GetDatasetOutboundShare() | ||
return &result, nil | ||
} | ||
|
||
func (client *Client) GetDatasetOutboundShare(ctx context.Context, id string) (*DatasetOutboundShare, error) { | ||
resp, err := getDatasetOutboundShare(ctx, client.Gql, id) | ||
return datasetOutboundShareOrError(resp, err) | ||
} | ||
|
||
func (client *Client) CreateDatasetOutboundShare(ctx context.Context, workspaceId string, datasetId string, outboundShareId string, input *DatasetOutboundShareInput) (*DatasetOutboundShare, error) { | ||
resp, err := createDatasetOutboundShare(ctx, client.Gql, workspaceId, datasetId, outboundShareId, *input) | ||
return datasetOutboundShareOrError(resp, err) | ||
} | ||
|
||
func (client *Client) UpdateDatasetOutboundShare(ctx context.Context, id string, input *DatasetOutboundShareInput) (*DatasetOutboundShare, error) { | ||
resp, err := updateDatasetOutboundShare(ctx, client.Gql, id, *input) | ||
return datasetOutboundShareOrError(resp, err) | ||
} | ||
|
||
func (client *Client) DeleteDatasetOutboundShare(ctx context.Context, id string) error { | ||
resp, err := deleteDatasetOutboundShare(ctx, client.Gql, id) | ||
return resultStatusError(resp, err) | ||
} | ||
|
||
func (p *DatasetOutboundShare) Oid() *oid.OID { | ||
return &oid.OID{ | ||
Id: p.Id, | ||
Type: oid.TypeDatasetOutboundShare, | ||
} | ||
} |
Oops, something went wrong.