diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md b/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md index ee184367ae14..aa4dff4f5328 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md +++ b/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.0-beta.2 (2024-04-29) +### Other Changes + + ## 2.0.0-beta.1 (2024-03-22) ### Breaking Changes diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md b/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md index 16d33dfe9f66..6aa638e6cf14 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md +++ b/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 -tag: package-2023-04-01-preview +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/configurationnames_client_example_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/configurationnames_client_example_test.go deleted file mode 100644 index 3e3ba14c18f9..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/configurationnames_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicelinker_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConfigurationNamesList.json -func ExampleConfigurationNamesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationNamesClient().NewListPager(&armservicelinker.ConfigurationNamesClientListOptions{Filter: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationNameResult = armservicelinker.ConfigurationNameResult{ - // Value: []*armservicelinker.ConfigurationNameItem{ - // { - // Properties: &armservicelinker.ConfigurationNames{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSystemAssignedIdentity), - // ClientType: to.Ptr(armservicelinker.ClientTypeNone), - // Names: []*armservicelinker.ConfigurationName{ - // { - // Description: to.Ptr("App configuration endpoint"), - // Value: to.Ptr("AZURE_APPCONFIGURATION_ENDPOINT"), - // }, - // { - // Description: to.Ptr("The scopes required for the token."), - // Value: to.Ptr("AZURE_APPCONFIGURATION_SCOPE"), - // }}, - // TargetService: to.Ptr("MICROSOFT.APPCONFIGURATION/CONFIGURATIONSTORES"), - // }, - // }, - // { - // Properties: &armservicelinker.ConfigurationNames{ - // AuthType: to.Ptr(armservicelinker.AuthTypeUserAssignedIdentity), - // ClientType: to.Ptr(armservicelinker.ClientTypeNone), - // Names: []*armservicelinker.ConfigurationName{ - // { - // Description: to.Ptr("App configuration endpoint"), - // Value: to.Ptr("AZURE_APPCONFIGURATION_ENDPOINT"), - // }, - // { - // Description: to.Ptr("The client(application) ID of the user identity."), - // Value: to.Ptr("AZURE_APPCONFIGURATION_CLIENTID"), - // }, - // { - // Description: to.Ptr("The scopes required for getting token."), - // Value: to.Ptr("AZURE_APPCONFIGURATION_SCOPE"), - // }}, - // TargetService: to.Ptr("MICROSOFT.APPCONFIGURATION/CONFIGURATIONSTORES"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/connector_client_example_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/connector_client_example_test.go deleted file mode 100644 index 6897072cc7e2..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/connector_client_example_test.go +++ /dev/null @@ -1,581 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicelinker_test - -import ( - "context" - "log" - - "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/servicelinker/armservicelinker/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConnectorDryrunList.json -func ExampleConnectorClient_NewListDryrunPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorClient().NewListDryrunPager("00000000-0000-0000-0000-000000000000", "test-rg", "westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DryrunList = armservicelinker.DryrunList{ - // Value: []*armservicelinker.DryrunResource{ - // { - // Name: to.Ptr("dryrunName"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/locations/westus/dryruns/dryrunName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.DryrunProperties{ - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("username"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConnectorDryrunGet.json -func ExampleConnectorClient_GetDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorClient().GetDryrun(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DryrunResource = armservicelinker.DryrunResource{ - // Name: to.Ptr("dryrunName"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/locations/westus/dryruns/dryrunName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.DryrunProperties{ - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("username"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConnectorDryrunCreate.json -func ExampleConnectorClient_BeginCreateDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorClient().BeginCreateDryrun(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", armservicelinker.DryrunResource{ - Properties: &armservicelinker.DryrunProperties{ - Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - Name: to.Ptr("name"), - SecretInfo: &armservicelinker.ValueSecretInfo{ - SecretType: to.Ptr(armservicelinker.SecretTypeRawValue), - Value: to.Ptr("secret"), - }, - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DryrunResource = armservicelinker.DryrunResource{ - // Name: to.Ptr("dryrunName"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/locations/westus/dryruns/dryrunName"), - // Properties: &armservicelinker.DryrunProperties{ - // OperationPreviews: []*armservicelinker.DryrunOperationPreview{ - // { - // Name: to.Ptr("configFirewallRule"), - // Description: to.Ptr("Config firewall rule for target service to allow source service access"), - // Action: to.Ptr("Microsoft.DocumentDb/databaseAccounts/write"), - // OperationType: to.Ptr(armservicelinker.DryrunPreviewOperationTypeConfigNetwork), - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("name"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // PrerequisiteResults: []armservicelinker.DryrunPrerequisiteResultClassification{ - // &armservicelinker.BasicErrorDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypeBasicError), - // Code: to.Ptr("ResourceNotFound"), - // Message: to.Ptr("Target resource is not found"), - // }, - // &armservicelinker.PermissionsMissingDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypePermissionsMissing), - // Permissions: []*string{ - // to.Ptr("Microsoft.DocumentDb/databaseAccounts/write")}, - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConnectorDryrunUpdate.json -func ExampleConnectorClient_BeginUpdateDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorClient().BeginUpdateDryrun(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", armservicelinker.DryrunPatch{ - Properties: &armservicelinker.DryrunProperties{ - Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - Name: to.Ptr("name"), - SecretInfo: &armservicelinker.ValueSecretInfo{ - SecretType: to.Ptr(armservicelinker.SecretTypeRawValue), - Value: to.Ptr("secret"), - }, - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DryrunResource = armservicelinker.DryrunResource{ - // Name: to.Ptr("dryrunName"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/locations/westus/dryruns/dryrunName"), - // Properties: &armservicelinker.DryrunProperties{ - // OperationPreviews: []*armservicelinker.DryrunOperationPreview{ - // { - // Name: to.Ptr("configFirewallRule"), - // Description: to.Ptr("Config firewall rule for target service to allow source service access"), - // Action: to.Ptr("Microsoft.DocumentDb/databaseAccounts/write"), - // OperationType: to.Ptr(armservicelinker.DryrunPreviewOperationTypeConfigNetwork), - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("name"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // PrerequisiteResults: []armservicelinker.DryrunPrerequisiteResultClassification{ - // &armservicelinker.BasicErrorDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypeBasicError), - // Code: to.Ptr("ResourceNotFound"), - // Message: to.Ptr("Target resource is not found"), - // }, - // &armservicelinker.PermissionsMissingDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypePermissionsMissing), - // Permissions: []*string{ - // to.Ptr("Microsoft.DocumentDb/databaseAccounts/write")}, - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConnectorDryrunDelete.json -func ExampleConnectorClient_DeleteDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectorClient().DeleteDryrun(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "dryrunName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ConnectorList.json -func ExampleConnectorClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorClient().NewListPager("00000000-0000-0000-0000-000000000000", "test-rg", "westus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceList = armservicelinker.ResourceList{ - // Value: []*armservicelinker.LinkerResource{ - // { - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/devConnectors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/linkers/linkName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("username"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/Connectors.json -func ExampleConnectorClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorClient().Get(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkerResource = armservicelinker.LinkerResource{ - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/devConnectors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/devConnnectors/linkName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.SystemAssignedIdentityAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSystemAssignedIdentity), - // Roles: []*string{ - // to.Ptr("customizedOwner")}, - // }, - // PublicNetworkSolution: &armservicelinker.PublicNetworkSolution{ - // Action: to.Ptr(armservicelinker.ActionTypeEnable), - // DeleteOrUpdateBehavior: to.Ptr(armservicelinker.DeleteOrUpdateBehaviorForcedCleanup), - // FirewallRules: &armservicelinker.FirewallRules{ - // CallerClientIP: to.Ptr(armservicelinker.AllowTypeTrue), - // IPRanges: []*string{ - // to.Ptr("182.22.120")}, - // }, - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/PutConnector.json -func ExampleConnectorClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorClient().BeginCreateOrUpdate(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", armservicelinker.LinkerResource{ - Properties: &armservicelinker.LinkerProperties{ - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - }, - SecretStore: &armservicelinker.SecretStore{ - KeyVaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv"), - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkerResource = armservicelinker.LinkerResource{ - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/links"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName"), - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // }, - // SecretStore: &armservicelinker.SecretStore{ - // KeyVaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/test-kv"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/DeleteConnector.json -func ExampleConnectorClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorClient().BeginDelete(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/PatchConnector.json -func ExampleConnectorClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorClient().BeginUpdate(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", armservicelinker.LinkerPatch{ - Properties: &armservicelinker.LinkerProperties{ - AuthInfo: &armservicelinker.ServicePrincipalSecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeServicePrincipalSecret), - ClientID: to.Ptr("name"), - PrincipalID: to.Ptr("id"), - Secret: to.Ptr("secret"), - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkerResource = armservicelinker.LinkerResource{ - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/links"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName"), - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.ServicePrincipalSecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeServicePrincipalSecret), - // ClientID: to.Ptr("name"), - // PrincipalID: to.Ptr("id"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ValidateConnectorSuccess.json -func ExampleConnectorClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorClient().BeginValidate(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateOperationResult = armservicelinker.ValidateOperationResult{ - // Properties: &armservicelinker.ValidateResult{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // IsConnectionAvailable: to.Ptr(true), - // ReportEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:06:09.000Z"); return t}()), - // ReportStartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // ValidationDetail: []*armservicelinker.ValidationResultItem{ - // { - // Name: to.Ptr("TargetExistence"), - // Description: to.Ptr("The target existence is validated"), - // Result: to.Ptr(armservicelinker.ValidationResultStatusSuccess), - // }, - // { - // Name: to.Ptr("TargetNetworkAccess"), - // Description: to.Ptr("Deny public network access is set to yes. Please confirm you are using private endpoint connection to access target resource."), - // Result: to.Ptr(armservicelinker.ValidationResultStatusWarning), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/GenerateConfigurations.json -func ExampleConnectorClient_GenerateConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorClient().GenerateConfigurations(ctx, "00000000-0000-0000-0000-000000000000", "test-rg", "westus", "connectorName", &armservicelinker.ConnectorClientGenerateConfigurationsOptions{Parameters: &armservicelinker.ConfigurationInfo{ - CustomizedKeys: map[string]*string{ - "ASL_DocumentDb_ConnectionString": to.Ptr("MyConnectionstring"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationResult = armservicelinker.ConfigurationResult{ - // Configurations: []*armservicelinker.SourceConfiguration{ - // { - // Name: to.Ptr("MyConnectionstring"), - // Value: to.Ptr("ConnectionString"), - // }}, - // } -} diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/constants.go b/sdk/resourcemanager/servicelinker/armservicelinker/constants.go index 35e4ff290b6b..e5deda9b685a 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/constants.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/constants.go @@ -10,7 +10,7 @@ package armservicelinker const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) type AccessKeyPermissions string diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/go.mod b/sdk/resourcemanager/servicelinker/armservicelinker/go.mod index d31fc77221b2..7222db154470 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/go.mod +++ b/sdk/resourcemanager/servicelinker/armservicelinker/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armse go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.6.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect - github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/google/uuid v1.5.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.21.0 // indirect golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/go.sum b/sdk/resourcemanager/servicelinker/armservicelinker/go.sum index 4cc6df0e379a..520f1a7d9768 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/go.sum +++ b/sdk/resourcemanager/servicelinker/armservicelinker/go.sum @@ -1,31 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 h1:c4k2FIYIh4xtwqrQwV0Ct1v5+ehlNXj5NI/MWVsiTkQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2/go.mod h1:5FDJtLEO/GxwNgUxbwrY3LP0pEoThTQJtk2oysdXHxM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= github.com/Azure/azure-sdk-for-go/sdk/internal v1.6.0 h1:sUFnFjzDUie80h24I7mrKtwCKgLY9L8h5Tp2x9+TWqk= github.com/Azure/azure-sdk-for-go/sdk/internal v1.6.0/go.mod h1:52JbnQTp15qg5mRkMBHwp0j0ZFwHJ42Sx3zVV5RE9p0= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= -github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/linker_client_example_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/linker_client_example_test.go deleted file mode 100644 index f8bc4395e38f..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/linker_client_example_test.go +++ /dev/null @@ -1,349 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicelinker_test - -import ( - "context" - "log" - - "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/servicelinker/armservicelinker/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/LinkerList.json -func ExampleLinkerClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLinkerClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceList = armservicelinker.ResourceList{ - // Value: []*armservicelinker.LinkerResource{ - // { - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/links"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ServiceLinker/links/linkName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("username"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/Linker.json -func ExampleLinkerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkerClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkerResource = armservicelinker.LinkerResource{ - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/links"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("name"), - // }, - // ClientType: to.Ptr(armservicelinker.ClientTypeDotnet), - // ConfigurationInfo: &armservicelinker.ConfigurationInfo{ - // AdditionalConfigurations: map[string]*string{ - // "throttlingLimit": to.Ptr("100"), - // }, - // CustomizedKeys: map[string]*string{ - // "AZURE_MYSQL_CONNECTIONSTRING": to.Ptr("myConnectionstring"), - // "AZURE_MYSQL_SSLMODE": to.Ptr("mySslmode"), - // }, - // DeleteOrUpdateBehavior: to.Ptr(armservicelinker.DeleteOrUpdateBehaviorForcedCleanup), - // }, - // PublicNetworkSolution: &armservicelinker.PublicNetworkSolution{ - // Action: to.Ptr(armservicelinker.ActionTypeEnable), - // }, - // Scope: to.Ptr("AKS-Namespace"), - // SecretStore: &armservicelinker.SecretStore{ - // KeyVaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/kvname"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/PutLinker.json -func ExampleLinkerClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkerClient().BeginCreateOrUpdate(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", armservicelinker.LinkerResource{ - Properties: &armservicelinker.LinkerProperties{ - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - Name: to.Ptr("name"), - SecretInfo: &armservicelinker.ValueSecretInfo{ - SecretType: to.Ptr(armservicelinker.SecretTypeRawValue), - Value: to.Ptr("secret"), - }, - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"), - }, - VNetSolution: &armservicelinker.VNetSolution{ - Type: to.Ptr(armservicelinker.VNetSolutionTypeServiceEndpoint), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkerResource = armservicelinker.LinkerResource{ - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/links"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName"), - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("name"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"), - // }, - // VNetSolution: &armservicelinker.VNetSolution{ - // Type: to.Ptr(armservicelinker.VNetSolutionTypeServiceEndpoint), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/DeleteLinker.json -func ExampleLinkerClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkerClient().BeginDelete(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/PatchLinker.json -func ExampleLinkerClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkerClient().BeginUpdate(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", armservicelinker.LinkerPatch{ - Properties: &armservicelinker.LinkerProperties{ - AuthInfo: &armservicelinker.ServicePrincipalSecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeServicePrincipalSecret), - ClientID: to.Ptr("name"), - PrincipalID: to.Ptr("id"), - Secret: to.Ptr("secret"), - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkerResource = armservicelinker.LinkerResource{ - // Name: to.Ptr("linkName"), - // Type: to.Ptr("Microsoft.ServiceLinker/links"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName"), - // Properties: &armservicelinker.LinkerProperties{ - // AuthInfo: &armservicelinker.ServicePrincipalSecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeServicePrincipalSecret), - // ClientID: to.Ptr("name"), - // PrincipalID: to.Ptr("id"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ValidateLinkerSuccess.json -func ExampleLinkerClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkerClient().BeginValidate(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateOperationResult = armservicelinker.ValidateOperationResult{ - // Properties: &armservicelinker.ValidateResult{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // IsConnectionAvailable: to.Ptr(true), - // ReportEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:06:09.000Z"); return t}()), - // ReportStartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // TargetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // ValidationDetail: []*armservicelinker.ValidationResultItem{ - // { - // Name: to.Ptr("TargetExistence"), - // Description: to.Ptr("The target existence is validated"), - // Result: to.Ptr(armservicelinker.ValidationResultStatusSuccess), - // }, - // { - // Name: to.Ptr("TargetNetworkAccess"), - // Description: to.Ptr("Deny public network access is set to yes. Please confirm you are using private endpoint connection to access target resource."), - // Result: to.Ptr(armservicelinker.ValidationResultStatusWarning), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/GetConfigurations.json -func ExampleLinkerClient_ListConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkerClient().ListConfigurations(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.App/containerApps/test-app", "linkName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationResult = armservicelinker.ConfigurationResult{ - // Configurations: []*armservicelinker.SourceConfiguration{ - // { - // Name: to.Ptr("AZURE_POSTGRESQL_HOST"), - // ConfigType: to.Ptr(armservicelinker.LinkerConfigurationTypeDefault), - // Value: to.Ptr("Host"), - // }, - // { - // Name: to.Ptr("AZURE_POSTGRESQL_USER"), - // ConfigType: to.Ptr(armservicelinker.LinkerConfigurationTypeDefault), - // Value: to.Ptr("Username"), - // }, - // { - // Name: to.Ptr("AZURE_POSTGRESQL_DATABASE"), - // ConfigType: to.Ptr(armservicelinker.LinkerConfigurationTypeDefault), - // Value: to.Ptr("DatabaseName"), - // }, - // { - // Name: to.Ptr("AZURE_POSTGRESQL_PORT"), - // ConfigType: to.Ptr(armservicelinker.LinkerConfigurationTypeDefault), - // Value: to.Ptr("Port"), - // }, - // { - // Name: to.Ptr("AZURE_POSTGRESQL_PASSWORD"), - // ConfigType: to.Ptr(armservicelinker.LinkerConfigurationTypeKeyVaultSecret), - // KeyVaultReferenceIdentity: to.Ptr("system"), - // Value: to.Ptr("SecretUri"), - // }}, - // } -} diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/linkers_client_example_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/linkers_client_example_test.go deleted file mode 100644 index 47deca1134ec..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/linkers_client_example_test.go +++ /dev/null @@ -1,366 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicelinker_test - -import ( - "context" - "log" - - "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/servicelinker/armservicelinker/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/ListDryrun.json -func ExampleLinkersClient_NewListDryrunPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLinkersClient().NewListDryrunPager("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DryrunList = armservicelinker.DryrunList{ - // Value: []*armservicelinker.DryrunResource{ - // { - // Name: to.Ptr("dryrunName"), - // Type: to.Ptr("Microsoft.ServiceLinker/dryruns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/dryruns/dryrunName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.DryrunProperties{ - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("username"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/GetDryrun.json -func ExampleLinkersClient_GetDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkersClient().GetDryrun(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "dryrunName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DryrunResource = armservicelinker.DryrunResource{ - // Name: to.Ptr("dryrunName"), - // Type: to.Ptr("Microsoft.ServiceLinker/dryruns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/dryruns/dryrunName"), - // SystemData: &armservicelinker.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-12T22:05:09.000Z"); return t}()), - // }, - // Properties: &armservicelinker.DryrunProperties{ - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("username"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/PutDryrun.json -func ExampleLinkersClient_BeginCreateDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkersClient().BeginCreateDryrun(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "dryrunName", armservicelinker.DryrunResource{ - Properties: &armservicelinker.DryrunProperties{ - Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - Name: to.Ptr("name"), - SecretInfo: &armservicelinker.ValueSecretInfo{ - SecretType: to.Ptr(armservicelinker.SecretTypeRawValue), - Value: to.Ptr("secret"), - }, - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DryrunResource = armservicelinker.DryrunResource{ - // Name: to.Ptr("dryrunName"), - // Type: to.Ptr("Microsoft.ServiceLinker/dryruns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/dryruns/dryrunName"), - // Properties: &armservicelinker.DryrunProperties{ - // OperationPreviews: []*armservicelinker.DryrunOperationPreview{ - // { - // Name: to.Ptr("configFirewallRule"), - // Description: to.Ptr("Config firewall rule for target service to allow source service access"), - // Action: to.Ptr("Microsoft.DocumentDb/databaseAccounts/write"), - // OperationType: to.Ptr(armservicelinker.DryrunPreviewOperationTypeConfigNetwork), - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("name"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // PrerequisiteResults: []armservicelinker.DryrunPrerequisiteResultClassification{ - // &armservicelinker.BasicErrorDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypeBasicError), - // Code: to.Ptr("ResourceNotFound"), - // Message: to.Ptr("Target resource is not found"), - // }, - // &armservicelinker.PermissionsMissingDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypePermissionsMissing), - // Permissions: []*string{ - // to.Ptr("Microsoft.DocumentDb/databaseAccounts/write")}, - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/PatchDryrun.json -func ExampleLinkersClient_BeginUpdateDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkersClient().BeginUpdateDryrun(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "dryrunName", armservicelinker.DryrunPatch{ - Properties: &armservicelinker.DryrunProperties{ - Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - Name: to.Ptr("name"), - SecretInfo: &armservicelinker.ValueSecretInfo{ - SecretType: to.Ptr(armservicelinker.SecretTypeRawValue), - Value: to.Ptr("secret"), - }, - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DryrunResource = armservicelinker.DryrunResource{ - // Name: to.Ptr("dryrunName"), - // Type: to.Ptr("Microsoft.ServiceLinker/dryruns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/dryruns/dryrunName"), - // Properties: &armservicelinker.DryrunProperties{ - // OperationPreviews: []*armservicelinker.DryrunOperationPreview{ - // { - // Name: to.Ptr("configFirewallRule"), - // Description: to.Ptr("Config firewall rule for target service to allow source service access"), - // Action: to.Ptr("Microsoft.DocumentDb/databaseAccounts/write"), - // OperationType: to.Ptr(armservicelinker.DryrunPreviewOperationTypeConfigNetwork), - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // Parameters: &armservicelinker.CreateOrUpdateDryrunParameters{ - // ActionName: to.Ptr(armservicelinker.DryrunActionNameCreateOrUpdate), - // AuthInfo: &armservicelinker.SecretAuthInfo{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // Name: to.Ptr("name"), - // }, - // TargetService: &armservicelinker.AzureResource{ - // Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - // }, - // }, - // PrerequisiteResults: []armservicelinker.DryrunPrerequisiteResultClassification{ - // &armservicelinker.BasicErrorDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypeBasicError), - // Code: to.Ptr("ResourceNotFound"), - // Message: to.Ptr("Target resource is not found"), - // }, - // &armservicelinker.PermissionsMissingDryrunPrerequisiteResult{ - // Type: to.Ptr(armservicelinker.DryrunPrerequisiteResultTypePermissionsMissing), - // Permissions: []*string{ - // to.Ptr("Microsoft.DocumentDb/databaseAccounts/write")}, - // Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/DeleteDryrun.json -func ExampleLinkersClient_DeleteDryrun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewLinkersClient().DeleteDryrun(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "dryrunName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/LinkerGenerateConfigurations.json -func ExampleLinkersClient_GenerateConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkersClient().GenerateConfigurations(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", "linkName", &armservicelinker.LinkersClientGenerateConfigurationsOptions{Parameters: &armservicelinker.ConfigurationInfo{ - CustomizedKeys: map[string]*string{ - "ASL_DocumentDb_ConnectionString": to.Ptr("MyConnectionstring"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationResult = armservicelinker.ConfigurationResult{ - // Configurations: []*armservicelinker.SourceConfiguration{ - // { - // Name: to.Ptr("MyConnectionstring"), - // Value: to.Ptr("ConnectionString"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/GetDaprConfigurations.json -func ExampleLinkersClient_NewListDaprConfigurationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLinkersClient().NewListDaprConfigurationsPager("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DaprConfigurationList = armservicelinker.DaprConfigurationList{ - // Value: []*armservicelinker.DaprConfigurationResource{ - // { - // Properties: &armservicelinker.DaprConfigurationProperties{ - // AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - // DaprProperties: &armservicelinker.DaprProperties{ - // BindingComponentDirection: to.Ptr(armservicelinker.DaprBindingComponentDirectionInput), - // ComponentType: to.Ptr("bindings"), - // Metadata: []*armservicelinker.DaprMetadata{ - // { - // Name: to.Ptr("containerName"), - // Description: to.Ptr("The name of the container to be used for Dapr state."), - // Required: to.Ptr(armservicelinker.DaprMetadataRequiredTrue), - // }}, - // RuntimeVersion: to.Ptr("1.10"), - // Version: to.Ptr("v1"), - // }, - // TargetType: to.Ptr("MICROSOFT.STORAGE/STORAGEACCOUNTS/BLOBSERVICES"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/operations_client_example_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/operations_client_example_test.go deleted file mode 100644 index a503e45cb3cb..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/operations_client_example_test.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armservicelinker_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c16ce913afbdaa073e8ca5e480f3b465db2de542/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2023-04-01-preview/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicelinker.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armservicelinker.OperationListResult{ - // Value: []*armservicelinker.Operation{ - // { - // Name: to.Ptr("Microsoft.ServiceLinker/register/action"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Register the subscription for Microsoft.ServiceLinker"), - // Operation: to.Ptr("Register the Microsoft.ServiceLinker"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("Microsoft.ServiceLinker"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/unregister/action"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Unregister the subscription for Microsoft.ServiceLinker"), - // Operation: to.Ptr("Unregister the Microsoft.ServiceLinker"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("Microsoft.ServiceLinker"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/operations/read"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("read operations"), - // Operation: to.Ptr("read_operations"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("operations"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/dryruns/read"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("list dryrun jobs"), - // Operation: to.Ptr("Dryrun_List"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("dryruns"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/dryruns/read"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("get a dryrun job"), - // Operation: to.Ptr("Dryrun_Get"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("dryruns"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/dryruns/write"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("create a dryrun job to do necessary check before actual creation"), - // Operation: to.Ptr("Dryrun_Create"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("dryruns"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/dryruns/delete"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("delete a dryrun job"), - // Operation: to.Ptr("Dryrun_Delete"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("dryruns"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/dryruns/write"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("add a dryrun job to do necessary check before actual creation"), - // Operation: to.Ptr("Dryrun_Update"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("dryruns"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/locations/operationStatuses/read"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("read operationStatuses"), - // Operation: to.Ptr("read_operationStatuses"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("locations/operationStatuses"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/locations/operationStatuses/write"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("write operationStatuses"), - // Operation: to.Ptr("write_operationStatuses"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("locations/operationStatuses"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/read"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Returns list of Linkers which connects to the resource."), - // Operation: to.Ptr("Linker_List"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/read"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Returns Linker resource for a given name."), - // Operation: to.Ptr("Linker_Get"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/write"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Create or update linker resource."), - // Operation: to.Ptr("Linker_CreateOrUpdate"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/delete"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Delete a link."), - // Operation: to.Ptr("Linker_Delete"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/write"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Operation to update an existing link."), - // Operation: to.Ptr("Linker_Update"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/validateLinker/action"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("Validate a link."), - // Operation: to.Ptr("Linker_Validate"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.ServiceLinker/linkers/listConfigurations/action"), - // Display: &armservicelinker.OperationDisplay{ - // Description: to.Ptr("list source configurations for a linker."), - // Operation: to.Ptr("Linker_ListConfigurations"), - // Provider: to.Ptr("Microsoft.ServiceLinker"), - // Resource: to.Ptr("linkers"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -}