Skip to content

Commit

Permalink
Rename snowflake_share_outbound to snowflake_outbound_share (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker authored Oct 26, 2023
1 parent d90d87f commit 5fda698
Show file tree
Hide file tree
Showing 15 changed files with 315 additions and 314 deletions.
16 changes: 8 additions & 8 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,35 +1233,35 @@ func (c *Client) GetFiledrop(ctx context.Context, id string) (*meta.Filedrop, er
return c.Meta.GetFiledrop(ctx, id)
}

func (c *Client) GetSnowflakeShareOutbound(ctx context.Context, id string) (*meta.SnowflakeShareOutbound, error) {
return c.Meta.GetSnowflakeShareOutbound(ctx, id)
func (c *Client) GetSnowflakeOutboundShare(ctx context.Context, id string) (*meta.SnowflakeOutboundShare, error) {
return c.Meta.GetSnowflakeOutboundShare(ctx, id)
}

func (c *Client) CreateSnowflakeShareOutbound(ctx context.Context, workspaceId string, input *meta.SnowflakeShareOutboundInput) (*meta.SnowflakeShareOutbound, error) {
func (c *Client) CreateSnowflakeOutboundShare(ctx context.Context, workspaceId string, input *meta.SnowflakeOutboundShareInput) (*meta.SnowflakeOutboundShare, error) {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}

return c.Meta.CreateSnowflakeShareOutbound(ctx, workspaceId, input)
return c.Meta.CreateSnowflakeOutboundShare(ctx, workspaceId, input)
}

func (c *Client) UpdateSnowflakeShareOutbound(ctx context.Context, id string, input *meta.SnowflakeShareOutboundInput) (*meta.SnowflakeShareOutbound, error) {
func (c *Client) UpdateSnowflakeOutboundShare(ctx context.Context, id string, input *meta.SnowflakeOutboundShareInput) (*meta.SnowflakeOutboundShare, error) {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}

return c.Meta.UpdateSnowflakeShareOutbound(ctx, id, input)
return c.Meta.UpdateSnowflakeOutboundShare(ctx, id, input)
}

func (c *Client) DeleteSnowflakeShareOutbound(ctx context.Context, id string) error {
func (c *Client) DeleteSnowflakeOutboundShare(ctx context.Context, id string) error {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}

return c.Meta.DeleteSnowflakeShareOutbound(ctx, id)
return c.Meta.DeleteSnowflakeOutboundShare(ctx, id)
}

func (c *Client) GetDatasetOutboundShare(ctx context.Context, id string) (*meta.DatasetOutboundShare, error) {
Expand Down
55 changes: 55 additions & 0 deletions client/internal/meta/operation/snowflakeoutboundshare.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
fragment SnowflakeOutboundShare on SnowflakeOutboundShare {
id
name
description
workspaceId

shareName

# @genqlient(flatten: true)
accounts {
...SnowflakeAccount
}
}

fragment SnowflakeAccount on SnowflakeAccount {
organization
account
}

query getSnowflakeOutboundShare($id: ObjectId!) {
# @genqlient(flatten: true)
share: snowflakeOutboundShare(id: $id) {
...SnowflakeOutboundShare
}
}

query lookupSnowflakeOutboundShare($name: String!, $workspaceId: ObjectId!) {
shares: searchSnowflakeOutboundShare(nameExact: $name, workspaceId: $workspaceId) {
# @genqlient(flatten: true)
results {
...SnowflakeOutboundShare
}
}
}

mutation createSnowflakeOutboundShare($workspaceId: ObjectId!, $input: SnowflakeOutboundShareInput!) {
# @genqlient(flatten: true)
share: createSnowflakeOutboundShare(workspaceId: $workspaceId, input: $input) {
...SnowflakeOutboundShare
}
}

mutation updateSnowflakeOutboundShare($id: ObjectId!, $input: SnowflakeOutboundShareInput!) {
# @genqlient(flatten: true)
share: updateSnowflakeOutboundShare(id: $id, input: $input) {
...SnowflakeOutboundShare
}
}

mutation deleteSnowflakeOutboundShare($id: ObjectId!) {
# @genqlient(flatten: true)
resultStatus: deleteSnowflakeOutboundShare(id: $id) {
...ResultStatus
}
}
55 changes: 0 additions & 55 deletions client/internal/meta/operation/snowflakeshareoutbound.graphql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# this file is auto-generated, do not edit
extend type Query {
snowflakeShareOutbound(id: ObjectId!): SnowflakeShareOutbound!
searchSnowflakeShareOutbound(workspaceId: ObjectId, folderId: ObjectId, nameExact: String, nameSubstring: String): SnowflakeShareOutboundSearchResult!
snowflakeOutboundShare(id: ObjectId!): SnowflakeOutboundShare!
searchSnowflakeOutboundShare(workspaceId: ObjectId, folderId: ObjectId, nameExact: String, nameSubstring: String): SnowflakeOutboundShareSearchResult!
}

extend type Mutation {
createSnowflakeShareOutbound(workspaceId: ObjectId!, input: SnowflakeShareOutboundInput!): SnowflakeShareOutbound!
updateSnowflakeShareOutbound(id: ObjectId!, input: SnowflakeShareOutboundInput!): SnowflakeShareOutbound!
deleteSnowflakeShareOutbound(id: ObjectId!): ResultStatus!
createSnowflakeOutboundShare(workspaceId: ObjectId!, input: SnowflakeOutboundShareInput!): SnowflakeOutboundShare!
updateSnowflakeOutboundShare(id: ObjectId!, input: SnowflakeOutboundShareInput!): SnowflakeOutboundShare!
deleteSnowflakeOutboundShare(id: ObjectId!): ResultStatus!
}

type SnowflakeShareOutbound implements WorkspaceObject & AuditedObject & FolderObject @goModel(model: "observe/meta/metatypes.SnowflakeShareOutbound") {
# Represents a Snowflake share from Observe to a customer-managed Snowflake account. All share mutations require the Manager role rather than the typical Editor role. By default, only administrators have this access for all workspace objects. However, administrators can grant other users access to sharing mutations via RBAC.
type SnowflakeOutboundShare implements WorkspaceObject & AuditedObject & FolderObject @goModel(model: "observe/meta/metatypes.SnowflakeOutboundShare") {
# payload
"""
The fully qualified name of the Snowflake share, for use in a consumer account.
Expand Down Expand Up @@ -48,7 +49,7 @@ type SnowflakeShareOutbound implements WorkspaceObject & AuditedObject & FolderO
updatedByInfo: UserInfo! @goField(forceResolver: true)
}

input SnowflakeShareOutboundInput @goModel(model: "observe/meta/metatypes.SnowflakeShareOutboundInput") {
input SnowflakeOutboundShareInput @goModel(model: "observe/meta/metatypes.SnowflakeOutboundShareInput") {
# payload
# not in input: shareName: String!
accounts: [SnowflakeAccountInput!]!
Expand All @@ -69,8 +70,8 @@ input SnowflakeShareOutboundInput @goModel(model: "observe/meta/metatypes.Snowfl
folderId: ObjectId
}

type SnowflakeShareOutboundSearchResult @goModel(model: "observe/meta/metatypes.SnowflakeShareOutboundSearchResult") {
results: [SnowflakeShareOutbound!]!
type SnowflakeOutboundShareSearchResult @goModel(model: "observe/meta/metatypes.SnowflakeOutboundShareSearchResult") {
results: [SnowflakeOutboundShare!]!
}
type SnowflakeAccount @goModel(model: "observe/meta/metatypes.SnowflakeAccount") {
# payload
Expand Down
Loading

0 comments on commit 5fda698

Please sign in to comment.