[Automation] Collect examples from azure-sdk-for-go#sdk/resourcemanager/digitaltwins/armdigitaltwins/v0.5.0

Co-authored-by: azure-sdk <azuresdk@microsoft.com>
This commit is contained in:
Azure-Fluent 2022-05-20 08:02:06 +08:00 коммит произвёл GitHub
Родитель c13337074e
Коммит 9a5a2b95eb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
22 изменённых файлов: 122 добавлений и 215 удалений

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -17,24 +17,21 @@ func ExampleClient_CheckNameAvailability() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.CheckNameAvailability(ctx,
"<location>",
"WestUS2",
armdigitaltwins.CheckNameRequest{
Name: to.Ptr("<name>"),
Type: to.Ptr("<type>"),
Name: to.Ptr("myadtinstance"),
Type: to.Ptr("Microsoft.DigitalTwins/digitalTwinsInstances"),
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
)
@ -18,26 +16,22 @@ func ExampleClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginDelete(ctx,
"<resource-group-name>",
"<resource-name>",
&armdigitaltwins.ClientBeginDeleteOptions{ResumeToken: ""})
"resRg",
"myDigitalTwinsService",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
)
@ -18,27 +16,23 @@ func ExampleEndpointClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewEndpointClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewEndpointClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginDelete(ctx,
"<resource-group-name>",
"<resource-name>",
"<endpoint-name>",
&armdigitaltwins.EndpointClientBeginDeleteOptions{ResumeToken: ""})
"resRg",
"myDigitalTwinsService",
"myendpoint",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,22 +16,19 @@ func ExampleEndpointClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewEndpointClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewEndpointClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.Get(ctx,
"<resource-group-name>",
"<resource-name>",
"<endpoint-name>",
"resRg",
"myDigitalTwinsService",
"myServiceBus",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
@ -19,35 +17,31 @@ func ExampleEndpointClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewEndpointClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewEndpointClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginCreateOrUpdate(ctx,
"<resource-group-name>",
"<resource-name>",
"<endpoint-name>",
"resRg",
"myDigitalTwinsService",
"myServiceBus",
armdigitaltwins.EndpointResource{
Properties: &armdigitaltwins.ServiceBus{
AuthenticationType: to.Ptr(armdigitaltwins.AuthenticationTypeKeyBased),
EndpointType: to.Ptr(armdigitaltwins.EndpointTypeServiceBus),
PrimaryConnectionString: to.Ptr("<primary-connection-string>"),
SecondaryConnectionString: to.Ptr("<secondary-connection-string>"),
PrimaryConnectionString: to.Ptr("Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc"),
SecondaryConnectionString: to.Ptr("Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc"),
},
},
&armdigitaltwins.EndpointClientBeginCreateOrUpdateOptions{ResumeToken: ""})
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,22 +16,19 @@ func ExampleEndpointClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewEndpointClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewEndpointClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
pager := client.NewListPager("<resource-group-name>",
"<resource-name>",
pager := client.NewListPager("resRg",
"myDigitalTwinsService",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
return
}
for _, v := range nextResult.Value {
// TODO: use page item

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,21 +16,18 @@ func ExampleClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.Get(ctx,
"<resource-group-name>",
"<resource-name>",
"resRg",
"myDigitalTwinsService",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,21 +16,18 @@ func ExampleClient_NewListByResourceGroupPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
pager := client.NewListByResourceGroupPager("<resource-group-name>",
pager := client.NewListByResourceGroupPager("resRg",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
return
}
for _, v := range nextResult.Value {
// TODO: use page item

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,20 +16,17 @@ func ExampleClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
pager := client.NewListPager(nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
return
}
for _, v := range nextResult.Value {
// TODO: use page item

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,20 +16,17 @@ func ExampleOperationsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewOperationsClient(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
pager := client.NewListPager(nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
return
}
for _, v := range nextResult.Value {
// TODO: use page item

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
@ -19,31 +17,27 @@ func ExampleClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginUpdate(ctx,
"<resource-group-name>",
"<resource-name>",
"resRg",
"myDigitalTwinsService",
armdigitaltwins.PatchDescription{
Tags: map[string]*string{
"purpose": to.Ptr("dev"),
},
},
&armdigitaltwins.ClientBeginUpdateOptions{ResumeToken: ""})
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
@ -19,29 +17,25 @@ func ExampleClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginCreateOrUpdate(ctx,
"<resource-group-name>",
"<resource-name>",
"resRg",
"myDigitalTwinsService",
armdigitaltwins.Description{
Location: to.Ptr("<location>"),
Location: to.Ptr("WestUS2"),
},
&armdigitaltwins.ClientBeginCreateOrUpdateOptions{ResumeToken: ""})
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,22 +16,19 @@ func ExamplePrivateEndpointConnectionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.Get(ctx,
"<resource-group-name>",
"<resource-name>",
"<private-endpoint-connection-name>",
"resRg",
"myDigitalTwinsService",
"myPrivateConnection",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
)
@ -18,27 +16,23 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginDelete(ctx,
"<resource-group-name>",
"<resource-name>",
"<private-endpoint-connection-name>",
&armdigitaltwins.PrivateEndpointConnectionsClientBeginDeleteOptions{ResumeToken: ""})
"resRg",
"myDigitalTwinsService",
"myPrivateConnection",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
_, err = poller.PollUntilDone(ctx, 30*time.Second)
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
}
```

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
@ -19,35 +17,31 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginCreateOrUpdate(ctx,
"<resource-group-name>",
"<resource-name>",
"<private-endpoint-connection-name>",
"resRg",
"myDigitalTwinsService",
"myPrivateConnection",
armdigitaltwins.PrivateEndpointConnection{
Properties: &armdigitaltwins.ConnectionProperties{
PrivateLinkServiceConnectionState: &armdigitaltwins.ConnectionPropertiesPrivateLinkServiceConnectionState{
Description: to.Ptr("<description>"),
Description: to.Ptr("Approved by johndoe@company.com."),
Status: to.Ptr(armdigitaltwins.PrivateLinkServiceConnectionStatusApproved),
},
},
},
&armdigitaltwins.PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions{ResumeToken: ""})
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,21 +16,18 @@ func ExamplePrivateEndpointConnectionsClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewPrivateEndpointConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.List(ctx,
"<resource-group-name>",
"<resource-name>",
"resRg",
"myDigitalTwinsService",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,22 +16,19 @@ func ExamplePrivateLinkResourcesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewPrivateLinkResourcesClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewPrivateLinkResourcesClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.Get(ctx,
"<resource-group-name>",
"<resource-name>",
"<resource-id>",
"resRg",
"myDigitalTwinsService",
"subResource",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,21 +16,18 @@ func ExamplePrivateLinkResourcesClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewPrivateLinkResourcesClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewPrivateLinkResourcesClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.List(ctx,
"<resource-group-name>",
"<resource-name>",
"resRg",
"myDigitalTwinsService",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
)
@ -18,27 +16,23 @@ func ExampleTimeSeriesDatabaseConnectionsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginDelete(ctx,
"<resource-group-name>",
"<resource-name>",
"<time-series-database-connection-name>",
&armdigitaltwins.TimeSeriesDatabaseConnectionsClientBeginDeleteOptions{ResumeToken: ""})
"resRg",
"myDigitalTwinsService",
"myConnection",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,22 +16,19 @@ func ExampleTimeSeriesDatabaseConnectionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
res, err := client.Get(ctx,
"<resource-group-name>",
"<resource-name>",
"<time-series-database-connection-name>",
"resRg",
"myDigitalTwinsService",
"myConnection",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
// TODO: use response item
_ = res

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -16,22 +16,19 @@ func ExampleTimeSeriesDatabaseConnectionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
pager := client.NewListPager("<resource-group-name>",
"<resource-name>",
pager := client.NewListPager("resRg",
"myDigitalTwinsService",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
return
}
for _, v := range nextResult.Value {
// TODO: use page item

Просмотреть файл

@ -1,4 +1,4 @@
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.4.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fdigitaltwins%2Farmdigitaltwins%2Fv0.5.0/sdk/resourcemanager/digitaltwins/armdigitaltwins/README.md) on how to add the SDK to your project and authenticate.
```go
package armdigitaltwins_test
@ -7,8 +7,6 @@ import (
"context"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/digitaltwins/armdigitaltwins"
@ -19,39 +17,35 @@ func ExampleTimeSeriesDatabaseConnectionsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("<subscription-id>", cred, nil)
client, err := armdigitaltwins.NewTimeSeriesDatabaseConnectionsClient("50016170-c839-41ba-a724-51e9df440b9e", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
poller, err := client.BeginCreateOrUpdate(ctx,
"<resource-group-name>",
"<resource-name>",
"<time-series-database-connection-name>",
"resRg",
"myDigitalTwinsService",
"myConnection",
armdigitaltwins.TimeSeriesDatabaseConnection{
Properties: &armdigitaltwins.AzureDataExplorerConnectionProperties{
ConnectionType: to.Ptr(armdigitaltwins.ConnectionTypeAzureDataExplorer),
AdxDatabaseName: to.Ptr("<adx-database-name>"),
AdxEndpointURI: to.Ptr("<adx-endpoint-uri>"),
AdxResourceID: to.Ptr("<adx-resource-id>"),
AdxTableName: to.Ptr("<adx-table-name>"),
EventHubEndpointURI: to.Ptr("<event-hub-endpoint-uri>"),
EventHubEntityPath: to.Ptr("<event-hub-entity-path>"),
EventHubNamespaceResourceID: to.Ptr("<event-hub-namespace-resource-id>"),
AdxDatabaseName: to.Ptr("myDatabase"),
AdxEndpointURI: to.Ptr("https://mycluster.kusto.windows.net"),
AdxResourceID: to.Ptr("/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster"),
AdxTableName: to.Ptr("myTable"),
EventHubEndpointURI: to.Ptr("sb://myeh.servicebus.windows.net/"),
EventHubEntityPath: to.Ptr("myeh"),
EventHubNamespaceResourceID: to.Ptr("/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh"),
},
},
&armdigitaltwins.TimeSeriesDatabaseConnectionsClientBeginCreateOrUpdateOptions{ResumeToken: ""})
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
res, err := poller.PollUntilDone(ctx, 30*time.Second)
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
return
}
// TODO: use response item
_ = res