Skip to content

Commit

Permalink
Revert "add support for azure resources integration (#430)" (#431)
Browse files Browse the repository at this point in the history
This reverts commit b70c0a0.
  • Loading branch information
Taimoor Ahmad authored Jul 9, 2024
1 parent b70c0a0 commit 0a0e2c7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 145 deletions.
3 changes: 0 additions & 3 deletions .changes/unreleased/Feature-20240705-152434.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestCache(t *testing.T) {
`{"data":{"account":{ "filters":{ "nodes":[{{ template "filter_1" }}] } }}}`,
)
testRequestSeven := autopilot.NewTestRequest(
`query IntegrationList($after:String!$first:Int!){account{integrations(after: $after, first: $first){nodes{id,name,type,createdAt,installedAt,... on AwsIntegration{iamRole,externalId,awsTagsOverrideOwnership,ownershipTagKeys},... on AzureResourcesIntegration{tenantId,subscriptionId,lastSyncedAt,aliases},... on NewRelicIntegration{baseUrl,accountKey}},{{ template "pagination_request" }},totalCount}}}`,
`query IntegrationList($after:String!$first:Int!){account{integrations(after: $after, first: $first){nodes{id,name,type,createdAt,installedAt,... on AwsIntegration{iamRole,externalId,awsTagsOverrideOwnership,ownershipTagKeys},... on NewRelicIntegration{baseUrl,accountKey}},{{ template "pagination_request" }},totalCount}}}`,
`{ "after": "", "first": 100 }`,
`{"data":{"account":{ "integrations":{ "nodes":[{{ template "integration_1" }}] } }}}`,
)
Expand Down
15 changes: 3 additions & 12 deletions input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package opslevel
import (
"fmt"

"github.com/relvacode/iso8601"

"github.com/gosimple/slug"
)

Expand All @@ -21,13 +19,6 @@ type AWSIntegrationFragment struct {
OwnershipTagKeys []string `graphql:"ownershipTagKeys"`
}

type AzureResourcesIntegrationFragment struct {
TenantId string `graphql:"tenantId"`
SubscriptionId string `graphql:"subscriptionId"`
LastSyncedAt *iso8601.Time `graphql:"lastSyncedAt"`
Aliases []string `graphql:"aliases"`
}

type NewRelicIntegrationFragment struct {
BaseUrl string `graphql:"baseUrl"`
AccountKey string `graphql:"accountKey"`
Expand Down Expand Up @@ -172,32 +163,3 @@ func (client *Client) DeleteIntegration(identifier string) error {
err := client.Mutate(&m, v, WithName("IntegrationDelete"))
return HandleErrors(err, m.Payload.Errors)
}

func (client *Client) CreateIntegrationAzureResources(input AzureResourcesIntegrationInput) (*Integration, error) {
var m struct {
Payload struct {
Integration *Integration
Errors []OpsLevelErrors
} `graphql:"azureResourcesIntegrationCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("AzureResourcesIntegrationCreate"))
return m.Payload.Integration, HandleErrors(err, m.Payload.Errors)
}

func (client *Client) UpdateIntegrationAzureResources(identifier string, input AzureResourcesIntegrationInput) (*Integration, error) {
var m struct {
Payload struct {
Integration *Integration
Errors []OpsLevelErrors
} `graphql:"azureResourcesIntegrationUpdate(integration: $integration input: $input)"`
}
v := PayloadVariables{
"integration": *NewIdentifier(identifier),
"input": input,
}
err := client.Mutate(&m, v, WithName("AzureResourcesIntegrationUpdate"))
return m.Payload.Integration, HandleErrors(err, m.Payload.Errors)
}
Loading

0 comments on commit 0a0e2c7

Please sign in to comment.