Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions resource-manager/aad/2025-05-01/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package v2025_05_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/aad/2025-05-01/domainservices"
"github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/oucontainer"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
DomainServices *domainservices.DomainServicesClient
OuContainer *oucontainer.OuContainerClient
}

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

ouContainerClient, err := oucontainer.NewOuContainerClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building OuContainer client: %+v", err)
}
configureFunc(ouContainerClient.Client)

return &Client{
DomainServices: domainServicesClient,
OuContainer: ouContainerClient,
}, nil
}
133 changes: 133 additions & 0 deletions resource-manager/aad/2025-05-01/domainservices/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/domainservices` Documentation

The `domainservices` SDK allows for interaction with Azure Resource Manager `aad` (API Version `2025-05-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/domainservices"
```


### Client Initialization

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


### Example Usage: `DomainServicesClient.CreateOrUpdate`

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

payload := domainservices.DomainService{
// ...
}


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


### Example Usage: `DomainServicesClient.Delete`

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

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


### Example Usage: `DomainServicesClient.Get`

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

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: `DomainServicesClient.List`

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

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


### Example Usage: `DomainServicesClient.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: `DomainServicesClient.Unsuspend`

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

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


### Example Usage: `DomainServicesClient.Update`

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

payload := domainservices.DomainService{
// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```
26 changes: 26 additions & 0 deletions resource-manager/aad/2025-05-01/domainservices/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package domainservices

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

func NewDomainServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*DomainServicesClient, error) {
client, err := resourcemanager.NewClient(sdkApi, "domainservices", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating DomainServicesClient: %+v", err)
}

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