Skip to content

Commit

Permalink
Updating based on c79f883e
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-tf-azure committed May 27, 2024
1 parent caf9a1e commit 937ba43
Show file tree
Hide file tree
Showing 70 changed files with 4,164 additions and 0 deletions.
46 changes: 46 additions & 0 deletions resource-manager/networkanalytics/2023-11-15/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package v2023_11_15

// 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/networkanalytics/2023-11-15/dataproducts"
"github.com/hashicorp/go-azure-sdk/resource-manager/networkanalytics/2023-11-15/dataproductscatalogs"
"github.com/hashicorp/go-azure-sdk/resource-manager/networkanalytics/2023-11-15/datatypes"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
DataProducts *dataproducts.DataProductsClient
DataProductsCatalogs *dataproductscatalogs.DataProductsCatalogsClient
DataTypes *datatypes.DataTypesClient
}

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

dataProductsClient, err := dataproducts.NewDataProductsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building DataProducts client: %+v", err)
}
configureFunc(dataProductsClient.Client)

dataTypesClient, err := datatypes.NewDataTypesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building DataTypes client: %+v", err)
}
configureFunc(dataTypesClient.Client)

return &Client{
DataProducts: dataProductsClient,
DataProductsCatalogs: dataProductsCatalogsClient,
DataTypes: dataTypesClient,
}, nil
}
218 changes: 218 additions & 0 deletions resource-manager/networkanalytics/2023-11-15/dataproducts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/networkanalytics/2023-11-15/dataproducts` Documentation

The `dataproducts` SDK allows for interaction with the Azure Resource Manager Service `networkanalytics` (API Version `2023-11-15`).

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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/networkanalytics/2023-11-15/dataproducts"
```


### Client Initialization

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


### Example Usage: `DataProductsClient.AddUserRole`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

payload := dataproducts.RoleAssignmentCommonProperties{
// ...
}


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


### Example Usage: `DataProductsClient.Create`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

payload := dataproducts.DataProduct{
// ...
}


if err := client.CreateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```


### Example Usage: `DataProductsClient.Delete`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
// handle the error
}
```


### Example Usage: `DataProductsClient.GenerateStorageAccountSasToken`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

payload := dataproducts.AccountSas{
// ...
}


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


### Example Usage: `DataProductsClient.Get`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

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: `DataProductsClient.ListByResourceGroup`

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

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


### Example Usage: `DataProductsClient.ListBySubscription`

```go
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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


### Example Usage: `DataProductsClient.ListRolesAssignments`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")
var payload interface{}

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


### Example Usage: `DataProductsClient.RemoveUserRole`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

payload := dataproducts.RoleAssignmentDetail{
// ...
}


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


### Example Usage: `DataProductsClient.RotateKey`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

payload := dataproducts.KeyVaultInfo{
// ...
}


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


### Example Usage: `DataProductsClient.Update`

```go
ctx := context.TODO()
id := dataproducts.NewDataProductID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataProductValue")

payload := dataproducts.DataProductUpdate{
// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dataproducts

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

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

return &DataProductsClient{
Client: client,
}, nil
}
Loading

0 comments on commit 937ba43

Please sign in to comment.