Skip to content

Commit

Permalink
New resource: snowflake_share_outbound (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker authored Oct 19, 2023
1 parent 5fdfba4 commit f5fd2b8
Show file tree
Hide file tree
Showing 9 changed files with 849 additions and 0 deletions.
31 changes: 31 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1232,3 +1232,34 @@ func (c *Client) DeleteFiledrop(ctx context.Context, id string) error {
func (c *Client) GetFiledrop(ctx context.Context, id string) (*meta.Filedrop, error) {
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) CreateSnowflakeShareOutbound(ctx context.Context, workspaceId string, input *meta.SnowflakeShareOutboundInput) (*meta.SnowflakeShareOutbound, error) {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}

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

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

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

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

return c.Meta.DeleteSnowflakeShareOutbound(ctx, id)
}
55 changes: 55 additions & 0 deletions client/internal/meta/operation/snowflakeshareoutbound.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
fragment SnowflakeShareOutbound on SnowflakeShareOutbound {
id
name
description
workspaceId

shareName

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

fragment SnowflakeAccount on SnowflakeAccount {
organization
account
}

query getSnowflakeShareOutbound($id: ObjectId!) {
# @genqlient(flatten: true)
share: snowflakeShareOutbound(id: $id) {
...SnowflakeShareOutbound
}
}

query lookupSnowflakeShareOutbound($name: String!, $workspaceId: ObjectId!) {
shares: searchSnowflakeShareOutbound(nameExact: $name, workspaceId: $workspaceId) {
# @genqlient(flatten: true)
results {
...SnowflakeShareOutbound
}
}
}

mutation createSnowflakeShareOutbound($workspaceId: ObjectId!, $input: SnowflakeShareOutboundInput!) {
# @genqlient(flatten: true)
share: createSnowflakeShareOutbound(workspaceId: $workspaceId, input: $input) {
...SnowflakeShareOutbound
}
}

mutation updateSnowflakeShareOutbound($id: ObjectId!, $input: SnowflakeShareOutboundInput!) {
# @genqlient(flatten: true)
share: updateSnowflakeShareOutbound(id: $id, input: $input) {
...SnowflakeShareOutbound
}
}

mutation deleteSnowflakeShareOutbound($id: ObjectId!) {
# @genqlient(flatten: true)
resultStatus: deleteSnowflakeShareOutbound(id: $id) {
...ResultStatus
}
}
Loading

0 comments on commit f5fd2b8

Please sign in to comment.