Skip to content

Commit

Permalink
Merge pull request hashicorp#955 from hashicorp/auto-pr/34c88481
Browse files Browse the repository at this point in the history
Auto PR: Regenerating the Go SDK (6042997)
  • Loading branch information
tombuildsstuff authored Apr 4, 2024
2 parents 6b8d44a + 6042997 commit e297d55
Show file tree
Hide file tree
Showing 245 changed files with 18,338 additions and 0 deletions.
73 changes: 73 additions & 0 deletions resource-manager/resources/2024-03-01/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package v2024_03_01

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deploymentoperations"
"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deployments"
"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/providers"
"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/resourcegroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/resources"
"github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/tags"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
DeploymentOperations *deploymentoperations.DeploymentOperationsClient
Deployments *deployments.DeploymentsClient
Providers *providers.ProvidersClient
ResourceGroups *resourcegroups.ResourceGroupsClient
Resources *resources.ResourcesClient
Tags *tags.TagsClient
}

func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
deploymentOperationsClient, err := deploymentoperations.NewDeploymentOperationsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building DeploymentOperations client: %+v", err)
}
configureFunc(deploymentOperationsClient.Client)

deploymentsClient, err := deployments.NewDeploymentsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Deployments client: %+v", err)
}
configureFunc(deploymentsClient.Client)

providersClient, err := providers.NewProvidersClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Providers client: %+v", err)
}
configureFunc(providersClient.Client)

resourceGroupsClient, err := resourcegroups.NewResourceGroupsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ResourceGroups client: %+v", err)
}
configureFunc(resourceGroupsClient.Client)

resourcesClient, err := resources.NewResourcesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Resources client: %+v", err)
}
configureFunc(resourcesClient.Client)

tagsClient, err := tags.NewTagsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Tags client: %+v", err)
}
configureFunc(tagsClient.Client)

return &Client{
DeploymentOperations: deploymentOperationsClient,
Deployments: deploymentsClient,
Providers: providersClient,
ResourceGroups: resourceGroupsClient,
Resources: resourcesClient,
Tags: tagsClient,
}, nil
}
185 changes: 185 additions & 0 deletions resource-manager/resources/2024-03-01/deploymentoperations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deploymentoperations` Documentation

The `deploymentoperations` SDK allows for interaction with the Azure Resource Manager Service `resources` (API Version `2024-03-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/resources/2024-03-01/deploymentoperations"
```


### Client Initialization

```go
client := deploymentoperations.NewDeploymentOperationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
```


### Example Usage: `DeploymentOperationsClient.Get`

```go
ctx := context.TODO()
id := deploymentoperations.NewResourceGroupDeploymentOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentValue", "operationIdValue")

read, err := client.Get(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```


### Example Usage: `DeploymentOperationsClient.GetAtManagementGroupScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewProviders2DeploymentOperationID("groupIdValue", "deploymentValue", "operationIdValue")

read, err := client.GetAtManagementGroupScope(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```


### Example Usage: `DeploymentOperationsClient.GetAtScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewScopedOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deploymentValue", "operationIdValue")

read, err := client.GetAtScope(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```


### Example Usage: `DeploymentOperationsClient.GetAtSubscriptionScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewDeploymentOperationID("12345678-1234-9876-4563-123456789012", "deploymentValue", "operationIdValue")

read, err := client.GetAtSubscriptionScope(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```


### Example Usage: `DeploymentOperationsClient.GetAtTenantScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewOperationID("deploymentValue", "operationIdValue")

read, err := client.GetAtTenantScope(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```


### Example Usage: `DeploymentOperationsClient.List`

```go
ctx := context.TODO()
id := deploymentoperations.NewResourceGroupDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentValue")

// alternatively `client.List(ctx, id, deploymentoperations.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, deploymentoperations.DefaultListOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `DeploymentOperationsClient.ListAtManagementGroupScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewProviders2DeploymentID("groupIdValue", "deploymentValue")

// alternatively `client.ListAtManagementGroupScope(ctx, id, deploymentoperations.DefaultListAtManagementGroupScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListAtManagementGroupScopeComplete(ctx, id, deploymentoperations.DefaultListAtManagementGroupScopeOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `DeploymentOperationsClient.ListAtScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewScopedDeploymentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deploymentValue")

// alternatively `client.ListAtScope(ctx, id, deploymentoperations.DefaultListAtScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListAtScopeComplete(ctx, id, deploymentoperations.DefaultListAtScopeOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `DeploymentOperationsClient.ListAtSubscriptionScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewProviderDeploymentID("12345678-1234-9876-4563-123456789012", "deploymentValue")

// alternatively `client.ListAtSubscriptionScope(ctx, id, deploymentoperations.DefaultListAtSubscriptionScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListAtSubscriptionScopeComplete(ctx, id, deploymentoperations.DefaultListAtSubscriptionScopeOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `DeploymentOperationsClient.ListAtTenantScope`

```go
ctx := context.TODO()
id := deploymentoperations.NewDeploymentID("deploymentValue")

// alternatively `client.ListAtTenantScope(ctx, id, deploymentoperations.DefaultListAtTenantScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListAtTenantScopeComplete(ctx, id, deploymentoperations.DefaultListAtTenantScopeOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package deploymentoperations

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 DeploymentOperationsClient struct {
Client *resourcemanager.Client
}

func NewDeploymentOperationsClientWithBaseURI(sdkApi sdkEnv.Api) (*DeploymentOperationsClient, error) {
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "deploymentoperations", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating DeploymentOperationsClient: %+v", err)
}

return &DeploymentOperationsClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package deploymentoperations

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 ProvisioningOperation string

const (
ProvisioningOperationAction ProvisioningOperation = "Action"
ProvisioningOperationAzureAsyncOperationWaiting ProvisioningOperation = "AzureAsyncOperationWaiting"
ProvisioningOperationCreate ProvisioningOperation = "Create"
ProvisioningOperationDelete ProvisioningOperation = "Delete"
ProvisioningOperationDeploymentCleanup ProvisioningOperation = "DeploymentCleanup"
ProvisioningOperationEvaluateDeploymentOutput ProvisioningOperation = "EvaluateDeploymentOutput"
ProvisioningOperationNotSpecified ProvisioningOperation = "NotSpecified"
ProvisioningOperationRead ProvisioningOperation = "Read"
ProvisioningOperationResourceCacheWaiting ProvisioningOperation = "ResourceCacheWaiting"
ProvisioningOperationWaiting ProvisioningOperation = "Waiting"
)

func PossibleValuesForProvisioningOperation() []string {
return []string{
string(ProvisioningOperationAction),
string(ProvisioningOperationAzureAsyncOperationWaiting),
string(ProvisioningOperationCreate),
string(ProvisioningOperationDelete),
string(ProvisioningOperationDeploymentCleanup),
string(ProvisioningOperationEvaluateDeploymentOutput),
string(ProvisioningOperationNotSpecified),
string(ProvisioningOperationRead),
string(ProvisioningOperationResourceCacheWaiting),
string(ProvisioningOperationWaiting),
}
}

func (s *ProvisioningOperation) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseProvisioningOperation(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseProvisioningOperation(input string) (*ProvisioningOperation, error) {
vals := map[string]ProvisioningOperation{
"action": ProvisioningOperationAction,
"azureasyncoperationwaiting": ProvisioningOperationAzureAsyncOperationWaiting,
"create": ProvisioningOperationCreate,
"delete": ProvisioningOperationDelete,
"deploymentcleanup": ProvisioningOperationDeploymentCleanup,
"evaluatedeploymentoutput": ProvisioningOperationEvaluateDeploymentOutput,
"notspecified": ProvisioningOperationNotSpecified,
"read": ProvisioningOperationRead,
"resourcecachewaiting": ProvisioningOperationResourceCacheWaiting,
"waiting": ProvisioningOperationWaiting,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := ProvisioningOperation(input)
return &out, nil
}
Loading

0 comments on commit e297d55

Please sign in to comment.