-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hc-github-team-tf-azure
committed
Jun 11, 2024
1 parent
d76faf0
commit 9194482
Showing
32 changed files
with
1,733 additions
and
3 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
resource-manager/datafactory/2018-06-01/pipelines/model_continuationsettingsreference.go
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,10 @@ | ||
package pipelines | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type ContinuationSettingsReference struct { | ||
ContinuationTtlInMinutes *interface{} `json:"continuationTtlInMinutes,omitempty"` | ||
CustomizedCheckpointKey *interface{} `json:"customizedCheckpointKey,omitempty"` | ||
IdleCondition *interface{} `json:"idleCondition,omitempty"` | ||
} |
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
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
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
8 changes: 8 additions & 0 deletions
8
...gservices/2024-04-01/v2workspaceconnectionresource/model_workspaceconnectionaccountkey.go
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,8 @@ | ||
package v2workspaceconnectionresource | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type WorkspaceConnectionAccountKey struct { | ||
Key *string `json:"key,omitempty"` | ||
} |
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
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
41 changes: 41 additions & 0 deletions
41
resource-manager/resourcegraph/2022-10-01/graphqueries/README.md
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,41 @@ | ||
|
||
## `github.com/hashicorp/go-azure-sdk/resource-manager/resourcegraph/2022-10-01/graphqueries` Documentation | ||
|
||
The `graphqueries` SDK allows for interaction with the Azure Resource Manager Service `resourcegraph` (API Version `2022-10-01`). | ||
|
||
This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). | ||
|
||
### Import Path | ||
|
||
```go | ||
import "github.com/hashicorp/go-azure-sdk/resource-manager/resourcegraph/2022-10-01/graphqueries" | ||
``` | ||
|
||
|
||
### Client Initialization | ||
|
||
```go | ||
client := graphqueries.NewGraphqueriesClientWithBaseURI("https://management.azure.com") | ||
client.Client.Authorizer = authorizer | ||
``` | ||
|
||
|
||
### Example Usage: `GraphqueriesClient.GraphQueryUpdate` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := graphqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryValue") | ||
|
||
payload := graphqueries.GraphQueryUpdateParameters{ | ||
// ... | ||
} | ||
|
||
|
||
read, err := client.GraphQueryUpdate(ctx, id, payload) | ||
if err != nil { | ||
// handle the error | ||
} | ||
if model := read.Model; model != nil { | ||
// do something with the model/response object | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
resource-manager/resourcegraph/2022-10-01/graphqueries/client.go
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,26 @@ | ||
package graphqueries | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" | ||
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type GraphqueriesClient struct { | ||
Client *resourcemanager.Client | ||
} | ||
|
||
func NewGraphqueriesClientWithBaseURI(sdkApi sdkEnv.Api) (*GraphqueriesClient, error) { | ||
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "graphqueries", defaultApiVersion) | ||
if err != nil { | ||
return nil, fmt.Errorf("instantiating GraphqueriesClient: %+v", err) | ||
} | ||
|
||
return &GraphqueriesClient{ | ||
Client: client, | ||
}, nil | ||
} |
48 changes: 48 additions & 0 deletions
48
resource-manager/resourcegraph/2022-10-01/graphqueries/constants.go
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,48 @@ | ||
package graphqueries | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type ResultKind string | ||
|
||
const ( | ||
ResultKindBasic ResultKind = "basic" | ||
) | ||
|
||
func PossibleValuesForResultKind() []string { | ||
return []string{ | ||
string(ResultKindBasic), | ||
} | ||
} | ||
|
||
func (s *ResultKind) UnmarshalJSON(bytes []byte) error { | ||
var decoded string | ||
if err := json.Unmarshal(bytes, &decoded); err != nil { | ||
return fmt.Errorf("unmarshaling: %+v", err) | ||
} | ||
out, err := parseResultKind(decoded) | ||
if err != nil { | ||
return fmt.Errorf("parsing %q: %+v", decoded, err) | ||
} | ||
*s = *out | ||
return nil | ||
} | ||
|
||
func parseResultKind(input string) (*ResultKind, error) { | ||
vals := map[string]ResultKind{ | ||
"basic": ResultKindBasic, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := ResultKind(input) | ||
return &out, nil | ||
} |
130 changes: 130 additions & 0 deletions
130
resource-manager/resourcegraph/2022-10-01/graphqueries/id_query.go
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,130 @@ | ||
package graphqueries | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" | ||
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
func init() { | ||
recaser.RegisterResourceId(&QueryId{}) | ||
} | ||
|
||
var _ resourceids.ResourceId = &QueryId{} | ||
|
||
// QueryId is a struct representing the Resource ID for a Query | ||
type QueryId struct { | ||
SubscriptionId string | ||
ResourceGroupName string | ||
QueryName string | ||
} | ||
|
||
// NewQueryID returns a new QueryId struct | ||
func NewQueryID(subscriptionId string, resourceGroupName string, queryName string) QueryId { | ||
return QueryId{ | ||
SubscriptionId: subscriptionId, | ||
ResourceGroupName: resourceGroupName, | ||
QueryName: queryName, | ||
} | ||
} | ||
|
||
// ParseQueryID parses 'input' into a QueryId | ||
func ParseQueryID(input string) (*QueryId, error) { | ||
parser := resourceids.NewParserFromResourceIdType(&QueryId{}) | ||
parsed, err := parser.Parse(input, false) | ||
if err != nil { | ||
return nil, fmt.Errorf("parsing %q: %+v", input, err) | ||
} | ||
|
||
id := QueryId{} | ||
if err := id.FromParseResult(*parsed); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &id, nil | ||
} | ||
|
||
// ParseQueryIDInsensitively parses 'input' case-insensitively into a QueryId | ||
// note: this method should only be used for API response data and not user input | ||
func ParseQueryIDInsensitively(input string) (*QueryId, error) { | ||
parser := resourceids.NewParserFromResourceIdType(&QueryId{}) | ||
parsed, err := parser.Parse(input, true) | ||
if err != nil { | ||
return nil, fmt.Errorf("parsing %q: %+v", input, err) | ||
} | ||
|
||
id := QueryId{} | ||
if err := id.FromParseResult(*parsed); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &id, nil | ||
} | ||
|
||
func (id *QueryId) FromParseResult(input resourceids.ParseResult) error { | ||
var ok bool | ||
|
||
if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { | ||
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) | ||
} | ||
|
||
if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { | ||
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) | ||
} | ||
|
||
if id.QueryName, ok = input.Parsed["queryName"]; !ok { | ||
return resourceids.NewSegmentNotSpecifiedError(id, "queryName", input) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// ValidateQueryID checks that 'input' can be parsed as a Query ID | ||
func ValidateQueryID(input interface{}, key string) (warnings []string, errors []error) { | ||
v, ok := input.(string) | ||
if !ok { | ||
errors = append(errors, fmt.Errorf("expected %q to be a string", key)) | ||
return | ||
} | ||
|
||
if _, err := ParseQueryID(v); err != nil { | ||
errors = append(errors, err) | ||
} | ||
|
||
return | ||
} | ||
|
||
// ID returns the formatted Query ID | ||
func (id QueryId) ID() string { | ||
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ResourceGraph/queries/%s" | ||
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.QueryName) | ||
} | ||
|
||
// Segments returns a slice of Resource ID Segments which comprise this Query ID | ||
func (id QueryId) Segments() []resourceids.Segment { | ||
return []resourceids.Segment{ | ||
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), | ||
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), | ||
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), | ||
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), | ||
resourceids.StaticSegment("staticProviders", "providers", "providers"), | ||
resourceids.ResourceProviderSegment("staticMicrosoftResourceGraph", "Microsoft.ResourceGraph", "Microsoft.ResourceGraph"), | ||
resourceids.StaticSegment("staticQueries", "queries", "queries"), | ||
resourceids.UserSpecifiedSegment("queryName", "queryValue"), | ||
} | ||
} | ||
|
||
// String returns a human-readable description of this Query ID | ||
func (id QueryId) String() string { | ||
components := []string{ | ||
fmt.Sprintf("Subscription: %q", id.SubscriptionId), | ||
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), | ||
fmt.Sprintf("Query Name: %q", id.QueryName), | ||
} | ||
return fmt.Sprintf("Query (%s)", strings.Join(components, "\n")) | ||
} |
Oops, something went wrong.